Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@govflanders/vl-widget-plugin

Package Overview
Dependencies
Maintainers
19
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.18 to 1.1.19

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.getPluginId=function(){return this.getPluginTypeId()},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.validatePluginContext=function(n){if(t.prototype.validatePluginContext.call(this,n),"string"!=typeof n.pluginVersion)throw new PluginError(this,'Context property "pluginVersion" should be a string')},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"),_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.getPluginId=function(){return this.getPluginTypeId()},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;
{
"name": "@govflanders/vl-widget-plugin",
"version": "1.1.18",
"version": "1.1.19",
"license": "MIT",

@@ -27,6 +27,6 @@ "contributors": [

"dependencies": {
"@govflanders/vl-widget-dependency-injection": "^1.1.18",
"@govflanders/vl-widget-event": "^1.1.18",
"@govflanders/vl-widget-module": "^1.1.18",
"@govflanders/vl-widget-utility": "^1.1.18"
"@govflanders/vl-widget-dependency-injection": "^1.1.19",
"@govflanders/vl-widget-event": "^1.1.19",
"@govflanders/vl-widget-module": "^1.1.19",
"@govflanders/vl-widget-utility": "^1.1.19"
},

@@ -33,0 +33,0 @@ "devDependencies": {

@@ -140,6 +140,2 @@ import { PluginContext } from './context';

*/
protected validatePluginContext(pluginContext: PluginContextType): void;
/**
* {@inheritdoc}
*/
protected createHookEvent(hook: string, ...args: any[]): PluginEvent;

@@ -146,0 +142,0 @@ /**

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