From 5967d6c901f12f0ee180600c55a30aabdc0cd17d Mon Sep 17 00:00:00 2001 From: Ahmed Zamil Date: Thu, 30 Apr 2020 09:26:58 +0300 Subject: [PATCH] April --- .babelrc | 8 +- LICENSE | 2 +- build/esyur.js | 857 +++++---- module.js | 1 + package-lock.json | 1091 ++++++----- package.json | 15 +- src/Core/AsyncQueue.js | 18 +- src/Core/IEventHandler.js | 1 + src/Data/DataConverter.js | 35 +- src/Data/KeyList.js | 5 + src/Net/IIP/DistributedConnection.js | 1702 ++++++++--------- src/Net/IIP/DistributedResource.js | 26 +- src/Net/Packets/IIPPacket.js | 3 + src/Resource/Instance.js | 3 +- src/Resource/Warehouse.js | 2 +- src/Security/Permissions/ActionType.js | 45 + .../Permissions/IPermissionsManager.js | 24 - src/Security/Permissions/Ruling.js | 35 + src/esyur.js | 13 + 19 files changed, 2102 insertions(+), 1784 deletions(-) create mode 100644 src/Security/Permissions/ActionType.js create mode 100644 src/Security/Permissions/Ruling.js diff --git a/.babelrc b/.babelrc index 22c3243..866f643 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,10 @@ { - "presets": ["@babel/preset-env"], - "plugins": [ + "presets": [ + [ + "@babel/preset-env", { "useBuiltIns": "entry" } + ] + ], + "plugins": [ ["@babel/transform-runtime"] ] } \ No newline at end of file diff --git a/LICENSE b/LICENSE index c319aeb..1972f87 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Esi Ur +Copyright (c) 2017-2020 Esyur Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/build/esyur.js b/build/esyur.js index b61098a..c6ef5f5 100644 --- a/build/esyur.js +++ b/build/esyur.js @@ -212,6 +212,8 @@ function _superPropBase(object, property) { module.exports = _superPropBase; },{"./getPrototypeOf":7}],14:[function(require,module,exports){ function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { module.exports = _typeof = function _typeof(obj) { return typeof obj; @@ -1048,9 +1050,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits var _AsyncReply2 = _interopRequireDefault(require("./AsyncReply.js")); -var AsyncBag = -/*#__PURE__*/ -function (_AsyncReply) { +var AsyncBag = /*#__PURE__*/function (_AsyncReply) { (0, _inherits2["default"])(AsyncBag, _AsyncReply); function AsyncBag() { @@ -1156,9 +1156,7 @@ var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/w var _ExceptionCode = _interopRequireDefault(require("./ExceptionCode.js")); -var AsyncException = -/*#__PURE__*/ -function (_Error) { +var AsyncException = /*#__PURE__*/function (_Error) { (0, _inherits2["default"])(AsyncException, _Error); function AsyncException() { @@ -1194,7 +1192,7 @@ function (_Error) { } }]); return AsyncException; -}((0, _wrapNativeSuper2["default"])(Error)); +}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(Error)); exports["default"] = AsyncException; @@ -1247,9 +1245,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits var _AsyncReply2 = _interopRequireDefault(require("./AsyncReply.js")); -var AsyncQueue = -/*#__PURE__*/ -function (_AsyncReply) { +var AsyncQueue = /*#__PURE__*/function (_AsyncReply) { (0, _inherits2["default"])(AsyncQueue, _AsyncReply); function AsyncQueue() { @@ -1264,8 +1260,15 @@ function (_AsyncReply) { for (var i = 0; i < self.list.length; i++) { if (self.list[i].ready) { self.trigger(self.list[i].result); - self.list.splice(i, 1); + self.ready = false; //self.list.splice(i, 1); + + self.list.shift(); i--; + } else if (self.list[i].failed) { + self.ready = false; + self.list.shift(); + i--; + console.log("AsyncQueue (Reply Failed)"); } else break; } @@ -1280,11 +1283,12 @@ function (_AsyncReply) { value: function add(reply) { this.list.push(reply); this.ready = false; - reply.then(this.processQueue); + reply.then(this.processQueue).error(this.processQueue); } }, { key: "remove", value: function remove(reply) { + console.log("REMOVE QUEUE"); this.list.splice(this.list.indexOf(reply), 1); this.processQueue(); } @@ -1345,9 +1349,7 @@ var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/w var _AsyncException = _interopRequireDefault(require("./AsyncException.js")); -var AsyncReply = -/*#__PURE__*/ -function (_Promise) { +var AsyncReply = /*#__PURE__*/function (_Promise) { (0, _inherits2["default"])(AsyncReply, _Promise); (0, _createClass2["default"])(AsyncReply, [{ key: "then", @@ -1464,7 +1466,7 @@ function (_Promise) { } return AsyncReply; -}((0, _wrapNativeSuper2["default"])(Promise)); +}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(Promise)); exports["default"] = AsyncReply; @@ -1569,9 +1571,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits var _IEventHandler2 = _interopRequireDefault(require("./IEventHandler.js")); -var IDestructible = -/*#__PURE__*/ -function (_IEventHandler) { +var IDestructible = /*#__PURE__*/function (_IEventHandler) { (0, _inherits2["default"])(IDestructible, _IEventHandler); (0, _createClass2["default"])(IDestructible, [{ key: "destroy", @@ -1629,9 +1629,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); -var IEventHandler = -/*#__PURE__*/ -function () { +var IEventHandler = /*#__PURE__*/function () { (0, _createClass2["default"])(IEventHandler, [{ key: "_register", value: function _register(event) { @@ -1764,9 +1762,7 @@ var _IEventHandler2 = _interopRequireDefault(require("../Core/IEventHandler.js") var _IDestructible = _interopRequireDefault(require("../Core/IDestructible.js")); -var AutoList = -/*#__PURE__*/ -function (_IEventHandler) { +var AutoList = /*#__PURE__*/function (_IEventHandler) { (0, _inherits2["default"])(AutoList, _IEventHandler); function AutoList() { @@ -1888,9 +1884,7 @@ var _DataType = _interopRequireDefault(require("./DataType.js")); var _DataConverter = _interopRequireDefault(require("./DataConverter.js")); -var BinaryList = -/*#__PURE__*/ -function () { +var BinaryList = /*#__PURE__*/function () { function BinaryList() { (0, _classCallCheck2["default"])(this, BinaryList); this.list = []; @@ -2197,9 +2191,7 @@ var _DistributedResource = _interopRequireDefault(require("../Net/IIP/Distribute var _IResource = _interopRequireDefault(require("../Resource/IResource.js")); -var Codec = -/*#__PURE__*/ -function () { +var Codec = /*#__PURE__*/function () { function Codec() { (0, _classCallCheck2["default"])(this, Codec); } @@ -3029,9 +3021,7 @@ exports.UNIX_EPOCH = UNIX_EPOCH; var TWO_PWR_32 = (1 << 16) * (1 << 16); exports.TWO_PWR_32 = TWO_PWR_32; -var DC = -/*#__PURE__*/ -function (_Uint8Array) { +var DC = /*#__PURE__*/function (_Uint8Array) { (0, _inherits2["default"])(DC, _Uint8Array); function DC(bufferOrSize) { @@ -3155,45 +3145,58 @@ function (_Uint8Array) { value: function getUint8Array(offset, length) { return new Uint8Array(this.buffer, offset, length); } + }, { + key: "copy", + value: function copy(offset, length, elementSize, func, dstType) { + var rt = new dstType(length / elementSize); + var d = 0, + end = offset + length; + + for (var i = offset; i < end; i += elementSize) { + rt[d++] = func.call(this, i); + } + + return rt; + } }, { key: "getInt16Array", value: function getInt16Array(offset, length) { - return new Int16Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 2, this.getInt16, Int16Array); //return new Int16Array(this.clip(offset, length).buffer); } }, { key: "getUint16Array", value: function getUint16Array(offset, length) { - return new Uint16Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 2, this.getUint16, Uint16Array); //return new Uint16Array(this.clip(offset, length).buffer); } }, { key: "getInt32Array", value: function getInt32Array(offset, length) { - return new Int32Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 4, this.getInt32, Int32Array); //return new Int32Array(this.clip(offset, length).buffer); } }, { key: "getUint32Array", value: function getUint32Array(offset, length) { - return new Uint32Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 4, this.getUint32, Uint32Array); //return new Uint32Array(this.clip(offset, length).buffer); } }, { key: "getFloat32Array", value: function getFloat32Array(offset, length) { - return new Float32Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 4, this.getFloat32, Float32Array); //return new Float32Array(this.clip(offset, length).buffer); } }, { key: "getFloat64Array", value: function getFloat64Array(offset, length) { - return new Float64Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 8, this.getFloat64, Float64Array); // return new Float64Array(this.clip(offset, length).buffer); } }, { key: "getInt64Array", value: function getInt64Array(offset, length) { - return new Int64Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 8, this.getInt64, Int64Array); //return new Int64Array(this.clip(offset, length).buffer); } }, { key: "getUint64Array", value: function getUint64Array(offset, length) { - return new Uint64Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 8, this.getUint64, Uint64Array); //return new Uint64Array(this.clip(offset, length).buffer); } }, { key: "getBoolean", @@ -3503,7 +3506,7 @@ function (_Uint8Array) { } }]); return DC; -}((0, _wrapNativeSuper2["default"])(Uint8Array)); +}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(Uint8Array)); exports.DC = exports["default"] = DC; @@ -3671,9 +3674,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); -var Guid = -/*#__PURE__*/ -function () { +var Guid = /*#__PURE__*/function () { function Guid(dc) { (0, _classCallCheck2["default"])(this, Guid); this.value = dc; @@ -3731,9 +3732,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat var _IDestructible = _interopRequireDefault(require("../Core/IDestructible.js")); -var KeyList = -/*#__PURE__*/ -function () { +var KeyList = /*#__PURE__*/function () { function KeyList() { (0, _classCallCheck2["default"])(this, KeyList); this.keys = []; @@ -3932,9 +3931,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); -var Structure = -/*#__PURE__*/ -function () { +var Structure = /*#__PURE__*/function () { (0, _createClass2["default"])(Structure, [{ key: "getKeys", value: function getKeys() { @@ -4009,9 +4006,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper")); -var StructureArray = -/*#__PURE__*/ -function (_Array) { +var StructureArray = /*#__PURE__*/function (_Array) { (0, _inherits2["default"])(StructureArray, _Array); function StructureArray() { @@ -4026,7 +4021,7 @@ function (_Array) { } }]); return StructureArray; -}((0, _wrapNativeSuper2["default"])(Array)); +}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(Array)); exports["default"] = StructureArray; @@ -4156,9 +4151,11 @@ var _DistributedPropertyContext = _interopRequireDefault(require("./DistributedP var _IResource = require("../../Resource/IResource.js"); -var DistributedConnection = -/*#__PURE__*/ -function (_IStore) { +var _Ruling = _interopRequireDefault(require("../../Security/Permissions/Ruling.js")); + +var _ActionType = _interopRequireDefault(require("../../Security/Permissions/ActionType.js")); + +var DistributedConnection = /*#__PURE__*/function (_IStore) { (0, _inherits2["default"])(DistributedConnection, _IStore); (0, _createClass2["default"])(DistributedConnection, [{ key: "send", @@ -4246,244 +4243,248 @@ function (_IStore) { } else { offset += rt; - if (packet.command == _IIPPacketCommand["default"].Event) { - switch (packet.event) { - case _IIPPacketEvent["default"].ResourceReassigned: - this.IIPEventResourceReassigned(packet.resourceId, packet.newResourceId); - break; + try { + if (packet.command == _IIPPacketCommand["default"].Event) { + switch (packet.event) { + case _IIPPacketEvent["default"].ResourceReassigned: + this.IIPEventResourceReassigned(packet.resourceId, packet.newResourceId); + break; - case _IIPPacketEvent["default"].ResourceDestroyed: - this.IIPEventResourceDestroyed(packet.resourceId); - break; + case _IIPPacketEvent["default"].ResourceDestroyed: + this.IIPEventResourceDestroyed(packet.resourceId); + break; - case _IIPPacketEvent["default"].PropertyUpdated: - this.IIPEventPropertyUpdated(packet.resourceId, packet.methodIndex, packet.content); - break; + case _IIPPacketEvent["default"].PropertyUpdated: + this.IIPEventPropertyUpdated(packet.resourceId, packet.methodIndex, packet.content); + break; - case _IIPPacketEvent["default"].EventOccurred: - this.IIPEventEventOccurred(packet.resourceId, packet.methodIndex, packet.content); - break; + case _IIPPacketEvent["default"].EventOccurred: + this.IIPEventEventOccurred(packet.resourceId, packet.methodIndex, packet.content); + break; - case _IIPPacketEvent["default"].ChildAdded: - this.IIPEventChildAdded(packet.resourceId, packet.childId); - break; + case _IIPPacketEvent["default"].ChildAdded: + this.IIPEventChildAdded(packet.resourceId, packet.childId); + break; - case _IIPPacketEvent["default"].ChildRemoved: - this.IIPEventChildRemoved(packet.resourceId, packet.childId); - break; + case _IIPPacketEvent["default"].ChildRemoved: + this.IIPEventChildRemoved(packet.resourceId, packet.childId); + break; - case _IIPPacketEvent["default"].Renamed: - this.IIPEventRenamed(packet.resourceId, packet.content); - break; + case _IIPPacketEvent["default"].Renamed: + this.IIPEventRenamed(packet.resourceId, packet.content); + break; - case _IIPPacketEvent["default"].AttributesUpdated: - this.IIPEventAttributesUpdated(packet.resourceId, packet.content); - break; - } - } else if (packet.command == _IIPPacketCommand["default"].Request) { - switch (packet.action) { - // Manage - case _IIPPacketAction["default"].AttachResource: - this.IIPRequestAttachResource(packet.callbackId, packet.resourceId); - break; - - case _IIPPacketAction["default"].ReattachResource: - this.IIPRequestReattachResource(packet.callbackId, packet.resourceId, packet.resourceAge); - break; - - case _IIPPacketAction["default"].DetachResource: - this.IIPRequestDetachResource(packet.callbackId, packet.resourceId); - break; - - case _IIPPacketAction["default"].CreateResource: - this.IIPRequestCreateResource(packet.callbackId, packet.storeId, packet.resourceId, packet.content); - break; - - case _IIPPacketAction["default"].DeleteResource: - this.IIPRequestDeleteResource(packet.callbackId, packet.resourceId); - break; - - case _IIPPacketAction["default"].AddChild: - this.IIPRequestAddChild(packet.callbackId, packet.resourceId, packet.childId); - break; - - case _IIPPacketAction["default"].RemoveChild: - this.IIPRequestRemoveChild(packet.callbackId, packet.resourceId, packet.childId); - break; - - case _IIPPacketAction["default"].RenameResource: - this.IIPRequestRenameResource(packet.callbackId, packet.resourceId, packet.content); - break; - // Inquire - - case _IIPPacketAction["default"].TemplateFromClassName: - this.IIPRequestTemplateFromClassName(packet.callbackId, packet.className); - break; - - case _IIPPacketAction["default"].TemplateFromClassId: - this.IIPRequestTemplateFromClassId(packet.callbackId, packet.classId); - break; - - case _IIPPacketAction["default"].TemplateFromResourceId: - this.IIPRequestTemplateFromResourceId(packet.callbackId, packet.resourceId); - break; - - case _IIPPacketAction["default"].QueryLink: - this.IIPRequestQueryResources(packet.callbackId, packet.resourceLink); - break; - - case _IIPPacketAction["default"].ResourceChildren: - this.IIPRequestResourceChildren(packet.callbackId, packet.resourceId); - break; - - case _IIPPacketAction["default"].ResourceParents: - this.IIPRequestResourceParents(packet.callbackId, packet.resourceId); - break; - - case _IIPPacketAction["default"].ResourceHistory: - this.IIPRequestInquireResourceHistory(packet.callbackId, packet.resourceId, packet.fromDate, packet.toDate); - break; - // Invoke - - case _IIPPacketAction["default"].InvokeFunctionArrayArguments: - this.IIPRequestInvokeFunctionArrayArguments(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); - break; - - case _IIPPacketAction["default"].InvokeFunctionNamedArguments: - this.IIPRequestInvokeFunctionNamedArguments(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); - break; - - case _IIPPacketAction["default"].GetProperty: - this.IIPRequestGetProperty(packet.callbackId, packet.resourceId, packet.methodIndex); - break; - - case _IIPPacketAction["default"].GetPropertyIfModified: - this.IIPRequestGetPropertyIfModifiedSince(packet.callbackId, packet.resourceId, packet.methodIndex, packet.resourceAge); - break; - - case _IIPPacketAction["default"].SetProperty: - this.IIPRequestSetProperty(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); - break; - - case _IIPPacketAction["default"].ResourceHistory: - this.IIPRequestInquireResourceHistory(packet.callbackId, packet.resourceId, packet.fromDate, packet.toDate); - break; - - case _IIPPacketAction["default"].QueryLink: - this.IIPRequestQueryResources(packet.callbackId, packet.resourceLink); - break; - // Attribute - - case _IIPPacketAction["default"].GetAllAttributes: - this.IIPRequestGetAttributes(packet.callbackId, packet.resourceId, packet.content, true); - break; - - case _IIPPacketAction["default"].UpdateAllAttributes: - this.IIPRequestUpdateAttributes(packet.callbackId, packet.resourceId, packet.content, true); - break; - - case _IIPPacketAction["default"].ClearAllAttributes: - this.IIPRequestClearAttributes(packet.callbackId, packet.resourceId, packet.content, true); - break; - - case _IIPPacketAction["default"].GetAttributes: - this.IIPRequestGetAttributes(packet.callbackId, packet.resourceId, packet.content, false); - break; - - case _IIPPacketAction["default"].UpdateAttributes: - this.IIPRequestUpdateAttributes(packet.callbackId, packet.resourceId, packet.content, false); - break; - - case _IIPPacketAction["default"].ClearAttributes: - this.IIPRequestClearAttributes(packet.callbackId, packet.resourceId, packet.content, false); - break; - } - } else if (packet.command == _IIPPacketCommand["default"].Reply) { - switch (packet.action) { - case _IIPPacketAction["default"].AttachResource: - this.IIPReply(packet.callbackId, packet.classId, packet.resourceAge, packet.resourceLink, packet.content); - break; - - case _IIPPacketAction["default"].ReattachResource: - this.IIPReply(packet.callbackId, packet.resourceAge, packet.content); - break; - - case _IIPPacketAction["default"].DetachResource: - this.IIPReply(packet.callbackId); - break; - - case _IIPPacketAction["default"].CreateResource: - this.IIPReply(packet.callbackId, packet.resourceId); - break; - - case _IIPPacketAction["default"].DeleteResource: - case _IIPPacketAction["default"].AddChild: - case _IIPPacketAction["default"].RemoveChild: - case _IIPPacketAction["default"].RenameResource: - this.IIPReply(packet.callbackId); - break; - - case _IIPPacketAction["default"].TemplateFromClassName: - case _IIPPacketAction["default"].TemplateFromClassId: - case _IIPPacketAction["default"].TemplateFromResourceId: - this.IIPReply(packet.callbackId, _ResourceTemplate["default"].parse(packet.content)); - break; - - case _IIPPacketAction["default"].QueryLink: - case _IIPPacketAction["default"].ResourceChildren: - case _IIPPacketAction["default"].ResourceParents: - case _IIPPacketAction["default"].ResourceHistory: - this.IIPReply(packet.callbackId, packet.content); - break; - - case _IIPPacketAction["default"].InvokeFunctionArrayArguments: - case _IIPPacketAction["default"].InvokeFunctionNamedArguments: - this.IIPReplyInvoke(packet.callbackId, packet.content); - break; - - case _IIPPacketAction["default"].GetProperty: - this.IIPReply(packet.callbackId, packet.content); - break; - - case _IIPPacketAction["default"].GetPropertyIfModified: - this.IIPReply(packet.callbackId, packet.content); - break; - - case _IIPPacketAction["default"].SetProperty: - this.IIPReply(packet.callbackId); - break; - // Attribute - - case _IIPPacketAction["default"].GetAllAttributes: - case _IIPPacketAction["default"].GetAttributes: - this.IIPReply(packet.callbackId, packet.content); - break; - - case _IIPPacketAction["default"].UpdateAllAttributes: - case _IIPPacketAction["default"].UpdateAttributes: - case _IIPPacketAction["default"].ClearAllAttributes: - case _IIPPacketAction["default"].ClearAttributes: - this.IIPReply(packet.callbackId); - break; - } - } else if (packet.command == _IIPPacketCommand["default"].Report) { - switch (packet.report) { - case _IIPPacketReport["default"].ManagementError: - this.IIPReportError(packet.callbackId, _ErrorType["default"].Management, packet.errorCode, null); - break; - - case _IIPPacketReport["default"].ExecutionError: - this.IIPReportError(packet.callbackId, _ErrorType["default"].Exception, packet.errorCode, packet.errorMessage); - break; - - case _IIPPacketReport["default"].ProgressReport: - this.IIPReportProgress(packet.callbackId, _ProgressType["default"].Execution, packet.progressValue, packet.progressMax); - break; - - case _IIPPacketReport["default"].ChunkStream: - this.IIPReportChunk(packet.callbackId, packet.content); - break; + case _IIPPacketEvent["default"].AttributesUpdated: + this.IIPEventAttributesUpdated(packet.resourceId, packet.content); + break; + } + } else if (packet.command == _IIPPacketCommand["default"].Request) { + switch (packet.action) { + // Manage + case _IIPPacketAction["default"].AttachResource: + this.IIPRequestAttachResource(packet.callbackId, packet.resourceId); + break; + + case _IIPPacketAction["default"].ReattachResource: + this.IIPRequestReattachResource(packet.callbackId, packet.resourceId, packet.resourceAge); + break; + + case _IIPPacketAction["default"].DetachResource: + this.IIPRequestDetachResource(packet.callbackId, packet.resourceId); + break; + + case _IIPPacketAction["default"].CreateResource: + this.IIPRequestCreateResource(packet.callbackId, packet.storeId, packet.resourceId, packet.content); + break; + + case _IIPPacketAction["default"].DeleteResource: + this.IIPRequestDeleteResource(packet.callbackId, packet.resourceId); + break; + + case _IIPPacketAction["default"].AddChild: + this.IIPRequestAddChild(packet.callbackId, packet.resourceId, packet.childId); + break; + + case _IIPPacketAction["default"].RemoveChild: + this.IIPRequestRemoveChild(packet.callbackId, packet.resourceId, packet.childId); + break; + + case _IIPPacketAction["default"].RenameResource: + this.IIPRequestRenameResource(packet.callbackId, packet.resourceId, packet.content); + break; + // Inquire + + case _IIPPacketAction["default"].TemplateFromClassName: + this.IIPRequestTemplateFromClassName(packet.callbackId, packet.className); + break; + + case _IIPPacketAction["default"].TemplateFromClassId: + this.IIPRequestTemplateFromClassId(packet.callbackId, packet.classId); + break; + + case _IIPPacketAction["default"].TemplateFromResourceId: + this.IIPRequestTemplateFromResourceId(packet.callbackId, packet.resourceId); + break; + + case _IIPPacketAction["default"].QueryLink: + this.IIPRequestQueryResources(packet.callbackId, packet.resourceLink); + break; + + case _IIPPacketAction["default"].ResourceChildren: + this.IIPRequestResourceChildren(packet.callbackId, packet.resourceId); + break; + + case _IIPPacketAction["default"].ResourceParents: + this.IIPRequestResourceParents(packet.callbackId, packet.resourceId); + break; + + case _IIPPacketAction["default"].ResourceHistory: + this.IIPRequestInquireResourceHistory(packet.callbackId, packet.resourceId, packet.fromDate, packet.toDate); + break; + // Invoke + + case _IIPPacketAction["default"].InvokeFunctionArrayArguments: + this.IIPRequestInvokeFunctionArrayArguments(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); + break; + + case _IIPPacketAction["default"].InvokeFunctionNamedArguments: + this.IIPRequestInvokeFunctionNamedArguments(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); + break; + + case _IIPPacketAction["default"].GetProperty: + this.IIPRequestGetProperty(packet.callbackId, packet.resourceId, packet.methodIndex); + break; + + case _IIPPacketAction["default"].GetPropertyIfModified: + this.IIPRequestGetPropertyIfModifiedSince(packet.callbackId, packet.resourceId, packet.methodIndex, packet.resourceAge); + break; + + case _IIPPacketAction["default"].SetProperty: + this.IIPRequestSetProperty(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); + break; + + case _IIPPacketAction["default"].ResourceHistory: + this.IIPRequestInquireResourceHistory(packet.callbackId, packet.resourceId, packet.fromDate, packet.toDate); + break; + + case _IIPPacketAction["default"].QueryLink: + this.IIPRequestQueryResources(packet.callbackId, packet.resourceLink); + break; + // Attribute + + case _IIPPacketAction["default"].GetAllAttributes: + this.IIPRequestGetAttributes(packet.callbackId, packet.resourceId, packet.content, true); + break; + + case _IIPPacketAction["default"].UpdateAllAttributes: + this.IIPRequestUpdateAttributes(packet.callbackId, packet.resourceId, packet.content, true); + break; + + case _IIPPacketAction["default"].ClearAllAttributes: + this.IIPRequestClearAttributes(packet.callbackId, packet.resourceId, packet.content, true); + break; + + case _IIPPacketAction["default"].GetAttributes: + this.IIPRequestGetAttributes(packet.callbackId, packet.resourceId, packet.content, false); + break; + + case _IIPPacketAction["default"].UpdateAttributes: + this.IIPRequestUpdateAttributes(packet.callbackId, packet.resourceId, packet.content, false); + break; + + case _IIPPacketAction["default"].ClearAttributes: + this.IIPRequestClearAttributes(packet.callbackId, packet.resourceId, packet.content, false); + break; + } + } else if (packet.command == _IIPPacketCommand["default"].Reply) { + switch (packet.action) { + case _IIPPacketAction["default"].AttachResource: + this.IIPReply(packet.callbackId, packet.classId, packet.resourceAge, packet.resourceLink, packet.content); + break; + + case _IIPPacketAction["default"].ReattachResource: + this.IIPReply(packet.callbackId, packet.resourceAge, packet.content); + break; + + case _IIPPacketAction["default"].DetachResource: + this.IIPReply(packet.callbackId); + break; + + case _IIPPacketAction["default"].CreateResource: + this.IIPReply(packet.callbackId, packet.resourceId); + break; + + case _IIPPacketAction["default"].DeleteResource: + case _IIPPacketAction["default"].AddChild: + case _IIPPacketAction["default"].RemoveChild: + case _IIPPacketAction["default"].RenameResource: + this.IIPReply(packet.callbackId); + break; + + case _IIPPacketAction["default"].TemplateFromClassName: + case _IIPPacketAction["default"].TemplateFromClassId: + case _IIPPacketAction["default"].TemplateFromResourceId: + this.IIPReply(packet.callbackId, _ResourceTemplate["default"].parse(packet.content)); + break; + + case _IIPPacketAction["default"].QueryLink: + case _IIPPacketAction["default"].ResourceChildren: + case _IIPPacketAction["default"].ResourceParents: + case _IIPPacketAction["default"].ResourceHistory: + this.IIPReply(packet.callbackId, packet.content); + break; + + case _IIPPacketAction["default"].InvokeFunctionArrayArguments: + case _IIPPacketAction["default"].InvokeFunctionNamedArguments: + this.IIPReplyInvoke(packet.callbackId, packet.content); + break; + + case _IIPPacketAction["default"].GetProperty: + this.IIPReply(packet.callbackId, packet.content); + break; + + case _IIPPacketAction["default"].GetPropertyIfModified: + this.IIPReply(packet.callbackId, packet.content); + break; + + case _IIPPacketAction["default"].SetProperty: + this.IIPReply(packet.callbackId); + break; + // Attribute + + case _IIPPacketAction["default"].GetAllAttributes: + case _IIPPacketAction["default"].GetAttributes: + this.IIPReply(packet.callbackId, packet.content); + break; + + case _IIPPacketAction["default"].UpdateAllAttributes: + case _IIPPacketAction["default"].UpdateAttributes: + case _IIPPacketAction["default"].ClearAllAttributes: + case _IIPPacketAction["default"].ClearAttributes: + this.IIPReply(packet.callbackId); + break; + } + } else if (packet.command == _IIPPacketCommand["default"].Report) { + switch (packet.report) { + case _IIPPacketReport["default"].ManagementError: + this.IIPReportError(packet.callbackId, _ErrorType["default"].Management, packet.errorCode, null); + break; + + case _IIPPacketReport["default"].ExecutionError: + this.IIPReportError(packet.callbackId, _ErrorType["default"].Exception, packet.errorCode, packet.errorMessage); + break; + + case _IIPPacketReport["default"].ProgressReport: + this.IIPReportProgress(packet.callbackId, _ProgressType["default"].Execution, packet.progressValue, packet.progressMax); + break; + + case _IIPPacketReport["default"].ChunkStream: + this.IIPReportChunk(packet.callbackId, packet.content); + break; + } } + } catch (ex) { + console.log("Esyur Error ", ex); } } } else { @@ -4683,7 +4684,13 @@ function (_IStore) { self.hold(); while (this.networkBuffer.available > 0 && !this.networkBuffer["protected"]) { - self.receive(this.networkBuffer); + // try + // { + self.receive(this.networkBuffer); // } + // catch(e) + //{ + // console.log(e); + //} } self.unhold(); @@ -4832,19 +4839,18 @@ function (_IStore) { value: function IIPEventPropertyUpdated(resourceId, index, content) { var self = this; this.fetch(resourceId).then(function (r) { + var pt = r.instance.template.getPropertyTemplateByIndex(index); + if (pt == null) return; // ft found, fi not found, this should never happen // push to the queue to gaurantee serialization + var item = new _AsyncReply["default"](); self.queue.add(item); _Codec["default"].parse(content, 0, {}, self).then(function (args) { - var pt = r.instance.template.getPropertyTemplateByIndex(index); - - if (pt != null) { - item.trigger(new _DistributedResourceQueueItem["default"](r, _DistributedResourceQueueItemType["default"].Propery, args, index)); - } else { - // ft found, fi not found, this should never happen - self.queue.remove(item); - } + item.trigger(new _DistributedResourceQueueItem["default"](r, _DistributedResourceQueueItemType["default"].Propery, args, index)); + }).error(function (ex) { + self.queue.remove(item); + console.log("Esyur Property Error", ex); }); }); } @@ -4853,20 +4859,18 @@ function (_IStore) { value: function IIPEventEventOccurred(resourceId, index, content) { var self = this; this.fetch(resourceId).then(function (r) { + var et = r.instance.template.getEventTemplateByIndex(index); + if (et == null) return; // ft found, fi not found, this should never happen // push to the queue to guarantee serialization + var item = new _AsyncReply["default"](); - var r = self.resources[resourceId]; self.queue.add(item); _Codec["default"].parseVarArray(content, 0, content.length, self).then(function (args) { - var et = r.instance.template.getEventTemplateByIndex(index); - - if (et != null) { - item.trigger(new _DistributedResourceQueueItem["default"](r, _DistributedResourceQueueItemType["default"].Event, args, index)); - } else { - // ft found, fi not found, this should never happen - self.queue.remove(item); - } + item.trigger(new _DistributedResourceQueueItem["default"](r, _DistributedResourceQueueItemType["default"].Event, args, index)); + }).error(function (ex) { + self.queue.remove(item); + console.log("Esyur Event Error", ex); }); }); } @@ -4926,7 +4930,7 @@ function (_IStore) { _Warehouse["default"].getById(resourceId).then(function (r) { if (r != null) { - if (r.instance.applicable(self.session, ActionType.Attach, null) == Ruling.Denied) { + if (r.instance.applicable(self.session, _ActionType["default"].Attach, null) == _Ruling["default"].Denied) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].AttachDenied); return; } @@ -4997,14 +5001,14 @@ function (_IStore) { } // check security - if (store.instance.applicable(self.session, ActionType.CreateResource, null) != Ruling.Allowed) { + if (store.instance.applicable(self.session, _ActionType["default"].CreateResource, null) != _Ruling["default"].Allowed) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].CreateDenied); return; } _Warehouse["default"].getById(parentId).then(function (parent) { // check security - if (parent != null) if (parent.instance.applicable(self.session, ActionType.AddChild, null) != Ruling.Allowed) { + if (parent != null) if (parent.instance.applicable(self.session, _ActionType["default"].AddChild, null) != _Ruling["default"].Allowed) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].AddChildDenied); return; } @@ -5054,7 +5058,7 @@ function (_IStore) { return; } - if (r.instance.store.instance.applicable(session, ActionType.Delete, null) != Ruling.Allowed) { + if (r.instance.store.instance.applicable(session, _ActionType["default"].Delete, null) != _Ruling["default"].Allowed) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].DeleteDenied); return; } @@ -5121,15 +5125,13 @@ function (_IStore) { } else { var fi = r[ft.name]; - if (r.instance.applicable(self.session, ActionType.Execute, ft) == Ruling.Denied) { + if (r.instance.applicable(self.session, _ActionType["default"].Execute, ft) == _Ruling["default"].Denied) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].InvokeDenied); return; } if (fi instanceof Function) { - var itt = - /*#__PURE__*/ - _regenerator["default"].mark(function itt() { + var itt = /*#__PURE__*/_regenerator["default"].mark(function itt() { return _regenerator["default"].wrap(function itt$(_context) { while (1) { switch (_context.prev = _context.next) { @@ -5211,7 +5213,7 @@ function (_IStore) { } else { var fi = r[ft.name]; - if (r.instance.applicable(self.session, ActionType.Execute, ft) == Ruling.Denied) { + if (r.instance.applicable(self.session, _ActionType["default"].Execute, ft) == _Ruling["default"].Denied) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].InvokeDenied); return; } @@ -5335,7 +5337,7 @@ function (_IStore) { self.sendError(x.type, callback, x.code, x.message).done(); }); } else { - if (r.instance.applicable(self.session, ActionType.SetProperty, pt) == Ruling.Denied) { + if (r.instance.applicable(self.session, _ActionType["default"].SetProperty, pt) == _Ruling["default"].Denied) { self.sendError(_AsyncReply["default"].ErrorType.Exception, callback, _ExceptionCode["default"].SetPropertyDenied); return; } @@ -5381,7 +5383,7 @@ function (_IStore) { _Warehouse["default"].query(resourceLink).then(function (resources) { var list = resources.filter(function (r) { - return r.instance.applicable(self.session, ActionType.Attach, null) != Ruling.Denied; + return r.instance.applicable(self.session, _ActionType["default"].Attach, null) != _Ruling["default"].Denied; }); if (list.length == 0) self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].ResourceNotFound);else self.sendReply(_IIPPacketAction["default"].QueryLink, callback).addUint8Array(_Codec["default"].composeResourceArray(list, self, true)).done(); }); @@ -5541,7 +5543,7 @@ function (_IStore) { var et = resource.instance.template.getEventTemplateByName(name); if (et == null) return; if (receivers != null) if (receivers.indexOf(this.session) < 0) return; - if (resource.instance.applicable(this.session, ActionType.ReceiveEvent, et, issuer) == Ruling.Denied) return; // compose the packet + if (resource.instance.applicable(this.session, _ActionType["default"].ReceiveEvent, et, issuer) == _Ruling["default"].Denied) return; // compose the packet this.sendEvent(_IIPPacketEvent["default"].EventOccurred).addUint32(resource.instance.id).addUint8(et.index).addUint8Array(_Codec["default"].composeVarArray(args, this, true)).done(); } @@ -5562,12 +5564,12 @@ function (_IStore) { return; } - if (parent.instance.applicable(self.session, ActionType.AddChild, null) != Ruling.Allowed) { + if (parent.instance.applicable(self.session, _ActionType["default"].AddChild, null) != _Ruling["default"].Allowed) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].AddChildDenied); return; } - if (child.instance.applicable(self.session, ActionType.AddParent, null) != Ruling.Allowed) { + if (child.instance.applicable(self.session, _ActionType["default"].AddParent, null) != _Ruling["default"].Allowed) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].AddParentDenied); return; } @@ -5594,12 +5596,12 @@ function (_IStore) { return; } - if (parent.instance.applicable(self.session, ActionType.RemoveChild, null) != Ruling.Allowed) { + if (parent.instance.applicable(self.session, _ActionType["default"].RemoveChild, null) != _Ruling["default"].Allowed) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].AddChildDenied); return; } - if (child.instance.applicable(self.session, ActionType.RemoveParent, null) != Ruling.Allowed) { + if (child.instance.applicable(self.session, _ActionType["default"].RemoveParent, null) != _Ruling["default"].Allowed) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].AddParentDenied); return; } @@ -5620,7 +5622,7 @@ function (_IStore) { return; } - if (resource.instance.applicable(self.session, ActionType.Rename, null) != Ruling.Allowed) { + if (resource.instance.applicable(self.session, _ActionType["default"].Rename, null) != _Ruling["default"].Allowed) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].RenameDenied); return; } @@ -5668,7 +5670,7 @@ function (_IStore) { return; } - if (r.instance.store.instance.applicable(self.session, ActionType.UpdateAttributes, null) != Ruling.Allowed) { + if (r.instance.store.instance.applicable(self.session, _ActionType["default"].UpdateAttributes, null) != _Ruling["default"].Allowed) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].UpdateAttributeDenied); return; } @@ -5690,7 +5692,7 @@ function (_IStore) { return; } - if (r.instance.store.instance.applicable(self.session, ActionType.UpdateAttributes, null) != Ruling.Allowed) { + if (r.instance.store.instance.applicable(self.session, _ActionType["default"].UpdateAttributes, null) != _Ruling["default"].Allowed) { self.sendError(_ErrorType["default"].Management, callback, _ExceptionCode["default"].UpdateAttributeDenied); return; } @@ -5808,7 +5810,7 @@ function (_IStore) { exports["default"] = DistributedConnection; -},{"../../Core/AsyncQueue.js":20,"../../Core/AsyncReply.js":21,"../../Core/ErrorType.js":22,"../../Core/ExceptionCode.js":23,"../../Core/ProgressType.js":26,"../../Data/Codec.js":29,"../../Data/DataConverter.js":30,"../../Data/KeyList.js":33,"../../Resource/IResource.js":56,"../../Resource/IStore.js":57,"../../Resource/Template/ResourceTemplate.js":64,"../../Resource/Warehouse.js":65,"../../Security/Authority/Authentication.js":66,"../../Security/Authority/AuthenticationType.js":67,"../../Security/Authority/Session.js":68,"../../Security/Integrity/SHA256.js":69,"../Packets//IIPPacketReport.js":52,"../Packets/IIPAuthPacket.js":44,"../Packets/IIPAuthPacketAction.js":45,"../Packets/IIPAuthPacketCommand.js":46,"../Packets/IIPAuthPacketMethod.js":47,"../Packets/IIPPacket.js":48,"../Packets/IIPPacketAction.js":49,"../Packets/IIPPacketCommand.js":50,"../Packets/IIPPacketEvent.js":51,"../SendList.js":53,"../Sockets/NetworkBuffer.js":54,"./DistributedPropertyContext.js":40,"./DistributedResource.js":41,"./DistributedResourceQueueItem.js":42,"./DistributedResourceQueueItemType.js":43,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":5,"@babel/runtime/helpers/getPrototypeOf":7,"@babel/runtime/helpers/inherits":8,"@babel/runtime/helpers/interopRequireDefault":9,"@babel/runtime/helpers/possibleConstructorReturn":11,"@babel/runtime/regenerator":17}],40:[function(require,module,exports){ +},{"../../Core/AsyncQueue.js":20,"../../Core/AsyncReply.js":21,"../../Core/ErrorType.js":22,"../../Core/ExceptionCode.js":23,"../../Core/ProgressType.js":26,"../../Data/Codec.js":29,"../../Data/DataConverter.js":30,"../../Data/KeyList.js":33,"../../Resource/IResource.js":56,"../../Resource/IStore.js":57,"../../Resource/Template/ResourceTemplate.js":64,"../../Resource/Warehouse.js":65,"../../Security/Authority/Authentication.js":66,"../../Security/Authority/AuthenticationType.js":67,"../../Security/Authority/Session.js":68,"../../Security/Integrity/SHA256.js":69,"../../Security/Permissions/ActionType.js":70,"../../Security/Permissions/Ruling.js":72,"../Packets//IIPPacketReport.js":52,"../Packets/IIPAuthPacket.js":44,"../Packets/IIPAuthPacketAction.js":45,"../Packets/IIPAuthPacketCommand.js":46,"../Packets/IIPAuthPacketMethod.js":47,"../Packets/IIPPacket.js":48,"../Packets/IIPPacketAction.js":49,"../Packets/IIPPacketCommand.js":50,"../Packets/IIPPacketEvent.js":51,"../SendList.js":53,"../Sockets/NetworkBuffer.js":54,"./DistributedPropertyContext.js":40,"./DistributedResource.js":41,"./DistributedResourceQueueItem.js":42,"./DistributedResourceQueueItemType.js":43,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":5,"@babel/runtime/helpers/getPrototypeOf":7,"@babel/runtime/helpers/inherits":8,"@babel/runtime/helpers/interopRequireDefault":9,"@babel/runtime/helpers/possibleConstructorReturn":11,"@babel/runtime/regenerator":17}],40:[function(require,module,exports){ /* * Copyright (c) 2017-2018 Ahmed Kh. Zamil * @@ -5913,9 +5915,7 @@ var _Structure = _interopRequireDefault(require("../../Data/Structure.js")); var _IIPPacketAction = _interopRequireDefault(require("../Packets//IIPPacketAction.js")); -var DistributedResource = -/*#__PURE__*/ -function (_IResource) { +var DistributedResource = /*#__PURE__*/function (_IResource) { (0, _inherits2["default"])(DistributedResource, _IResource); (0, _createClass2["default"])(DistributedResource, [{ key: "destroy", @@ -6181,9 +6181,7 @@ var _IIPAuthPacketAction = _interopRequireDefault(require("./IIPAuthPacketAction var _IIPAuthPacketMethod = _interopRequireDefault(require("./IIPAuthPacketMethod.js")); -var IIPAuthPacket = -/*#__PURE__*/ -function () { +var IIPAuthPacket = /*#__PURE__*/function () { function IIPAuthPacket() { (0, _classCallCheck2["default"])(this, IIPAuthPacket); this.command = 0; @@ -6412,9 +6410,7 @@ var _IIPPacketReport = _interopRequireDefault(require("./IIPPacketReport.js")); var _DataType = _interopRequireDefault(require("../../Data/DataType.js")); -var IIPPacket = -/*#__PURE__*/ -function () { +var IIPPacket = /*#__PURE__*/function () { function IIPPacket() { (0, _classCallCheck2["default"])(this, IIPPacket); this.command = 0; @@ -6897,9 +6893,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits var _BinaryList2 = _interopRequireDefault(require("../Data/BinaryList.js")); -var SendList = -/*#__PURE__*/ -function (_BinaryList) { +var SendList = /*#__PURE__*/function (_BinaryList) { (0, _inherits2["default"])(SendList, _BinaryList); function SendList(connection, doneReply) { @@ -6965,9 +6959,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat var _DataConverter = _interopRequireDefault(require("../../Data/DataConverter.js")); -var NetworkBuffer = -/*#__PURE__*/ -function () { +var NetworkBuffer = /*#__PURE__*/function () { function NetworkBuffer() { (0, _classCallCheck2["default"])(this, NetworkBuffer); this.neededDataLength = 0; @@ -7164,9 +7156,7 @@ var ResourceTrigger = { }; exports.ResourceTrigger = ResourceTrigger; -var IResource = -/*#__PURE__*/ -function (_IDestructible) { +var IResource = /*#__PURE__*/function (_IDestructible) { (0, _inherits2["default"])(IResource, _IDestructible); (0, _createClass2["default"])(IResource, [{ key: "trigger", @@ -7241,9 +7231,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits var _IResource2 = _interopRequireDefault(require("./IResource.js")); -var IStore = -/*#__PURE__*/ -function (_IResource) { +var IStore = /*#__PURE__*/function (_IResource) { (0, _inherits2["default"])(IStore, _IResource); (0, _createClass2["default"])(IStore, [{ key: "get", @@ -7342,9 +7330,7 @@ var _CustomResourceEvent = _interopRequireDefault(require("./CustomResourceEvent var _Warehouse = _interopRequireDefault(require("./Warehouse.js")); -var Instance = -/*#__PURE__*/ -function (_IEventHandler) { +var Instance = /*#__PURE__*/function (_IEventHandler) { (0, _inherits2["default"])(Instance, _IEventHandler); (0, _createClass2["default"])(Instance, [{ key: "getAge", @@ -7616,7 +7602,7 @@ function (_IEventHandler) { exports["default"] = Instance; -},{"../Core/IEventHandler.js":25,"../Data/AutoList.js":27,"../Data/KeyList.js":33,"../Data/PropertyValue.js":34,"../Data/Structure.js":36,"../Data/StructureArray.js":37,"../Security/Permissions/IPermissionsManager.js":70,"./CustomResourceEvent.js":55,"./Warehouse.js":65,"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":5,"@babel/runtime/helpers/get":6,"@babel/runtime/helpers/getPrototypeOf":7,"@babel/runtime/helpers/inherits":8,"@babel/runtime/helpers/interopRequireDefault":9,"@babel/runtime/helpers/possibleConstructorReturn":11}],59:[function(require,module,exports){ +},{"../Core/IEventHandler.js":25,"../Data/AutoList.js":27,"../Data/KeyList.js":33,"../Data/PropertyValue.js":34,"../Data/Structure.js":36,"../Data/StructureArray.js":37,"../Security/Permissions/IPermissionsManager.js":71,"./CustomResourceEvent.js":55,"./Warehouse.js":65,"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":5,"@babel/runtime/helpers/get":6,"@babel/runtime/helpers/getPrototypeOf":7,"@babel/runtime/helpers/inherits":8,"@babel/runtime/helpers/interopRequireDefault":9,"@babel/runtime/helpers/possibleConstructorReturn":11}],59:[function(require,module,exports){ /* * Copyright (c) 2017 Ahmed Kh. Zamil * @@ -7669,9 +7655,7 @@ var _MemberTemplate2 = _interopRequireDefault(require("./MemberTemplate.js")); var _MemberType = _interopRequireDefault(require("./MemberType.js")); -var EventTemplate = -/*#__PURE__*/ -function (_MemberTemplate) { +var EventTemplate = /*#__PURE__*/function (_MemberTemplate) { (0, _inherits2["default"])(EventTemplate, _MemberTemplate); function EventTemplate() { @@ -7754,9 +7738,7 @@ var _MemberTemplate2 = _interopRequireDefault(require("./MemberTemplate.js")); var _MemberType = _interopRequireDefault(require("./MemberType.js")); -var FunctionTemplate = -/*#__PURE__*/ -function (_MemberTemplate) { +var FunctionTemplate = /*#__PURE__*/function (_MemberTemplate) { (0, _inherits2["default"])(FunctionTemplate, _MemberTemplate); (0, _createClass2["default"])(FunctionTemplate, [{ key: "compose", @@ -7827,9 +7809,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat var _DataConverter = _interopRequireDefault(require("../../Data/DataConverter.js")); -var MemberTemplate = -/*#__PURE__*/ -function () { +var MemberTemplate = /*#__PURE__*/function () { function MemberTemplate() { (0, _classCallCheck2["default"])(this, MemberTemplate); } @@ -7919,9 +7899,7 @@ var PropertyPermission = { }; exports.PropertyPermission = PropertyPermission; -var PropertyTemplate = -/*#__PURE__*/ -function (_MemberTemplate) { +var PropertyTemplate = /*#__PURE__*/function (_MemberTemplate) { (0, _inherits2["default"])(PropertyTemplate, _MemberTemplate); function PropertyTemplate() { @@ -8007,9 +7985,7 @@ var _SHA = _interopRequireDefault(require("../../Security/Integrity/SHA256.js")) var _DataConverter = require("../../Data/DataConverter.js"); -var ResourceTemplate = -/*#__PURE__*/ -function () { +var ResourceTemplate = /*#__PURE__*/function () { (0, _createClass2["default"])(ResourceTemplate, [{ key: "getEventTemplateByName", value: function getEventTemplateByName(eventName) { @@ -8353,9 +8329,7 @@ var _IStore = _interopRequireDefault(require("./IStore.js")); var _IResource = require("./IResource.js"); -var WH = -/*#__PURE__*/ -function (_IEventHandler) { +var WH = /*#__PURE__*/function (_IEventHandler) { (0, _inherits2["default"])(WH, _IEventHandler); function WH() { @@ -8625,9 +8599,7 @@ function (_IEventHandler) { }, { key: "query", value: function () { - var _query = (0, _asyncToGenerator2["default"])( - /*#__PURE__*/ - _regenerator["default"].mark(function _callee(path) { + var _query = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(path) { var rt, p, resource, i, store, res, children; return _regenerator["default"].wrap(function _callee$(_context) { while (1) { @@ -8758,7 +8730,7 @@ Warehouse.protocols.add("mem", function () { var _default = Warehouse; exports["default"] = _default; -},{"../Core/AsyncReply.js":21,"../Core/IEventHandler.js":25,"../Data/AutoList.js":27,"../Data/KeyList.js":33,"../Net/IIP/DistributedConnection.js":39,"../Resource/Instance.js":58,"../Resource/Template/ResourceTemplate.js":64,"../Stores/MemoryStore.js":71,"./IResource.js":56,"./IStore.js":57,"@babel/runtime/helpers/asyncToGenerator":2,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":5,"@babel/runtime/helpers/getPrototypeOf":7,"@babel/runtime/helpers/inherits":8,"@babel/runtime/helpers/interopRequireDefault":9,"@babel/runtime/helpers/possibleConstructorReturn":11,"@babel/runtime/helpers/typeof":14,"@babel/runtime/regenerator":17}],66:[function(require,module,exports){ +},{"../Core/AsyncReply.js":21,"../Core/IEventHandler.js":25,"../Data/AutoList.js":27,"../Data/KeyList.js":33,"../Net/IIP/DistributedConnection.js":39,"../Resource/Instance.js":58,"../Resource/Template/ResourceTemplate.js":64,"../Stores/MemoryStore.js":73,"./IResource.js":56,"./IStore.js":57,"@babel/runtime/helpers/asyncToGenerator":2,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":5,"@babel/runtime/helpers/getPrototypeOf":7,"@babel/runtime/helpers/inherits":8,"@babel/runtime/helpers/interopRequireDefault":9,"@babel/runtime/helpers/possibleConstructorReturn":11,"@babel/runtime/helpers/typeof":14,"@babel/runtime/regenerator":17}],66:[function(require,module,exports){ /* * Copyright (c) 2017 Ahmed Kh. Zamil * @@ -8797,9 +8769,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); -var Authentication = -/*#__PURE__*/ -function () { +var Authentication = /*#__PURE__*/function () { function Authentication(type) { (0, _classCallCheck2["default"])(this, Authentication); this.type = type; @@ -8925,9 +8895,7 @@ var _DataConverter = require("../../Data/DataConverter.js"); * Created by Ahmed Zamil on 25/12/2017. * Ref: https://en.wikipedia.org/wiki/SHA-2 */ -var SHA256 = -/*#__PURE__*/ -function () { +var SHA256 = /*#__PURE__*/function () { function SHA256() { (0, _classCallCheck2["default"])(this, SHA256); } @@ -9070,22 +9038,16 @@ exports["default"] = SHA256; */ /** - * Created by Ahmed Zamil on 16/11/2017. + * Created by Ahmed Zamil on 9/2/2017. */ "use strict"; -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - Object.defineProperty(exports, "__esModule", { value: true }); -exports["default"] = exports.Ruling = exports.ActionType = void 0; - -var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); - -var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); - -var ActionType = { +exports["default"] = void 0; +var _default = // ActionType = +{ Attach: 0, Delete: 1, Execute: 2, @@ -9101,17 +9063,48 @@ var ActionType = { Rename: 12, ReceiveEvent: 13 }; -exports.ActionType = ActionType; -var Ruling = { - Denied: 0, - Allowed: 1, - DontCare: 2 -}; -exports.Ruling = Ruling; +exports["default"] = _default; -var IPermissionsManager = -/*#__PURE__*/ -function () { +},{}],71:[function(require,module,exports){ +/* +* Copyright (c) 2017 Ahmed Kh. Zamil +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +*/ + +/** + * Created by Ahmed Zamil on 16/11/2017. + */ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); + +var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); + +var IPermissionsManager = /*#__PURE__*/function () { function IPermissionsManager() { (0, _classCallCheck2["default"])(this, IPermissionsManager); } @@ -9139,7 +9132,47 @@ function () { exports["default"] = IPermissionsManager; -},{"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":5,"@babel/runtime/helpers/interopRequireDefault":9}],71:[function(require,module,exports){ +},{"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":5,"@babel/runtime/helpers/interopRequireDefault":9}],72:[function(require,module,exports){ +/* +* Copyright (c) 2017 Ahmed Kh. Zamil +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +*/ + +/** + * Created by Ahmed Zamil on 9/2/2020. + */ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; +var _default = //Ruling = +{ + Denied: 0, + Allowed: 1, + DontCare: 2 +}; +exports["default"] = _default; + +},{}],73:[function(require,module,exports){ /* * Copyright (c) 2017 Ahmed Kh. Zamil * @@ -9186,9 +9219,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits var _IStore2 = _interopRequireDefault(require("../Resource/IStore.js")); -var MemoryStore = -/*#__PURE__*/ -function (_IStore) { +var MemoryStore = /*#__PURE__*/function (_IStore) { (0, _inherits2["default"])(MemoryStore, _IStore); function MemoryStore() { @@ -9237,7 +9268,8 @@ function (_IStore) { exports["default"] = MemoryStore; -},{"../Resource/IStore.js":57,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":5,"@babel/runtime/helpers/getPrototypeOf":7,"@babel/runtime/helpers/inherits":8,"@babel/runtime/helpers/interopRequireDefault":9,"@babel/runtime/helpers/possibleConstructorReturn":11}],72:[function(require,module,exports){ +},{"../Resource/IStore.js":57,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":5,"@babel/runtime/helpers/getPrototypeOf":7,"@babel/runtime/helpers/inherits":8,"@babel/runtime/helpers/interopRequireDefault":9,"@babel/runtime/helpers/possibleConstructorReturn":11}],74:[function(require,module,exports){ +(function (global){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); @@ -9253,13 +9285,26 @@ var _Structure = _interopRequireDefault(require("./Data/Structure.js")); var _DistributedResource = _interopRequireDefault(require("./Net/IIP/DistributedResource.js")); +var _MemoryStore = _interopRequireDefault(require("./Stores/MemoryStore.js")); + +var _IResource = _interopRequireDefault(require("./Resource/IResource.js")); + if (window) { window.wh = _Warehouse["default"]; window.Structure = _Structure["default"]; window.DistributedResource = _DistributedResource["default"]; + window.MemoryStore = _MemoryStore["default"]; + window.IResource = _IResource["default"]; +} else if (global) { + global.wh = _Warehouse["default"]; + global.Structure = _Structure["default"]; + global.DistributedResource = _DistributedResource["default"]; + global.MemoryStore = _MemoryStore["default"]; + global.IResource = _IResource["default"]; } var _default = _Warehouse["default"]; exports["default"] = _default; -},{"./Data/Structure.js":36,"./Net/IIP/DistributedResource.js":41,"./Resource/Warehouse.js":65,"@babel/runtime/helpers/interopRequireDefault":9}]},{},[72]); +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./Data/Structure.js":36,"./Net/IIP/DistributedResource.js":41,"./Resource/IResource.js":56,"./Resource/Warehouse.js":65,"./Stores/MemoryStore.js":73,"@babel/runtime/helpers/interopRequireDefault":9}]},{},[74]); diff --git a/module.js b/module.js index 0d70b49..e8967a3 100644 --- a/module.js +++ b/module.js @@ -5,3 +5,4 @@ exports.printMsg = function() { module.exports = { wh }; let WebSocket = require('ws') + diff --git a/package-lock.json b/package-lock.json index f63bab6..3ce904f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "esyur", - "version": "1.3.5", + "version": "1.4.5", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/cli": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.7.7.tgz", - "integrity": "sha512-XQw5KyCZyu/M8/0rYiZyuwbgIQNzOrJzs9dDLX+MieSgBwTLvTj4QVbLmxJACAIvQIDT7PtyHN2sC48EOWTgaA==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.8.4.tgz", + "integrity": "sha512-XXLgAm6LBbaNxaGhMAznXXaxtCWfuv6PIDJ9Alsy9JYTOh+j2jJz+L/162kkfU1j/pTSxK1xGmlwI4pdIMkoag==", "dev": true, "requires": { "chokidar": "^2.1.8", @@ -22,29 +22,41 @@ } }, "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", "dev": true, "requires": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "^7.8.3" + } + }, + "@babel/compat-data": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.8.6.tgz", + "integrity": "sha512-CurCIKPTkS25Mb8mz267vU95vy+TyUpnctEX2lV33xWNmHAfjruztgiPBbXZRh3xZZy1CYvGx6XfxyTVS+sk7Q==", + "dev": true, + "requires": { + "browserslist": "^4.8.5", + "invariant": "^2.2.4", + "semver": "^5.5.0" } }, "@babel/core": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.7.tgz", - "integrity": "sha512-jlSjuj/7z138NLZALxVgrx13AOtqip42ATZP7+kYl53GvDV6+4dCek1mVUo8z8c8Xnw/mx2q3d9HWh3griuesQ==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.6.tgz", + "integrity": "sha512-Sheg7yEJD51YHAvLEV/7Uvw95AeWqYPL3Vk3zGujJKIhJ+8oLw2ALaf3hbucILhKsgSoADOvtKRJuNVdcJkOrg==", "dev": true, "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.7", - "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.7", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.8.6", + "@babel/helpers": "^7.8.4", + "@babel/parser": "^7.8.6", + "@babel/template": "^7.8.6", + "@babel/traverse": "^7.8.6", + "@babel/types": "^7.8.6", "convert-source-map": "^1.7.0", "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", "json5": "^2.1.0", "lodash": "^4.17.13", "resolve": "^1.3.2", @@ -52,6 +64,17 @@ "source-map": "^0.5.0" }, "dependencies": { + "@babel/types": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.6.tgz", + "integrity": "sha512-wqz7pgWMIrht3gquyEFPVXeXCti72Rm8ep9b5tQKz9Yg9LzJA3HxosF1SB3Kc81KD1A3XBkkVYtJvCKS2Z/QrA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -70,234 +93,288 @@ } }, "@babel/generator": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", - "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.6.tgz", + "integrity": "sha512-4bpOR5ZBz+wWcMeVtcf7FbjcFzCp+817z2/gHNncIRcM9MmKzUhtWCYAq27RAfUrAFwb+OCG1s9WEaVxfi6cjg==", "dev": true, "requires": { - "@babel/types": "^7.7.4", + "@babel/types": "^7.8.6", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.6.tgz", + "integrity": "sha512-wqz7pgWMIrht3gquyEFPVXeXCti72Rm8ep9b5tQKz9Yg9LzJA3HxosF1SB3Kc81KD1A3XBkkVYtJvCKS2Z/QrA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-annotate-as-pure": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.4.tgz", - "integrity": "sha512-2BQmQgECKzYKFPpiycoF9tlb5HA4lrVyAmLLVK177EcQAqjVLciUb2/R+n1boQ9y5ENV3uz2ZqiNw7QMBBw1Og==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz", + "integrity": "sha512-6o+mJrZBxOoEX77Ezv9zwW7WV8DdluouRKNY/IR5u/YTMuKHgugHOzYWlYvYLpLA9nPsQCAAASpCIbjI9Mv+Uw==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.3" } }, "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.7.4.tgz", - "integrity": "sha512-Biq/d/WtvfftWZ9Uf39hbPBYDUo986m5Bb4zhkeYDGUllF43D+nUe5M6Vuo6/8JDK/0YX/uBdeoQpyaNhNugZQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.8.3.tgz", + "integrity": "sha512-5eFOm2SyFPK4Rh3XMMRDjN7lBH0orh3ss0g3rTYZnBQ+r6YPj7lgDyCvPphynHvUrobJmeMignBr6Acw9mAPlw==", "dev": true, "requires": { - "@babel/helper-explode-assignable-expression": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-explode-assignable-expression": "^7.8.3", + "@babel/types": "^7.8.3" } }, "@babel/helper-call-delegate": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.7.4.tgz", - "integrity": "sha512-8JH9/B7J7tCYJ2PpWVpw9JhPuEVHztagNVuQAFBVFYluRMlpG7F1CgKEgGeL6KFqcsIa92ZYVj6DSc0XwmN1ZA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.8.3.tgz", + "integrity": "sha512-6Q05px0Eb+N4/GTyKPPvnkig7Lylw+QzihMpws9iiZQv7ZImf84ZsZpQH7QoWN4n4tm81SnSzPgHw2qtO0Zf3A==", "dev": true, "requires": { - "@babel/helper-hoist-variables": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-hoist-variables": "^7.8.3", + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.6.tgz", + "integrity": "sha512-UrJdk27hKVJSnibFcUWYLkCL0ZywTUoot8yii1lsHJcvwrypagmYKjHLMWivQPm4s6GdyygCL8fiH5EYLxhQwQ==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.8.6", + "browserslist": "^4.8.5", + "invariant": "^2.2.4", + "levenary": "^1.1.1", + "semver": "^5.5.0" } }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.4.tgz", - "integrity": "sha512-Mt+jBKaxL0zfOIWrfQpnfYCN7/rS6GKx6CCCfuoqVVd+17R8zNDlzVYmIi9qyb2wOk002NsmSTDymkIygDUH7A==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.6.tgz", + "integrity": "sha512-bPyujWfsHhV/ztUkwGHz/RPV1T1TDEsSZDsN42JPehndA+p1KKTh3npvTadux0ZhCrytx9tvjpWNowKby3tM6A==", "dev": true, "requires": { - "@babel/helper-regex": "^7.4.4", + "@babel/helper-annotate-as-pure": "^7.8.3", + "@babel/helper-regex": "^7.8.3", "regexpu-core": "^4.6.0" } }, "@babel/helper-define-map": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.7.4.tgz", - "integrity": "sha512-v5LorqOa0nVQUvAUTUF3KPastvUt/HzByXNamKQ6RdJRTV7j8rLL+WB5C/MzzWAwOomxDhYFb1wLLxHqox86lg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.8.3.tgz", + "integrity": "sha512-PoeBYtxoZGtct3md6xZOCWPcKuMuk3IHhgxsRRNtnNShebf4C8YonTSblsK4tvDbm+eJAw2HAPOfCr+Q/YRG/g==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/helper-function-name": "^7.8.3", + "@babel/types": "^7.8.3", "lodash": "^4.17.13" } }, "@babel/helper-explode-assignable-expression": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.7.4.tgz", - "integrity": "sha512-2/SicuFrNSXsZNBxe5UGdLr+HZg+raWBLE9vC98bdYOKX/U6PY0mdGlYUJdtTDPSU0Lw0PNbKKDpwYHJLn2jLg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.8.3.tgz", + "integrity": "sha512-N+8eW86/Kj147bO9G2uclsg5pwfs/fqqY5rwgIL7eTBklgXjcOJ3btzS5iM6AitJcftnY7pm2lGsrJVYLGjzIw==", "dev": true, "requires": { - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3" } }, "@babel/helper-function-name": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", - "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", + "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-get-function-arity": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" } }, "@babel/helper-get-function-arity": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", - "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", + "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.3" } }, "@babel/helper-hoist-variables": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.4.tgz", - "integrity": "sha512-wQC4xyvc1Jo/FnLirL6CEgPgPCa8M74tOdjWpRhQYapz5JC7u3NYU1zCVoVAGCE3EaIP9T1A3iW0WLJ+reZlpQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.8.3.tgz", + "integrity": "sha512-ky1JLOjcDUtSc+xkt0xhYff7Z6ILTAHKmZLHPxAhOP0Nd77O+3nCsd6uSVYur6nJnCI029CrNbYlc0LoPfAPQg==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.3" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.4.tgz", - "integrity": "sha512-9KcA1X2E3OjXl/ykfMMInBK+uVdfIVakVe7W7Lg3wfXUNyS3Q1HWLFRwZIjhqiCGbslummPDnmb7vIekS0C1vw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", + "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.3" } }, "@babel/helper-module-imports": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.7.4.tgz", - "integrity": "sha512-dGcrX6K9l8258WFjyDLJwuVKxR4XZfU0/vTUgOQYWEnRD8mgr+p4d6fCUMq/ys0h4CCt/S5JhbvtyErjWouAUQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.3" } }, "@babel/helper-module-transforms": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.7.5.tgz", - "integrity": "sha512-A7pSxyJf1gN5qXVcidwLWydjftUN878VkalhXX5iQDuGyiGK3sOrrKKHF4/A4fwHtnsotv/NipwAeLzY4KQPvw==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.8.6.tgz", + "integrity": "sha512-RDnGJSR5EFBJjG3deY0NiL0K9TO8SXxS9n/MPsbPK/s9LbQymuLNtlzvDiNS7IpecuL45cMeLVkA+HfmlrnkRg==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.7.4", - "@babel/helper-simple-access": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.8.6", "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/types": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.6.tgz", + "integrity": "sha512-wqz7pgWMIrht3gquyEFPVXeXCti72Rm8ep9b5tQKz9Yg9LzJA3HxosF1SB3Kc81KD1A3XBkkVYtJvCKS2Z/QrA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-optimise-call-expression": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.4.tgz", - "integrity": "sha512-VB7gWZ2fDkSuqW6b1AKXkJWO5NyNI3bFL/kK79/30moK57blr6NbH8xcl2XcKCwOmJosftWunZqfO84IGq3ZZg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", + "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.3" } }, "@babel/helper-plugin-utils": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", - "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", "dev": true }, "@babel/helper-regex": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz", - "integrity": "sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.8.3.tgz", + "integrity": "sha512-BWt0QtYv/cg/NecOAZMdcn/waj/5P26DR4mVLXfFtDokSR6fyuG0Pj+e2FqtSME+MqED1khnSMulkmGl8qWiUQ==", "dev": true, "requires": { "lodash": "^4.17.13" } }, "@babel/helper-remap-async-to-generator": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.4.tgz", - "integrity": "sha512-Sk4xmtVdM9sA/jCI80f+KS+Md+ZHIpjuqmYPk1M7F/upHou5e4ReYmExAiu6PVe65BhJPZA2CY9x9k4BqE5klw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.8.3.tgz", + "integrity": "sha512-kgwDmw4fCg7AVgS4DukQR/roGp+jP+XluJE5hsRZwxCYGg+Rv9wSGErDWhlI90FODdYfd4xG4AQRiMDjjN0GzA==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.7.4", - "@babel/helper-wrap-function": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-annotate-as-pure": "^7.8.3", + "@babel/helper-wrap-function": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3" } }, "@babel/helper-replace-supers": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz", - "integrity": "sha512-pP0tfgg9hsZWo5ZboYGuBn/bbYT/hdLPVSS4NMmiRJdwWhP0IznPwN9AE1JwyGsjSPLC364I0Qh5p+EPkGPNpg==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", + "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.7.4", - "@babel/helper-optimise-call-expression": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-member-expression-to-functions": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/traverse": "^7.8.6", + "@babel/types": "^7.8.6" + }, + "dependencies": { + "@babel/types": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.6.tgz", + "integrity": "sha512-wqz7pgWMIrht3gquyEFPVXeXCti72Rm8ep9b5tQKz9Yg9LzJA3HxosF1SB3Kc81KD1A3XBkkVYtJvCKS2Z/QrA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-simple-access": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz", - "integrity": "sha512-zK7THeEXfan7UlWsG2A6CI/L9jVnI5+xxKZOdej39Y0YtDYKx9raHk5F2EtK9K8DHRTihYwg20ADt9S36GR78A==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", "dev": true, "requires": { - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" } }, "@babel/helper-split-export-declaration": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", - "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.3" } }, "@babel/helper-wrap-function": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.7.4.tgz", - "integrity": "sha512-VsfzZt6wmsocOaVU0OokwrIytHND55yvyT4BPB9AIIgwr8+x7617hetdJTsuGwygN5RC6mxA9EJztTjuwm2ofg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz", + "integrity": "sha512-LACJrbUET9cQDzb6kG7EeD7+7doC3JNvUgTEQOx2qaO1fKlzE/Bf05qs9w1oXQMmXlPO65lC3Tq9S6gZpTErEQ==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-function-name": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3" } }, "@babel/helpers": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.4.tgz", - "integrity": "sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz", + "integrity": "sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w==", "dev": true, "requires": { - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.8.4", + "@babel/types": "^7.8.3" } }, "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", + "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -306,507 +383,581 @@ } }, "@babel/parser": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", - "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.6.tgz", + "integrity": "sha512-trGNYSfwq5s0SgM1BMEB8hX3NDmO7EP2wsDGDexiaKMB92BaRpS+qZfpkMqUBhcsOTBwNy9B/jieo4ad/t/z2g==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.4.tgz", - "integrity": "sha512-1ypyZvGRXriY/QP668+s8sFr2mqinhkRDMPSQLNghCQE+GAkFtp+wkHVvg2+Hdki8gwP+NFzJBJ/N1BfzCCDEw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.8.3.tgz", + "integrity": "sha512-NZ9zLv848JsV3hs8ryEh7Uaz/0KsmPLqv0+PdkDJL1cJy0K4kOCFa8zc1E3mp+RHPQcpdfb/6GovEsW4VDrOMw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.7.4", - "@babel/plugin-syntax-async-generators": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-remap-async-to-generator": "^7.8.3", + "@babel/plugin-syntax-async-generators": "^7.8.0" } }, "@babel/plugin-proposal-dynamic-import": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.4.tgz", - "integrity": "sha512-StH+nGAdO6qDB1l8sZ5UBV8AC3F2VW2I8Vfld73TMKyptMU9DY5YsJAS8U81+vEtxcH3Y/La0wG0btDrhpnhjQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz", + "integrity": "sha512-NyaBbyLFXFLT9FP+zk0kYlUlA8XtCUbehs67F0nnEg7KICgMc2mNkIeu9TYhKzyXMkrapZFwAhXLdnt4IYHy1w==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-dynamic-import": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-dynamic-import": "^7.8.0" } }, "@babel/plugin-proposal-json-strings": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.7.4.tgz", - "integrity": "sha512-wQvt3akcBTfLU/wYoqm/ws7YOAQKu8EVJEvHip/mzkNtjaclQoCCIqKXFP5/eyfnfbQCDV3OLRIK3mIVyXuZlw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.8.3.tgz", + "integrity": "sha512-KGhQNZ3TVCQG/MjRbAUwuH+14y9q0tpxs1nWWs3pbSleRdDro9SAMMDyye8HhY1gqZ7/NqIc8SKhya0wRDgP1Q==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-json-strings": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.0" + } + }, + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.7.tgz", - "integrity": "sha512-3qp9I8lelgzNedI3hrhkvhaEYree6+WHnyA/q4Dza9z7iEIs1eyhWyJnetk3jJ69RT0AT4G0UhEGwyGFJ7GUuQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-8qvuPwU/xxUCt78HocNlv0mXXo0wdh9VT1R04WU8HGOfaOob26pF+9P5/lYjN/q7DHOX1bvX60hnhOvuQUJdbA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-object-rest-spread": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0" } }, "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.7.4.tgz", - "integrity": "sha512-DyM7U2bnsQerCQ+sejcTNZh8KQEUuC3ufzdnVnSiUv/qoGJp2Z3hanKL18KDhsBT5Wj6a7CMT5mdyCNJsEaA9w==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-0gkX7J7E+AtAw9fcwlVQj8peP61qhdg/89D5swOkjYbkboA2CVckn3kiyum1DE0wskGb7KJJxBdyEBApDLLVdw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" + } + }, + "@babel/plugin-proposal-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.8.3.tgz", + "integrity": "sha512-QIoIR9abkVn+seDE3OjA08jWcs3eZ9+wJCKSRgo3WdEU2csFYgdScb+8qHB3+WXsGJD55u+5hWCISI7ejXS+kg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.0" } }, "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.7.tgz", - "integrity": "sha512-80PbkKyORBUVm1fbTLrHpYdJxMThzM1UqFGh0ALEhO9TYbG86Ah9zQYAB/84axz2vcxefDLdZwWwZNlYARlu9w==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.3.tgz", + "integrity": "sha512-1/1/rEZv2XGweRwwSkLpY+s60za9OZ1hJs4YDqFHCw0kYWYwL5IFljVY1MYBL+weT1l9pokDO2uhSTLVxzoHkQ==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-create-regexp-features-plugin": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-syntax-async-generators": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.7.4.tgz", - "integrity": "sha512-Li4+EjSpBgxcsmeEF8IFcfV/+yJGxHXDirDkEoyFjumuwbmfCVHUt0HuowD/iGM7OhIRyXJH9YXxqiH6N815+g==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" } }, "@babel/plugin-syntax-dynamic-import": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.7.4.tgz", - "integrity": "sha512-jHQW0vbRGvwQNgyVxwDh4yuXu4bH1f5/EICJLAhl1SblLs2CDhrsmCk+v5XLdE9wxtAFRyxx+P//Iw+a5L/tTg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" } }, "@babel/plugin-syntax-json-strings": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.7.4.tgz", - "integrity": "sha512-QpGupahTQW1mHRXddMG5srgpHWqRLwJnJZKXTigB9RPFCCGbDGCgBeM/iC82ICXp414WeYx/tD54w7M2qRqTMg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, "@babel/plugin-syntax-object-rest-spread": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.7.4.tgz", - "integrity": "sha512-mObR+r+KZq0XhRVS2BrBKBpr5jqrqzlPvS9C9vuOf5ilSwzloAl7RPWLrgKdWS6IreaVrjHxTjtyqFiOisaCwg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" } }, "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.7.4.tgz", - "integrity": "sha512-4ZSuzWgFxqHRE31Glu+fEr/MirNZOMYmD/0BhBWyLyOOQz/gTAl7QmWm2hX1QxEIXsr2vkdlwxIzTyiYRC4xcQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, "@babel/plugin-syntax-top-level-await": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.7.4.tgz", - "integrity": "sha512-wdsOw0MvkL1UIgiQ/IFr3ETcfv1xb8RMM0H9wbiDyLaJFyiDg5oZvDLCXosIXmFeIlweML5iOBXAkqddkYNizg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.8.3.tgz", + "integrity": "sha512-kwj1j9lL/6Wd0hROD3b/OZZ7MSrZLqqn9RAZ5+cYYsflQ9HZBIKCUkr3+uL1MEJ1NePiUbf98jjiMQSv0NMR9g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-arrow-functions": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.7.4.tgz", - "integrity": "sha512-zUXy3e8jBNPiffmqkHRNDdZM2r8DWhCB7HhcoyZjiK1TxYEluLHAvQuYnTT+ARqRpabWqy/NHkO6e3MsYB5YfA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz", + "integrity": "sha512-0MRF+KC8EqH4dbuITCWwPSzsyO3HIWWlm30v8BbbpOrS1B++isGxPnnuq/IZvOX5J2D/p7DQalQm+/2PnlKGxg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.4.tgz", - "integrity": "sha512-zpUTZphp5nHokuy8yLlyafxCJ0rSlFoSHypTUWgpdwoDXWQcseaect7cJ8Ppk6nunOM6+5rPMkod4OYKPR5MUg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.8.3.tgz", + "integrity": "sha512-imt9tFLD9ogt56Dd5CI/6XgpukMwd/fLGSrix2httihVe7LOGVPhyhMh1BU5kDM7iHD08i8uUtmV2sWaBFlHVQ==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.7.4" + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-remap-async-to-generator": "^7.8.3" } }, "@babel/plugin-transform-block-scoped-functions": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.7.4.tgz", - "integrity": "sha512-kqtQzwtKcpPclHYjLK//3lH8OFsCDuDJBaFhVwf8kqdnF6MN4l618UDlcA7TfRs3FayrHj+svYnSX8MC9zmUyQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.8.3.tgz", + "integrity": "sha512-vo4F2OewqjbB1+yaJ7k2EJFHlTP3jR634Z9Cj9itpqNjuLXvhlVxgnjsHsdRgASR8xYDrx6onw4vW5H6We0Jmg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-block-scoping": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.7.4.tgz", - "integrity": "sha512-2VBe9u0G+fDt9B5OV5DQH4KBf5DoiNkwFKOz0TCvBWvdAN2rOykCTkrL+jTLxfCAm76l9Qo5OqL7HBOx2dWggg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.8.3.tgz", + "integrity": "sha512-pGnYfm7RNRgYRi7bids5bHluENHqJhrV4bCZRwc5GamaWIIs07N4rZECcmJL6ZClwjDz1GbdMZFtPs27hTB06w==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-plugin-utils": "^7.8.3", "lodash": "^4.17.13" } }, "@babel/plugin-transform-classes": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.4.tgz", - "integrity": "sha512-sK1mjWat7K+buWRuImEzjNf68qrKcrddtpQo3swi9j7dUcG6y6R6+Di039QN2bD1dykeswlagupEmpOatFHHUg==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.8.6.tgz", + "integrity": "sha512-k9r8qRay/R6v5aWZkrEclEhKO6mc1CCQr2dLsVHBmOQiMpN6I2bpjX3vgnldUWeEI1GHVNByULVxZ4BdP4Hmdg==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.7.4", - "@babel/helper-define-map": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-optimise-call-expression": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/helper-annotate-as-pure": "^7.8.3", + "@babel/helper-define-map": "^7.8.3", + "@babel/helper-function-name": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-split-export-declaration": "^7.8.3", "globals": "^11.1.0" } }, "@babel/plugin-transform-computed-properties": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.7.4.tgz", - "integrity": "sha512-bSNsOsZnlpLLyQew35rl4Fma3yKWqK3ImWMSC/Nc+6nGjC9s5NFWAer1YQ899/6s9HxO2zQC1WoFNfkOqRkqRQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.8.3.tgz", + "integrity": "sha512-O5hiIpSyOGdrQZRQ2ccwtTVkgUDBBiCuK//4RJ6UfePllUTCENOzKxfh6ulckXKc0DixTFLCfb2HVkNA7aDpzA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-destructuring": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.7.4.tgz", - "integrity": "sha512-4jFMXI1Cu2aXbcXXl8Lr6YubCn6Oc7k9lLsu8v61TZh+1jny2BWmdtvY9zSUlLdGUvcy9DMAWyZEOqjsbeg/wA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.8.3.tgz", + "integrity": "sha512-H4X646nCkiEcHZUZaRkhE2XVsoz0J/1x3VVujnn96pSoGCtKPA99ZZA+va+gK+92Zycd6OBKCD8tDb/731bhgQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.7.tgz", - "integrity": "sha512-b4in+YlTeE/QmTgrllnb3bHA0HntYvjz8O3Mcbx75UBPJA2xhb5A8nle498VhxSXJHQefjtQxpnLPehDJ4TRlg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz", + "integrity": "sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-create-regexp-features-plugin": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-duplicate-keys": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.7.4.tgz", - "integrity": "sha512-g1y4/G6xGWMD85Tlft5XedGaZBCIVN+/P0bs6eabmcPP9egFleMAo65OOjlhcz1njpwagyY3t0nsQC9oTFegJA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.8.3.tgz", + "integrity": "sha512-s8dHiBUbcbSgipS4SMFuWGqCvyge5V2ZeAWzR6INTVC3Ltjig/Vw1G2Gztv0vU/hRG9X8IvKvYdoksnUfgXOEQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-exponentiation-operator": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.7.4.tgz", - "integrity": "sha512-MCqiLfCKm6KEA1dglf6Uqq1ElDIZwFuzz1WH5mTf8k2uQSxEJMbOIEh7IZv7uichr7PMfi5YVSrr1vz+ipp7AQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.8.3.tgz", + "integrity": "sha512-zwIpuIymb3ACcInbksHaNcR12S++0MDLKkiqXHl3AzpgdKlFNhog+z/K0+TGW+b0w5pgTq4H6IwV/WhxbGYSjQ==", "dev": true, "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-for-of": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.7.4.tgz", - "integrity": "sha512-zZ1fD1B8keYtEcKF+M1TROfeHTKnijcVQm0yO/Yu1f7qoDoxEIc/+GX6Go430Bg84eM/xwPFp0+h4EbZg7epAA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.6.tgz", + "integrity": "sha512-M0pw4/1/KI5WAxPsdcUL/w2LJ7o89YHN3yLkzNjg7Yl15GlVGgzHyCU+FMeAxevHGsLVmUqbirlUIKTafPmzdw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-function-name": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.4.tgz", - "integrity": "sha512-E/x09TvjHNhsULs2IusN+aJNRV5zKwxu1cpirZyRPw+FyyIKEHPXTsadj48bVpc1R5Qq1B5ZkzumuFLytnbT6g==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.8.3.tgz", + "integrity": "sha512-rO/OnDS78Eifbjn5Py9v8y0aR+aSYhDhqAwVfsTl0ERuMZyr05L1aFSCJnbv2mmsLkit/4ReeQ9N2BgLnOcPCQ==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-function-name": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-literals": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.7.4.tgz", - "integrity": "sha512-X2MSV7LfJFm4aZfxd0yLVFrEXAgPqYoDG53Br/tCKiKYfX0MjVjQeWPIhPHHsCqzwQANq+FLN786fF5rgLS+gw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.8.3.tgz", + "integrity": "sha512-3Tqf8JJ/qB7TeldGl+TT55+uQei9JfYaregDcEAyBZ7akutriFrt6C/wLYIer6OYhleVQvH/ntEhjE/xMmy10A==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-member-expression-literals": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.7.4.tgz", - "integrity": "sha512-9VMwMO7i69LHTesL0RdGy93JU6a+qOPuvB4F4d0kR0zyVjJRVJRaoaGjhtki6SzQUu8yen/vxPKN6CWnCUw6bA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.8.3.tgz", + "integrity": "sha512-3Wk2EXhnw+rP+IDkK6BdtPKsUE5IeZ6QOGrPYvw52NwBStw9V1ZVzxgK6fSKSxqUvH9eQPR3tm3cOq79HlsKYA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-modules-amd": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.7.5.tgz", - "integrity": "sha512-CT57FG4A2ZUNU1v+HdvDSDrjNWBrtCmSH6YbbgN3Lrf0Di/q/lWRxZrE72p3+HCCz9UjfZOEBdphgC0nzOS6DQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.8.3.tgz", + "integrity": "sha512-MadJiU3rLKclzT5kBH4yxdry96odTUwuqrZM+GllFI/VhxfPz+k9MshJM+MwhfkCdxxclSbSBbUGciBngR+kEQ==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.7.5", - "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-module-transforms": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", "babel-plugin-dynamic-import-node": "^2.3.0" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.5.tgz", - "integrity": "sha512-9Cq4zTFExwFhQI6MT1aFxgqhIsMWQWDVwOgLzl7PTWJHsNaqFvklAU+Oz6AQLAS0dJKTwZSOCo20INwktxpi3Q==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.8.3.tgz", + "integrity": "sha512-JpdMEfA15HZ/1gNuB9XEDlZM1h/gF/YOH7zaZzQu2xCFRfwc01NXBMHHSTT6hRjlXJJs5x/bfODM3LiCk94Sxg==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.7.5", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-simple-access": "^7.7.4", + "@babel/helper-module-transforms": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-simple-access": "^7.8.3", "babel-plugin-dynamic-import-node": "^2.3.0" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.7.4.tgz", - "integrity": "sha512-y2c96hmcsUi6LrMqvmNDPBBiGCiQu0aYqpHatVVu6kD4mFEXKjyNxd/drc18XXAf9dv7UXjrZwBVmTTGaGP8iw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.8.3.tgz", + "integrity": "sha512-8cESMCJjmArMYqa9AO5YuMEkE4ds28tMpZcGZB/jl3n0ZzlsxOAi3mC+SKypTfT8gjMupCnd3YiXCkMjj2jfOg==", "dev": true, "requires": { - "@babel/helper-hoist-variables": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-hoist-variables": "^7.8.3", + "@babel/helper-module-transforms": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", "babel-plugin-dynamic-import-node": "^2.3.0" } }, "@babel/plugin-transform-modules-umd": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.7.4.tgz", - "integrity": "sha512-u2B8TIi0qZI4j8q4C51ktfO7E3cQ0qnaXFI1/OXITordD40tt17g/sXqgNNCcMTcBFKrUPcGDx+TBJuZxLx7tw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.8.3.tgz", + "integrity": "sha512-evhTyWhbwbI3/U6dZAnx/ePoV7H6OUG+OjiJFHmhr9FPn0VShjwC2kdxqIuQ/+1P50TMrneGzMeyMTFOjKSnAw==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-module-transforms": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.7.4.tgz", - "integrity": "sha512-jBUkiqLKvUWpv9GLSuHUFYdmHg0ujC1JEYoZUfeOOfNydZXp1sXObgyPatpcwjWgsdBGsagWW0cdJpX/DO2jMw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.8.3.tgz", + "integrity": "sha512-f+tF/8UVPU86TrCb06JoPWIdDpTNSGGcAtaD9mLP0aYGA0OS0j7j7DHJR0GTFrUZPUU6loZhbsVZgTh0N+Qdnw==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.7.4" + "@babel/helper-create-regexp-features-plugin": "^7.8.3" } }, "@babel/plugin-transform-new-target": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.7.4.tgz", - "integrity": "sha512-CnPRiNtOG1vRodnsyGX37bHQleHE14B9dnnlgSeEs3ek3fHN1A1SScglTCg1sfbe7sRQ2BUcpgpTpWSfMKz3gg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.8.3.tgz", + "integrity": "sha512-QuSGysibQpyxexRyui2vca+Cmbljo8bcRckgzYV4kRIsHpVeyeC3JDO63pY+xFZ6bWOBn7pfKZTqV4o/ix9sFw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-object-super": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.7.4.tgz", - "integrity": "sha512-ho+dAEhC2aRnff2JCA0SAK7V2R62zJd/7dmtoe7MHcso4C2mS+vZjn1Pb1pCVZvJs1mgsvv5+7sT+m3Bysb6eg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.8.3.tgz", + "integrity": "sha512-57FXk+gItG/GejofIyLIgBKTas4+pEU47IXKDBWFTxdPd7F80H8zybyAY7UoblVfBhBGs2EKM+bJUu2+iUYPDQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.3" } }, "@babel/plugin-transform-parameters": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.7.7.tgz", - "integrity": "sha512-OhGSrf9ZBrr1fw84oFXj5hgi8Nmg+E2w5L7NhnG0lPvpDtqd7dbyilM2/vR8CKbJ907RyxPh2kj6sBCSSfI9Ew==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.4.tgz", + "integrity": "sha512-IsS3oTxeTsZlE5KqzTbcC2sV0P9pXdec53SU+Yxv7o/6dvGM5AkTotQKhoSffhNgZ/dftsSiOoxy7evCYJXzVA==", "dev": true, "requires": { - "@babel/helper-call-delegate": "^7.7.4", - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-call-delegate": "^7.8.3", + "@babel/helper-get-function-arity": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-property-literals": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.7.4.tgz", - "integrity": "sha512-MatJhlC4iHsIskWYyawl53KuHrt+kALSADLQQ/HkhTjX954fkxIEh4q5slL4oRAnsm/eDoZ4q0CIZpcqBuxhJQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.8.3.tgz", + "integrity": "sha512-uGiiXAZMqEoQhRWMK17VospMZh5sXWg+dlh2soffpkAl96KAm+WZuJfa6lcELotSRmooLqg0MWdH6UUq85nmmg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-regenerator": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.5.tgz", - "integrity": "sha512-/8I8tPvX2FkuEyWbjRCt4qTAgZK0DVy8QRguhA524UH48RfGJy94On2ri+dCuwOpcerPRl9O4ebQkRcVzIaGBw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.3.tgz", + "integrity": "sha512-qt/kcur/FxrQrzFR432FGZznkVAjiyFtCOANjkAKwCbt465L6ZCiUQh2oMYGU3Wo8LRFJxNDFwWn106S5wVUNA==", "dev": true, "requires": { "regenerator-transform": "^0.14.0" } }, "@babel/plugin-transform-reserved-words": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.7.4.tgz", - "integrity": "sha512-OrPiUB5s5XvkCO1lS7D8ZtHcswIC57j62acAnJZKqGGnHP+TIc/ljQSrgdX/QyOTdEK5COAhuc820Hi1q2UgLQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.8.3.tgz", + "integrity": "sha512-mwMxcycN3omKFDjDQUl+8zyMsBfjRFr0Zn/64I41pmjv4NJuqcYlEtezwYtw9TFd9WR1vN5kiM+O0gMZzO6L0A==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-runtime": { - "version": "7.7.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.7.6.tgz", - "integrity": "sha512-tajQY+YmXR7JjTwRvwL4HePqoL3DYxpYXIHKVvrOIvJmeHe2y1w4tz5qz9ObUDC9m76rCzIMPyn4eERuwA4a4A==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.8.3.tgz", + "integrity": "sha512-/vqUt5Yh+cgPZXXjmaG9NT8aVfThKk7G4OqkVhrXqwsC5soMn/qTCxs36rZ2QFhpfTJcjw4SNDIZ4RUb8OL4jQ==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", "resolve": "^1.8.1", "semver": "^5.5.1" } }, "@babel/plugin-transform-shorthand-properties": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.7.4.tgz", - "integrity": "sha512-q+suddWRfIcnyG5YiDP58sT65AJDZSUhXQDZE3r04AuqD6d/XLaQPPXSBzP2zGerkgBivqtQm9XKGLuHqBID6Q==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz", + "integrity": "sha512-I9DI6Odg0JJwxCHzbzW08ggMdCezoWcuQRz3ptdudgwaHxTjxw5HgdFJmZIkIMlRymL6YiZcped4TTCB0JcC8w==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-spread": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.7.4.tgz", - "integrity": "sha512-8OSs0FLe5/80cndziPlg4R0K6HcWSM0zyNhHhLsmw/Nc5MaA49cAsnoJ/t/YZf8qkG7fD+UjTRaApVDB526d7Q==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.8.3.tgz", + "integrity": "sha512-CkuTU9mbmAoFOI1tklFWYYbzX5qCIZVXPVy0jpXgGwkplCndQAa58s2jr66fTeQnA64bDox0HL4U56CFYoyC7g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-sticky-regex": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.7.4.tgz", - "integrity": "sha512-Ls2NASyL6qtVe1H1hXts9yuEeONV2TJZmplLONkMPUG158CtmnrzW5Q5teibM5UVOFjG0D3IC5mzXR6pPpUY7A==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.8.3.tgz", + "integrity": "sha512-9Spq0vGCD5Bb4Z/ZXXSK5wbbLFMG085qd2vhL1JYu1WcQ5bXqZBAYRzU1d+p79GcHs2szYv5pVQCX13QgldaWw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-regex": "^7.8.3" } }, "@babel/plugin-transform-template-literals": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.7.4.tgz", - "integrity": "sha512-sA+KxLwF3QwGj5abMHkHgshp9+rRz+oY9uoRil4CyLtgEuE/88dpkeWgNk5qKVsJE9iSfly3nvHapdRiIS2wnQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.8.3.tgz", + "integrity": "sha512-820QBtykIQOLFT8NZOcTRJ1UNuztIELe4p9DCgvj4NK+PwluSJ49we7s9FB1HIGNIYT7wFUJ0ar2QpCDj0escQ==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-annotate-as-pure": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-typeof-symbol": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.7.4.tgz", - "integrity": "sha512-KQPUQ/7mqe2m0B8VecdyaW5XcQYaePyl9R7IsKd+irzj6jvbhoGnRE+M0aNkyAzI07VfUQ9266L5xMARitV3wg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz", + "integrity": "sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-unicode-regex": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.4.tgz", - "integrity": "sha512-N77UUIV+WCvE+5yHw+oks3m18/umd7y392Zv7mYTpFqHtkpcc+QUz+gLJNTWVlWROIWeLqY0f3OjZxV5TcXnRw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz", + "integrity": "sha512-+ufgJjYdmWfSQ+6NS9VGUR2ns8cjJjYbrbi11mZBTaWm+Fui/ncTLFF28Ei1okavY+xkojGr1eJxNsWYeA5aZw==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-create-regexp-features-plugin": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" + } + }, + "@babel/polyfill": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.8.3.tgz", + "integrity": "sha512-0QEgn2zkCzqGIkSWWAEmvxD7e00Nm9asTtQvi7HdlYvMhjy/J38V/1Y9ode0zEJeIuxAI0uftiAzqc7nVeWUGg==", + "requires": { + "core-js": "^2.6.5", + "regenerator-runtime": "^0.13.2" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", + "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==" + } } }, "@babel/preset-env": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.7.7.tgz", - "integrity": "sha512-pCu0hrSSDVI7kCVUOdcMNQEbOPJ52E+LrQ14sN8uL2ALfSqePZQlKrOy+tM4uhEdYlCHi4imr8Zz2cZe9oSdIg==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.8.6.tgz", + "integrity": "sha512-M5u8llV9DIVXBFB/ArIpqJuvXpO+ymxcJ6e8ZAmzeK3sQeBNOD1y+rHvHCGG4TlEmsNpIrdecsHGHT8ZCoOSJg==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-async-generator-functions": "^7.7.4", - "@babel/plugin-proposal-dynamic-import": "^7.7.4", - "@babel/plugin-proposal-json-strings": "^7.7.4", - "@babel/plugin-proposal-object-rest-spread": "^7.7.7", - "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", - "@babel/plugin-proposal-unicode-property-regex": "^7.7.7", - "@babel/plugin-syntax-async-generators": "^7.7.4", - "@babel/plugin-syntax-dynamic-import": "^7.7.4", - "@babel/plugin-syntax-json-strings": "^7.7.4", - "@babel/plugin-syntax-object-rest-spread": "^7.7.4", - "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", - "@babel/plugin-syntax-top-level-await": "^7.7.4", - "@babel/plugin-transform-arrow-functions": "^7.7.4", - "@babel/plugin-transform-async-to-generator": "^7.7.4", - "@babel/plugin-transform-block-scoped-functions": "^7.7.4", - "@babel/plugin-transform-block-scoping": "^7.7.4", - "@babel/plugin-transform-classes": "^7.7.4", - "@babel/plugin-transform-computed-properties": "^7.7.4", - "@babel/plugin-transform-destructuring": "^7.7.4", - "@babel/plugin-transform-dotall-regex": "^7.7.7", - "@babel/plugin-transform-duplicate-keys": "^7.7.4", - "@babel/plugin-transform-exponentiation-operator": "^7.7.4", - "@babel/plugin-transform-for-of": "^7.7.4", - "@babel/plugin-transform-function-name": "^7.7.4", - "@babel/plugin-transform-literals": "^7.7.4", - "@babel/plugin-transform-member-expression-literals": "^7.7.4", - "@babel/plugin-transform-modules-amd": "^7.7.5", - "@babel/plugin-transform-modules-commonjs": "^7.7.5", - "@babel/plugin-transform-modules-systemjs": "^7.7.4", - "@babel/plugin-transform-modules-umd": "^7.7.4", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", - "@babel/plugin-transform-new-target": "^7.7.4", - "@babel/plugin-transform-object-super": "^7.7.4", - "@babel/plugin-transform-parameters": "^7.7.7", - "@babel/plugin-transform-property-literals": "^7.7.4", - "@babel/plugin-transform-regenerator": "^7.7.5", - "@babel/plugin-transform-reserved-words": "^7.7.4", - "@babel/plugin-transform-shorthand-properties": "^7.7.4", - "@babel/plugin-transform-spread": "^7.7.4", - "@babel/plugin-transform-sticky-regex": "^7.7.4", - "@babel/plugin-transform-template-literals": "^7.7.4", - "@babel/plugin-transform-typeof-symbol": "^7.7.4", - "@babel/plugin-transform-unicode-regex": "^7.7.4", - "@babel/types": "^7.7.4", - "browserslist": "^4.6.0", - "core-js-compat": "^3.6.0", + "@babel/compat-data": "^7.8.6", + "@babel/helper-compilation-targets": "^7.8.6", + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-proposal-async-generator-functions": "^7.8.3", + "@babel/plugin-proposal-dynamic-import": "^7.8.3", + "@babel/plugin-proposal-json-strings": "^7.8.3", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-proposal-object-rest-spread": "^7.8.3", + "@babel/plugin-proposal-optional-catch-binding": "^7.8.3", + "@babel/plugin-proposal-optional-chaining": "^7.8.3", + "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.8.3", + "@babel/plugin-transform-arrow-functions": "^7.8.3", + "@babel/plugin-transform-async-to-generator": "^7.8.3", + "@babel/plugin-transform-block-scoped-functions": "^7.8.3", + "@babel/plugin-transform-block-scoping": "^7.8.3", + "@babel/plugin-transform-classes": "^7.8.6", + "@babel/plugin-transform-computed-properties": "^7.8.3", + "@babel/plugin-transform-destructuring": "^7.8.3", + "@babel/plugin-transform-dotall-regex": "^7.8.3", + "@babel/plugin-transform-duplicate-keys": "^7.8.3", + "@babel/plugin-transform-exponentiation-operator": "^7.8.3", + "@babel/plugin-transform-for-of": "^7.8.6", + "@babel/plugin-transform-function-name": "^7.8.3", + "@babel/plugin-transform-literals": "^7.8.3", + "@babel/plugin-transform-member-expression-literals": "^7.8.3", + "@babel/plugin-transform-modules-amd": "^7.8.3", + "@babel/plugin-transform-modules-commonjs": "^7.8.3", + "@babel/plugin-transform-modules-systemjs": "^7.8.3", + "@babel/plugin-transform-modules-umd": "^7.8.3", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", + "@babel/plugin-transform-new-target": "^7.8.3", + "@babel/plugin-transform-object-super": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.8.4", + "@babel/plugin-transform-property-literals": "^7.8.3", + "@babel/plugin-transform-regenerator": "^7.8.3", + "@babel/plugin-transform-reserved-words": "^7.8.3", + "@babel/plugin-transform-shorthand-properties": "^7.8.3", + "@babel/plugin-transform-spread": "^7.8.3", + "@babel/plugin-transform-sticky-regex": "^7.8.3", + "@babel/plugin-transform-template-literals": "^7.8.3", + "@babel/plugin-transform-typeof-symbol": "^7.8.4", + "@babel/plugin-transform-unicode-regex": "^7.8.3", + "@babel/types": "^7.8.6", + "browserslist": "^4.8.5", + "core-js-compat": "^3.6.2", "invariant": "^2.2.2", - "js-levenshtein": "^1.1.3", + "levenary": "^1.1.1", "semver": "^5.5.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.6.tgz", + "integrity": "sha512-wqz7pgWMIrht3gquyEFPVXeXCti72Rm8ep9b5tQKz9Yg9LzJA3HxosF1SB3Kc81KD1A3XBkkVYtJvCKS2Z/QrA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/runtime": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.7.tgz", - "integrity": "sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.4.tgz", + "integrity": "sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==", "requires": { "regenerator-runtime": "^0.13.2" }, @@ -819,33 +970,57 @@ } }, "@babel/template": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", - "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + }, + "dependencies": { + "@babel/types": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.6.tgz", + "integrity": "sha512-wqz7pgWMIrht3gquyEFPVXeXCti72Rm8ep9b5tQKz9Yg9LzJA3HxosF1SB3Kc81KD1A3XBkkVYtJvCKS2Z/QrA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/traverse": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", - "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.6.tgz", + "integrity": "sha512-2B8l0db/DPi8iinITKuo7cbPznLCEk0kCxDoB9/N6gGNg/gxOXiR/IcymAFPiBwk5w6TtQ27w4wpElgp9btR9A==", "dev": true, "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.8.6", + "@babel/helper-function-name": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" }, "dependencies": { + "@babel/types": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.6.tgz", + "integrity": "sha512-wqz7pgWMIrht3gquyEFPVXeXCti72Rm8ep9b5tQKz9Yg9LzJA3HxosF1SB3Kc81KD1A3XBkkVYtJvCKS2Z/QrA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -864,9 +1039,9 @@ } }, "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", + "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -1021,9 +1196,9 @@ "optional": true }, "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" }, "atob": { "version": "2.1.2", @@ -1757,14 +1932,14 @@ } }, "browserslist": { - "version": "4.8.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.2.tgz", - "integrity": "sha512-+M4oeaTplPm/f1pXDw84YohEv7B1i/2Aisei8s4s6k3QsoSHa7i5sz8u/cGQkkatCPxMASKxPualR4wwYgVboA==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.9.0.tgz", + "integrity": "sha512-seffIXhwgB84+OCeT/aMjpZnsAsYDiMSC+CEs3UkF8iU64BZGYcu+TZYs/IBpo4nRi0vJywUJWYdbTsOhFTweg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001015", - "electron-to-chromium": "^1.3.322", - "node-releases": "^1.1.42" + "caniuse-lite": "^1.0.30001030", + "electron-to-chromium": "^1.3.361", + "node-releases": "^1.1.50" } }, "buffer": { @@ -1819,9 +1994,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001017", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001017.tgz", - "integrity": "sha512-EDnZyOJ6eYh6lHmCvCdHAFbfV4KJ9lSdfv4h/ppEhrU/Yudkl7jujwMZ1we6RX7DXqBfT04pVMQ4J+1wcTlsKA==", + "version": "1.0.30001030", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001030.tgz", + "integrity": "sha512-QGK0W4Ft/Ac+zTjEiRJfwDNATvS3fodDczBXrH42784kcfqcDKpEPfN08N0HQjrAp8He/Jw8QiSS9QRn7XAbUw==", "dev": true }, "chalk": { @@ -1935,9 +2110,9 @@ } }, "commander": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.0.1.tgz", - "integrity": "sha512-IPF4ouhCP+qdlcmCedhxX4xiGBPyigb8v5NeUp+0LyhwLgxMqyp3S0vl7TAPfS/hiP7FC3caI/PB9lTmP8r1NA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", "dev": true }, "component-emitter": { @@ -1994,16 +2169,15 @@ "core-js": { "version": "2.6.11", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", - "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", - "dev": true + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" }, "core-js-compat": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.1.tgz", - "integrity": "sha512-2Tl1EuxZo94QS2VeH28Ebf5g3xbPZG/hj/N5HDDy4XMP/ImR0JIer/nggQRiMN91Q54JVkGbytf42wO29oXVHg==", + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.4.tgz", + "integrity": "sha512-zAa3IZPvsJ0slViBQ2z+vgyyTuhd3MFn1rBQjZSKVEgB0UMYhUkCj9jJUVPgGTGqWvsBVmfnruXgTcNyTlEiSA==", "dev": true, "requires": { - "browserslist": "^4.8.2", + "browserslist": "^4.8.3", "semver": "7.0.0" }, "dependencies": { @@ -2223,9 +2397,9 @@ } }, "electron-to-chromium": { - "version": "1.3.322", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.322.tgz", - "integrity": "sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA==", + "version": "1.3.362", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.362.tgz", + "integrity": "sha512-xdU5VCoZyMPMOWtCaMgbr48OwWZHrMLbGnAOlEqibXiIGsb4kiCGWEHK5NOghcVLdBVIbr/BW+yuKxVuGTtzEg==", "dev": true }, "elliptic": { @@ -3073,6 +3247,12 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, "get-assigned-identifiers": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", @@ -3529,12 +3709,6 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, - "js-levenshtein": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", - "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", - "dev": true - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3593,6 +3767,21 @@ "stream-splicer": "^2.0.0" } }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "levenary": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz", + "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==", + "dev": true, + "requires": { + "leven": "^3.1.0" + } + }, "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", @@ -3809,9 +3998,9 @@ } }, "node-releases": { - "version": "1.1.44", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.44.tgz", - "integrity": "sha512-NwbdvJyR7nrcGrXvKAvzc5raj/NkoJudkarh2yIpJ4t0NH4aqjUDz/486P+ynIW5eokKOfzGNRdYoLfBlomruw==", + "version": "1.1.50", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.50.tgz", + "integrity": "sha512-lgAmPv9eYZ0bGwUYAKlr8MG6K4CvWliWqnkcT2P8mMAgVrH3lqfBPorFlxiG1pHQnqmavJZ9vbMXUTNyMLbrgQ==", "dev": true, "requires": { "semver": "^6.3.0" @@ -4286,9 +4475,9 @@ "dev": true }, "regjsparser": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.2.tgz", - "integrity": "sha512-E9ghzUtoLwDekPT0DYCp+c4h+bvuUpe6rRHCTYn6eGoqj1LgKXxT6I0Il4WbjhQkOghzi/V+y03bPKvbllL93Q==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.3.tgz", + "integrity": "sha512-8uZvYbnfAtEm9Ab8NTb3hdLwL4g/LQzEYP7Xs27T96abJCCE2d6r3cPZPQEsLKy0vRSGVNG+/zVGtLr86HQduA==", "dev": true, "requires": { "jsesc": "~0.5.0" @@ -5000,9 +5189,9 @@ "dev": true }, "ws": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", - "integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "requires": { "async-limiter": "~1.0.0" } diff --git a/package.json b/package.json index e10714f..08a4d5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "esyur", - "version": "1.4.0", + "version": "1.4.6", "description": "Distributed Object Framework", "main": "esyur.js", "scripts": { @@ -19,14 +19,15 @@ }, "homepage": "https://github.com/esyur/esyur-js#readme", "dependencies": { - "@babel/runtime": "^7.7.7", - "ws": "^6.2.0" + "@babel/polyfill": "^7.8.3", + "@babel/runtime": "^7.8.4", + "ws": "^6.2.1" }, "devDependencies": { - "@babel/cli": "^7.7.7", - "@babel/core": "^7.7.7", - "@babel/plugin-transform-runtime": "^7.7.6", - "@babel/preset-env": "^7.7.7", + "@babel/cli": "^7.8.4", + "@babel/core": "^7.8.6", + "@babel/plugin-transform-runtime": "^7.8.3", + "@babel/preset-env": "^7.8.6", "babel-cli": "^6.0.0", "babelify": "^10.0.0", "browserify": "^16.5.0" diff --git a/src/Core/AsyncQueue.js b/src/Core/AsyncQueue.js index ffbdfd1..ae06403 100644 --- a/src/Core/AsyncQueue.js +++ b/src/Core/AsyncQueue.js @@ -40,12 +40,20 @@ export default class AsyncQueue extends AsyncReply this.processQueue = function () { for (var i = 0; i < self.list.length; i++) - if (self.list[i].ready) - { + if (self.list[i].ready) { self.trigger(self.list[i].result); - self.list.splice(i, 1); + self.ready = false; + //self.list.splice(i, 1); + self.list.shift(); + i--; } + else if (self.list[i].failed) { + self.ready = false; + self.list.shift(); + i--; + console.log("AsyncQueue (Reply Failed)"); + } else break; @@ -57,11 +65,13 @@ export default class AsyncQueue extends AsyncReply { this.list.push(reply); this.ready = false; - reply.then(this.processQueue); + reply.then(this.processQueue).error(this.processQueue); + } remove(reply) { + console.log("REMOVE QUEUE"); this.list.splice(this.list.indexOf(reply), 1); this.processQueue(); } diff --git a/src/Core/IEventHandler.js b/src/Core/IEventHandler.js index cad3e23..f153ec2 100644 --- a/src/Core/IEventHandler.js +++ b/src/Core/IEventHandler.js @@ -72,6 +72,7 @@ export default class IEventHandler return this; } + off(event, fn) { event = event.toLocaleString(); diff --git a/src/Data/DataConverter.js b/src/Data/DataConverter.js index 6aa1b3b..f47a903 100644 --- a/src/Data/DataConverter.js +++ b/src/Data/DataConverter.js @@ -295,45 +295,64 @@ export default class DC extends Uint8Array return new Uint8Array(this.buffer, offset, length); } + copy(offset, length, elementSize, func, dstType) + { + let rt = new dstType(length / elementSize); + let d = 0, end = offset + length; + for (let i = offset; i < end; i += elementSize) + rt[d++] = func.call(this, i); + return rt; + } + getInt16Array(offset, length) { - return new Int16Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 2, this.getInt16, Int16Array); + //return new Int16Array(this.clip(offset, length).buffer); } getUint16Array(offset, length) { - return new Uint16Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 2, this.getUint16, Uint16Array); + //return new Uint16Array(this.clip(offset, length).buffer); } getInt32Array(offset, length) { - return new Int32Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 4, this.getInt32, Int32Array); + //return new Int32Array(this.clip(offset, length).buffer); } + getUint32Array(offset, length) { - return new Uint32Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 4, this.getUint32, Uint32Array); + //return new Uint32Array(this.clip(offset, length).buffer); } getFloat32Array(offset, length) { - return new Float32Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 4, this.getFloat32, Float32Array); + //return new Float32Array(this.clip(offset, length).buffer); } getFloat64Array(offset, length) { - return new Float64Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 8, this.getFloat64, Float64Array); + +// return new Float64Array(this.clip(offset, length).buffer); } getInt64Array(offset, length) { - return new Int64Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 8, this.getInt64, BigInt64Array); + //return new Int64Array(this.clip(offset, length).buffer); } getUint64Array(offset, length) { - return new Uint64Array(this.clip(offset, length).buffer); + return this.copy(offset, length, 8, this.getUint64, BigUint64Array); + //return new Uint64Array(this.clip(offset, length).buffer); } getBoolean(offset) diff --git a/src/Data/KeyList.js b/src/Data/KeyList.js index 2ffe012..6e0c6a1 100644 --- a/src/Data/KeyList.js +++ b/src/Data/KeyList.js @@ -92,6 +92,11 @@ export default class KeyList return false; } + containsKey(key) + { + return this.contains(key); + } + set(key, value) { this.remove(key); diff --git a/src/Net/IIP/DistributedConnection.js b/src/Net/IIP/DistributedConnection.js index b5b066b..3d7434d 100644 --- a/src/Net/IIP/DistributedConnection.js +++ b/src/Net/IIP/DistributedConnection.js @@ -24,15 +24,15 @@ * Created by Ahmed Zamil on 25/07/2017. */ -"use strict"; +"use strict"; import IStore from '../../Resource/IStore.js'; import Session from '../../Security/Authority/Session.js'; -import Authentication from '../../Security/Authority/Authentication.js'; +import Authentication from '../../Security/Authority/Authentication.js'; import AuthenticationType from "../../Security/Authority/AuthenticationType.js"; import SHA256 from '../../Security/Integrity/SHA256.js'; -import {BL, DC} from '../../Data/DataConverter.js'; +import { BL, DC } from '../../Data/DataConverter.js'; import SendList from '../SendList.js'; import AsyncReply from '../../Core/AsyncReply.js'; @@ -66,15 +66,17 @@ import DistributedResourceQueueItemType from './DistributedResourceQueueItemType import DistributedPropertyContext from './DistributedPropertyContext.js'; import { ResourceTrigger } from '../../Resource/IResource.js'; +import Ruling from '../../Security/Permissions/Ruling.js'; +import ActionType from '../../Security/Permissions/ActionType.js'; + export default class DistributedConnection extends IStore { - + send(data) { - if (this.holdSending) - { - //console.log("hold ", data.length); - this.sendBuffer.writeAll(data); + if (this.holdSending) { + //console.log("hold ", data.length); + this.sendBuffer.writeAll(data); } else //console.log("Send", data.length); @@ -85,10 +87,9 @@ export default class DistributedConnection extends IStore { return new SendList(this, doneReply); } - generateNonce(length) - { + generateNonce(length) { var rt = new Uint8Array(length); - for(var i = 0; i < length; i++) + for (var i = 0; i < length; i++) rt[i] = Math.random() * 255; return rt; @@ -99,11 +100,11 @@ export default class DistributedConnection extends IStore { super(); //Instance.Name = Global.GenerateCode(12); - + //this.hostType = AuthenticationType.Client; //this.domain = domain; //this.localUsername = username; - + //this._register("ready"); //this._register("error"); this._register("close"); @@ -115,10 +116,10 @@ export default class DistributedConnection extends IStore { this.resources = {}; this.templates = new KeyList(); - this.requests = {}; - this.pathRequests = {}; + this.requests = new KeyList();// {}; + //this.pathRequests = new KeyList();// {}; this.templateRequests = new KeyList(); - this.resourceRequests = {}; + this.resourceRequests = new KeyList();// {}; this.callbackCounter = 0; this.queue = new AsyncQueue(); @@ -144,12 +145,11 @@ export default class DistributedConnection extends IStore { - processPacket(msg, offset, ends, data) - { + processPacket(msg, offset, ends, data) { + - var authPacket = this.authPacket; - + if (this.ready) { var packet = new IIPPacket(); @@ -161,217 +161,219 @@ export default class DistributedConnection extends IStore { else { offset += rt; - if (packet.command == IIPPacketCommand.Event) { - switch (packet.event) { - case IIPPacketEvent.ResourceReassigned: - this.IIPEventResourceReassigned(packet.resourceId, packet.newResourceId); - break; - case IIPPacketEvent.ResourceDestroyed: - this.IIPEventResourceDestroyed(packet.resourceId); - break; - case IIPPacketEvent.PropertyUpdated: - this.IIPEventPropertyUpdated(packet.resourceId, packet.methodIndex, packet.content); - break; - case IIPPacketEvent.EventOccurred: - this.IIPEventEventOccurred(packet.resourceId, packet.methodIndex, packet.content); - break; + try { + if (packet.command == IIPPacketCommand.Event) { + switch (packet.event) { + case IIPPacketEvent.ResourceReassigned: + this.IIPEventResourceReassigned(packet.resourceId, packet.newResourceId); + break; + case IIPPacketEvent.ResourceDestroyed: + this.IIPEventResourceDestroyed(packet.resourceId); + break; + case IIPPacketEvent.PropertyUpdated: + this.IIPEventPropertyUpdated(packet.resourceId, packet.methodIndex, packet.content); + break; + case IIPPacketEvent.EventOccurred: + this.IIPEventEventOccurred(packet.resourceId, packet.methodIndex, packet.content); + break; - case IIPPacketEvent.ChildAdded: - this.IIPEventChildAdded(packet.resourceId, packet.childId); - break; - case IIPPacketEvent.ChildRemoved: - this.IIPEventChildRemoved(packet.resourceId, packet.childId); - break; - case IIPPacketEvent.Renamed: - this.IIPEventRenamed(packet.resourceId, packet.content); - break; - case IIPPacketEvent.AttributesUpdated: - this.IIPEventAttributesUpdated(packet.resourceId, packet.content); - break; + case IIPPacketEvent.ChildAdded: + this.IIPEventChildAdded(packet.resourceId, packet.childId); + break; + case IIPPacketEvent.ChildRemoved: + this.IIPEventChildRemoved(packet.resourceId, packet.childId); + break; + case IIPPacketEvent.Renamed: + this.IIPEventRenamed(packet.resourceId, packet.content); + break; + case IIPPacketEvent.AttributesUpdated: + this.IIPEventAttributesUpdated(packet.resourceId, packet.content); + break; + } } - } - else if (packet.command == IIPPacketCommand.Request) { - switch (packet.action) { + else if (packet.command == IIPPacketCommand.Request) { + switch (packet.action) { - // Manage - case IIPPacketAction.AttachResource: - this.IIPRequestAttachResource(packet.callbackId, packet.resourceId); - break; - case IIPPacketAction.ReattachResource: - this.IIPRequestReattachResource(packet.callbackId, packet.resourceId, packet.resourceAge); - break; - case IIPPacketAction.DetachResource: - this.IIPRequestDetachResource(packet.callbackId, packet.resourceId); - break; - case IIPPacketAction.CreateResource: - this.IIPRequestCreateResource(packet.callbackId, packet.storeId, packet.resourceId, packet.content); - break; - case IIPPacketAction.DeleteResource: - this.IIPRequestDeleteResource(packet.callbackId, packet.resourceId); - break; - case IIPPacketAction.AddChild: - this.IIPRequestAddChild(packet.callbackId, packet.resourceId, packet.childId); - break; - case IIPPacketAction.RemoveChild: - this.IIPRequestRemoveChild(packet.callbackId, packet.resourceId, packet.childId); - break; - case IIPPacketAction.RenameResource: - this.IIPRequestRenameResource(packet.callbackId, packet.resourceId, packet.content); - break; + // Manage + case IIPPacketAction.AttachResource: + this.IIPRequestAttachResource(packet.callbackId, packet.resourceId); + break; + case IIPPacketAction.ReattachResource: + this.IIPRequestReattachResource(packet.callbackId, packet.resourceId, packet.resourceAge); + break; + case IIPPacketAction.DetachResource: + this.IIPRequestDetachResource(packet.callbackId, packet.resourceId); + break; + case IIPPacketAction.CreateResource: + this.IIPRequestCreateResource(packet.callbackId, packet.storeId, packet.resourceId, packet.content); + break; + case IIPPacketAction.DeleteResource: + this.IIPRequestDeleteResource(packet.callbackId, packet.resourceId); + break; + case IIPPacketAction.AddChild: + this.IIPRequestAddChild(packet.callbackId, packet.resourceId, packet.childId); + break; + case IIPPacketAction.RemoveChild: + this.IIPRequestRemoveChild(packet.callbackId, packet.resourceId, packet.childId); + break; + case IIPPacketAction.RenameResource: + this.IIPRequestRenameResource(packet.callbackId, packet.resourceId, packet.content); + break; - // Inquire - case IIPPacketAction.TemplateFromClassName: - this.IIPRequestTemplateFromClassName(packet.callbackId, packet.className); - break; - case IIPPacketAction.TemplateFromClassId: - this.IIPRequestTemplateFromClassId(packet.callbackId, packet.classId); - break; - case IIPPacketAction.TemplateFromResourceId: - this.IIPRequestTemplateFromResourceId(packet.callbackId, packet.resourceId); - break; - case IIPPacketAction.QueryLink: - this.IIPRequestQueryResources(packet.callbackId, packet.resourceLink); - break; - case IIPPacketAction.ResourceChildren: - this.IIPRequestResourceChildren(packet.callbackId, packet.resourceId); - break; - case IIPPacketAction.ResourceParents: - this.IIPRequestResourceParents(packet.callbackId, packet.resourceId); - break; - case IIPPacketAction.ResourceHistory: - this.IIPRequestInquireResourceHistory(packet.callbackId, packet.resourceId, packet.fromDate, packet.toDate); - break; + // Inquire + case IIPPacketAction.TemplateFromClassName: + this.IIPRequestTemplateFromClassName(packet.callbackId, packet.className); + break; + case IIPPacketAction.TemplateFromClassId: + this.IIPRequestTemplateFromClassId(packet.callbackId, packet.classId); + break; + case IIPPacketAction.TemplateFromResourceId: + this.IIPRequestTemplateFromResourceId(packet.callbackId, packet.resourceId); + break; + case IIPPacketAction.QueryLink: + this.IIPRequestQueryResources(packet.callbackId, packet.resourceLink); + break; + case IIPPacketAction.ResourceChildren: + this.IIPRequestResourceChildren(packet.callbackId, packet.resourceId); + break; + case IIPPacketAction.ResourceParents: + this.IIPRequestResourceParents(packet.callbackId, packet.resourceId); + break; + case IIPPacketAction.ResourceHistory: + this.IIPRequestInquireResourceHistory(packet.callbackId, packet.resourceId, packet.fromDate, packet.toDate); + break; - // Invoke - case IIPPacketAction.InvokeFunctionArrayArguments: - this.IIPRequestInvokeFunctionArrayArguments(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); - break; - case IIPPacketAction.InvokeFunctionNamedArguments: - this.IIPRequestInvokeFunctionNamedArguments(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); - break; - case IIPPacketAction.GetProperty: - this.IIPRequestGetProperty(packet.callbackId, packet.resourceId, packet.methodIndex); - break; - case IIPPacketAction.GetPropertyIfModified: - this.IIPRequestGetPropertyIfModifiedSince(packet.callbackId, packet.resourceId, packet.methodIndex, packet.resourceAge); - break; - case IIPPacketAction.SetProperty: - this.IIPRequestSetProperty(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); - break; - case IIPPacketAction.ResourceHistory: - this.IIPRequestInquireResourceHistory(packet.callbackId, packet.resourceId, packet.fromDate, packet.toDate); - break; - case IIPPacketAction.QueryLink: - this.IIPRequestQueryResources(packet.callbackId, packet.resourceLink); - break; + // Invoke + case IIPPacketAction.InvokeFunctionArrayArguments: + this.IIPRequestInvokeFunctionArrayArguments(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); + break; + case IIPPacketAction.InvokeFunctionNamedArguments: + this.IIPRequestInvokeFunctionNamedArguments(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); + break; + case IIPPacketAction.GetProperty: + this.IIPRequestGetProperty(packet.callbackId, packet.resourceId, packet.methodIndex); + break; + case IIPPacketAction.GetPropertyIfModified: + this.IIPRequestGetPropertyIfModifiedSince(packet.callbackId, packet.resourceId, packet.methodIndex, packet.resourceAge); + break; + case IIPPacketAction.SetProperty: + this.IIPRequestSetProperty(packet.callbackId, packet.resourceId, packet.methodIndex, packet.content); + break; + case IIPPacketAction.ResourceHistory: + this.IIPRequestInquireResourceHistory(packet.callbackId, packet.resourceId, packet.fromDate, packet.toDate); + break; + case IIPPacketAction.QueryLink: + this.IIPRequestQueryResources(packet.callbackId, packet.resourceLink); + break; // Attribute - case IIPPacketAction.GetAllAttributes: - this.IIPRequestGetAttributes(packet.callbackId, packet.resourceId, packet.content, true); - break; - case IIPPacketAction.UpdateAllAttributes: - this.IIPRequestUpdateAttributes(packet.callbackId, packet.resourceId, packet.content, true); - break; - case IIPPacketAction.ClearAllAttributes: - this.IIPRequestClearAttributes(packet.callbackId, packet.resourceId, packet.content, true); - break; - case IIPPacketAction.GetAttributes: - this.IIPRequestGetAttributes(packet.callbackId, packet.resourceId, packet.content, false); - break; - case IIPPacketAction.UpdateAttributes: - this.IIPRequestUpdateAttributes(packet.callbackId, packet.resourceId, packet.content, false); - break; - case IIPPacketAction.ClearAttributes: - this.IIPRequestClearAttributes(packet.callbackId, packet.resourceId, packet.content, false); - break; + case IIPPacketAction.GetAllAttributes: + this.IIPRequestGetAttributes(packet.callbackId, packet.resourceId, packet.content, true); + break; + case IIPPacketAction.UpdateAllAttributes: + this.IIPRequestUpdateAttributes(packet.callbackId, packet.resourceId, packet.content, true); + break; + case IIPPacketAction.ClearAllAttributes: + this.IIPRequestClearAttributes(packet.callbackId, packet.resourceId, packet.content, true); + break; + case IIPPacketAction.GetAttributes: + this.IIPRequestGetAttributes(packet.callbackId, packet.resourceId, packet.content, false); + break; + case IIPPacketAction.UpdateAttributes: + this.IIPRequestUpdateAttributes(packet.callbackId, packet.resourceId, packet.content, false); + break; + case IIPPacketAction.ClearAttributes: + this.IIPRequestClearAttributes(packet.callbackId, packet.resourceId, packet.content, false); + break; + } } - } - else if (packet.command == IIPPacketCommand.Reply) { - switch (packet.action) { - case IIPPacketAction.AttachResource: - this.IIPReply(packet.callbackId, packet.classId, packet.resourceAge, packet.resourceLink, packet.content); - break; - case IIPPacketAction.ReattachResource: - this.IIPReply(packet.callbackId, packet.resourceAge, packet.content); - break; - case IIPPacketAction.DetachResource: - this.IIPReply(packet.callbackId); - break; - case IIPPacketAction.CreateResource: - this.IIPReply(packet.callbackId, packet.resourceId); - break; - case IIPPacketAction.DeleteResource: - case IIPPacketAction.AddChild: - case IIPPacketAction.RemoveChild: - case IIPPacketAction.RenameResource: - this.IIPReply(packet.callbackId); - break; - case IIPPacketAction.TemplateFromClassName: - case IIPPacketAction.TemplateFromClassId: - case IIPPacketAction.TemplateFromResourceId: - this.IIPReply(packet.callbackId, ResourceTemplate.parse(packet.content)); - break; + else if (packet.command == IIPPacketCommand.Reply) { + switch (packet.action) { + case IIPPacketAction.AttachResource: + this.IIPReply(packet.callbackId, packet.classId, packet.resourceAge, packet.resourceLink, packet.content); + break; + case IIPPacketAction.ReattachResource: + this.IIPReply(packet.callbackId, packet.resourceAge, packet.content); + break; + case IIPPacketAction.DetachResource: + this.IIPReply(packet.callbackId); + break; + case IIPPacketAction.CreateResource: + this.IIPReply(packet.callbackId, packet.resourceId); + break; + case IIPPacketAction.DeleteResource: + case IIPPacketAction.AddChild: + case IIPPacketAction.RemoveChild: + case IIPPacketAction.RenameResource: + this.IIPReply(packet.callbackId); + break; + case IIPPacketAction.TemplateFromClassName: + case IIPPacketAction.TemplateFromClassId: + case IIPPacketAction.TemplateFromResourceId: + this.IIPReply(packet.callbackId, ResourceTemplate.parse(packet.content)); + break; - case IIPPacketAction.QueryLink: - case IIPPacketAction.ResourceChildren: - case IIPPacketAction.ResourceParents: - case IIPPacketAction.ResourceHistory: - this.IIPReply(packet.callbackId, packet.content); - break; + case IIPPacketAction.QueryLink: + case IIPPacketAction.ResourceChildren: + case IIPPacketAction.ResourceParents: + case IIPPacketAction.ResourceHistory: + this.IIPReply(packet.callbackId, packet.content); + break; - case IIPPacketAction.InvokeFunctionArrayArguments: - case IIPPacketAction.InvokeFunctionNamedArguments: - this.IIPReplyInvoke(packet.callbackId, packet.content); - break; + case IIPPacketAction.InvokeFunctionArrayArguments: + case IIPPacketAction.InvokeFunctionNamedArguments: + this.IIPReplyInvoke(packet.callbackId, packet.content); + break; - case IIPPacketAction.GetProperty: - this.IIPReply(packet.callbackId, packet.content); - break; - case IIPPacketAction.GetPropertyIfModified: - this.IIPReply(packet.callbackId, packet.content); - break; - case IIPPacketAction.SetProperty: - this.IIPReply(packet.callbackId); - break; + case IIPPacketAction.GetProperty: + this.IIPReply(packet.callbackId, packet.content); + break; + case IIPPacketAction.GetPropertyIfModified: + this.IIPReply(packet.callbackId, packet.content); + break; + case IIPPacketAction.SetProperty: + this.IIPReply(packet.callbackId); + break; - // Attribute - case IIPPacketAction.GetAllAttributes: - case IIPPacketAction.GetAttributes: - this.IIPReply(packet.callbackId, packet.content); - break; + // Attribute + case IIPPacketAction.GetAllAttributes: + case IIPPacketAction.GetAttributes: + this.IIPReply(packet.callbackId, packet.content); + break; - case IIPPacketAction.UpdateAllAttributes: - case IIPPacketAction.UpdateAttributes: - case IIPPacketAction.ClearAllAttributes: - case IIPPacketAction.ClearAttributes: - this.IIPReply(packet.callbackId); - break; + case IIPPacketAction.UpdateAllAttributes: + case IIPPacketAction.UpdateAttributes: + case IIPPacketAction.ClearAllAttributes: + case IIPPacketAction.ClearAttributes: + this.IIPReply(packet.callbackId); + break; } - } - else if (packet.command == IIPPacketCommand.Report) - { - switch (packet.report) - { - case IIPPacketReport.ManagementError: - this.IIPReportError(packet.callbackId, ErrorType.Management, packet.errorCode, null); - break; - case IIPPacketReport.ExecutionError: - this.IIPReportError(packet.callbackId, ErrorType.Exception, packet.errorCode, packet.errorMessage); - break; - case IIPPacketReport.ProgressReport: - this.IIPReportProgress(packet.callbackId, ProgressType.Execution, packet.progressValue, packet.progressMax); - break; - case IIPPacketReport.ChunkStream: - this.IIPReportChunk(packet.callbackId, packet.content); - - break; } - } + else if (packet.command == IIPPacketCommand.Report) { + switch (packet.report) { + case IIPPacketReport.ManagementError: + this.IIPReportError(packet.callbackId, ErrorType.Management, packet.errorCode, null); + break; + case IIPPacketReport.ExecutionError: + this.IIPReportError(packet.callbackId, ErrorType.Exception, packet.errorCode, packet.errorMessage); + break; + case IIPPacketReport.ProgressReport: + this.IIPReportProgress(packet.callbackId, ProgressType.Execution, packet.progressValue, packet.progressMax); + break; + case IIPPacketReport.ChunkStream: + this.IIPReportChunk(packet.callbackId, packet.content); + break; + } + + } + } catch (ex) { + console.log("Esyur Error ", ex); + } } } @@ -405,7 +407,7 @@ export default class DistributedConnection extends IStore { //var hash = new DC(sha256.arrayBuffer(BL().addString(pw).addUint8Array(remoteNonce).addUint8Array(this.localNonce).toArray())); var hash = SHA256.compute(BL().addString(pw).addUint8Array(remoteNonce).addUint8Array(this.localNonce).toDC()); - + if (hash.sequenceEqual(remoteHash)) { // send our hash @@ -418,10 +420,10 @@ export default class DistributedConnection extends IStore { else { // incorrect password this.sendParams().addUint8(0xc0) - .addInt32(ExceptionCode.AccessDenied) - .addUint16(13) - .addString("Access Denied") - .done(); + .addInt32(ExceptionCode.AccessDenied) + .addUint16(13) + .addString("Access Denied") + .done(); } } }); @@ -435,7 +437,7 @@ export default class DistributedConnection extends IStore { this.ready = true; this.openReply.trigger(this); - + this.openReply = null; //this._emit("ready", this); } } @@ -476,24 +478,24 @@ export default class DistributedConnection extends IStore { } else { this.sendParams().addUint8(0xc0) - .addUint32(ExceptionCode.ChallengeFailed) - .addUint16(16) - .addString("Challenge Failed") - .done(); + .addUint32(ExceptionCode.ChallengeFailed) + .addUint16(16) + .addString("Challenge Failed") + .done(); } } else if (authPacket.action == IIPAuthPacketAction.ConnectionEstablished) { this.session.id = authPacket.sessionId; this.ready = true; this.openReply.trigger(this); + this.openReply = null; //this._emit("ready", this); } } - else if (authPacket.command == IIPAuthPacketCommand.Error) - { + else if (authPacket.command == IIPAuthPacketCommand.Error) { this.openReply.triggerError(1, authPacket.errorCode, authPacket.errorMessage); - + this.openReply = null; //this._emit("error", this, authPacket.errorCode, authPacket.errorMessage); this.close(); } @@ -516,31 +518,65 @@ export default class DistributedConnection extends IStore { //console.log("Data"); while (offset < ends) { - offset = this.processPacket(msg, offset, ends, data); + offset = this.processPacket(msg, offset, ends, data); } } - close(event) - { - this._emit("close", event); - - Warehouse.remove(this); + close(event) { - if (this.socket.readyState != this.socket.CLOSED) - { + this.ready = false; + this.readyToEstablish = false; + + this.requests.values.forEach((x) => x.triggerError(AsyncException(ErrorType.Management, 0, "Connection closed"))); + this.resourceRequests.values.forEach((x) => x.triggerError(new AsyncException(ErrorType.Management, 0, "Connection closed"))); + this.templateRequests.values.forEach((x) => x.triggerError(new AsyncException(ErrorType.Management, 0, "Connection closed"))); + this.resources.values.forEach((x) => x.suspend()); + + this.requests.clear(); + this.resourceRequests.clear(); + this.templateRequests.clear(); + + // Warehouse.remove(this); + + if (this.socket.readyState != this.socket.CLOSED) { this.socket.close(); } + + this._emit("close", event); } - hold() - { + async reconnect() { + try { + if (await this.connect()) { + try { + var bag = new AsyncBag(); + + for (var i = 0; i < this.resources.keys.length; i++) { + var index = this.resources.keys[i]; + bag.add(this.fetch(index)); + } + + bag.seal(); + await bag; + } + catch (ex) { + console.log(ex); + } + } + } + catch (ex) { + return false; + } + + return true; + } + + hold() { this.holdSending = true; } - unhold() - { - if (this.holdSending) - { + unhold() { + if (this.holdSending) { this.holdSending = false; var msg = this.sendBuffer.read(); @@ -552,245 +588,254 @@ export default class DistributedConnection extends IStore { } } - trigger(trigger) - { - if (trigger == ResourceTrigger.Open) - { - var { domain = null, + trigger(trigger) { + if (trigger == ResourceTrigger.Open) { + var { domain = null, secure = false, - username = "guest", - password = "", - checkInterval = 30, - connectionTimeout = 600, - revivingTime = 120, - debug = false} = this.instance.attributes.toObject(); - - this.openReply = new AsyncReply(); - - //var hostname = this.instance.name.split("://", 2)[1].split("/", 2)[0]; - - // assign domain from hostname if not provided - + username = "guest", + password = "", + checkInterval = 30, + connectionTimeout = 600, + revivingTime = 120, + debug = false } = this.instance.attributes.toObject(); + + this.debug = debug; + this.checkInterval = checkInterval * 1000; // check every 30 seconds + this.connectionTimeout = connectionTimeout * 1000; // 10 minutes (4 pings failed) + this.revivingTime = revivingTime * 1000; // 2 minutes + + var pw = DC.stringToBytes(password); var host = this.instance.name.split(':'); var address = host[0]; var port = parseInt(host[1]); - domain = domain ? domain : address; - - this.session.localAuthentication.domain = domain; - this.session.localAuthentication.username = username; - - this.localPassword = DC.stringToBytes(password); - - var url = `ws${secure ? 's' : ''}://${this.instance.name}`; - - - this.debug = debug; - this.totalReceived = 0; - this.totalSent = 0; - - this.checkInterval = checkInterval * 1000; // check every 30 seconds - this.connectionTimeout = connectionTimeout * 1000; // 10 minutes (4 pings failed) - this.revivingTime = revivingTime * 1000; // 2 minutes - this.lastAction = Date.now(); - - this.socket = new WebSocket(url, "iip"); - this.socket.binaryType = "arraybuffer"; - this.socket.connection = this; - this.socket.networkBuffer = new NetworkBuffer(); - this.sendBuffer = new NetworkBuffer(); - - var un = DC.stringToBytes(username); - var dmn = DC.stringToBytes(domain); - var self = this; - - this.socket.onopen = function () { - var bl = BL(); - bl.addUint8(0x60).addUint8(dmn.length).addUint8Array(dmn).addUint8Array(self.localNonce).addUint8(un.length).addUint8Array(un); - self.send(bl.toArray()); - }; - - this.socket.onmessage = function (msg) { - - //console.log("Rec", msg.data.byteLength); - - this.networkBuffer.writeAll(msg.data); - - self.lastAction = new Date(); - - self.hold(); - while (this.networkBuffer.available > 0 && !this.networkBuffer.protected) - self.receive(this.networkBuffer); - self.unhold(); - - }; - - this.socket.onclose = function(event) - { - if (this.connection.openReply) - this.connection.openReply.triggerError(0, 0, "Host not reachable"); - - self.close(event); - }; - - return this.openReply; - + return this.connect(secure, address, port, username, pw, domain); } return new AsyncReply(true); } + + connect(secure, hostname, port, username, password, domain) { + this.openReply = new AsyncReply(); + + + if (secure !== undefined) { + this.session.localAuthentication.domain = domain; + this.session.localAuthentication.username = username; + this.localPassword = password; + + //this.url = `ws${secure ? 's' : ''}://${this.instance.name}`; + this.url = `ws${secure ? 's' : ''}://${hostname}:${port}`; + } + + //this.debug = debug; + this.totalReceived = 0; + this.totalSent = 0; + + this.lastAction = Date.now(); + + this.socket = new WebSocket(this.url, "iip"); + this.socket.binaryType = "arraybuffer"; + this.socket.connection = this; + this.socket.networkBuffer = new NetworkBuffer(); + this.sendBuffer = new NetworkBuffer(); + + var un = DC.stringToBytes(this.session.localAuthentication.username); + var dmn = DC.stringToBytes(this.session.localAuthentication.domain); + var self = this; + + this.socket.onopen = function () { + var bl = BL(); + bl.addUint8(0x60).addUint8(dmn.length).addUint8Array(dmn).addUint8Array(self.localNonce).addUint8(un.length).addUint8Array(un); + self.send(bl.toArray()); + }; + + this.socket.onmessage = function (msg) { + + //console.log("Rec", msg.data.byteLength); + + this.networkBuffer.writeAll(msg.data); + + self.lastAction = new Date(); + + self.hold(); + while (this.networkBuffer.available > 0 && !this.networkBuffer.protected) { + // try + // { + self.receive(this.networkBuffer); + // } + // catch(e) + //{ + // console.log(e); + //} + } + + self.unhold(); + + }; + + this.socket.onclose = function (event) { + if (this.connection.openReply) { + this.connection.openReply.triggerError(0, 0, "Host not reachable"); + this.connection.openReply = null; + } + + self.close(event); + }; + + return this.openReply; + } + + reconnect() { + + } + put(resource) { this.resources[parseInt(resource.instance.name)] = resource; return true; } - remove(resource) - { + remove(resource) { // nothing to do (IStore interface) } // Protocol Implementation - - sendRequest2(action, binaryList) { - var reply = new AsyncReply(); - this.callbackCounter++; - this.sendParams().addUint8(0x40 | action).addUint32(this.callbackCounter).addRange(binaryList).done(); - this.requests[this.callbackCounter] = reply; - return reply; - } - sendRequest(action) { var reply = new AsyncReply(); this.callbackCounter++; - this.requests[this.callbackCounter] = reply; - return this.sendParams(reply).addUint8(0x40 | action).addUint32(this.callbackCounter); + this.requests.set(this.callbackCounter, reply); + return this.sendParams(reply).addUint8(0x40 | action).addUint32(this.callbackCounter); } - sendInvokeByArrayArguments(instanceId, index, parameters) + sendDetachRequest(instanceId) { + try + { + return this.sendRequest(IIPPacketAction.DetachResource).addUint32(instanceId).done(); + } + catch(ex) + { + return null; + } + } + + sendInvokeByArrayArguments(instanceId, index, parameters) { var reply = new AsyncReply(); - + var pb = Codec.composeVarArray(parameters, this, true); this.callbackCounter++; this.sendParams() - .addUint8(0x40 | IIPPacketAction.InvokeFunctionArrayArguments) - .addUint32(this.callbackCounter) - .addUint32(instanceId) - .addUint8(index) - .addUint8Array(pb) - .done(); + .addUint8(0x40 | IIPPacketAction.InvokeFunctionArrayArguments) + .addUint32(this.callbackCounter) + .addUint32(instanceId) + .addUint8(index) + .addUint8Array(pb) + .done(); - this.requests[this.callbackCounter] = reply; + this.requests.set(this.callbackCounter, reply); - return reply; + return reply; } - sendInvokeByNamedArguments(instanceId, index, parameters) - { + sendInvokeByNamedArguments(instanceId, index, parameters) { var reply = new AsyncReply(); - + var pb = Codec.composeStructure(parameters, this, true, true, true); this.callbackCounter++; this.sendParams() - .addUint8(0x40 | IIPPacketAction.InvokeFunctionNamedArguments) - .addUint32(this.callbackCounter) - .addUint32(instanceId) - .addUint8(index) - .addUint8Array(pb) - .done(); + .addUint8(0x40 | IIPPacketAction.InvokeFunctionNamedArguments) + .addUint32(this.callbackCounter) + .addUint32(instanceId) + .addUint8(index) + .addUint8Array(pb) + .done(); - this.requests[this.callbackCounter] = reply; + this.requests.set(this.callbackCounter, reply); - return reply; + return reply; } - sendError(type, callbackId, errorCode, errorMessage = "") - { + sendError(type, callbackId, errorCode, errorMessage = "") { var msg = DC.stringToBytes(errorMessage); if (type == ErrorType.Management) this.sendParams() - .addUint8(0xC0 | IIPPacketReport.ManagementError) - .addUint32(callbackId) - .addUint16(errorCode) - .done(); + .addUint8(0xC0 | IIPPacketReport.ManagementError) + .addUint32(callbackId) + .addUint16(errorCode) + .done(); else if (type == ErrorType.Exception) this.sendParams() - .addUint8(0xC0 | IIPPacketReport.ExecutionError) - .addUint32(callbackId) - .addUint16(errorCode) - .addUint16(msg.length) - .addUint8Array(msg) - .done(); + .addUint8(0xC0 | IIPPacketReport.ExecutionError) + .addUint32(callbackId) + .addUint16(errorCode) + .addUint16(msg.length) + .addUint8Array(msg) + .done(); } - sendProgress(callbackId, value, max) - { + sendProgress(callbackId, value, max) { this.sendParams() - .addUint8(0xC0 | IIPPacketReport.ProgressReport) - .addUint32(callbackId) - .addInt32(value) - .addInt32(max) - .done(); + .addUint8(0xC0 | IIPPacketReport.ProgressReport) + .addUint32(callbackId) + .addInt32(value) + .addInt32(max) + .done(); } - sendChunk(callbackId, chunk) - { + sendChunk(callbackId, chunk) { var c = Codec.compose(chunk, this, true); this.sendParams() - .addUint8(0xC0 | IIPPacketReport.ChunkStream) - .addUint32(callbackId) - .addUint8Array(c) - .done(); + .addUint8(0xC0 | IIPPacketReport.ChunkStream) + .addUint32(callbackId) + .addUint8Array(c) + .done(); } IIPReply(callbackId) { var results = Array.prototype.slice.call(arguments, 1); - var req = this.requests[callbackId]; - - //console.log("Reply " + callbackId, req); - - delete this.requests[callbackId]; + var req = this.requests.item(callbackId); + this.requests.remove(callbackId); req.trigger(results); } - IIPReplyInvoke(callbackId, result) - { - var req = this.requests[callbackId]; - delete this.requests[callbackId]; + IIPReplyInvoke(callbackId, result) { + var req = this.requests.item(callbackId); - Codec.parse(result, 0, {}, this).then(function(rt) + if (req != null) { + + this.requests.remove(callbackId); + + Codec.parse(result, 0, {}, this).then(function (rt) { + req.trigger(rt); + }); + } + } + + IIPReportError(callbackId, errorType, errorCode, errorMessage) { + var req = this.requests.item(callbackId); + if (request != null) { - req.trigger(rt); - }); + this.requests.remove(callbackId); + req.triggerError(errorType, errorCode, errorMessage); + } } - IIPReportError(callbackId, errorType, errorCode, errorMessage) - { - var req = this.requests[callbackId]; - delete this.requests[callbackId]; - req.triggerError(errorType, errorCode, errorMessage); + IIPReportProgress(callbackId, type, value, max) { + var req = this.requests.item(callbackId); + req?.triggerProgress(type, value, max); } - IIPReportProgress(callbackId, type, value, max) - { - var req = this.requests[callbackId]; - req.triggerProgress(type, value, max); - } - - IIPReportChunk(callbackId, data) - { - if (this.requests[callbackId]) - { - var req = this.requests[callbackId]; - Codec.parse(data, 0, {}, this).then(function(x) - { + IIPReportChunk(callbackId, data) { + var req = this.requests.item(callbackId); + if (req != null) { + Codec.parse(data, 0, {}, this).then(function (x) { req.triggerChunk(x); }); } @@ -810,22 +855,25 @@ export default class DistributedConnection extends IStore { IIPEventPropertyUpdated(resourceId, index, content) { - var self = this; - - this.fetch(resourceId).then(function(r){ - // push to the queue to gaurantee serialization - var item = new AsyncReply(); - self.queue.add(item); - - Codec.parse(content, 0, {}, self).then(function (args) { - var pt = r.instance.template.getPropertyTemplateByIndex(index); - if (pt != null) { - item.trigger(new DistributedResourceQueueItem(r, DistributedResourceQueueItemType.Propery, args, index)); - } - else { // ft found, fi not found, this should never happen - self.queue.remove(item); - } - }); + let self = this; + + this.fetch(resourceId).then(function (r) { + + let pt = r.instance.template.getPropertyTemplateByIndex(index); + + if (pt == null) + return; // ft found, fi not found, this should never happen + + // push to the queue to gaurantee serialization + let item = new AsyncReply(); + self.queue.add(item); + + Codec.parse(content, 0, {}, self).then(function (args) { + item.trigger(new DistributedResourceQueueItem(r, DistributedResourceQueueItemType.Propery, args, index)); + }).error(function (ex) { + self.queue.remove(item); + console.log("Esyur Property Error", ex); + }); }); } @@ -833,82 +881,70 @@ export default class DistributedConnection extends IStore { IIPEventEventOccurred(resourceId, index, content) { var self = this; - this.fetch(resourceId).then(function(r){ + this.fetch(resourceId).then(function (r) { + let et = r.instance.template.getEventTemplateByIndex(index); + + if (et == null) + return; // ft found, fi not found, this should never happen + // push to the queue to guarantee serialization var item = new AsyncReply(); - var r = self.resources[resourceId]; - self.queue.add(item); Codec.parseVarArray(content, 0, content.length, self).then(function (args) { - var et = r.instance.template.getEventTemplateByIndex(index); - if (et != null) { - item.trigger(new DistributedResourceQueueItem(r, DistributedResourceQueueItemType.Event, args, index)); - } - else { // ft found, fi not found, this should never happen - self.queue.remove(item); - } + item.trigger(new DistributedResourceQueueItem(r, DistributedResourceQueueItemType.Event, args, index)); + + }).error(function (ex) { + self.queue.remove(item); + console.log("Esyur Event Error", ex); }); }); } - IIPEventChildAdded(resourceId, childId) - { + IIPEventChildAdded(resourceId, childId) { var self = this; - this.fetch(resourceId).then(function(parent) - { - self.fetch(childId).then(function(child) - { + this.fetch(resourceId).then(function (parent) { + self.fetch(childId).then(function (child) { parent.instance.children.add(child); }); }); } - IIPEventChildRemoved(resourceId, childId) - { + IIPEventChildRemoved(resourceId, childId) { var self = this; - this.fetch(resourceId).then(function(parent) - { - self.fetch(childId).then(function(child) - { + this.fetch(resourceId).then(function (parent) { + self.fetch(childId).then(function (child) { parent.instance.children.remove(child); }); }); } - IIPEventRenamed(resourceId, name) - { - this.fetch(resourceId).then(function(resource) - { + IIPEventRenamed(resourceId, name) { + this.fetch(resourceId).then(function (resource) { resource.instance.attributes.set("name", name.getString(0, name.length)); }); } - IIPEventAttributesUpdated(resourceId, attributes) - { + IIPEventAttributesUpdated(resourceId, attributes) { var self = this; - this.fetch(resourceId).then(function(resource) - { + this.fetch(resourceId).then(function (resource) { var attrs = attributes.getStringArray(0, attributes.length); - self.getAttributes(resource, attrs).then(function(s) - { + self.getAttributes(resource, attrs).then(function (s) { resource.instance.setAttributes(s); }); }); } - sendReply(action, callbackId) - { + sendReply(action, callbackId) { return this.sendParams().addUint8(0x80 | action).addUint32(callbackId); } - sendEvent(evt) - { + sendEvent(evt) { return this.sendParams().addUint8(evt); } @@ -921,15 +957,11 @@ export default class DistributedConnection extends IStore { Warehouse.getById(resourceId).then(function (r) { if (r != null) { - if (r.instance.applicable(self.session, ActionType.Attach, null) == Ruling.Denied) - { + if (r.instance.applicable(self.session, ActionType.Attach, null) == Ruling.Denied) { self.sendError(ErrorType.Management, callback, ExceptionCode.AttachDenied); return; } - r.instance.on("ResourceEventOccurred", self.instance_eventOccurred, self); - r.instance.on("ResourceModified", self.instance_propertyModified, self); - r.instance.on("ResourceDestroyed", self.instance_resourceDestroyed, self); // reply ok var link = DC.stringToBytes(r.instance.link); @@ -950,10 +982,15 @@ export default class DistributedConnection extends IStore { .addUint8Array(link) .addUint8Array(Codec.composePropertyValueArray(r.instance.serialize(), self, true)) .done(); + + r.instance.on("ResourceEventOccurred", self.instance_eventOccurred, self); + r.instance.on("ResourceModified", self.instance_propertyModified, self); + r.instance.on("ResourceDestroyed", self.instance_resourceDestroyed, self); + } else { // reply failed - self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); + self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); } }); } @@ -968,9 +1005,9 @@ export default class DistributedConnection extends IStore { r.instance.on("ResourceDestroyed", self.instance_resourceDestroyed, self); // reply ok self.sendReply(IIPPacketAction.ReattachResource, callback) - .addUint64(r.instance.age) - .addUint8Array(Codec.composePropertyValueArray(r.instance.serialize(), self, true)) - .done(); + .addUint64(r.instance.age) + .addUint8Array(Codec.composePropertyValueArray(r.instance.serialize(), self, true)) + .done(); } else { // reply failed @@ -1000,121 +1037,108 @@ export default class DistributedConnection extends IStore { IIPRequestCreateResource(callback, storeId, parentId, content) { var self = this; - Warehouse.getById(storeId).then(function(store) - { - if (store == null) - { - self.sendError(ErrorType.Management, callback, ExceptionCode.StoreNotFound); - return; - } + Warehouse.getById(storeId).then(function (store) { + if (store == null) { + self.sendError(ErrorType.Management, callback, ExceptionCode.StoreNotFound); + return; + } - if (!(store instanceof IStore)) - { - self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceIsNotStore); - return; - } + if (!(store instanceof IStore)) { + self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceIsNotStore); + return; + } + + // check security + if (store.instance.applicable(self.session, ActionType.CreateResource, null) != Ruling.Allowed) { + self.sendError(ErrorType.Management, callback, ExceptionCode.CreateDenied); + return; + } + + Warehouse.getById(parentId).then(function (parent) { // check security - if (store.instance.applicable(self.session, ActionType.CreateResource, null) != Ruling.Allowed) - { - self.sendError(ErrorType.Management, callback, ExceptionCode.CreateDenied); - return; - } - Warehouse.getById(parentId).then(function(parent) - { - - // check security - - if (parent != null) - if (parent.instance.applicable(self.session, ActionType.AddChild, null) != Ruling.Allowed) - { - self.sendError(ErrorType.Management, callback, ExceptionCode.AddChildDenied); - return; - } - - var offset = 0; - - var className = content.getString(offset + 1, content[0]); - offset += 1 + content[0]; - - var nameLength = content.getUint16(offset); - offset += 2; - var name = content.getString(offset, nameLength); - - var cl = content.getUint32(offset); - offset += 4; - - var type = window[className]; - - if (type == null) - { - self.sendError(ErrorType.Management, callback, ExceptionCode.ClassNotFound); + if (parent != null) + if (parent.instance.applicable(self.session, ActionType.AddChild, null) != Ruling.Allowed) { + self.sendError(ErrorType.Management, callback, ExceptionCode.AddChildDenied); return; } - Codec.parseVarArray(content, offset, cl, self).then(function(parameters) - { + var offset = 0; + + var className = content.getString(offset + 1, content[0]); + offset += 1 + content[0]; + + var nameLength = content.getUint16(offset); + offset += 2; + var name = content.getString(offset, nameLength); + + var cl = content.getUint32(offset); + offset += 4; + + var type = window[className]; + + if (type == null) { + self.sendError(ErrorType.Management, callback, ExceptionCode.ClassNotFound); + return; + } + + Codec.parseVarArray(content, offset, cl, self).then(function (parameters) { + offset += cl; + cl = content.getUint32(offset); + Codec.parseStructure(content, offset, cl, self).then(function (attributes) { offset += cl; - cl = content.getUint32(offset); - Codec.parseStructure(content, offset, cl, self).then(function(attributes) - { - offset += cl; - cl = content.length - offset; + cl = content.length - offset; - Codec.parseStructure(content, offset, cl, self).then(function(values) - { + Codec.parseStructure(content, offset, cl, self).then(function (values) { - var resource = new (Function.prototype.bind.apply(type, values)); - - Warehouse.put(resource, name, store, parent); + var resource = new (Function.prototype.bind.apply(type, values)); + + Warehouse.put(resource, name, store, parent); - self.sendReply(IIPPacketAction.CreateResource, callback) - .addUint32(resource.Instance.Id) - .done(); - - }); + self.sendReply(IIPPacketAction.CreateResource, callback) + .addUint32(resource.Instance.Id) + .done(); + }); }); }); }); + }); } IIPRequestDeleteResource(callback, resourceId) { var self = this; - Warehouse.getById(resourceId).then(function(r) - { - if (r == null) - { - self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); - return; - } + Warehouse.getById(resourceId).then(function (r) { + if (r == null) { + self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); + return; + } - if (r.instance.store.instance.applicable(session, ActionType.Delete, null) != Ruling.Allowed) - { - self.sendError(ErrorType.Management, callback, ExceptionCode.DeleteDenied); - return; - } + if (r.instance.store.instance.applicable(session, ActionType.Delete, null) != Ruling.Allowed) { + self.sendError(ErrorType.Management, callback, ExceptionCode.DeleteDenied); + return; + } - if (Warehouse.remove(r)) - self.sendReply(IIPPacketAction.DeleteResource, callback).done(); - else - self.sendError(ErrorType.Management, callback, ExceptionCode.DeleteFailed); - }); + if (Warehouse.remove(r)) + self.sendReply(IIPPacketAction.DeleteResource, callback).done(); + else + self.sendError(ErrorType.Management, callback, ExceptionCode.DeleteFailed); + }); } IIPRequestTemplateFromClassName(callback, className) { - + var self = this; Warehouse.getTemplateByClassName(className).then(function (t) { if (t != null) self.sendReply(IIPPacketAction.TemplateFromClassName, callback) - .addUint32(t.content.length) - .addUint8Array(t.content) - .done(); + .addUint32(t.content.length) + .addUint8Array(t.content) + .done(); else { // reply failed self.sendError(ErrorType.Management, callback, ExceptionCode.TemplateNotFound); @@ -1127,9 +1151,9 @@ export default class DistributedConnection extends IStore { Warehouse.getTemplateByClassId(classId).then(function (t) { if (t != null) self.sendReply(IIPPacketAction.TemplateFromClassId, callback) - .addUint32(t.content.length) - .addUint8Array(t.content) - .done(); + .addUint32(t.content.length) + .addUint8Array(t.content) + .done(); else { // reply failed self.sendError(ErrorType.Management, callback, ExceptionCode.TemplateNotFound); @@ -1144,12 +1168,12 @@ export default class DistributedConnection extends IStore { Warehouse.getById(resourceId).then(function (r) { if (r != null) self.sendReply(IIPPacketAction.TemplateFromResourceId, callback) - .addUint32(r.instance.template.content.length) - .addUint8Array(r.instance.template.content) - .done(); + .addUint32(r.instance.template.content.length) + .addUint8Array(r.instance.template.content) + .done(); else { // reply failed - self.sendError(ErrorType.Management, callback, ExceptionCode.TemplateNotFound); + self.sendError(ErrorType.Management, callback, ExceptionCode.TemplateNotFound); } }); } @@ -1168,8 +1192,8 @@ export default class DistributedConnection extends IStore { if (rt != null) { rt.then(function (res) { self.sendReply(IIPPacketAction.InvokeFunctionArrayArguments, callback) - .addUint8Array(Codec.compose(res, self)) - .done(); + .addUint8Array(Codec.compose(res, self)) + .done(); }); } else { @@ -1180,8 +1204,7 @@ export default class DistributedConnection extends IStore { var fi = r[ft.name]; - if (r.instance.applicable(self.session, ActionType.Execute, ft) == Ruling.Denied) - { + if (r.instance.applicable(self.session, ActionType.Execute, ft) == Ruling.Denied) { self.sendError(ErrorType.Management, callback, ExceptionCode.InvokeDenied); return; } @@ -1192,30 +1215,29 @@ export default class DistributedConnection extends IStore { var rt = fi.apply(r, args); function* itt() { - + }; // Is iterator ? - if (rt[Symbol.iterator] instanceof Function) - { + if (rt[Symbol.iterator] instanceof Function) { for (let v of rt) self.sendChunk(callback, v); self.sendReply(IIPPacket.IIPPacketAction.InvokeFunctionArrayArguments, callback) - .addUint8(DataType.Void) - .done(); + .addUint8(DataType.Void) + .done(); } else if (rt instanceof AsyncReply) { rt.then(function (res) { self.sendReply(IIPPacketAction.InvokeFunctionArrayArguments, callback) - .addUint8Array(Codec.compose(res, self)) - .done(); + .addUint8Array(Codec.compose(res, self)) + .done(); }); } else { self.sendReply(IIPPacketAction.InvokeFunctionArrayArguments, callback) - .addUint8Array(Codec.compose(rt, self)) - .done(); + .addUint8Array(Codec.compose(rt, self)) + .done(); } } else { @@ -1234,7 +1256,7 @@ export default class DistributedConnection extends IStore { }); } - + IIPRequestInvokeFunctionNamedArguments(callback, resourceId, index, content) { var self = this; @@ -1249,8 +1271,8 @@ export default class DistributedConnection extends IStore { if (rt != null) { rt.then(function (res) { self.sendReply(IIPPacketAction.InvokeFunctionNamedArguments, callback) - .addUint8Array(Codec.compose(res, self)) - .done(); + .addUint8Array(Codec.compose(res, self)) + .done(); }); } else { @@ -1261,8 +1283,7 @@ export default class DistributedConnection extends IStore { var fi = r[ft.name]; - if (r.instance.applicable(self.session, ActionType.Execute, ft) == Ruling.Denied) - { + if (r.instance.applicable(self.session, ActionType.Execute, ft) == Ruling.Denied) { self.sendError(ErrorType.Management, callback, ExceptionCode.InvokeDenied); return; } @@ -1272,39 +1293,37 @@ export default class DistributedConnection extends IStore { var pi = ResourceTemplate.getFunctionParameters(fi); var args = new Array(pi.length); - for (var i = 0; i < pi.length; i++) - { + for (var i = 0; i < pi.length; i++) { if (namedArgs[pi[i]] !== undefined) args[i] = namedArgs[pi[i]]; } // pass this to the last argument if it is undefined - if (args[args.length-1] === undefined) - args[args.length-1] = self; + if (args[args.length - 1] === undefined) + args[args.length - 1] = self; var rt = fi.apply(r, args); // Is iterator ? - if (rt[Symbol.iterator] instanceof Function) - { + if (rt[Symbol.iterator] instanceof Function) { for (let v of rt) self.sendChunk(callback, v); self.sendReply(IIPPacket.IIPPacketAction.InvokeFunctionNamedArguments, callback) - .addUint8(DataType.Void) - .done(); + .addUint8(DataType.Void) + .done(); } else if (rt instanceof AsyncReply) { rt.then(function (res) { self.sendReply(IIPPacketAction.InvokeFunctionNamedArguments, callback) - .addUint8Array(Codec.compose(res, self)) - .done(); + .addUint8Array(Codec.compose(res, self)) + .done(); }); } else { self.sendReply(IIPPacketAction.InvokeFunctionNamedArguments, callback) - .addUint8Array(Codec.compose(rt, self)) - .done(); + .addUint8Array(Codec.compose(rt, self)) + .done(); } } else { @@ -1324,7 +1343,7 @@ export default class DistributedConnection extends IStore { } IIPRequestGetProperty(callback, resourceId, index) { - + var self = this; Warehouse.getById(resourceId).then(function (r) { @@ -1333,14 +1352,14 @@ export default class DistributedConnection extends IStore { if (pt != null) { if (r instanceof DistributedResource) { self.sendReply(IIPPacketAction.GetProperty, callback) - .addUint8Array(Codec.compose(r._get(pt.index), self)) - .done(); + .addUint8Array(Codec.compose(r._get(pt.index), self)) + .done(); } else { var pv = r[pt.name]; self.sendReply(IIPPacketAction.GetProperty) - .addUint8Array(Codec.compose(pv, self)) - .done(); + .addUint8Array(Codec.compose(pv, self)) + .done(); } } else { @@ -1354,7 +1373,7 @@ export default class DistributedConnection extends IStore { } IIPRequestGetPropertyIfModifiedSince(callback, resourceId, index, age) { - + var self = this; Warehouse.getById(resourceId).then(function (r) { @@ -1364,14 +1383,13 @@ export default class DistributedConnection extends IStore { if (r.instance.getAge(index) > age) { var pv = r[pt.name]; self.sendReply(IIPPacketAction.GetPropertyIfModified, callback) - .addUint8Array(Codec.compose(pv, self)) - .done(); + .addUint8Array(Codec.compose(pv, self)) + .done(); } - else - { + else { self.sendReply(IIPPacketAction.GetPropertyIfModified, callback) - .addUint8(DataType.NotModified) - .done(); + .addUint8(DataType.NotModified) + .done(); } } else { @@ -1385,7 +1403,7 @@ export default class DistributedConnection extends IStore { } IIPRequestSetProperty(callback, resourceId, index, content) { - + var self = this; Warehouse.getById(resourceId).then(function (r) { @@ -1399,30 +1417,26 @@ export default class DistributedConnection extends IStore { // propagation r._set(index, value).then(function (x) { self.sendReply(IIPPacketAction.SetProperty, callback) - .done(); - }).error(function(x){ + .done(); + }).error(function (x) { self.sendError(x.type, callback, x.code, x.message) .done(); }); } - else - { - if (r.instance.applicable(self.session, ActionType.SetProperty, pt) == Ruling.Denied) - { + else { + if (r.instance.applicable(self.session, ActionType.SetProperty, pt) == Ruling.Denied) { self.sendError(AsyncReply.ErrorType.Exception, callback, ExceptionCode.SetPropertyDenied); return; } - - try - { + + try { if (r[pt.name] instanceof DistributedPropertyContext) value = new DistributedPropertyContext(this, value); r[pt.name] = value; self.sendReply(IIPPacketAction.SetProperty, callback).done(); } - catch(ex) - { + catch (ex) { self.sendError(AsyncReply.ErrorType.Exception, callback, 0, ex.toString()).done(); } } @@ -1441,32 +1455,26 @@ export default class DistributedConnection extends IStore { }); } - IIPRequestInquireResourceHistory(callback, resourceId, fromDate, toDate) - { + IIPRequestInquireResourceHistory(callback, resourceId, fromDate, toDate) { var self = this; - Warehouse.getById(resourceId).then(function(r) - { - if (r != null) - { - r.instance.store.getRecord(r, fromDate, toDate).then(function(results) - { + Warehouse.getById(resourceId).then(function (r) { + if (r != null) { + r.instance.store.getRecord(r, fromDate, toDate).then(function (results) { var history = Codec.composeHistory(results, self, true); self.sendReply(IIPPacketAction.ResourceHistory, callback) - .addUint8Array(history) - .done(); + .addUint8Array(history) + .done(); }); } }); } - IIPRequestQueryResources(callback, resourceLink) - { + IIPRequestQueryResources(callback, resourceLink) { var self = this; - Warehouse.query(resourceLink).then(function(resources) - { + Warehouse.query(resourceLink).then(function (resources) { - var list = resources.filter(function(r){return r.instance.applicable(self.session, ActionType.Attach, null) != Ruling.Denied}); + var list = resources.filter(function (r) { return r.instance.applicable(self.session, ActionType.Attach, null) != Ruling.Denied }); if (list.length == 0) self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); @@ -1477,27 +1485,24 @@ export default class DistributedConnection extends IStore { }); } - create(store, parent, className, parameters, attributes, values) - { + create(store, parent, className, parameters, attributes, values) { var reply = new AsyncReply(); var sb = DC.stringToBytes(className); var pkt = BL().addUint32(store.instance.id) - .addUint32(parent.instance.id) - .addUint32(sb.length) - .addUint8Array(sb) - .addUint8Array(Codec.composeVarArray(parameters, this, true)) - .addUint8Array(Codec.composeStructure(attributes, this, true, true, true)) - .addUint8Array(Codec.composeStructure(values, this)); + .addUint32(parent.instance.id) + .addUint32(sb.length) + .addUint8Array(sb) + .addUint8Array(Codec.composeVarArray(parameters, this, true)) + .addUint8Array(Codec.composeStructure(attributes, this, true, true, true)) + .addUint8Array(Codec.composeStructure(values, this)); pkt.addUint32(pkt.length, 8); - this.sendRequest(IIPPacket.IIPPacketAction.CreateResource).addUint8Array(pkt.ToArray()).done().then(function(args) - { + this.sendRequest(IIPPacket.IIPPacketAction.CreateResource).addUint8Array(pkt.ToArray()).done().then(function (args) { var rid = args[0]; - self.fetch(rid).then(function(r) - { + self.fetch(rid).then(function (r) { reply.trigger(r); }); @@ -1506,25 +1511,23 @@ export default class DistributedConnection extends IStore { return reply; } - query(resourceLink) - { + query(resourceLink) { var reply = new AsyncReply(); var self = this; var sb = DC.stringToBytes(resourceLink); this.sendRequest(IIPPacketAction.QueryLink) - .addUint16(sb.length) - .addUint8Array(sb) - .done() - .then(function(args) - { - Codec.parseResourceArray(args[0], 0, args[0].length, self).then(function(resources) { - reply.trigger(resources); + .addUint16(sb.length) + .addUint8Array(sb) + .done() + .then(function (args) { + Codec.parseResourceArray(args[0], 0, args[0].length, self).then(function (resources) { + reply.trigger(resources); + }); + }).error(function (ex) { + reply.triggerError(ex); }); - }).error(function(ex){ - reply.triggerError(ex); - }); return reply; } @@ -1541,33 +1544,32 @@ export default class DistributedConnection extends IStore { var self = this; this.sendRequest(IIPPacketAction.TemplateFromClassId) - .addUint8Array(classId.value) - .done() - .then(function (rt) { - self.templateRequests.remove(classId); - self.templates.add(rt[0].classId.valueOf(), rt[0]); - Warehouse.putTemplate(rt[0]); - reply.trigger(rt[0]); - }); + .addUint8Array(classId.value) + .done() + .then(function (rt) { + self.templateRequests.remove(classId); + self.templates.add(rt[0].classId.valueOf(), rt[0]); + Warehouse.putTemplate(rt[0]); + reply.trigger(rt[0]); + }); return reply; } -// IStore interface + // IStore interface get(path) { var rt = new AsyncReply(); - - this.query(path).then(function(ar) - { + + this.query(path).then(function (ar) { if (ar != null && ar.length > 0) rt.trigger(ar[0]); else rt.trigger(null); - }).error(function(ex) {rt.triggerError(ex);}); + }).error(function (ex) { rt.triggerError(ex); }); return rt; - + /* if (this.pathRequests[path]) return this.pathRequests[path]; @@ -1603,53 +1605,56 @@ export default class DistributedConnection extends IStore { return new AsyncReply(null); } -// Get a resource from the other end + // Get a resource from the other end fetch(id) { - if (this.resourceRequests[id] && this.resources[id]) { - // dig for dead locks - // or not - return new AsyncReply(this.resources[id]); - //return this.resourceRequests[id]; + + let resource = this.resources.item(id); + let request = htis.resourceRequests.item(id); + + if (request != null) { + + if (resource != null) + // dig for dead locks // or not + return new AsyncReply(resource); + else + return request; + } + else if (resource != null && !resource._p.suspended) { + return new AsyncReply(resource); } - else if (this.resourceRequests[id]) - return this.resourceRequests[id]; - else if (this.resources[id]) - return new AsyncReply(this.resources[id]); var reply = new AsyncReply(); - this.resourceRequests[id] = reply; + this.resourceRequests.set(id, reply); var self = this; this.sendRequest(IIPPacketAction.AttachResource) - .addUint32(id) - .done() - .then(function (rt) { - var dr = new DistributedResource(self, id, rt[1], rt[2]); - //var dr = new DistributedResource(self, tmp, id, rt[1], rt[2]); + .addUint32(id) + .done() + .then(function (rt) { - self.getTemplate(rt[0]).then(function (tmp) { + let dr = resource ?? new DistributedResource(self, id, rt[1], rt[2]); - // ClassId, ResourceAge, ResourceLink, Content - Warehouse.put(dr, id.toString(), self, null, tmp); + self.getTemplate(rt[0]).then(function (tmp) { - - Codec.parsePropertyValueArray(rt[3], 0, rt[3].length, self).then(function (ar) { - dr._attached(ar); - delete self.resourceRequests[id]; - reply.trigger(dr); - }); - }); + // ClassId, ResourceAge, ResourceLink, Content + if (resource == null) + Warehouse.put(dr, id.toString(), self, null, tmp); + + Codec.parsePropertyValueArray(rt[3], 0, rt[3].length, self).then(function (ar) { + dr._attach(ar); + self.resourceRequests.remove(id); + reply.trigger(dr); }); + }); + }); return reply; } - getRecord(resource, fromDate, toDate) - { - if (resource instanceof DistributedResource) - { + getRecord(resource, fromDate, toDate) { + if (resource instanceof DistributedResource) { if (resource._p.connection != this) return new AsyncReply(null); @@ -1659,16 +1664,14 @@ export default class DistributedConnection extends IStore { var self = this; this.sendRequest(IIPPacketAction.ResourceHistory) - .addUint32(resource._p.instanceId) - .addDateTime(fromDate).addDateTime(toDate) - .done() - .then(function(rt) - { - Codec.parseHistory(rt[0], 0, rt[0].length, resource, self).then(function(history) - { - reply.trigger(history); - }); - }); + .addUint32(resource._p.instanceId) + .addDateTime(fromDate).addDateTime(toDate) + .done() + .then(function (rt) { + Codec.parseHistory(rt[0], 0, rt[0].length, resource, self).then(function (history) { + reply.trigger(history); + }); + }); return reply; } @@ -1679,8 +1682,8 @@ export default class DistributedConnection extends IStore { instance_resourceDestroyed(resource) { // compose the packet this.sendEvent(IIPPacketEvent.ResourceDestroyed) - .addUint32(resource.instance.id) - .done(); + .addUint32(resource.instance.id) + .done(); } instance_propertyModified(resource, name, newValue) { @@ -1690,10 +1693,10 @@ export default class DistributedConnection extends IStore { return; this.sendEvent(IIPPacketEvent.PropertyUpdated) - .addUint32(resource.instance.id) - .addUint8(pt.index) - .addUint8Array(Codec.compose(newValue, this)) - .done(); + .addUint32(resource.instance.id) + .addUint8(pt.index) + .addUint8Array(Codec.compose(newValue, this)) + .done(); } instance_eventOccurred(resource, issuer, receivers, name, args) { @@ -1711,42 +1714,35 @@ export default class DistributedConnection extends IStore { // compose the packet this.sendEvent(IIPPacketEvent.EventOccurred) - .addUint32(resource.instance.id) - .addUint8(et.index) - .addUint8Array(Codec.composeVarArray(args, this, true)) - .done(); + .addUint32(resource.instance.id) + .addUint8(et.index) + .addUint8Array(Codec.composeVarArray(args, this, true)) + .done(); } - IIPRequestAddChild(callback, parentId, childId) - { + IIPRequestAddChild(callback, parentId, childId) { var self = this; - Warehouse.getById(parentId).then(function(parent) - { - if (parent == null) - { + Warehouse.getById(parentId).then(function (parent) { + if (parent == null) { self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); return; } - Warehouse.getById(childId).then(function(child) - { - if (child == null) - { + Warehouse.getById(childId).then(function (child) { + if (child == null) { self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); return; } - if (parent.instance.applicable(self.session, ActionType.AddChild, null) != Ruling.Allowed) - { + if (parent.instance.applicable(self.session, ActionType.AddChild, null) != Ruling.Allowed) { self.sendError(ErrorType.Management, callback, ExceptionCode.AddChildDenied); return; } - if (child.instance.applicable(self.session, ActionType.AddParent, null) != Ruling.Allowed) - { + if (child.instance.applicable(self.session, ActionType.AddParent, null) != Ruling.Allowed) { self.sendError(ErrorType.Management, callback, ExceptionCode.AddParentDenied); return; } @@ -1754,41 +1750,34 @@ export default class DistributedConnection extends IStore { parent.instance.children.add(child); self.sendReply(IIPPacketAction.AddChild, callback) - .done(); + .done(); //child.Instance.Parents }); }); } - IIPRequestRemoveChild(callback, parentId, childId) - { + IIPRequestRemoveChild(callback, parentId, childId) { var self = this; - Warehouse.getById(parentId).then(function(parent) - { - if (parent == null) - { + Warehouse.getById(parentId).then(function (parent) { + if (parent == null) { self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); return; } - Warehouse.getById(childId).then(function(child) - { - if (child == null) - { + Warehouse.getById(childId).then(function (child) { + if (child == null) { self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); return; } - if (parent.instance.applicable(self.session, ActionType.RemoveChild, null) != Ruling.Allowed) - { + if (parent.instance.applicable(self.session, ActionType.RemoveChild, null) != Ruling.Allowed) { self.sendError(ErrorType.Management, callback, ExceptionCode.AddChildDenied); return; } - if (child.instance.applicable(self.session, ActionType.RemoveParent, null) != Ruling.Allowed) - { + if (child.instance.applicable(self.session, ActionType.RemoveParent, null) != Ruling.Allowed) { self.sendError(ErrorType.Management, callback, ExceptionCode.AddParentDenied); return; } @@ -1796,84 +1785,70 @@ export default class DistributedConnection extends IStore { parent.instance.children.remove(child); self.sendReply(IIPPacketAction.RemoveChild, callback) - .done(); + .done(); //child.Instance.Parents }); }); } - IIPRequestRenameResource(callback, resourceId, name) - { + IIPRequestRenameResource(callback, resourceId, name) { var self = this; - Warehouse.getById(resourceId).then(function(resource) - { - if (resource == null) - { + Warehouse.getById(resourceId).then(function (resource) { + if (resource == null) { self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); return; } - if (resource.instance.applicable(self.session, ActionType.Rename, null) != Ruling.Allowed) - { + if (resource.instance.applicable(self.session, ActionType.Rename, null) != Ruling.Allowed) { self.sendError(ErrorType.Management, callback, ExceptionCode.RenameDenied); return; } resource.instance.name = name.getString(0, name.length); self.sendReply(IIPPacketAction.RenameResource, callback) - .done(); + .done(); }); - } + } - IIPRequestResourceChildren(callback, resourceId) - { + IIPRequestResourceChildren(callback, resourceId) { var self = this; - Warehouse.getById(resourceId).then(function(resource) - { - if (resource == null) - { + Warehouse.getById(resourceId).then(function (resource) { + if (resource == null) { self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); return; } self.sendReply(IIPPacketAction.ResourceChildren, callback) - .addUint8Array(Codec.composeResourceArray(resource.instance.children.toArray(), this, true)) - .done(); - + .addUint8Array(Codec.composeResourceArray(resource.instance.children.toArray(), this, true)) + .done(); + }); } - IIPRequestResourceParents(callback, resourceId) - { + IIPRequestResourceParents(callback, resourceId) { var self = this; - Warehouse.getById(resourceId).then(function(resource) - { - if (resource == null) - { + Warehouse.getById(resourceId).then(function (resource) { + if (resource == null) { self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); return; } self.sendReply(IIPPacketAction.ResourceParents, callback) - .addUint8Array(Codec.composeResourceArray(resource.instance.parents.toArray(), this, true)) - .done(); + .addUint8Array(Codec.composeResourceArray(resource.instance.parents.toArray(), this, true)) + .done(); }); } - IIPRequestClearAttributes(callback, resourceId, attributes, all = false) - { - Warehouse.getById(resourceId).then(function(r) - { - if (r == null) - { + IIPRequestClearAttributes(callback, resourceId, attributes, all = false) { + Warehouse.getById(resourceId).then(function (r) { + if (r == null) { self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); return; } - if (r.instance.store.instance.applicable(self.session, ActionType.UpdateAttributes, null) != Ruling.Allowed) - { + if (r.instance.store.instance.applicable(self.session, ActionType.UpdateAttributes, null) != Ruling.Allowed) { self.sendError(ErrorType.Management, callback, ExceptionCode.UpdateAttributeDenied); return; } @@ -1885,48 +1860,43 @@ export default class DistributedConnection extends IStore { if (r.instance.removeAttributes(attrs)) self.sendReply(all ? IIPPacketAction.ClearAllAttributes : IIPPacketAction.ClearAttributes, callback) - .done(); + .done(); else self.sendError(AsyncReply.ErrorType.Management, callback, ExceptionCode.UpdateAttributeFailed); }); } - IIPRequestUpdateAttributes(callback, resourceId, attributes, clearAttributes = false) - { + IIPRequestUpdateAttributes(callback, resourceId, attributes, clearAttributes = false) { var self = this; - Warehouse.getById(resourceId).then(function(r) - { - if (r == null) - { + Warehouse.getById(resourceId).then(function (r) { + if (r == null) { self.sendError(ErrorType.Management, callback, ExceptionCode.ResourceNotFound); return; } - if (r.instance.store.instance.applicable(self.session, ActionType.UpdateAttributes, null) != Ruling.Allowed) - { + if (r.instance.store.instance.applicable(self.session, ActionType.UpdateAttributes, null) != Ruling.Allowed) { self.sendError(ErrorType.Management, callback, ExceptionCode.UpdateAttributeDenied); return; } - Codec.parseStructure(attributes, 0, attributes.length, this).then(function(attrs) { + Codec.parseStructure(attributes, 0, attributes.length, this).then(function (attrs) { if (r.instance.setAttributes(attrs, clearAttributes)) self.sendReply(clearAttributes ? IIPPacketAction.ClearAllAttributes : IIPPacketAction.ClearAttributes, - callback) - .done(); + callback) + .done(); else self.sendError(ErrorType.Management, callback, ExceptionCode.UpdateAttributeFailed); }); - + }); } - - getChildren(resource) - { + + getChildren(resource) { if (resource._p.connection != this) return new AsyncReply(null); @@ -1934,22 +1904,19 @@ export default class DistributedConnection extends IStore { var self = this; this.sendRequest(IIPPacketAction.ResourceChildren) - .addUint32(resource._p.instanceId) - .done() - .then(function(d) - { - - Codec.parseResourceArray(d, 0, d.length, self).then(function(resources) - { - rt.trigger(resources); - }).error(function(ex) { rt.triggerError(ex); }); - }); + .addUint32(resource._p.instanceId) + .done() + .then(function (d) { + + Codec.parseResourceArray(d, 0, d.length, self).then(function (resources) { + rt.trigger(resources); + }).error(function (ex) { rt.triggerError(ex); }); + }); return rt; } - getParents(resource) - { + getParents(resource) { if (resource._p.connection != this) return new AsyncReply(null); @@ -1957,21 +1924,18 @@ export default class DistributedConnection extends IStore { var self = this; this.sendRequest(IIPPacketAction.ResourceParents) - .addUint32(resource._p.instanceId) - .done() - .then(function(d) - { - Codec.parseResourceArray(d, 0, d.length, this).then(function(resources) - { - rt.trigger(resources); - }).error(function(ex) { rt.triggerError(ex);}); - }); + .addUint32(resource._p.instanceId) + .done() + .then(function (d) { + Codec.parseResourceArray(d, 0, d.length, this).then(function (resources) { + rt.trigger(resources); + }).error(function (ex) { rt.triggerError(ex); }); + }); return rt; } - removeAttributes(resource, attributes = null) - { + removeAttributes(resource, attributes = null) { if (resource._p.connection != this) return new AsyncReply(null); @@ -1979,88 +1943,76 @@ export default class DistributedConnection extends IStore { if (attributes == null) this.sendRequest(IIPPacketAction.ClearAllAttributes) - .addUint32(resource._p.instanceId) - .done() - .then(function(ar) - { - rt.trigger(true); - }).error(function(ex) { rt.triggerError(ex); }); - else - { + .addUint32(resource._p.instanceId) + .done() + .then(function (ar) { + rt.trigger(true); + }).error(function (ex) { rt.triggerError(ex); }); + else { var attrs = DC.stringArrayToBytes(attributes); this.sendRequest(IIPPacketAction.ClearAttributes) - .addUint32(resource.instance.id) - .addUint32(attrs.length) - .addUint8Array(attrs) - .done() - .then(function(ar) - { - rt.trigger(true); - }).error(function(ex) { rt.triggerError(ex); }); + .addUint32(resource.instance.id) + .addUint32(attrs.length) + .addUint8Array(attrs) + .done() + .then(function (ar) { + rt.trigger(true); + }).error(function (ex) { rt.triggerError(ex); }); } return rt; } - setAttributes(resource, attributes, clearAttributes = false) - { + setAttributes(resource, attributes, clearAttributes = false) { if (resource._p.connection != this) return new AsyncReply(null); var rt = new AsyncReply(); - + this.sendRequest(clearAttributes ? IIPPacketAction.UpdateAllAttributes : IIPPacketAction.UpdateAttributes) - .addUint32(resource._p.instanceId) - .addUint8Array(Codec.composeStructure(attributes, this, true, true, true)) - .done() - .then(function(ar) - { - rt.trigger(true); - }).error(function(ex) {rt.triggerError(ex);}); - + .addUint32(resource._p.instanceId) + .addUint8Array(Codec.composeStructure(attributes, this, true, true, true)) + .done() + .then(function (ar) { + rt.trigger(true); + }).error(function (ex) { rt.triggerError(ex); }); + return rt; } - getAttributes(resource, attributes = null) - { + getAttributes(resource, attributes = null) { if (resource._p.connection != this) return new AsyncReply(null); var rt = new AsyncReply(); var self = this; - if (attributes == null) - { + if (attributes == null) { this.sendRequest(IIPPacketAction.GetAllAttributes) - .addUint32(resource._p.instanceId) - .done() - .then(function(ar) - { - Codec.parseStructure(ar[0], 0, ar[0].length, this).then(function(st) - { - for (var a in st) - resource.instance.attributes.set(a, st[a]); - rt.trigger(st); - }).error(function(ex) { rt.triggerError(ex); }); - }); + .addUint32(resource._p.instanceId) + .done() + .then(function (ar) { + Codec.parseStructure(ar[0], 0, ar[0].length, this).then(function (st) { + for (var a in st) + resource.instance.attributes.set(a, st[a]); + rt.trigger(st); + }).error(function (ex) { rt.triggerError(ex); }); + }); } - else - { + else { var attrs = DC.stringArrayToBytes(attributes); this.sendRequest(IIPPacketAction.GetAttributes) - .addUint32(resource._p.instanceId) - .addUint32(attrs.length) - .addUint8Array(attrs) - .done() - .then(function(ar) - { - Codec.parseStructure(ar[0], 0, ar[0].length, self).then(function(st) - { - for (var a in st) - resource.instance.attributes.set(a, st[a]); - rt.trigger(st); - }).error(function(ex) { rt.triggerError(ex); }); - }); + .addUint32(resource._p.instanceId) + .addUint32(attrs.length) + .addUint8Array(attrs) + .done() + .then(function (ar) { + Codec.parseStructure(ar[0], 0, ar[0].length, self).then(function (st) { + for (var a in st) + resource.instance.attributes.set(a, st[a]); + rt.trigger(st); + }).error(function (ex) { rt.triggerError(ex); }); + }); } return rt; diff --git a/src/Net/IIP/DistributedResource.js b/src/Net/IIP/DistributedResource.js index b9266ea..7fe8df2 100644 --- a/src/Net/IIP/DistributedResource.js +++ b/src/Net/IIP/DistributedResource.js @@ -37,15 +37,24 @@ export default class DistributedResource extends IResource destroy() { this.destroyed = true; + this._p.attached = false; + this._p.connection.sendDetachRequest(this._p.instanceId); this._emit("destroy", this); } + _suspend() + { + this._p.suspended = true; + this._p.attached = false; + } + constructor(connection, instanceId, age, link) { super(); this._p = { - isAttached: false, + suspended: false, + attached: false, connection: connection, instanceId: instanceId, age: age, @@ -66,13 +75,16 @@ export default class DistributedResource extends IResource return props; } - _attached(properties) + _attach(properties) { - if (this._isAttached) + if (this._p.attached) return false; else { + + this._p.suspended = false; + for(var i = 0; i < properties.length; i++) { this.instance.setAge(i, properties[i].age); @@ -81,7 +93,7 @@ export default class DistributedResource extends IResource } - this._p.isAttached = true; + this._p.attached = true; var self = this; @@ -154,6 +166,9 @@ export default class DistributedResource extends IResource if (this.destroyed) throw new Error("Trying to access destroyed object"); + if (this._p.suspended) + throw new Error("Trying to access suspended object"); + if (index >= this.instance.template.functions.length) throw new Error("Function index is incorrect"); @@ -164,6 +179,9 @@ export default class DistributedResource extends IResource if (this.destroyed) throw new Error("Trying to access destroyed object"); + if (this._p.suspended) + throw new Error("Trying to access suspended object"); + if (index >= this.instance.template.functions.length) throw new Error("Function index is incorrect"); diff --git a/src/Net/Packets/IIPPacket.js b/src/Net/Packets/IIPPacket.js index 27a66a4..b7682f7 100644 --- a/src/Net/Packets/IIPPacket.js +++ b/src/Net/Packets/IIPPacket.js @@ -189,6 +189,9 @@ export default class IIPPacket var cl = data.getUint32(offset); offset += 4; + if (this.notEnough(offset, ends, cl)) + return -this.dataLengthNeeded; + this.content = data.clip(offset, cl); offset += cl; } diff --git a/src/Resource/Instance.js b/src/Resource/Instance.js index 97c7382..b0e41f7 100644 --- a/src/Resource/Instance.js +++ b/src/Resource/Instance.js @@ -137,7 +137,8 @@ export default class Instance extends IEventHandler this.store.record(this.resource, pt.name, value, this.ages[pt.index], now); super._emit("ResourceModified", this.resource, pt.name, value); - this.resource._emit("modified", pt.name, value); + //this.resource._emit("modified", pt.name, value); + this.resource._emit(":" + pt.name, value); } modified(propertyName = null) diff --git a/src/Resource/Warehouse.js b/src/Resource/Warehouse.js index b274bae..2f8f2ed 100644 --- a/src/Resource/Warehouse.js +++ b/src/Resource/Warehouse.js @@ -82,7 +82,7 @@ export class WH extends IEventHandler //var url = path.split(/(?:):\/\/([^:\/]*):?(\d*)/); // without port let url = path.split(this._urlRegex); - + //var url = path.split("://", 2); //var hostname = url[1];// url[1].split("/", 2)[0]; //var pathname = url[2];// url[1].split("/").splice(1).join("/"); diff --git a/src/Security/Permissions/ActionType.js b/src/Security/Permissions/ActionType.js new file mode 100644 index 0000000..f3ba63a --- /dev/null +++ b/src/Security/Permissions/ActionType.js @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2017 Ahmed Kh. Zamil +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +*/ + +/** + * Created by Ahmed Zamil on 9/2/2017. + */ + +"use strict"; + +export default // ActionType = +{ + Attach: 0, + Delete: 1, + Execute: 2, + GetProperty: 3, + SetProperty: 4, + CreateResource: 5, + UpdateAttributes: 6, + InquireAttributes: 7, + AddParent: 8, + RemoveParent: 9, + AddChild: 10, + RemoveChild: 11, + Rename: 12, + ReceiveEvent: 13 +}; diff --git a/src/Security/Permissions/IPermissionsManager.js b/src/Security/Permissions/IPermissionsManager.js index 00d4fb6..e3fd7fd 100644 --- a/src/Security/Permissions/IPermissionsManager.js +++ b/src/Security/Permissions/IPermissionsManager.js @@ -26,30 +26,6 @@ "use strict"; -export const ActionType = -{ - Attach: 0, - Delete: 1, - Execute: 2, - GetProperty: 3, - SetProperty: 4, - CreateResource: 5, - UpdateAttributes: 6, - InquireAttributes: 7, - AddParent: 8, - RemoveParent: 9, - AddChild: 10, - RemoveChild: 11, - Rename: 12, - ReceiveEvent: 13 -}; - -export const Ruling = { - Denied: 0, - Allowed: 1, - DontCare: 2, -}; - export default class IPermissionsManager { /// diff --git a/src/Security/Permissions/Ruling.js b/src/Security/Permissions/Ruling.js new file mode 100644 index 0000000..8c19f11 --- /dev/null +++ b/src/Security/Permissions/Ruling.js @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2017 Ahmed Kh. Zamil +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +*/ + +/** + * Created by Ahmed Zamil on 9/2/2020. + */ + +"use strict"; + +export default //Ruling = +{ + Denied: 0, + Allowed: 1, + DontCare: 2, +}; + diff --git a/src/esyur.js b/src/esyur.js index 158be2d..5114837 100644 --- a/src/esyur.js +++ b/src/esyur.js @@ -2,11 +2,24 @@ import wh from './Resource/Warehouse.js'; import Structure from './Data/Structure.js'; import DistributedResource from './Net/IIP/DistributedResource.js' +import MemoryStore from './Stores/MemoryStore.js'; +import IResource from './Resource/IResource.js'; if (window) { window.wh = wh; window.Structure = Structure; window.DistributedResource = DistributedResource; + window.MemoryStore = MemoryStore; + window.IResource = IResource; +} +else if (global) +{ + global.wh = wh; + global.Structure = Structure; + global.DistributedResource = DistributedResource; + global.MemoryStore = MemoryStore; + global.IResource = IResource; + } export default wh; \ No newline at end of file