Socket
Socket
Sign inDemoInstall

@govflanders/vl-widget-plugin

Package Overview
Dependencies
Maintainers
13
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@govflanders/vl-widget-plugin - npm Package Compare versions

Comparing version 1.1.29 to 1.1.30

2

dist/index.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var vlWidgetUtility=require("@govflanders/vl-widget-utility"),vlWidgetEvent=require("@govflanders/vl-widget-event"),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},defaults=function(t,n){for(var e=Object.getOwnPropertyNames(n),r=0;r<e.length;r++){var o=e[r],i=Object.getOwnPropertyDescriptor(n,o);i&&i.configurable&&void 0===t[o]&&Object.defineProperty(t,o,i)}return t},_extends=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t};function installPluginModule(t,n){return Promise.resolve().then(function(){switch(void 0===n?"undefined":_typeof(n)){case"string":return t.import(n);default:return n}}).then(function(n){return t.install(n)})}function installPluginContext(t,n){return Promise.resolve().then(function(){var e=n.pluginModule||null;return installPluginModule(t,e)}).then(function(){return n})}var __extends=function(){var t=function(n,e){return(t=Object.setPrototypeOf||_extends({},[])instanceof Array&&function(t,n){defaults(t,n)}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),ContainerPluginDiscovery=function(){function t(t,n){this.container=t,this.pluginFactoryServiceId=n}return t.prototype.getContainer=function(){return this.container},t.prototype.getPluginFactoryServiceId=function(){return this.pluginFactoryServiceId},t.prototype.getPluginFactoryFromContainer=function(t){var n=this.getPluginFactoryServiceId();return this.getContainer().getNamed(n,t.pluginTypeId)},t.prototype.resolvePluginFactory=function(t){var n=this;return new Promise(function(e){e(n.getPluginFactoryFromContainer(t))})},t}(),ModulePluginDiscovery=function(t){function n(n,e,r){var o=t.call(this,e,r)||this;return o.moduleManager=n,o}return __extends(n,t),n.prototype.getModuleManager=function(){return this.moduleManager},n.prototype.resolvePluginFactory=function(n){var e=this;return Promise.resolve().then(function(){return installPluginContext(e.getModuleManager(),n)}).then(function(n){return t.prototype.resolvePluginFactory.call(e,n)})},n}(ContainerPluginDiscovery),__extends$1=function(){var t=function(n,e){return(t=Object.setPrototypeOf||_extends({},[])instanceof Array&&function(t,n){defaults(t,n)}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),PluginError=function(t){function n(n,e,r){void 0===r&&(r=null);var o=t.call(this,e,r)||this;return o.plugin=n,o}return __extends$1(n,t),n.prototype.getPlugin=function(){return this.plugin},n}(vlWidgetUtility.Error.RuntimeError),__extends$2=function(){var t=function(n,e){return(t=Object.setPrototypeOf||_extends({},[])instanceof Array&&function(t,n){defaults(t,n)}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),PluginEventBase=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends$2(n,t),n}(vlWidgetEvent.EventBase),GenericPluginEvent=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends$2(n,t),n}(PluginEventBase),GenericPluginExtensionEvent=function(t){function n(n,e,r,o){void 0===o&&(o=vlWidgetEvent.EventScope.Broadcast);var i=t.call(this,n,e,o)||this;return i.pluginExtension=r,i}return __extends$2(n,t),n.prototype.getExtension=function(){return this.pluginExtension},n}(PluginEventBase),GenericPluginErrorEvent=function(t){function n(n,e,r,o){void 0===o&&(o=vlWidgetEvent.EventScope.Broadcast);var i=t.call(this,n,e,o)||this;return i.error=r,i}return __extends$2(n,t),n.prototype.getError=function(){return this.error},n}(PluginEventBase),__extends$3=function(){var t=function(n,e){return(t=Object.setPrototypeOf||_extends({},[])instanceof Array&&function(t,n){defaults(t,n)}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),PluginManagerBase=function(){function t(t,n){this.pluginHost=t,this.pluginDiscovery=n,this.pluginRegistry=[]}return t.prototype.getPluginHost=function(){return this.pluginHost},t.prototype.getPluginDiscovery=function(){return this.pluginDiscovery},t.prototype.createPluginInstance=function(t){var n=this;return this.getPluginDiscovery().resolvePluginFactory(t).then(function(e){var r=n.getPluginHost();return e.createPluginInstance(r,t)}).then(function(t){return t.initialize()}).then(function(t){return n.pluginRegistry.push(t),t})},t.prototype.list=function(t){for(var n=[],e="function"==typeof t?t:null,r=0,o=this.pluginRegistry;r<o.length;r++){var i=o[r];(null===e||e(i))&&n.push(i)}return n},t.prototype.each=function(t){for(var n=[],e=0,r=this.pluginRegistry;e<r.length;e++){var o=r[e];n.push(t(o))}return Promise.all(n)},t.prototype.has=function(t){return null!==this.get(t)},t.prototype.get=function(t){return this.pluginRegistry.find(function(n){return n.getPluginId()===t})||null},t}(),PluginExtensionManagerBase=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends$3(n,t),n}(PluginManagerBase),HookablePluginExtensionManager=function(){function t(t,n){this.pluginExtensionManager=t,this.createPluginInstanceCallback=n}return t.prototype.getPluginHost=function(){return this.pluginExtensionManager.getPluginHost()},t.prototype.getPluginDiscovery=function(){return this.pluginExtensionManager.getPluginDiscovery()},t.prototype.createPluginInstance=function(t){return this.pluginExtensionManager.createPluginInstance(t).then(this.createPluginInstanceCallback)},t.prototype.has=function(t){return this.pluginExtensionManager.has(t)},t.prototype.get=function(t){return this.pluginExtensionManager.get(t)},t.prototype.list=function(t){return this.pluginExtensionManager.list(t)},t.prototype.each=function(t){return this.pluginExtensionManager.each(t)},t}();!function(t){t.None="none",t.Initialize="initialize",t.Ready="ready",t.Failed="failed"}(exports.PluginState||(exports.PluginState={}));var __extends$4=function(){var t=function(n,e){return(t=Object.setPrototypeOf||_extends({},[])instanceof Array&&function(t,n){defaults(t,n)}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),PluginBase=function(t){function n(n,e){var r=t.call(this)||this;return r.pluginHost=n,r.pluginContext=e,r.pluginState=exports.PluginState.None,r}return __extends$4(n,t),n.prototype.onBeforeInitialize=function(){var t=this;return Promise.resolve(this).then(function(){return t.validatePluginContext(t.getPluginContext()),t})},n.prototype.onInitialize=function(){return Promise.resolve(this)},n.prototype.onBeforeReady=function(){return Promise.resolve(this)},n.prototype.onReady=function(){return Promise.resolve(this)},n.prototype.onFailed=function(){return Promise.resolve(this)},n.prototype.onError=function(t){return Promise.resolve(this)},n.prototype.createHookEvent=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];switch(t){case"error":return new GenericPluginErrorEvent(t,this,n[0]);default:return new GenericPluginEvent(t,this)}},n.prototype.invokeHook=function(t){for(var n,e=this,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(t.length>0){var i=[],u="on"+(t.charAt(0).toUpperCase()+t.slice(1));if("function"==typeof this[u]&&i.push((n=this)[u].apply(n,r)),this.getPluginState()===exports.PluginState.Ready){var s=this.createHookEvent.apply(this,[t].concat(r));i.push(this.getEventEmitter().emit(s))}return Promise.all(i).then(function(){return e})}return Promise.resolve(this)},n.prototype.validatePluginContext=function(t){if("string"!=typeof t.pluginTypeId)throw new PluginError(this,'Context property "pluginTypeId" should be a string')},n.prototype.initialize=function(){var t=this;return void 0===this.pluginInitPromise?(this.pluginState=exports.PluginState.Initialize,this.pluginInitPromise=Promise.resolve().then(function(){return t.invokeHook("beforeInitialize")}).then(function(){return t.invokeHook("initialize")}).then(function(){return t.invokeHook("beforeReady")}).then(function(){return t.pluginState=exports.PluginState.Ready,t.invokeHook("ready")}).catch(function(n){return t.pluginState=exports.PluginState.Failed,t.invokeHook("failed",n).then(function(){return Promise.reject(n)})})):this.invokeHook("error",new PluginError(this,'Plugin "'+this.getPluginTypeId()+'" is being initialized multiple times')),this.pluginInitPromise},n.prototype.getPluginState=function(){return this.pluginState},n.prototype.getPluginHost=function(){return this.pluginHost},n.prototype.getPluginContext=function(){return this.pluginContext},n.prototype.getPluginTypeId=function(){return this.getPluginContext().pluginTypeId},n.prototype.toString=function(){return this.getPluginTypeId()+":"+this.getPluginId()},n}(vlWidgetEvent.EventSourceBase),__extends$5=function(){var t=function(n,e){return(t=Object.setPrototypeOf||_extends({},[])instanceof Array&&function(t,n){defaults(t,n)}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();!function(t){t.Internal="internal",t.Required="required",t.Optional="optional"}(exports.PluginExtensionConstraint||(exports.PluginExtensionConstraint={})),function(t){t.UnSafe="unsafe",t.Safe="safe"}(exports.PluginExtensionResolveMethod||(exports.PluginExtensionResolveMethod={}));var ExtensiblePluginBase=function(t){function n(n,e){var r=t.call(this,n,e)||this;return r.extensionPromiseCache={},r}return __extends$5(n,t),n.prototype.createHookEvent=function(n){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];switch(n){case"extension":return new GenericPluginExtensionEvent(n,this,e[0]);default:return t.prototype.createHookEvent.apply(this,[n].concat(e))}},n.prototype.onBeforeReady=function(){var n=this;return t.prototype.onBeforeReady.call(this).then(function(){return n.createExtensionsByConstraint(exports.PluginExtensionConstraint.Internal)}).then(function(){return n})},n.prototype.onReady=function(){var n=this;return t.prototype.onReady.call(this).then(function(){return n.createExtensionsByConstraint(exports.PluginExtensionConstraint.Required)}).then(function(){return n.createExtensionsByConstraint(exports.PluginExtensionConstraint.Optional).catch(function(t){return n.invokeHook("error",t)}),n})},n.prototype.onExtension=function(t){var n=this;return Promise.resolve(this).then(function(){var e=t.getPluginId(),r=n.extensionPromiseCache[e]||null;return null!==r&&null!==r.resolve&&(r.resolve(t),delete n.extensionPromiseCache[e]),n})},n.prototype.createExtensionsByConstraint=function(t){var n=this;return Promise.resolve().then(function(){return n.resolveExtensionContexts(t)}).then(function(t){return n.createExtensionsByContexts(t)})},n.prototype.createExtensionsByContexts=function(t){var n=this;return Promise.resolve().then(function(){for(var e=[],r=n.getExtensionManager(),o=0,i=t;o<i.length;o++){var u=i[o],s=r.createPluginInstance(u);e.push(s)}return Promise.all(e)})},n.prototype.getExtensionManager=function(){var t=this;if(void 0===this.extensionManager){var n=this.createExtensionManager();this.extensionManager=new HookablePluginExtensionManager(n,function(n){return t.invokeHook("extension",n).then(function(){return n})})}return this.extensionManager},n.prototype.getExtensionSafe=function(t){var n=this;return Promise.resolve().then(function(){return n.getExtensionManager().get(t)}).then(function(e){if(null===e){var r=n.extensionPromiseCache[t]||null;return null!==r&&null!==r.promise||((r=n.extensionPromiseCache[t]={promise:null,resolve:null}).promise=new Promise(function(t){r.resolve=t})),r.promise}return Promise.resolve(e)})},n.prototype.getExtensionUnsafe=function(t){if(this.getPluginState()!==exports.PluginState.Ready)throw new vlWidgetUtility.Error.RuntimeError('Cannot retrieve "'+t+'" extension as plugin is not ready');var n=this.getExtensionManager().get(t);if(null===n)throw new vlWidgetUtility.Error.RuntimeError('Failed to resolve "'+t+'" extension');return n},n.prototype.getExtension=function(t,n){switch(void 0===n&&(n=exports.PluginExtensionResolveMethod.Safe),n){case exports.PluginExtensionResolveMethod.UnSafe:return this.getExtensionUnsafe(t);default:return this.getExtensionSafe(t)}},n}(PluginBase),__extends$6=function(){var t=function(n,e){return(t=Object.setPrototypeOf||_extends({},[])instanceof Array&&function(t,n){defaults(t,n)}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),ContainerPluginContextProcessorDiscovery=function(){function t(t,n){this.container=t,this.processorFactoryServiceId=n}return t.prototype.getContainer=function(){return this.container},t.prototype.getPluginContextProcessorFactoryServiceId=function(){return this.processorFactoryServiceId},t.prototype.getPluginContextProcessorFactoryFromContainer=function(t){var n=this.getPluginContextProcessorFactoryServiceId();return this.getContainer().getNamed(n,t.pluginTypeId)},t.prototype.resolvePluginContextProcessorFactory=function(t){var n=this;return Promise.resolve().then(function(){return n.getPluginContextProcessorFactoryFromContainer(t)})},t}(),ModulePluginContextProcessorDiscovery=function(t){function n(n,e,r){var o=t.call(this,e,r)||this;return o.moduleManager=n,o}return __extends$6(n,t),n.prototype.getModuleManager=function(){return this.moduleManager},n.prototype.resolvePluginContextProcessorFactory=function(n){var e=this;return Promise.resolve().then(function(){return installPluginContext(e.getModuleManager(),n)}).then(function(n){return t.prototype.resolvePluginContextProcessorFactory.call(e,n)})},n}(ContainerPluginContextProcessorDiscovery),PluginContextPipelineBase=function(){function t(t){this.processorDiscovery=t}return t.prototype.getProcessorDiscovery=function(){return this.processorDiscovery},t.prototype.process=function(t){var n=this;return this.getProcessorDiscovery().resolvePluginContextProcessorFactory(t).then(function(n){return n.createPluginContextProcessor(t)}).then(function(e){return e.process(t,n)})},t}(),PluginContextProcessorBase=function(){function t(){}return t.prototype.onPreProcess=function(t,n){return Promise.resolve(t)},t.prototype.onProcess=function(t,n){return Promise.resolve(t)},t.prototype.onPostProcess=function(t,n){return Promise.resolve(t)},t.prototype.process=function(t,n){var e=this;return Promise.resolve(t).then(function(t){return e.onPreProcess(t,n)}).then(function(t){return e.onProcess(t,n)}).then(function(t){return e.onPostProcess(t,n)})},t}();exports.ContainerPluginDiscovery=ContainerPluginDiscovery,exports.ModulePluginDiscovery=ModulePluginDiscovery,exports.PluginError=PluginError,exports.PluginEventBase=PluginEventBase,exports.GenericPluginEvent=GenericPluginEvent,exports.GenericPluginExtensionEvent=GenericPluginExtensionEvent,exports.GenericPluginErrorEvent=GenericPluginErrorEvent,exports.ExtensiblePluginBase=ExtensiblePluginBase,exports.PluginManagerBase=PluginManagerBase,exports.PluginExtensionManagerBase=PluginExtensionManagerBase,exports.HookablePluginExtensionManager=HookablePluginExtensionManager,exports.PluginBase=PluginBase,exports.ContainerPluginContextProcessorDiscovery=ContainerPluginContextProcessorDiscovery,exports.ModulePluginContextProcessorDiscovery=ModulePluginContextProcessorDiscovery,exports.PluginContextPipelineBase=PluginContextPipelineBase,exports.PluginContextProcessorBase=PluginContextProcessorBase,exports.installPluginModule=installPluginModule,exports.installPluginContext=installPluginContext;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var vlWidgetUtility=require("@govflanders/vl-widget-utility"),vlWidgetEvent=require("@govflanders/vl-widget-event"),extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function __extends(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function installPluginModule(e,t){return Promise.resolve().then(function(){switch(_typeof(t)){case"string":return e.import(t);default:return t}}).then(function(t){return e.install(t)})}function installPluginContext(e,n){return Promise.resolve().then(function(){var t=n.pluginModule||null;return installPluginModule(e,t)}).then(function(){return n})}var ContainerPluginDiscovery=function(){function t(t,e){this.container=t,this.pluginFactoryServiceId=e}return t.prototype.getContainer=function(){return this.container},t.prototype.getPluginFactoryServiceId=function(){return this.pluginFactoryServiceId},t.prototype.getPluginFactoryFromContainer=function(t){var e=this.getPluginFactoryServiceId();return this.getContainer().getNamed(e,t.pluginTypeId)},t.prototype.resolvePluginFactory=function(e){var n=this;return new Promise(function(t){t(n.getPluginFactoryFromContainer(e))})},t}(),ModulePluginDiscovery=function(o){function t(t,e,n){var r=o.call(this,e,n)||this;return r.moduleManager=t,r}return __extends(t,o),t.prototype.getModuleManager=function(){return this.moduleManager},t.prototype.resolvePluginFactory=function(t){var e=this;return Promise.resolve().then(function(){return installPluginContext(e.getModuleManager(),t)}).then(function(t){return o.prototype.resolvePluginFactory.call(e,t)})},t}(ContainerPluginDiscovery),PluginError=function(o){function t(t,e,n){void 0===n&&(n=null);var r=o.call(this,e,n)||this;return r.plugin=t,r}return __extends(t,o),t.prototype.getPlugin=function(){return this.plugin},t}(vlWidgetUtility.Error.RuntimeError),PluginEventBase=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(vlWidgetEvent.EventBase),GenericPluginEvent=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PluginEventBase),GenericPluginExtensionEvent=function(i){function t(t,e,n,r){void 0===r&&(r=vlWidgetEvent.EventScope.Broadcast);var o=i.call(this,t,e,r)||this;return o.pluginExtension=n,o}return __extends(t,i),t.prototype.getExtension=function(){return this.pluginExtension},t}(PluginEventBase),GenericPluginErrorEvent=function(i){function t(t,e,n,r){void 0===r&&(r=vlWidgetEvent.EventScope.Broadcast);var o=i.call(this,t,e,r)||this;return o.error=n,o}return __extends(t,i),t.prototype.getError=function(){return this.error},t}(PluginEventBase),PluginManagerBase=function(){function t(t,e){this.pluginHost=t,this.pluginDiscovery=e,this.pluginRegistry=[]}return t.prototype.getPluginHost=function(){return this.pluginHost},t.prototype.getPluginDiscovery=function(){return this.pluginDiscovery},t.prototype.createPluginInstance=function(n){var r=this;return this.getPluginDiscovery().resolvePluginFactory(n).then(function(t){var e=r.getPluginHost();return t.createPluginInstance(e,n)}).then(function(t){return t.initialize()}).then(function(t){return r.pluginRegistry.push(t),t})},t.prototype.list=function(t){for(var e=[],n="function"==typeof t?t:null,r=0,o=this.pluginRegistry;r<o.length;r++){var i=o[r];null!==n&&!n(i)||e.push(i)}return e},t.prototype.each=function(t){for(var e=[],n=0,r=this.pluginRegistry;n<r.length;n++){var o=r[n];e.push(t(o))}return Promise.all(e)},t.prototype.has=function(t){return null!==this.get(t)},t.prototype.get=function(e){return this.pluginRegistry.find(function(t){return t.getPluginId()===e})||null},t}(),PluginExtensionManagerBase=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PluginManagerBase),HookablePluginExtensionManager=function(){function t(t,e){this.pluginExtensionManager=t,this.createPluginInstanceCallback=e}return t.prototype.getPluginHost=function(){return this.pluginExtensionManager.getPluginHost()},t.prototype.getPluginDiscovery=function(){return this.pluginExtensionManager.getPluginDiscovery()},t.prototype.createPluginInstance=function(t){return this.pluginExtensionManager.createPluginInstance(t).then(this.createPluginInstanceCallback)},t.prototype.has=function(t){return this.pluginExtensionManager.has(t)},t.prototype.get=function(t){return this.pluginExtensionManager.get(t)},t.prototype.list=function(t){return this.pluginExtensionManager.list(t)},t.prototype.each=function(t){return this.pluginExtensionManager.each(t)},t}();!function(t){t.None="none",t.Initialize="initialize",t.Ready="ready",t.Failed="failed"}(exports.PluginState||(exports.PluginState={}));var PluginBase=function(r){function t(t,e){var n=r.call(this)||this;return n.pluginHost=t,n.pluginContext=e,n.pluginState=exports.PluginState.None,n}return __extends(t,r),t.prototype.onBeforeInitialize=function(){var t=this;return Promise.resolve(this).then(function(){return t.validatePluginContext(t.getPluginContext()),t})},t.prototype.onInitialize=function(){return Promise.resolve(this)},t.prototype.onBeforeReady=function(){return Promise.resolve(this)},t.prototype.onReady=function(){return Promise.resolve(this)},t.prototype.onFailed=function(){return Promise.resolve(this)},t.prototype.onError=function(t){return Promise.resolve(this)},t.prototype.createHookEvent=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];switch(t){case"error":return new GenericPluginErrorEvent(t,this,e[0]);default:return new GenericPluginEvent(t,this)}},t.prototype.invokeHook=function(t){for(var e,n=this,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(0<t.length){var i=[],s="on"+(t.charAt(0).toUpperCase()+t.slice(1));if("function"==typeof this[s]&&i.push((e=this)[s].apply(e,r)),this.getPluginState()===exports.PluginState.Ready){var u=this.createHookEvent.apply(this,[t].concat(r));i.push(this.getEventEmitter().emit(u))}return Promise.all(i).then(function(){return n})}return Promise.resolve(this)},t.prototype.validatePluginContext=function(t){if("string"!=typeof t.pluginTypeId)throw new PluginError(this,'Context property "pluginTypeId" should be a string')},t.prototype.initialize=function(){var e=this;return void 0===this.pluginInitPromise?(this.pluginState=exports.PluginState.Initialize,this.pluginInitPromise=Promise.resolve().then(function(){return e.invokeHook("beforeInitialize")}).then(function(){return e.invokeHook("initialize")}).then(function(){return e.invokeHook("beforeReady")}).then(function(){return e.pluginState=exports.PluginState.Ready,e.invokeHook("ready")}).catch(function(t){return e.pluginState=exports.PluginState.Failed,e.invokeHook("failed",t).then(function(){return Promise.reject(t)})})):this.invokeHook("error",new PluginError(this,'Plugin "'+this.getPluginTypeId()+'" is being initialized multiple times')),this.pluginInitPromise},t.prototype.getPluginState=function(){return this.pluginState},t.prototype.getPluginHost=function(){return this.pluginHost},t.prototype.getPluginContext=function(){return this.pluginContext},t.prototype.getPluginTypeId=function(){return this.getPluginContext().pluginTypeId},t.prototype.toString=function(){return this.getPluginTypeId()+":"+this.getPluginId()},t}(vlWidgetEvent.EventSourceBase);!function(t){t.Internal="internal",t.Required="required",t.Optional="optional"}(exports.PluginExtensionConstraint||(exports.PluginExtensionConstraint={})),function(t){t.UnSafe="unsafe",t.Safe="safe"}(exports.PluginExtensionResolveMethod||(exports.PluginExtensionResolveMethod={}));var ExtensiblePluginBase=function(r){function t(t,e){var n=r.call(this,t,e)||this;return n.extensionPromiseCache={},n}return __extends(t,r),t.prototype.createHookEvent=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];switch(t){case"extension":return new GenericPluginExtensionEvent(t,this,e[0]);default:return r.prototype.createHookEvent.apply(this,[t].concat(e))}},t.prototype.onBeforeReady=function(){var t=this;return r.prototype.onBeforeReady.call(this).then(function(){return t.createExtensionsByConstraint(exports.PluginExtensionConstraint.Internal)}).then(function(){return t})},t.prototype.onReady=function(){var e=this;return r.prototype.onReady.call(this).then(function(){return e.createExtensionsByConstraint(exports.PluginExtensionConstraint.Required)}).then(function(){return e.createExtensionsByConstraint(exports.PluginExtensionConstraint.Optional).catch(function(t){return e.invokeHook("error",t)}),e})},t.prototype.onExtension=function(n){var r=this;return Promise.resolve(this).then(function(){var t=n.getPluginId(),e=r.extensionPromiseCache[t]||null;return null!==e&&null!==e.resolve&&(e.resolve(n),delete r.extensionPromiseCache[t]),r})},t.prototype.createExtensionsByConstraint=function(t){var e=this;return Promise.resolve().then(function(){return e.resolveExtensionContexts(t)}).then(function(t){return e.createExtensionsByContexts(t)})},t.prototype.createExtensionsByContexts=function(s){var u=this;return Promise.resolve().then(function(){for(var t=[],e=u.getExtensionManager(),n=0,r=s;n<r.length;n++){var o=r[n],i=e.createPluginInstance(o);t.push(i)}return Promise.all(t)})},t.prototype.getExtensionManager=function(){var e=this;if(void 0===this.extensionManager){var t=this.createExtensionManager();this.extensionManager=new HookablePluginExtensionManager(t,function(t){return e.invokeHook("extension",t).then(function(){return t})})}return this.extensionManager},t.prototype.getExtensionSafe=function(n){var r=this;return Promise.resolve().then(function(){return r.getExtensionManager().get(n)}).then(function(t){if(null!==t)return Promise.resolve(t);var e=r.extensionPromiseCache[n]||null;return null!==e&&null!==e.promise||((e=r.extensionPromiseCache[n]={promise:null,resolve:null}).promise=new Promise(function(t){e.resolve=t})),e.promise})},t.prototype.getExtensionUnsafe=function(t){if(this.getPluginState()!==exports.PluginState.Ready)throw new vlWidgetUtility.Error.RuntimeError('Cannot retrieve "'+t+'" extension as plugin is not ready');var e=this.getExtensionManager().get(t);if(null===e)throw new vlWidgetUtility.Error.RuntimeError('Failed to resolve "'+t+'" extension');return e},t.prototype.getExtension=function(t,e){switch(void 0===e&&(e=exports.PluginExtensionResolveMethod.Safe),e){case exports.PluginExtensionResolveMethod.UnSafe:return this.getExtensionUnsafe(t);default:return this.getExtensionSafe(t)}},t}(PluginBase),ContainerPluginContextProcessorDiscovery=function(){function t(t,e){this.container=t,this.processorFactoryServiceId=e}return t.prototype.getContainer=function(){return this.container},t.prototype.getPluginContextProcessorFactoryServiceId=function(){return this.processorFactoryServiceId},t.prototype.getPluginContextProcessorFactoryFromContainer=function(t){var e=this.getPluginContextProcessorFactoryServiceId();return this.getContainer().getNamed(e,t.pluginTypeId)},t.prototype.resolvePluginContextProcessorFactory=function(t){var e=this;return Promise.resolve().then(function(){return e.getPluginContextProcessorFactoryFromContainer(t)})},t}(),ModulePluginContextProcessorDiscovery=function(o){function t(t,e,n){var r=o.call(this,e,n)||this;return r.moduleManager=t,r}return __extends(t,o),t.prototype.getModuleManager=function(){return this.moduleManager},t.prototype.resolvePluginContextProcessorFactory=function(t){var e=this;return Promise.resolve().then(function(){return installPluginContext(e.getModuleManager(),t)}).then(function(t){return o.prototype.resolvePluginContextProcessorFactory.call(e,t)})},t}(ContainerPluginContextProcessorDiscovery),PluginContextPipelineBase=function(){function t(t){this.processorDiscovery=t}return t.prototype.getProcessorDiscovery=function(){return this.processorDiscovery},t.prototype.process=function(e){var n=this;return this.getProcessorDiscovery().resolvePluginContextProcessorFactory(e).then(function(t){return t.createPluginContextProcessor(e)}).then(function(t){return t.process(e,n)})},t}(),PluginContextProcessorBase=function(){function t(){}return t.prototype.onPreProcess=function(t,e){return Promise.resolve(t)},t.prototype.onProcess=function(t,e){return Promise.resolve(t)},t.prototype.onPostProcess=function(t,e){return Promise.resolve(t)},t.prototype.process=function(t,e){var n=this;return Promise.resolve(t).then(function(t){return n.onPreProcess(t,e)}).then(function(t){return n.onProcess(t,e)}).then(function(t){return n.onPostProcess(t,e)})},t}();exports.ContainerPluginContextProcessorDiscovery=ContainerPluginContextProcessorDiscovery,exports.ContainerPluginDiscovery=ContainerPluginDiscovery,exports.ExtensiblePluginBase=ExtensiblePluginBase,exports.GenericPluginErrorEvent=GenericPluginErrorEvent,exports.GenericPluginEvent=GenericPluginEvent,exports.GenericPluginExtensionEvent=GenericPluginExtensionEvent,exports.HookablePluginExtensionManager=HookablePluginExtensionManager,exports.ModulePluginContextProcessorDiscovery=ModulePluginContextProcessorDiscovery,exports.ModulePluginDiscovery=ModulePluginDiscovery,exports.PluginBase=PluginBase,exports.PluginContextPipelineBase=PluginContextPipelineBase,exports.PluginContextProcessorBase=PluginContextProcessorBase,exports.PluginError=PluginError,exports.PluginEventBase=PluginEventBase,exports.PluginExtensionManagerBase=PluginExtensionManagerBase,exports.PluginManagerBase=PluginManagerBase,exports.installPluginContext=installPluginContext,exports.installPluginModule=installPluginModule;
{
"name": "@govflanders/vl-widget-plugin",
"version": "1.1.29",
"version": "1.1.30",
"license": "MIT",

@@ -19,6 +19,5 @@ "contributors": [

"scripts": {
"build": "rimraf types && rimraf dist && tsc && rollup -c rollup.config.js && rimraf compiled",
"prepublishOnly": "export NODE_ENV=production && yarn run test && yarn run build",
"test:lint": "tslint --project . 'src/**/*.ts'",
"test": "yarn run test:lint"
"build": "npx yarn clean && npx rollup -c rollup.config.js",
"clean": "npx rimraf dist && npx rimraf types",
"prepublishOnly": "export NODE_ENV=production && npx yarn build"
},

@@ -28,23 +27,7 @@ "main": "dist/index.js",

"dependencies": {
"@govflanders/vl-widget-dependency-injection": "^1.1.29",
"@govflanders/vl-widget-event": "^1.1.29",
"@govflanders/vl-widget-module": "^1.1.29",
"@govflanders/vl-widget-utility": "^1.1.29"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
"babel-plugin-transform-es3-property-literals": "^6.22.0",
"babel-preset-es2015-ie-native-modules": "^6.6.2",
"rimraf": "^2.6.2",
"rollup": "^0.55.3",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^3.0.0",
"tslint": "^5.9.1",
"tslint-config-airbnb": "^5.6.0",
"typescript": "^3.0.0",
"yarn": "^1.3.2"
"@govflanders/vl-widget-dependency-injection": "^1.1.30",
"@govflanders/vl-widget-event": "^1.1.30",
"@govflanders/vl-widget-module": "^1.1.30",
"@govflanders/vl-widget-utility": "^1.1.30"
}
}

@@ -0,0 +0,0 @@ import { PluginModule } from './module';

@@ -0,0 +0,0 @@ import { ServiceContainer } from '@govflanders/vl-widget-dependency-injection';

@@ -0,0 +0,0 @@ import { Error } from '@govflanders/vl-widget-utility';

@@ -0,0 +0,0 @@ import { Event, EventBase, EventScope } from '@govflanders/vl-widget-event';

@@ -0,0 +0,0 @@ import { PluginContext } from './context';

@@ -0,0 +0,0 @@ import { PluginContext } from './context';

@@ -0,0 +0,0 @@ /**

@@ -12,3 +12,3 @@ export * from './context';

export * from './plugin';
export * from './processor/index';
export * from './processor';
export * from './registry';

@@ -15,0 +15,0 @@ export * from './runtime';

@@ -0,0 +0,0 @@ import { Plugin } from './plugin';

@@ -0,0 +0,0 @@ import { PluginContext } from './context';

@@ -0,0 +0,0 @@ import { Module as ModuleBase } from '@govflanders/vl-widget-module';

@@ -0,0 +0,0 @@ import { EventSourceBase, EventEmitter } from '@govflanders/vl-widget-event';

@@ -0,0 +0,0 @@ import { PluginContext } from '../context';

@@ -0,0 +0,0 @@ import { PluginContext } from '../context';

@@ -0,0 +0,0 @@ export * from './discovery';

@@ -0,0 +0,0 @@ import { PluginContext } from '../context';

@@ -0,0 +0,0 @@ import { PluginContext } from '../context';

@@ -0,0 +0,0 @@ import { PluginLookup } from './lookup';

@@ -0,0 +0,0 @@ import { ServiceContainerAware } from '@govflanders/vl-widget-dependency-injection';

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ import { ModuleManager } from '@govflanders/vl-widget-module';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc