web-node 1.0.444 → 1.0.447

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from './configurator';
2
2
  export * from './pluginAPI';
3
- import { ProcedureFunction } from 'clientnode/type';
4
- export declare const main: ProcedureFunction;
3
+ export declare const main: () => Promise<void>;
5
4
  export default main;
package/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  // -*- coding: utf-8 -*-
3
- 'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(module===eval('require.main'))module.paths.unshift('/application/node_modules');(()=>{"use strict";var __webpack_modules__=[(e,_,r)=>{r.d(_,{D:()=>m,Z:()=>D});var t=r(5),n=r.n(t),a=r(6),o=r.n(a),i=r(7),c=r.n(i),l=r(1);const u=JSON.parse('{"name":"web-node","version":"1.0.444","description":"High level javaScript backend plugin system and configuration merger.","keywords":["web","backend","api","plugin","management"],"homepage":"https://torben.website/web-node","bugs":{"email":"info@torben.website","url":"https://github.com/thaibault/web-node/issues"},"license":"CC-BY-3.0","author":{"name":"Torben Sickert","email":"info@torben.website","url":"https://torben.website"},"files":["configurator.d.ts","index.d.ts","index.js","pluginAPI.d.ts","type.d.ts","unixCrypt.d.ts","unixCrypt.js"],"bin":{"web-node":"index.js"},"repository":{"type":"git","url":"https://github.com/thaibault/web-node.git"},"scripts":{"build":"yarn build:types; yarn build:plain","build:plain":"weboptimizer build","build:types":"weboptimizer build:types","check":"yarn check:types; yarn lint","check:types":"weboptimizer check:types","clear":"weboptimizer clear","document":"weboptimizer document","lint":"weboptimizer lint","prepare":"yarn build","serve":"weboptimizer build && yarn serve","start":"./index.js \'{plugin: {hotReloading: true}}\'","prepare:test":"yarn clear && cd dummyPlugin && yarn build && cd ..","test":"yarn prepare:test && weboptimizer test","test:coverage":"yarn prepare:test && weboptimizer test:coverage","test:coverage:report":"yarn prepare:test && weboptimizer test:coverage:report","update":"yarn version --patch && yarn publish","update:documentation":"documentation-website","watch":"weboptimizer build --watch"},"dependencies":{"@types/webpack":"https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz"},"devDependencies":{"@babel/cli":"*","@babel/eslint-parser":"*","@types/node":"*","@typescript-eslint/eslint-plugin":"*","@typescript-eslint/parser":"*","clientnode":"*","documentation-website":"*","eslint":"*","eslint-config-google":"*","eslint-plugin-jsdoc":"*","jest":"*","jsdoc":"*","weboptimizer":"*"},"peerDependencies":{"@babel/runtime":"*","clientnode":"*"},"peerDependenciesMeta":{"@babel/runtime":{"optional":true}},"engines":{"node":">=17","npm":">=7"},"resolutions":{"@types/webpack":"https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz","colors":"1.4.0"},"sideEffects":true,"documentationWebsite":{"name":"web-node","trackingCode":"UA-40192634-9"},"webNode":{"core":{"context":{"path":"./","type":"relative"},"debug":false,"encoding":"utf8","interDependencies":{},"name":"web-node","plugin":{"configuration":{"fileNames":["package.json","private-package.json"],"propertyNames":["webNode","webnode","web-node"]},"directories":{"external":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-]+?)-?[wW]eb-?[nN]ode-?[pP]lugin$","path":{"__evaluate__":"`${currentPath}/node_modules/`"}},"internal":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-_].*)$","path":{"__evaluate__":"`${currentPath}/plugins/`"}}},"hotReloading":false}}},"webOptimizer":{"assetPattern":{"javaScript":{"includeFilePathRegularExpression":"^(.+/)?index\\\\.js$","pattern":{"#":"This is how we can make our main exported artefact executable.","__evaluate__":"`#!/usr/bin/env node\\n// -*- coding: utf-8 -*-\\n${self.generic.assetPattern.javaScript.pattern}if(module===eval(\'require.main\'))module.paths.unshift(\'/application/node_modules\');{1}`"}}},"exportFormat":{"external":"commonjs2","self":"commonjs2"},"injection":{"entry":{"__evaluate__":"2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith(\'test\') ? {testBundle: \'test\'} : {index: \'./index.ts\', unixCrypt: \'./unixCrypt.ts\'}"}},"module":{"optimizer":{"babelMinify":{"#":"To provide a logging output we need to exclude this feature.","__evaluate__":"self.debug ? {bundle: null, module: null} : {bundle: {transform: {removeConsole: false}}, module: {removeConsole: false}}"}}},"targetTechnology":{"boilerplate":"node","payload":"node"}}}');var s,p;for(u.webNode.core.context={path:"/",type:"relative"};u.webNode.core.context.path=c().resolve(u.webNode.core.context.path,"../../"),"node_modules"===c().basename(c().dirname(u.webNode.core.context.path)););if("/"===u.webNode.core.context.path||"node_modules"===c().basename(c().dirname(process.cwd()))||".staging"===c().basename(c().dirname(process.cwd()))&&"node_modules"===c().basename(c().dirname(c().dirname(process.cwd()))))u.webNode.core.context.path=process.cwd();else try{(0,a.lstatSync)(c().join(process.cwd(),"node_modules")).isSymbolicLink()&&(u.webNode.core.context.path=process.cwd())}catch(e){}var d={name:"main"};try{d=(0,t.currentRequire)(c().join(u.webNode.core.context.path,"package"))}catch(e){u.webNode.core.context.path=process.cwd()}var E=(null==(s=d.documentationWebsite)?void 0:s.name)||d.name||"main",f=d.webNode||((p={})[E]={name:E,package:d},p);u.webNode.core.name=u.documentationWebsite.name;var b=new Date,P={currentPath:process.cwd(),fileSystem:o(),path:c(),PluginAPI:l.ZP,require:t.currentRequire,Tools:n(),webNodePath:"/",now:b,nowUTCTimestamp:n().numberGetUTCTimestamp(b)},m=n().evaluateDynamicData(u.webNode,P);if(delete u.webNode,n().extend(!0,n().modifyObject(m,f),f),2<process.argv.length){var O=n().stringParseEncodedObject(process.argv[process.argv.length-1],m,"configuration");n().isPlainObject(O)&&(n().extend(!0,n().modifyObject(m,O),O),m.core.runtimeConfiguration=O)}(m=n().evaluateDynamicData(n().removeKeysInEvaluation(m),P)).name=E,m.core.package=u;const D=m},(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{var __dirname="/";__webpack_require__.d(__webpack_exports__,{Jf:()=>currentRequire,Sw:()=>PluginAPI,ZP:()=>__WEBPACK_DEFAULT_EXPORT__});var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3),_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__),child_process__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(8),child_process__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_2__),clientnode__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(5),clientnode__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(clientnode__WEBPACK_IMPORTED_MODULE_3__),fs__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(6),fs__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_4__),module__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(9),module__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(module__WEBPACK_IMPORTED_MODULE_5__),path__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(7),path__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_6__),_configurator__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(0);function _createForOfIteratorHelperLoose(e,_){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||_&&e&&"number"==typeof e.length){r&&(e=r);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,_){if(e){if("string"==typeof e)return _arrayLikeToArray(e,_);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,_):void 0}}function _arrayLikeToArray(e,_){(null==_||_>e.length)&&(_=e.length);for(var r=0,t=Array(_);r<_;r++)t[r]=e[r];return t}var currentRequire=eval("require"),oldResolveFilename=module__WEBPACK_IMPORTED_MODULE_5__.Module._resolveFilename;module__WEBPACK_IMPORTED_MODULE_5__.Module._resolveFilename=function(e,_,r){return oldResolveFilename("web-node"===e?currentRequire.main.id:e,_,r)};var PluginAPI=function(){function e(){}return e.callStack=function(){var _=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark((function _(r,t,n,a){var o,i,c,l,u,s,p,d,E,f,b=arguments;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:if(void 0===a&&(a=null),!n.core.plugin.hotReloading){_.next=15;break}if(!(o=e.hotReloadConfigurationFile(t,n.core.plugin.configuration.propertyNames)).length){_.next=10;break}return n.core.debug&&console.info('Configuration for "'+o.map((function(e){return e.name})).join('", "')+'" has been changed: reloading initialized.'),_.next=7,e.callStack("preConfigurationLoaded",t,n,n,o);case 7:return e.loadConfigurations(t,n),_.next=10,e.callStack("postConfigurationLoaded",t,n,n,o);case 10:if(!(i=e.hotReloadAPIFile(t)).length){_.next=15;break}return n.core.debug&&console.info('API-file for "'+i.map((function(e){return e.name})).join('", "')+'" has been changed: reloading initialized.'),_.next=15,e.callStack("apiFileReloaded",t,n,i);case 15:for(c=b.length,l=Array(4<c?c-4:0),u=4;u<c;u++)l[u-4]=b[u];s=_createForOfIteratorHelperLoose(t);case 17:if((p=s()).done){_.next=36;break}if(!(d=p.value).api){_.next=34;break}return E=void 0,_.prev=21,_.next=24,d.api.apply(d,[r,a].concat(l.concat(r.endsWith("ConfigurationLoaded")?[]:n,[t])));case 24:E=_.sent,_.next=32;break;case 27:if(_.prev=27,_.t0=_.catch(21),null==(f=_.t0.message)||!f.startsWith("NotImplemented:")){_.next=31;break}return _.abrupt("continue",34);case 31:throw new Error('Plugin "'+d.internalName+'" '+(d.internalName===d.name?"":"("+d.name+") ")+"throws: "+clientnode__WEBPACK_IMPORTED_MODULE_3___default().represent(_.t0)+' during asynchronous hook "'+r+'".');case 32:a=E,n.core.debug&&console.info('Ran asynchronous hook "'+r+'" for plugin "'+d.name+'".');case 34:_.next=17;break;case 36:return _.abrupt("return",a);case 37:case"end":return _.stop()}}),_,null,[[21,27]])})));return function(){return _.apply(this,arguments)}}(),e.callStackSynchronous=function(e,_,r,t){void 0===t&&(t=null);for(var n=arguments.length,a=Array(4<n?n-4:0),o=4;o<n;o++)a[o-4]=arguments[o];for(var i,c,l=_createForOfIteratorHelperLoose(_);!(i=l()).done;)if((c=i.value).api){var u=void 0;try{u=c.api.apply(c,[e,t].concat(a.concat(r,_)))}catch(_){var s;if(null!=(s=_.message)&&s.startsWith("NotImplemented:"))continue;throw new Error('Plugin "'+c.internalName+'" '+(c.internalName===c.name?"":"("+c.name+") ")+"throws: "+clientnode__WEBPACK_IMPORTED_MODULE_3___default().represent(_)+' during synchronous hook "'+e+'".')}t=u,r.core.debug&&console.info('Ran synchronous hook "'+e+'" for plugin "'+c.name+'".')}return t},e.determineInternalName=function(e,_){return clientnode__WEBPACK_IMPORTED_MODULE_3___default().stringDelimitedToCamelCase(e.replace(_,(function(e,_){return"string"==typeof _?_:e})))},e.evaluateConfiguration=function(_){for(var r={},t=0,n=Object.entries(_);t<n.length;t++){var a=n[t],o=a[0],i=a[1];i.package&&(r[o]=i.package,delete i.package)}var c=new Date;_=clientnode__WEBPACK_IMPORTED_MODULE_3___default().evaluateDynamicData(clientnode__WEBPACK_IMPORTED_MODULE_3___default().removeKeysInEvaluation(_),{currentPath:process.cwd(),fileSystem:fs__WEBPACK_IMPORTED_MODULE_4___default(),path:path__WEBPACK_IMPORTED_MODULE_6___default(),PluginAPI:e,require:currentRequire,Tools:clientnode__WEBPACK_IMPORTED_MODULE_3___default(),webNodePath:__dirname,now:c,nowUTCTimestamp:clientnode__WEBPACK_IMPORTED_MODULE_3___default().numberGetUTCTimestamp(c)});for(var l=0,u=Object.entries(r);l<u.length;l++){var s=u[l],p=s[0],d=s[1];_[p].package=d}return _},e.hotReloadAPIFile=function(_){for(var r,t,n=[],a=_createForOfIteratorHelperLoose(e.hotReloadFiles("api","scope",_));!(r=a()).done;)if((t=r.value).oldScope){for(var o=0,i=Object.entries(t.oldScope);o<i.length;o++){var c=i[o],l=c[0],u=c[1];Object.prototype.hasOwnProperty.call(t.newScope,l)&&!clientnode__WEBPACK_IMPORTED_MODULE_3___default().isFunction(t.newScope[l])&&(t.newScope[l]=u)}n.push(t.plugin)}return n},e.hotReloadConfigurationFile=function(_,r){for(var t,n,a=[],o=_createForOfIteratorHelperLoose(e.hotReloadFiles("configuration","packageConfiguration",_));!(t=o()).done;)(n=t.value).plugin.configuration=e.loadConfiguration(n.plugin.internalName,n.plugin.packageConfiguration,r),a.push(n.plugin);return a},e.hotReloadFiles=function(_,r,t){for(var n,a,o=[],i=_createForOfIteratorHelperLoose(t);!(n=i()).done;)if((a=n.value)[r])for(var c,l=0,u=_createForOfIteratorHelperLoose(a[_+"FilePaths"]);!(c=u()).done;){var s=c.value,p=(0,fs__WEBPACK_IMPORTED_MODULE_4__.statSync)(s).mtime.getTime();if(a[_+"FileLoadTimestamps"][l]<p){delete currentRequire.cache[currentRequire.resolve(s)];var d=a[r];a[r]=e.loadFile(s,a.name,a[r]),o.push({newScope:a[r],oldScope:d,plugin:a,target:r})}a[_+"FileLoadTimestamps"][l]=p,l+=1}return o},e.load=function(){var _=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark((function _(r,t,n,a,o,i){var c,l,u,s,p,d,E,f;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:void 0===i&&(i="utf8"),c=[],l={},u=_createForOfIteratorHelperLoose(a.fileNames);case 4:if((s=u()).done){_.next=14;break}return p=s.value,d=(0,path__WEBPACK_IMPORTED_MODULE_6__.resolve)(o,p),_.next=9,clientnode__WEBPACK_IMPORTED_MODULE_3___default().isFile(d);case 9:if(!_.sent){_.next=12;break}clientnode__WEBPACK_IMPORTED_MODULE_3___default().extend(!0,l,e.loadFile(d,r)),c.push(d);case 12:_.next=4;break;case 14:if(E=["index.js"],!Object.keys(l).length){_.next=22;break}return t=l.webNodeInternalName||t,(f=e.loadConfiguration(t,l,a.propertyNames))[t].package.main&&(E[0]=f[t].package.main),_.next=21,e.loadAPI(E,o,r,t,n,i,f,c);case 21:return _.abrupt("return",_.sent);case 22:return _.next=24,e.loadAPI(E,o,r,t,n,i);case 24:return _.abrupt("return",_.sent);case 25:case"end":return _.stop()}}),_)})));return function(){return _.apply(this,arguments)}}(),e.loadAPI=function(){var _=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark((function _(r,t,n,a,o,i,c,l){var u,s,p,d,E,f,b,P,m,O,D;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:return void 0===i&&(i="utf8"),void 0===c&&(c=null),void 0===l&&(l=[]),E=(0,path__WEBPACK_IMPORTED_MODULE_6__.resolve)(t,r[0]),_.next=6,clientnode__WEBPACK_IMPORTED_MODULE_3___default().isFile(E);case 6:if(_.sent){_.next=21;break}f=_createForOfIteratorHelperLoose((0,fs__WEBPACK_IMPORTED_MODULE_4__.readdirSync)(t));case 8:if((b=f()).done){_.next=21;break}if(P=b.value,_.t0=!l.map((function(e){return(0,path__WEBPACK_IMPORTED_MODULE_6__.basename)(e)})).includes(P),!_.t0){_.next=15;break}return _.next=14,clientnode__WEBPACK_IMPORTED_MODULE_3___default().isFile((0,path__WEBPACK_IMPORTED_MODULE_6__.resolve)(t,P));case 14:_.t0=_.sent;case 15:if(!_.t0){_.next=19;break}if(E=(0,path__WEBPACK_IMPORTED_MODULE_6__.resolve)(t,E),!["index","main"].includes((0,path__WEBPACK_IMPORTED_MODULE_6__.basename)(E,(0,path__WEBPACK_IMPORTED_MODULE_6__.extname)(P)))){_.next=19;break}return _.abrupt("break",21);case 19:_.next=8;break;case 21:if(m=null,O=!1,_.t1=c&&(1<Object.keys(c).length||c[a]&&1<Object.keys(c[a]).length),!_.t1){_.next=28;break}return _.next=27,clientnode__WEBPACK_IMPORTED_MODULE_3___default().isFile(E);case 27:_.t1=_.sent;case 28:if(!_.t1){_.next=30;break}E.endsWith(".js")?(O=!0,m=function(_,r){for(var t,a=arguments.length,i=Array(2<a?a-2:0),c=2;c<a;c++)i[c-2]=arguments[c];if(_ in o[n].scope)return(t=o[n].scope)[_].apply(t,[r].concat(i,[e]));throw new Error('NotImplemented: API method "'+_+'" is not implemented in plugin "'+n+'".')}):m=function(e){for(var _=arguments.length,r=Array(1<_?_-1:0),t=1;t<_;t++)r[t-1]=arguments[t];var n=(0,child_process__WEBPACK_IMPORTED_MODULE_2__.spawnSync)(E,clientnode__WEBPACK_IMPORTED_MODULE_3___default().arrayMake(r),{cwd:process.cwd(),encoding:i,env:process.env,input:clientnode__WEBPACK_IMPORTED_MODULE_3___default().represent(e),shell:!0,stdio:"inherit"});return n.stdout.startsWith("##")&&n.stdout.endsWith("##")&&(e=JSON.parse(e)),e};case 30:return D=null!==(u=c)&&void 0!==u?u:((s={})[a]={package:{}},s),_.abrupt("return",{api:m,apiFileLoadTimestamps:m?[(0,fs__WEBPACK_IMPORTED_MODULE_4__.statSync)(E).mtime.getTime()]:[],apiFilePaths:m?[E]:[],configuration:D,configurationFilePaths:l,configurationFileLoadTimestamps:l.map((function(e){return(0,fs__WEBPACK_IMPORTED_MODULE_4__.statSync)(e).mtime.getTime()})),dependencies:(null==(p=D[a])?void 0:p.dependencies)||[],internalName:a,name:n,packageConfiguration:null==(d=D[a])?void 0:d.package,path:t,scope:O?e.loadFile(E,n):null});case 32:case"end":return _.stop()}}),_)})));return function(){return _.apply(this,arguments)}}(),e.loadConfiguration=function(e,_,r){for(var t,n,a,o=clientnode__WEBPACK_IMPORTED_MODULE_3___default().removeKeyPrefixes(clientnode__WEBPACK_IMPORTED_MODULE_3___default().copy(_)),i=((t={})[e]={package:o},t),c=_createForOfIteratorHelperLoose(r);!(n=c()).done;)if(_[a=n.value]){clientnode__WEBPACK_IMPORTED_MODULE_3___default().extend(!0,i,_[a]),delete i[e].package[a];break}return i},e.loadConfigurations=function(_,r){for(var t=0,n=Object.keys(r);t<n.length;t++)delete r[n[t]];clientnode__WEBPACK_IMPORTED_MODULE_3___default().extend(r,clientnode__WEBPACK_IMPORTED_MODULE_3___default().copy(_configurator__WEBPACK_IMPORTED_MODULE_7__.Z));for(var a,o,i=_createForOfIteratorHelperLoose(_);!(a=i()).done;)if((o=a.value).configuration){var c=clientnode__WEBPACK_IMPORTED_MODULE_3___default().copy(o.configuration);clientnode__WEBPACK_IMPORTED_MODULE_3___default().extend(!0,clientnode__WEBPACK_IMPORTED_MODULE_3___default().modifyObject(r,c),c),r.core.runtimeConfiguration&&clientnode__WEBPACK_IMPORTED_MODULE_3___default().extend(!0,r,r.core.runtimeConfiguration)}return e.evaluateConfiguration(r)},e.loadFile=function(e,_,r,t){var n,a;void 0===r&&(r=null),void 0===t&&(t=!0);try{n=currentRequire.resolve(e)}catch(e){}n&&n in currentRequire.cache&&delete currentRequire.cache[n];try{a=currentRequire(e)}catch(n){if(!r)throw new Error("Couln't load plugin file \""+e+'" for plugin "'+_+'": '+clientnode__WEBPACK_IMPORTED_MODULE_3___default().represent(n));a=r,t&&console.warn("Couln't load new api plugin file \""+e+'" for plugin "'+_+'": '+clientnode__WEBPACK_IMPORTED_MODULE_3___default().represent(n)+". Using fallback one.")}return Object.prototype.hasOwnProperty.call(a,"default")?a.default:a},e.loadAll=function(){var _=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark((function _(r){var t,n,a,o,i,c,l,u,s,p,d,E,f,b,P,m,O,D,g,M,h,v,I,A,w,k;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:if(t={},"web-node"===r.name){_.next=5;break}return _.next=4,e.load(r.name,e.determineInternalName(r.name,new RegExp(r.core.plugin.directories.external.nameRegularExpressionPattern)),t,r.core.plugin.configuration,r.core.context.path,r.core.encoding);case 4:t[r.name]=_.sent;case 5:n=0,a=Object.values(r.core.plugin.directories);case 6:if(!(n<a.length)){_.next=27;break}return o=a[n],_.next=10,clientnode__WEBPACK_IMPORTED_MODULE_3___default().isDirectory(o.path);case 10:if(!_.sent){_.next=24;break}i=new RegExp(o.nameRegularExpressionPattern),c=_createForOfIteratorHelperLoose((0,fs__WEBPACK_IMPORTED_MODULE_4__.readdirSync)(o.path));case 13:if((l=c()).done){_.next=24;break}if(u=l.value,i.test(u)){_.next=17;break}return _.abrupt("continue",22);case 17:return s=(0,path__WEBPACK_IMPORTED_MODULE_6__.resolve)(o.path,u),p=e.determineInternalName(u,i),_.next=21,e.load(u,p,t,r.core.plugin.configuration,s,r.core.encoding);case 21:t[u]=_.sent;case 22:_.next=13;break;case 24:n++,_.next=6;break;case 27:for(d={},E=0,f=Object.values(t);E<f.length;E++)if(b=f[E],d[b.internalName]=b.dependencies,Object.prototype.hasOwnProperty.call(r.core.interDependencies,b.internalName))for(P=_createForOfIteratorHelperLoose([].concat(r.core.interDependencies[b.internalName]));!(m=P()).done;)O=m.value,d[b.internalName].includes(O)||d[b.internalName].push(O);D=[],g=_createForOfIteratorHelperLoose(clientnode__WEBPACK_IMPORTED_MODULE_3___default().arraySortTopological(d));case 31:if((M=g()).done){_.next=44;break}h=M.value,v=0,I=Object.entries(t);case 34:if(!(v<I.length)){_.next=42;break}if(A=I[v],w=A[0],![(k=A[1]).internalName,w].includes(h)){_.next=39;break}return D.push(k),_.abrupt("break",42);case 39:v++,_.next=34;break;case 42:_.next=31;break;case 44:return _.abrupt("return",{configuration:e.loadConfigurations(D,r),plugins:D});case 45:case"end":return _.stop()}}),_)})));return function(){return _.apply(this,arguments)}}(),e.determineLocations=function(e,_){return void 0===_&&(_=[]),(_=[].concat(_)).length?_.map((function(_){return(0,path__WEBPACK_IMPORTED_MODULE_6__.resolve)(e.core.context.path,_)})):[e.core.context.path]},e.isInLocations=function(e,_,r,t){for(var n,a,o=_.map((function(e){return e.path})),i=_createForOfIteratorHelperLoose([].concat(t));!(n=i()).done;)if((a=n.value).startsWith("/")){if(r.startsWith((0,path__WEBPACK_IMPORTED_MODULE_6__.join)(e.core.context.path,a)))return!0}else for(var c,l,u=_createForOfIteratorHelperLoose(o);!(c=u()).done;)if(l=c.value,r.startsWith((0,path__WEBPACK_IMPORTED_MODULE_6__.resolve)(l,a)))return!0;return!1},e}();const __WEBPACK_DEFAULT_EXPORT__=PluginAPI},(module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{PluginAPI:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.Sw,configuration:()=>_configurator__WEBPACK_IMPORTED_MODULE_2__.D,currentRequire:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.Jf,default:()=>__WEBPACK_DEFAULT_EXPORT__,main:()=>main});var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3),_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__),_configurator__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(0),_pluginAPI__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1),clientnode__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(5),clientnode__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(clientnode__WEBPACK_IMPORTED_MODULE_4__);function _createForOfIteratorHelperLoose(e,_){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||_&&e&&"number"==typeof e.length){r&&(e=r);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,_){if(e){if("string"==typeof e)return _arrayLikeToArray(e,_);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,_):void 0}}function _arrayLikeToArray(e,_){(null==_||_>e.length)&&(_=e.length);for(var r=0,t=Array(_);r<_;r++)t[r]=e[r];return t}module=__webpack_require__.hmd(module);var handleError=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark((function e(_,r,t,n){return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStack("error",_,r,t,n);case 3:e.next=12;break;case 5:if(e.prev=5,e.t0=e.catch(0),!r.core.debug){e.next=11;break}throw e.t0;case 11:console.error(e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),main=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark((function e(){var _,r,t,n,a,o,i,c,l,u,s,p,d,E,f,b,P,m,O,D,g,M,h,v;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.loadAll(clientnode__WEBPACK_IMPORTED_MODULE_4___default().copy(_configurator__WEBPACK_IMPORTED_MODULE_2__.Z));case 2:return _=e.sent,r=_.configuration,t=_.plugins,e.next=7,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStack("initialize",t,r);case 7:t.length&&console.info('Loaded plugins: "'+t.map((function(e){return e.internalName})).join('", "')+'".'),n=_createForOfIteratorHelperLoose(["pre","post"]);case 9:if((a=n()).done){e.next=15;break}return o=a.value,e.next=13,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStack(o+"ConfigurationLoaded",t,r,r,t.filter((function(e){return!!e.configurationFilePaths.length})));case 13:e.next=9;break;case 15:return i={},c={},l=!1,e.prev=18,e.next=21,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStack("preLoadService",t,r,i);case 21:for(i=e.sent,u=0,s=Object.keys(i);u<s.length;u++)p=s[u],console.info('Service "'+p+'" initialized.');d=_createForOfIteratorHelperLoose(t);case 24:if((E=d()).done){e.next=47;break}if(!(f=E.value).api){e.next=45;break}return e.next=29,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStack("preLoad"+clientnode__WEBPACK_IMPORTED_MODULE_4___default().stringCapitalize(f.internalName)+"Service",t,r,i);case 29:return i=e.sent,P=null,e.prev=31,e.next=34,f.api.call(_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP,"loadService",c,i,r,t);case 34:P=e.sent,e.next=41;break;case 37:if(e.prev=37,e.t0=e.catch(31),null!=e.t0&&null!=(m=e.t0.message)&&m.startsWith("NotImplemented:")){e.next=41;break}throw new Error('Plugin "'+f.internalName+'" '+(f.internalName===f.name?"":"("+f.name+") ")+"throws: "+clientnode__WEBPACK_IMPORTED_MODULE_4___default().represent(e.t0)+' during asynchrone hook "loadService".');case 41:return"string"==typeof(null==(b=P)?void 0:b.name)&&(null!==P.promise&&"object"==typeof P.promise&&"then"in P.promise?(console.info('Service "'+P.name+'" started.'),c[P.name]=P.promise):console.info('Service "'+P.name+'" loaded.')),e.next=44,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStack("postLoad"+clientnode__WEBPACK_IMPORTED_MODULE_4___default().stringCapitalize(f.internalName)+"Service",t,r,i,c);case 44:i=e.sent;case 45:e.next=24;break;case 47:return e.next=49,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStack("postLoadService",t,r,c,i);case 49:for(c=e.sent,O=!1,D=function(){O||_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStackSynchronous("exit",t.slice().reverse(),r,i),O=!0},g=_createForOfIteratorHelperLoose(clientnode__WEBPACK_IMPORTED_MODULE_4__.CloseEventNames);!(M=g()).done;)h=M.value,process.on(h,D);return v=!1,process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding(r.core.encoding),process.stdin.on("data",(function(e){_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark((function _(){return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:if(""!==e){_.next=10;break}if(!v){_.next=5;break}console.warn("Stopping ungracefully."),_.next=9;break;case 5:return v=!0,console.info("You have requested to shut down all services. A second request will force to stop ungracefully."),_.next=9,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStack("shouldExit",t,r,i);case 9:process.exit();case 10:process.stdout.write(e);case 11:case"end":return _.stop()}}),_)})))()})),e.prev=58,e.next=61,Promise.all(Object.keys(c).map((function(e){return c[e]})));case 61:e.next=65;break;case 63:e.prev=63,e.t1=e.catch(58);case 65:return l=!0,e.next=68,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStack("shouldExit",t,r,i);case 68:process.exit(),e.next=91;break;case 71:return e.prev=71,e.t2=e.catch(18),e.next=75,handleError(t,r,e.t2,i);case 75:if(l){e.next=85;break}return e.prev=76,e.next=79,_pluginAPI__WEBPACK_IMPORTED_MODULE_3__.ZP.callStack("shouldExit",t,r,i);case 79:e.next=85;break;case 81:return e.prev=81,e.t3=e.catch(76),e.next=85,handleError(t,r,e.t3,i);case 85:if(!r.core.debug){e.next=89;break}throw e.t2;case 89:console.error(e.t2);case 90:process.exit(1);case 91:case"end":return e.stop()}}),e,null,[[18,71],[31,37],[58,63],[76,81]])})));return function(){return e.apply(this,arguments)}}();(__webpack_require__.c[__webpack_require__.s]===module||eval("require.main")!==__webpack_require__.c[__webpack_require__.s]&&"undefined"!=typeof ORIGINAL_MAIN_MODULE&&ORIGINAL_MAIN_MODULE===eval("require.main"))&&main();const __WEBPACK_DEFAULT_EXPORT__=main},e=>{e.exports=require("@babel/runtime/helpers/asyncToGenerator")},e=>{e.exports=require("@babel/runtime/regenerator")},e=>{e.exports=require("clientnode")},e=>{e.exports=require("fs")},e=>{e.exports=require("path")},e=>{e.exports=require("child_process")},e=>{e.exports=require("module")}],__webpack_module_cache__={};function __webpack_require__(e){var _=__webpack_module_cache__[e];if(void 0!==_)return _.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.c=__webpack_module_cache__,__webpack_require__.n=e=>{var _=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(_,{a:_}),_},__webpack_require__.d=(e,_)=>{for(var r in _)__webpack_require__.o(_,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:_[r]})},__webpack_require__.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(__webpack_require__.s=2);module.exports=__webpack_exports__})();
3
+ 'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(module===eval('require.main'))module.paths.unshift('/application/node_modules');(()=>{"use strict";var __webpack_modules__=[(e,_,r)=>{r.d(_,{D:()=>m,Z:()=>g});var t=r(6),n=r.n(t),a=r(7),o=r.n(a),i=r(8),l=r.n(i),c=r(1);const u=JSON.parse('{"name":"web-node","version":"1.0.447","description":"High level javaScript backend plugin system and configuration merger.","keywords":["web","backend","api","plugin","management"],"homepage":"https://torben.website/web-node","bugs":{"email":"info@torben.website","url":"https://github.com/thaibault/web-node/issues"},"license":"CC-BY-3.0","author":{"name":"Torben Sickert","email":"info@torben.website","url":"https://torben.website"},"files":["configurator.d.ts","index.d.ts","index.js","pluginAPI.d.ts","type.d.ts","unixCrypt.d.ts","unixCrypt.js"],"bin":{"web-node":"index.js"},"repository":{"type":"git","url":"https://github.com/thaibault/web-node.git"},"scripts":{"build":"yarn build:types; yarn build:plain","build:plain":"weboptimizer build","build:types":"weboptimizer build:types","check":"yarn check:types; yarn lint","check:types":"weboptimizer check:types","clear":"weboptimizer clear","document":"weboptimizer document","lint":"weboptimizer lint","prepare":"yarn build","serve":"weboptimizer build && yarn serve","start":"./index.js \'{plugin: {hotReloading: true}}\'","prepare:test":"yarn clear && cd dummyPlugin && yarn build && cd ..","test":"yarn prepare:test && weboptimizer test","test:coverage":"yarn prepare:test && weboptimizer test:coverage","test:coverage:report":"yarn prepare:test && weboptimizer test:coverage:report","update":"yarn version --patch && yarn publish","update:documentation":"documentation-website","watch":"weboptimizer build --watch"},"dependencies":{"@types/webpack":"https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz"},"devDependencies":{"@babel/cli":"*","@babel/eslint-parser":"*","@types/node":"*","@typescript-eslint/eslint-plugin":"*","@typescript-eslint/parser":"*","clientnode":"*","documentation-website":"*","eslint":"*","eslint-config-google":"*","eslint-plugin-jsdoc":"*","jest":"*","jsdoc":"*","weboptimizer":"*"},"peerDependencies":{"@babel/runtime":"*","clientnode":"*"},"peerDependenciesMeta":{"@babel/runtime":{"optional":true}},"engines":{"node":">=17","npm":">=7"},"resolutions":{"@types/webpack":"https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz","colors":"1.4.0"},"sideEffects":true,"documentationWebsite":{"name":"web-node","trackingCode":"UA-40192634-9"},"webNode":{"core":{"context":{"path":"./","type":"relative"},"debug":false,"encoding":"utf8","interDependencies":{},"name":"web-node","plugin":{"configuration":{"fileNames":["package.json","private-package.json"],"propertyNames":["webNode","webnode","web-node"]},"directories":{"external":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-]+?)-?[wW]eb-?[nN]ode-?[pP]lugin$","path":{"__evaluate__":"`${currentPath}/node_modules/`"}},"internal":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-_].*)$","path":{"__evaluate__":"`${currentPath}/plugins/`"}}},"hotReloading":false}}},"webOptimizer":{"assetPattern":{"javaScript":{"includeFilePathRegularExpression":"^(.+/)?index\\\\.js$","pattern":{"#":"This is how we can make our main exported artefact executable.","__evaluate__":"`#!/usr/bin/env node\\n// -*- coding: utf-8 -*-\\n${self.generic.assetPattern.javaScript.pattern}if(module===eval(\'require.main\'))module.paths.unshift(\'/application/node_modules\');{1}`"}}},"exportFormat":{"external":"commonjs2","self":"commonjs2"},"injection":{"entry":{"__evaluate__":"2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith(\'test\') ? {testBundle: \'test\'} : {index: \'./index.ts\', unixCrypt: \'./unixCrypt.ts\'}"}},"module":{"optimizer":{"babelMinify":{"#":"To provide a logging output we need to exclude this feature.","__evaluate__":"self.debug ? {bundle: null, module: null} : {bundle: {transform: {removeConsole: false}}, module: {removeConsole: false}}"}}},"targetTechnology":{"boilerplate":"node","payload":"node"}}}');var s,p;for(u.webNode.core.context={path:"/",type:"relative"};u.webNode.core.context.path=l().resolve(u.webNode.core.context.path,"../../"),"node_modules"===l().basename(l().dirname(u.webNode.core.context.path)););if("/"===u.webNode.core.context.path||"node_modules"===l().basename(l().dirname(process.cwd()))||".staging"===l().basename(l().dirname(process.cwd()))&&"node_modules"===l().basename(l().dirname(l().dirname(process.cwd()))))u.webNode.core.context.path=process.cwd();else try{(0,a.lstatSync)(l().join(process.cwd(),"node_modules")).isSymbolicLink()&&(u.webNode.core.context.path=process.cwd())}catch(e){}var d={name:"main"};try{d=(0,t.currentRequire)(l().join(u.webNode.core.context.path,"package"))}catch(e){u.webNode.core.context.path=process.cwd()}var E=(null==(s=d.documentationWebsite)?void 0:s.name)||d.name||"main",f=d.webNode||((p={})[E]={name:E,package:d},p);u.webNode.core.name=u.documentationWebsite.name;var b=new Date,P={currentPath:process.cwd(),fileSystem:o(),path:l(),PluginAPI:c.ZP,require:t.currentRequire,Tools:n(),webNodePath:"/",now:b,nowUTCTimestamp:n().numberGetUTCTimestamp(b)},m=n().evaluateDynamicData(u.webNode,P);if(delete u.webNode,n().extend(!0,n().modifyObject(m,f),f),2<process.argv.length){var O=n().stringParseEncodedObject(process.argv[process.argv.length-1],m,"configuration");n().isPlainObject(O)&&(n().extend(!0,n().modifyObject(m,O),O),m.core.runtimeConfiguration=O)}(m=n().evaluateDynamicData(n().removeKeysInEvaluation(m),P)).name=E,m.core.package=u;const g=m},(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{var __dirname="/";__webpack_require__.d(__webpack_exports__,{Jf:()=>currentRequire,Sw:()=>PluginAPI,ZP:()=>__WEBPACK_DEFAULT_EXPORT__});var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3),_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4),_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__),child_process__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(9),child_process__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_3__),clientnode__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(6),clientnode__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(clientnode__WEBPACK_IMPORTED_MODULE_4__),fs__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(7),fs__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_5__),module__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(10),module__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(module__WEBPACK_IMPORTED_MODULE_6__),path__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(8),path__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_7__),_configurator__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(0);function _createForOfIteratorHelperLoose(e,_){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||_&&e&&"number"==typeof e.length){r&&(e=r);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,_){if(e){if("string"==typeof e)return _arrayLikeToArray(e,_);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,_):void 0}}function _arrayLikeToArray(e,_){(null==_||_>e.length)&&(_=e.length);for(var r=0,t=Array(_);r<_;r++)t[r]=e[r];return t}var currentRequire=eval("require"),oldResolveFilename=module__WEBPACK_IMPORTED_MODULE_6__.Module._resolveFilename;module__WEBPACK_IMPORTED_MODULE_6__.Module._resolveFilename=function(e,_,r){return oldResolveFilename("web-node"===e?currentRequire.main.id:e,_,r)};var PluginAPI=function(){function e(){}return e.callStack=function(){var _=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark((function _(r){var t,n,a,o,i,l,c,u,s,p,d,E,f,b,P,m,O,g=arguments;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:if(t=_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},r,{pluginAPI:e}),n=t.configuration,a=t.hook,o=t.plugins,i=a.endsWith("ConfigurationLoaded")||a.endsWith("ConfigurationHotLoaded"),!n.core.plugin.hotReloading){_.next=20;break}if(i){_.next=14;break}if(!(l=e.hotReloadConfigurationFile(o,n.core.plugin.configuration.propertyNames)).length){_.next=14;break}return n.core.debug&&console.info('Configuration for "'+l.map((function(e){return e.name})).join('", "')+'" has been changed: reloading initialized.'),c=_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},t,{triggerHook:t.hook,pluginsWithChangedConfiguration:l}),_.next=11,e.callStack(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},c,{hook:"preConfigurationHotLoaded"}));case 11:return e.loadConfigurations(o,n),_.next=14,e.callStack(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},c,{hook:"postConfigurationHotLoaded"}));case 14:if("apiFileReloaded"===a){_.next=20;break}if(!(u=e.hotReloadAPIFile(o)).length){_.next=20;break}return n.core.debug&&console.info('API-file for "'+u.map((function(e){return e.name})).join('", "')+'" has been changed: reloading initialized.'),_.next=20,e.callStack(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},t,{hook:"apiFileReloaded",pluginsWithChangedAPIFiles:u,triggerHook:t.hook}));case 20:for(s=r.data,p=g.length,d=Array(1<p?p-1:0),E=1;E<p;E++)d[E-1]=g[E];f=_createForOfIteratorHelperLoose(o);case 23:if((b=f()).done){_.next=42;break}if(!(P=b.value).api){_.next=40;break}return m=void 0,_.prev=27,_.next=30,P.api.apply(P,[t].concat(d));case 30:m=_.sent,_.next=38;break;case 33:if(_.prev=33,_.t0=_.catch(27),null==(O=_.t0.message)||!O.startsWith("NotImplemented:")){_.next=37;break}return _.abrupt("continue",40);case 37:throw new Error('Plugin "'+P.internalName+'" '+(P.internalName===P.name?"":"("+P.name+") ")+"throws: "+clientnode__WEBPACK_IMPORTED_MODULE_4___default().represent(_.t0)+' during asynchronous hook "'+a+'".');case 38:s=m,n.core.debug&&console.info('Ran asynchronous hook "'+a+'" for plugin "'+P.name+'".');case 40:_.next=23;break;case 42:return _.abrupt("return",s);case 43:case"end":return _.stop()}}),_,null,[[27,33]])})));return function(){return _.apply(this,arguments)}}(),e.callStackSynchronous=function(_){for(var r=_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},_,{pluginAPI:e}),t=r.configuration,n=r.hook,a=r.plugins,o=_.data,i=arguments.length,l=Array(1<i?i-1:0),c=1;c<i;c++)l[c-1]=arguments[c];for(var u,s,p=_createForOfIteratorHelperLoose(a);!(u=p()).done;)if((s=u.value).api){var d=void 0;try{d=s.api.apply(s,[r].concat(l))}catch(e){var E;if(null!=(E=e.message)&&E.startsWith("NotImplemented:"))continue;throw new Error('Plugin "'+s.internalName+'" '+(s.internalName===s.name?"":"("+s.name+") ")+"throws: "+clientnode__WEBPACK_IMPORTED_MODULE_4___default().represent(e)+' during synchronous hook "'+n+'".')}o=d,t.core.debug&&console.info('Ran synchronous hook "'+n+'" for plugin "'+s.name+'".')}return o},e.determineInternalName=function(e,_){return clientnode__WEBPACK_IMPORTED_MODULE_4___default().stringDelimitedToCamelCase(e.replace(_,(function(e,_){return"string"==typeof _?_:e})))},e.evaluateConfiguration=function(_){for(var r={},t=0,n=Object.entries(_);t<n.length;t++){var a=n[t],o=a[0],i=a[1];i.package&&(r[o]=i.package,delete i.package)}var l=new Date;_=clientnode__WEBPACK_IMPORTED_MODULE_4___default().evaluateDynamicData(clientnode__WEBPACK_IMPORTED_MODULE_4___default().removeKeysInEvaluation(_),{currentPath:process.cwd(),fileSystem:fs__WEBPACK_IMPORTED_MODULE_5___default(),path:path__WEBPACK_IMPORTED_MODULE_7___default(),PluginAPI:e,require:currentRequire,Tools:clientnode__WEBPACK_IMPORTED_MODULE_4___default(),webNodePath:__dirname,now:l,nowUTCTimestamp:clientnode__WEBPACK_IMPORTED_MODULE_4___default().numberGetUTCTimestamp(l)});for(var c=0,u=Object.entries(r);c<u.length;c++){var s=u[c],p=s[0],d=s[1];_[p].package=d}return _},e.hotReloadAPIFile=function(_){for(var r,t,n=[],a=_createForOfIteratorHelperLoose(e.hotReloadFiles("api","scope",_));!(r=a()).done;)if((t=r.value).oldScope){for(var o=0,i=Object.entries(t.oldScope);o<i.length;o++){var l=i[o],c=l[0],u=l[1];Object.prototype.hasOwnProperty.call(t.newScope,c)&&!clientnode__WEBPACK_IMPORTED_MODULE_4___default().isFunction(t.newScope[c])&&(t.newScope[c]=u)}n.push(t.plugin)}return n},e.hotReloadConfigurationFile=function(_,r){for(var t,n,a=[],o=_createForOfIteratorHelperLoose(e.hotReloadFiles("configuration","packageConfiguration",_));!(t=o()).done;)(n=t.value).plugin.configuration=e.loadConfiguration(n.plugin.internalName,n.plugin.packageConfiguration,r),a.push(n.plugin);return a},e.hotReloadFiles=function(_,r,t){for(var n,a,o=[],i=_createForOfIteratorHelperLoose(t);!(n=i()).done;)if((a=n.value)[r])for(var l,c=0,u=_createForOfIteratorHelperLoose(a[_+"FilePaths"]);!(l=u()).done;){var s=l.value,p=(0,fs__WEBPACK_IMPORTED_MODULE_5__.statSync)(s).mtime.getTime();if(a[_+"FileLoadTimestamps"][c]<p){delete currentRequire.cache[currentRequire.resolve(s)];var d=a[r];a[r]=e.loadFile(s,a.name,a[r]),o.push({newScope:a[r],oldScope:d,plugin:a,target:r})}a[_+"FileLoadTimestamps"][c]=p,c+=1}return o},e.load=function(){var _=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark((function _(r,t,n,a,o,i){var l,c,u,s,p,d,E,f;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:void 0===i&&(i="utf8"),l=[],c={},u=_createForOfIteratorHelperLoose(a.fileNames);case 4:if((s=u()).done){_.next=14;break}return p=s.value,d=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(o,p),_.next=9,clientnode__WEBPACK_IMPORTED_MODULE_4___default().isFile(d);case 9:if(!_.sent){_.next=12;break}clientnode__WEBPACK_IMPORTED_MODULE_4___default().extend(!0,c,e.loadFile(d,r)),l.push(d);case 12:_.next=4;break;case 14:if(E=["index.js"],!Object.keys(c).length){_.next=22;break}return t=c.webNodeInternalName||t,(f=e.loadConfiguration(t,c,a.propertyNames))[t].package.main&&(E[0]=f[t].package.main),_.next=21,e.loadAPI(E,o,r,t,n,i,f,l);case 21:return _.abrupt("return",_.sent);case 22:return _.next=24,e.loadAPI(E,o,r,t,n,i);case 24:return _.abrupt("return",_.sent);case 25:case"end":return _.stop()}}),_)})));return function(){return _.apply(this,arguments)}}(),e.loadAPI=function(){var _=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark((function _(r,t,n,a,o,i,l,c){var u,s,p,d,E,f,b,P,m,O,g;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:return void 0===i&&(i="utf8"),void 0===l&&(l=null),void 0===c&&(c=[]),E=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(t,r[0]),_.next=6,clientnode__WEBPACK_IMPORTED_MODULE_4___default().isFile(E);case 6:if(_.sent){_.next=21;break}f=_createForOfIteratorHelperLoose((0,fs__WEBPACK_IMPORTED_MODULE_5__.readdirSync)(t));case 8:if((b=f()).done){_.next=21;break}if(P=b.value,_.t0=!c.map((function(e){return(0,path__WEBPACK_IMPORTED_MODULE_7__.basename)(e)})).includes(P),!_.t0){_.next=15;break}return _.next=14,clientnode__WEBPACK_IMPORTED_MODULE_4___default().isFile((0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(t,P));case 14:_.t0=_.sent;case 15:if(!_.t0){_.next=19;break}if(E=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(t,E),!["index","main"].includes((0,path__WEBPACK_IMPORTED_MODULE_7__.basename)(E,(0,path__WEBPACK_IMPORTED_MODULE_7__.extname)(P)))){_.next=19;break}return _.abrupt("break",21);case 19:_.next=8;break;case 21:if(m=null,O=!1,_.t1=l&&(1<Object.keys(l).length||l[a]&&1<Object.keys(l[a]).length),!_.t1){_.next=28;break}return _.next=27,clientnode__WEBPACK_IMPORTED_MODULE_4___default().isFile(E);case 27:_.t1=_.sent;case 28:if(!_.t1){_.next=30;break}E.endsWith(".js")?(O=!0,m=function(_){for(var r,t=arguments.length,a=Array(1<t?t-1:0),i=1;i<t;i++)a[i-1]=arguments[i];if(_.hook in o[n].scope)return(r=o[n].scope)[_.hook].apply(r,[_].concat(a,[e]));throw new Error('NotImplemented: API method "'+_.hook+'" is not implemented in plugin "'+n+'".')}):m=function(e){for(var _=e.hook,r=e.data,t=arguments.length,n=Array(1<t?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];var o=(0,child_process__WEBPACK_IMPORTED_MODULE_3__.spawnSync)(E,[_].concat(n.map((function(e){return JSON.stringify(e)}))),{cwd:process.cwd(),encoding:i,env:process.env,input:JSON.stringify(r),shell:!0,stdio:"inherit"});return 404===o.status?r:o.stdout.startsWith("##!JSON!##")?JSON.parse(o.stdout.substring(10)):r};case 30:return g=null!==(u=l)&&void 0!==u?u:((s={})[a]={package:{}},s),_.abrupt("return",{api:m,apiFileLoadTimestamps:m?[(0,fs__WEBPACK_IMPORTED_MODULE_5__.statSync)(E).mtime.getTime()]:[],apiFilePaths:m?[E]:[],configuration:g,configurationFilePaths:c,configurationFileLoadTimestamps:c.map((function(e){return(0,fs__WEBPACK_IMPORTED_MODULE_5__.statSync)(e).mtime.getTime()})),dependencies:(null==(p=g[a])?void 0:p.dependencies)||[],internalName:a,name:n,packageConfiguration:null==(d=g[a])?void 0:d.package,path:t,scope:O?e.loadFile(E,n):null});case 32:case"end":return _.stop()}}),_)})));return function(){return _.apply(this,arguments)}}(),e.loadConfiguration=function(e,_,r){for(var t,n,a,o=clientnode__WEBPACK_IMPORTED_MODULE_4___default().removeKeyPrefixes(clientnode__WEBPACK_IMPORTED_MODULE_4___default().copy(_)),i=((t={})[e]={package:o},t),l=_createForOfIteratorHelperLoose(r);!(n=l()).done;)if(_[a=n.value]){clientnode__WEBPACK_IMPORTED_MODULE_4___default().extend(!0,i,_[a]),delete i[e].package[a];break}return i},e.loadConfigurations=function(_,r){for(var t=0,n=Object.keys(r);t<n.length;t++)delete r[n[t]];clientnode__WEBPACK_IMPORTED_MODULE_4___default().extend(r,clientnode__WEBPACK_IMPORTED_MODULE_4___default().copy(_configurator__WEBPACK_IMPORTED_MODULE_8__.Z));for(var a,o,i=_createForOfIteratorHelperLoose(_);!(a=i()).done;)if((o=a.value).configuration){var l=clientnode__WEBPACK_IMPORTED_MODULE_4___default().copy(o.configuration);clientnode__WEBPACK_IMPORTED_MODULE_4___default().extend(!0,clientnode__WEBPACK_IMPORTED_MODULE_4___default().modifyObject(r,l),l),r.core.runtimeConfiguration&&clientnode__WEBPACK_IMPORTED_MODULE_4___default().extend(!0,r,r.core.runtimeConfiguration)}return e.evaluateConfiguration(r)},e.loadFile=function(e,_,r,t){var n,a;void 0===r&&(r=null),void 0===t&&(t=!0);try{n=currentRequire.resolve(e)}catch(e){}n&&n in currentRequire.cache&&delete currentRequire.cache[n];try{a=currentRequire(e)}catch(n){if(!r)throw new Error("Couln't load plugin file \""+e+'" for plugin "'+_+'": '+clientnode__WEBPACK_IMPORTED_MODULE_4___default().represent(n));a=r,t&&console.warn("Couln't load new api plugin file \""+e+'" for plugin "'+_+'": '+clientnode__WEBPACK_IMPORTED_MODULE_4___default().represent(n)+". Using fallback one.")}return Object.prototype.hasOwnProperty.call(a,"default")?a.default:a},e.loadAll=function(){var _=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark((function _(r){var t,n,a,o,i,l,c,u,s,p,d,E,f,b,P,m,O,g,D,M,h,v,k,I,A,w;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:if(t={},"web-node"===r.name){_.next=5;break}return _.next=4,e.load(r.name,e.determineInternalName(r.name,new RegExp(r.core.plugin.directories.external.nameRegularExpressionPattern)),t,r.core.plugin.configuration,r.core.context.path,r.core.encoding);case 4:t[r.name]=_.sent;case 5:n=0,a=Object.values(r.core.plugin.directories);case 6:if(!(n<a.length)){_.next=27;break}return o=a[n],_.next=10,clientnode__WEBPACK_IMPORTED_MODULE_4___default().isDirectory(o.path);case 10:if(!_.sent){_.next=24;break}i=new RegExp(o.nameRegularExpressionPattern),l=_createForOfIteratorHelperLoose((0,fs__WEBPACK_IMPORTED_MODULE_5__.readdirSync)(o.path));case 13:if((c=l()).done){_.next=24;break}if(u=c.value,i.test(u)){_.next=17;break}return _.abrupt("continue",22);case 17:return s=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(o.path,u),p=e.determineInternalName(u,i),_.next=21,e.load(u,p,t,r.core.plugin.configuration,s,r.core.encoding);case 21:t[u]=_.sent;case 22:_.next=13;break;case 24:n++,_.next=6;break;case 27:for(d={},E=0,f=Object.values(t);E<f.length;E++)if(b=f[E],d[b.internalName]=b.dependencies,Object.prototype.hasOwnProperty.call(r.core.interDependencies,b.internalName))for(P=_createForOfIteratorHelperLoose([].concat(r.core.interDependencies[b.internalName]));!(m=P()).done;)O=m.value,d[b.internalName].includes(O)||d[b.internalName].push(O);g=[],D=_createForOfIteratorHelperLoose(clientnode__WEBPACK_IMPORTED_MODULE_4___default().arraySortTopological(d));case 31:if((M=D()).done){_.next=44;break}h=M.value,v=0,k=Object.entries(t);case 34:if(!(v<k.length)){_.next=42;break}if(I=k[v],A=I[0],![(w=I[1]).internalName,A].includes(h)){_.next=39;break}return g.push(w),_.abrupt("break",42);case 39:v++,_.next=34;break;case 42:_.next=31;break;case 44:return _.abrupt("return",{configuration:e.loadConfigurations(g,r),plugins:g});case 45:case"end":return _.stop()}}),_)})));return function(){return _.apply(this,arguments)}}(),e.determineLocations=function(e,_){return void 0===_&&(_=[]),(_=[].concat(_)).length?_.map((function(_){return(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(e.core.context.path,_)})):[e.core.context.path]},e.isInLocations=function(e,_,r,t){for(var n,a,o=_.map((function(e){return e.path})),i=_createForOfIteratorHelperLoose([].concat(t));!(n=i()).done;)if((a=n.value).startsWith("/")){if(r.startsWith((0,path__WEBPACK_IMPORTED_MODULE_7__.join)(e.core.context.path,a)))return!0}else for(var l,c,u=_createForOfIteratorHelperLoose(o);!(l=u()).done;)if(c=l.value,r.startsWith((0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(c,a)))return!0;return!1},e}();const __WEBPACK_DEFAULT_EXPORT__=PluginAPI},(module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{PluginAPI:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Sw,configuration:()=>_configurator__WEBPACK_IMPORTED_MODULE_3__.D,currentRequire:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Jf,default:()=>__WEBPACK_DEFAULT_EXPORT__,main:()=>main});var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3),_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4),_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__),_configurator__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(0),_pluginAPI__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(1),clientnode__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(6),clientnode__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(clientnode__WEBPACK_IMPORTED_MODULE_5__);function _createForOfIteratorHelperLoose(e,_){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||_&&e&&"number"==typeof e.length){r&&(e=r);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,_){if(e){if("string"==typeof e)return _arrayLikeToArray(e,_);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,_):void 0}}function _arrayLikeToArray(e,_){(null==_||_>e.length)&&(_=e.length);for(var r=0,t=Array(_);r<_;r++)t[r]=e[r];return t}module=__webpack_require__.hmd(module);var handleError=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark((function e(_){return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStack(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},_,{hook:"error"}));case 3:e.next=12;break;case 5:if(e.prev=5,e.t0=e.catch(0),!_.configuration.core.debug){e.next=11;break}throw e.t0;case 11:console.error(e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),main=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark((function e(){var _,r,t,n,a,o,i,l,c,u,s,p,d,E,f,b,P,m,O,g,D,M,h,v,k;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.loadAll(clientnode__WEBPACK_IMPORTED_MODULE_5___default().copy(_configurator__WEBPACK_IMPORTED_MODULE_3__.Z));case 2:return _=e.sent,r=_.configuration,t=_.plugins,e.next=7,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStack({configuration:r,hook:"initialize",plugins:t});case 7:t.length&&console.info('Loaded plugins: "'+t.map((function(e){return e.internalName})).join('", "')+'".'),n=t.filter((function(e){return!!e.configurationFilePaths.length})),a=_createForOfIteratorHelperLoose(["pre","post"]);case 10:if((o=a()).done){e.next=16;break}return i=o.value,e.next=14,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStack({configuration:r,hook:i+"ConfigurationLoaded",plugins:t,pluginsWithChangedConfiguration:n});case 14:e.next=10;break;case 16:return l={},c={},u=!1,e.prev=19,e.next=22,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStack({configuration:r,hook:"preLoadService",plugins:t,services:l});case 22:for(s=0,p=Object.keys(l);s<p.length;s++)d=p[s],console.info('Service "'+d+'" initialized.');E=_createForOfIteratorHelperLoose(t);case 24:if((f=E()).done){e.next=45;break}if(!(b=f.value).api){e.next=43;break}return e.next=29,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStack({configuration:r,hook:"preLoad"+clientnode__WEBPACK_IMPORTED_MODULE_5___default().stringCapitalize(b.internalName)+"Service",plugins:t,services:l});case 29:return m=null,e.prev=30,e.next=33,b.api({configuration:r,hook:"loadService",pluginAPI:_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP,plugins:t,servicePromises:c,services:l});case 33:m=e.sent,e.next=40;break;case 36:if(e.prev=36,e.t0=e.catch(30),null!=e.t0&&null!=(O=e.t0.message)&&O.startsWith("NotImplemented:")){e.next=40;break}throw new Error('Plugin "'+b.internalName+'" '+(b.internalName===b.name?"":"("+b.name+") ")+"throws: "+clientnode__WEBPACK_IMPORTED_MODULE_5___default().represent(e.t0)+' during asynchrone hook "loadService".');case 40:return"string"==typeof(null==(P=m)?void 0:P.name)&&(null!==m.promise&&"object"==typeof m.promise&&"then"in m.promise?(console.info('Service "'+m.name+'" started.'),c[m.name]=m.promise):console.info('Service "'+m.name+'" loaded.')),e.next=43,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStack({configuration:r,hook:"postLoad"+clientnode__WEBPACK_IMPORTED_MODULE_5___default().stringCapitalize(b.internalName)+"Service",plugins:t,services:l,servicePromises:c});case 43:e.next=24;break;case 45:return e.next=47,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStack({configuration:r,hook:"postLoadService",plugins:t,servicePromises:c,services:l});case 47:for(g=!1,D=function(){g||_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStackSynchronous({configuration:r,hook:"exit",plugins:t.slice().reverse(),servicePromises:c,services:l}),g=!0},M=_createForOfIteratorHelperLoose(clientnode__WEBPACK_IMPORTED_MODULE_5__.CloseEventNames);!(h=M()).done;)v=h.value,process.on(v,D);return k=!1,process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding(r.core.encoding),process.stdin.on("data",(function(e){_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark((function _(){return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:if(""!==e){_.next=10;break}if(!k){_.next=5;break}console.warn("Stopping ungracefully."),_.next=9;break;case 5:return k=!0,console.info("You have requested to shut down all services. A second request will force to stop ungracefully."),_.next=9,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStack({configuration:r,hook:"shouldExit",plugins:t,servicePromises:c,services:l});case 9:process.exit();case 10:process.stdout.write(e);case 11:case"end":return _.stop()}}),_)})))()})),e.prev=55,e.next=58,Promise.all(Object.keys(c).map((function(e){return c[e]})));case 58:e.next=62;break;case 60:e.prev=60,e.t1=e.catch(55);case 62:return u=!0,e.next=65,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStack({configuration:r,hook:"shouldExit",plugins:t,servicePromises:c,services:l});case 65:process.exit(),e.next=88;break;case 68:return e.prev=68,e.t2=e.catch(19),e.next=72,handleError({configuration:r,data:e.t2,plugins:t,servicePromises:c,services:l});case 72:if(u){e.next=82;break}return e.prev=73,e.next=76,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.ZP.callStack({configuration:r,hook:"shouldExit",plugins:t,servicePromises:c,services:l});case 76:e.next=82;break;case 78:return e.prev=78,e.t3=e.catch(73),e.next=82,handleError({configuration:r,data:e.t3,plugins:t,servicePromises:c,services:l});case 82:if(!r.core.debug){e.next=86;break}throw e.t2;case 86:console.error(e.t2);case 87:process.exit(1);case 88:case"end":return e.stop()}}),e,null,[[19,68],[30,36],[55,60],[73,78]])})));return function(){return e.apply(this,arguments)}}();(__webpack_require__.c[__webpack_require__.s]===module||eval("require.main")!==__webpack_require__.c[__webpack_require__.s]&&"undefined"!=typeof ORIGINAL_MAIN_MODULE&&ORIGINAL_MAIN_MODULE===eval("require.main"))&&main();const __WEBPACK_DEFAULT_EXPORT__=main},e=>{e.exports=require("@babel/runtime/helpers/extends")},e=>{e.exports=require("@babel/runtime/helpers/asyncToGenerator")},e=>{e.exports=require("@babel/runtime/regenerator")},e=>{e.exports=require("clientnode")},e=>{e.exports=require("fs")},e=>{e.exports=require("path")},e=>{e.exports=require("child_process")},e=>{e.exports=require("module")}],__webpack_module_cache__={};function __webpack_require__(e){var _=__webpack_module_cache__[e];if(void 0!==_)return _.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.c=__webpack_module_cache__,__webpack_require__.n=e=>{var _=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(_,{a:_}),_},__webpack_require__.d=(e,_)=>{for(var r in _)__webpack_require__.o(_,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:_[r]})},__webpack_require__.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(__webpack_require__.s=2);module.exports=__webpack_exports__})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-node",
3
- "version": "1.0.444",
3
+ "version": "1.0.447",
4
4
  "description": "High level javaScript backend plugin system and configuration merger.",
5
5
  "keywords": [
6
6
  "web",
package/pluginAPI.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Encoding, Mapping, RecursiveEvaluateable } from 'clientnode/type';
3
- import { Configuration, EvaluateablePartialConfiguration, MetaPluginConfiguration, PackageConfiguration, Plugin, PluginChange } from './type';
3
+ import { BaseState, Configuration, EvaluateablePartialConfiguration, MetaPluginConfiguration, PackageConfiguration, Plugin, PluginChange, ServicePromisesState } from './type';
4
4
  export declare const currentRequire: NodeRequire;
5
5
  /**
6
6
  * A dumm plugin interface with all available hooks.
@@ -10,30 +10,22 @@ export declare class PluginAPI {
10
10
  * Calls all plugin methods for given trigger description asynchronous and
11
11
  * waits for their resolved promises.
12
12
  * @param this - Nothing.
13
- * @param hook - Type of trigger.
14
- * @param plugins - List of plugins to search for trigger callbacks in.
15
- * @param configuration - Plugin extendable configuration object.
16
- * @param data - Data to pipe throw all plugins and resolve after all
17
- * plugins have been resolved.
13
+ * @param givenState - Contains runtime information about current hook.
18
14
  * @param parameters - Additional parameters to forward into plugin api.
19
15
  *
20
16
  * @returns A promise which resolves when all callbacks have resolved their
21
17
  * promise holding given potentially modified data.
22
18
  */
23
- static callStack<Input = unknown, Result = unknown>(this: void, hook: string, plugins: Array<Plugin>, configuration: Configuration, data?: Input, ...parameters: Array<unknown>): Promise<Result>;
19
+ static callStack<State extends BaseState<unknown> = ServicePromisesState, Output = void>(this: void, givenState: Omit<State, 'pluginAPI'>, ...parameters: Array<unknown>): Promise<Output>;
24
20
  /**
25
21
  * Calls all plugin methods for given trigger description synchronous.
26
22
  * @param this - Nothing.
27
- * @param hook - Hook to trigger.
28
- * @param plugins - List of plugins to search for trigger callbacks in.
29
- * @param configuration - Plugin extendable configuration object.
30
- * @param data - Data to pipe throw all plugins and resolve after all
31
- * plugins have been resolved.
23
+ * @param givenState - Contains runtime information about current hook.
32
24
  * @param parameters - Additional parameters to forward into plugin api.
33
25
  *
34
26
  * @returns Given potentially modified data.
35
27
  */
36
- static callStackSynchronous<Input = unknown, Result = unknown>(this: void, hook: string, plugins: Array<Plugin>, configuration: Configuration, data?: Input, ...parameters: Array<unknown>): Result;
28
+ static callStackSynchronous<State extends BaseState<unknown> = ServicePromisesState, Output = void>(this: void, givenState: Omit<State, 'pluginAPI'>, ...parameters: Array<unknown>): Output;
37
29
  /**
38
30
  * Converts given plugin name into the corresponding internal
39
31
  * representation.
package/type.d.ts CHANGED
@@ -65,18 +65,17 @@ export declare type PackageConfiguration = Mapping<unknown> & {
65
65
  webNodeInternalName?: string;
66
66
  'web-node'?: EvaluateablePartialConfiguration;
67
67
  };
68
- export declare type APIFunction = null | ((_hook: string, _data: unknown, ..._parameters: Array<unknown>) => unknown);
69
68
  export interface Plugin {
70
- api: APIFunction;
69
+ api: APIFunction | null;
71
70
  apiFilePaths: Array<string>;
72
71
  apiFileLoadTimestamps: Array<number>;
73
72
  configuration: EvaluateablePartialConfiguration;
74
- configurationFilePaths: Array<string>;
75
73
  configurationFileLoadTimestamps: Array<number>;
74
+ configurationFilePaths: Array<string>;
75
+ packageConfiguration: PackageConfiguration;
76
76
  dependencies: Array<string>;
77
77
  internalName: string;
78
78
  name: string;
79
- packageConfiguration: PackageConfiguration;
80
79
  path: string;
81
80
  scope: null | object;
82
81
  }
@@ -92,70 +91,127 @@ export interface Service<Type = unknown> {
92
91
  }
93
92
  export declare type Services<PluginServiceType = Mapping<unknown>> = Mapping<unknown> & PluginServiceType;
94
93
  export declare type ServicePromises<PluginPromiseType = Mapping<unknown>> = Mapping<Promise<unknown>> & PluginPromiseType;
94
+ export interface BaseState<Type = undefined> {
95
+ configuration: Configuration;
96
+ data?: Type;
97
+ hook: string;
98
+ plugins: Array<Plugin>;
99
+ pluginAPI: typeof PluginAPI;
100
+ }
101
+ export interface ChangedState<Type = unknown> extends BaseState<Type> {
102
+ triggerHook?: string;
103
+ }
104
+ export interface ChangedConfigurationState<Type = unknown> extends ChangedState<Type> {
105
+ pluginsWithChangedConfiguration: Array<Plugin>;
106
+ }
107
+ export interface ChangedAPIFileState<Type = unknown> extends ChangedState<Type> {
108
+ pluginsWithChangedAPIFiles: Array<Plugin>;
109
+ }
110
+ export declare type APIFunction<Output = unknown, State extends BaseState<unknown> = ServicePromisesState> = (state: State, ...parameters: Array<unknown>) => Output;
111
+ export interface ServicesState<Type = undefined> extends BaseState<Type> {
112
+ services: Services;
113
+ }
114
+ export interface ServicePromisesState<Type = undefined> extends ServicesState<Type> {
115
+ servicePromises: ServicePromises;
116
+ }
117
+ /**
118
+ * Plugins can hook into the following life cycle.
119
+ *
120
+ * Starting lifecycle with:
121
+ * ------------------------
122
+ *
123
+ * 1. initialize (async)
124
+ * 1. preConfigurationLoaded (async)
125
+ * 2. postConfigurationLoaded (async)
126
+ * 3. preLoadService (async)
127
+ * 3.a preLoad_A_Service (async)
128
+ * 3.b preLoad_B_Service (async)
129
+ * ...
130
+ * 4. loadService (async)
131
+ * 5.a postLoad_A_Service (async)
132
+ * 5.b postLoad_B_Service (async)
133
+ * 5. postLoadService (async)
134
+ * 6. shouldExit (async)
135
+ * 7. exit (sync)
136
+ *
137
+ * Lifecycle with "hotReloading" (call "callStack" with hook "eventName"):
138
+ * ------------------------------------------------------------------
139
+ *
140
+ * 1. preConfigurationHotLoaded (async)
141
+ * 2. postConfigurationHotLoaded (async)
142
+ * 3. apiFileReloaded (async)
143
+ * 4. eventName (async)
144
+ *
145
+ * Lifecycle without "hotReloading" (call "callStack" with hook "eventName"):
146
+ * ---------------------------------------------------------------------
147
+ *
148
+ * 1. eventName (async)
149
+ */
95
150
  export interface PluginHandler {
96
151
  /**
97
152
  * Application started, static configuration loaded and all available
98
153
  * plugins are determined and sorted in there dependency specific
99
154
  * typological order. Asynchronous tasks are allowed and a returning
100
155
  * promise will be respected.
101
- * @param _configuration - Mutable configuration object. Extended by each
102
- * plugin specific configuration.
103
- * @param _plugins - Topological sorted list of plugins.
104
- * @param _pluginAPI - Plugin api reference.
156
+ * @param state - Application state.
105
157
  *
106
- * @returns Will be ignored.
158
+ * @returns Promise resolving to nothing.
107
159
  */
108
- initialize?(_configuration: Configuration, _plugins: Array<Plugin>, _pluginAPI: typeof PluginAPI): Promise<Array<Plugin>>;
160
+ initialize?(state: BaseState): Promise<void>;
109
161
  /**
110
162
  * Triggered hook when at least one plugin has a new configuration file and
111
163
  * configuration object has been changed. Asynchronous tasks are allowed
112
164
  * and a returning promise will be respected.
113
- * @param _configuration - Configuration object to update.
114
- * @param _pluginsWithChangedConfiguration - List of plugins which have a
115
- * changed plugin configuration.
116
- * @param _plugins - Topological sorted list of plugins.
117
- * @param _pluginAPI - Plugin api reference.
165
+ * @param state - Application state.
118
166
  *
119
- * @returns New configuration object to use.
167
+ * @returns Promise resolving to nothing.
120
168
  */
121
- preConfigurationLoaded?(_configuration: Configuration, _pluginsWithChangedConfiguration: Array<Plugin>, _plugins: Array<Plugin>, _pluginAPI: typeof PluginAPI): Promise<Configuration>;
169
+ preConfigurationHotLoaded?(state: ChangedConfigurationState): Promise<void>;
122
170
  /**
123
171
  * Triggered hook when at least one plugin has a new configuration file and
124
172
  * configuration object has been changed. Asynchronous tasks are allowed
125
173
  * and a returning promise will be respected.
126
- * @param _configuration - Updated configuration object.
127
- * @param _pluginsWithChangedConfiguration - List of plugins which have a
128
- * changed plugin configuration.
129
- * @param _plugins - Topological sorted list of plugins.
130
- * @param _pluginAPI - Plugin api reference.
174
+ * @param state - Application state.
131
175
  *
132
- * @returns New configuration object to use.
176
+ * @returns Promise resolving to nothing.
133
177
  */
134
- postConfigurationLoaded?(_configuration: Configuration, _pluginsWithChangedConfiguration: Array<Plugin>, _plugins: Array<Plugin>, _pluginAPI: typeof PluginAPI): Promise<Configuration>;
178
+ postConfigurationHotLoaded?(state: ChangedConfigurationState): Promise<void>;
179
+ /**
180
+ * Triggered hook when at least one plugin has a configuration file and
181
+ * configuration object has been initialized. Asynchronous tasks are
182
+ * allowed and a returning promise will be respected.
183
+ * @param state - Application state.
184
+ *
185
+ * @returns Promise resolving to nothing.
186
+ */
187
+ preConfigurationLoaded?(state: ChangedConfigurationState): Promise<void>;
188
+ /**
189
+ * Triggered hook when at least one plugin has a configuration file and
190
+ * configuration object has been initialized. Asynchronous tasks are
191
+ * allowed and a returning promise will be respected.
192
+ * @param state - Application state.
193
+ *
194
+ * @returns Promise resolving to nothing.
195
+ */
196
+ postConfigurationLoaded?(state: ChangedConfigurationState): Promise<void>;
135
197
  /**
136
198
  * Plugins are initialized now and plugins should initialize their
137
199
  * continues running services (if they have one). Asynchronous tasks are
138
200
  * allowed and a returning promise will be respected.
139
- * @param _services - An object with stored service instances.
140
- * @param _configuration - Configuration object extended by each plugin
141
- * specific configuration.
142
- * @param _plugins - Topological sorted list of plugins.
143
- * @param _pluginAPI - Plugin api reference.
201
+ * @param state - Application state.
144
202
  *
145
- * @returns Given and maybe extended object of services.
203
+ * @returns Promise resolving to given and maybe extended object of
204
+ * services.
146
205
  */
147
- preLoadService?(_services: Services, _configuration: Configuration, _plugins: Array<Plugin>, _pluginAPI: typeof PluginAPI): Promise<Services>;
206
+ preLoadService?(state: ServicesState): Promise<void>;
148
207
  /**
149
208
  * Plugins are initialized now and plugins should initialize their
150
209
  * continues running services (if they have one). Asynchronous tasks are
151
210
  * allowed and a returning promise will be respected.
152
- * @param _services - An object with stored service instances.
153
- * @param _configuration - Configuration object extended by each plugin
154
- * specific configuration.
155
- * @param _plugins - Topological sorted list of plugins.
156
- * @param _pluginAPI - Plugin api reference.
211
+ * @param state - Application state.
157
212
  *
158
- * @returns Given and maybe extended object of services.
213
+ * @returns Promise resolving to given and maybe extended object of
214
+ * services.
159
215
  */
160
216
  /**
161
217
  * Plugins have initialized their continues running service and should
@@ -163,94 +219,60 @@ export interface PluginHandler {
163
219
  * returned. Asynchronous tasks are allowed and a returning promise will be
164
220
  * respected NOTE: You have to wrap a promise in a promise if a continues
165
221
  * service should be registered.
166
- * @param _servicePromises - An intermediate object with yet stored service
167
- * promise instances.
168
- * @param _services - An object with stored service instances.
169
- * @param _configuration - Configuration object extended by each plugin
170
- * specific configuration.
171
- * @param _plugins - Topological sorted list of plugins.
172
- * @param _pluginAPI - Plugin api reference.
222
+ * @param state - Application state.
173
223
  *
174
224
  * @returns A promise which correspond to the plugin specific continues
175
225
  * service.
176
226
  */
177
- loadService?(_servicePromises: ServicePromises, _services: Services, _configuration: Configuration, _plugins: Array<Plugin>, _pluginAPI: typeof PluginAPI): Promise<null | Service>;
227
+ loadService?(state: ServicePromisesState): Promise<null | Service>;
178
228
  /**
179
229
  * Plugins have launched their continues running services and returned a
180
230
  * corresponding promise which can be observed here.
181
- * @param _services - An object with stored service instances.
182
- * @param _servicePromises - An object with stored service promise
183
- * instances.
184
- * @param _configuration - Configuration object extended by each plugin
185
- * specific configuration.
186
- * @param _plugins - Topological sorted list of plugins.
187
- * @param _pluginAPI - Plugin api reference.
231
+ * @param state - Application state.
188
232
  *
189
- * @returns Given and maybe extended object of services.
233
+ * @returns A promise which correspond to the plugin specific continues
234
+ * service.
190
235
  */
191
236
  /**
192
237
  * Plugins have launched their continues running services and returned a
193
238
  * corresponding promise which can be observed here.
194
- * @param _servicePromises - An object with stored service promise
195
- * instances.
196
- * @param _services - An object with stored service instances.
197
- * @param _configuration - Configuration object extended by each plugin
198
- * specific configuration.
199
- * @param _plugins - Topological sorted list of plugins.
200
- * @param _pluginAPI - Plugin api reference.
239
+ * @param state - Application state.
201
240
  *
202
- * @returns Given and maybe extended object of services.
241
+ * @returns A promise which correspond to the plugin specific continues
242
+ * service promises.
203
243
  */
204
- postLoadService?(_servicePromises: ServicePromises, _services: Services, _configuration: Configuration, _plugins: Array<Plugin>, _pluginAPI: typeof PluginAPI): Promise<ServicePromises>;
244
+ postLoadService?(state: ServicePromisesState): Promise<void>;
205
245
  /**
206
246
  * Triggered hook when at least one plugin has an api file which has been
207
247
  * changed and is reloaded. Asynchronous tasks are allowed and a returning
208
248
  * promise will be respected.
209
- * @param _pluginsWithChangedAPIFiles - List of plugins which have a
210
- * changed plugin api file.
211
- * @param _configuration - Configuration object extended by each plugin
212
- * specific configuration.
213
- * @param _plugins - Topological sorted list of plugins.
214
- * @param _pluginAPI - Plugin api reference.
249
+ * @param state - Application state.
215
250
  *
216
- * @returns Will be ignored.
251
+ * @returns Promise resolving to nothing.
217
252
  */
218
- apiFileReloaded?(_pluginsWithChangedAPIFiles: Array<Plugin>, _configuration: Configuration, _plugins: Array<Plugin>, _pluginAPI: typeof PluginAPI): Promise<Array<Plugin>>;
253
+ apiFileReloaded?(state: ChangedAPIFileState): Promise<void>;
219
254
  /**
220
255
  * Application has thrown an error and will be closed soon. Asynchronous
221
256
  * tasks are allowed and a returning promise will be respected.
222
- * @param _error - An object with stored informations why an error occurs.
223
- * @param _services - An object with stored service instances.
224
- * @param _configuration - Configuration object extended by each plugin
225
- * specific configuration.
226
- * @param _plugins - Topological sorted list of plugins.
227
- * @param _pluginAPI - Plugin api reference.
257
+ * @param state - Application state.
228
258
  *
229
- * @returns Given and maybe changed object of services.
259
+ * @returns Promise resolving to nothing.
230
260
  */
231
- error?(_error: object, _services: Services, _configuration: Configuration, _plugins: Array<Plugin>, _pluginAPI: typeof PluginAPI): Promise<Services>;
261
+ error?(state: ServicesState): Promise<void>;
232
262
  /**
233
263
  * Triggers if application will be closed soon. Asynchronous tasks are
234
264
  * allowed and a returning promise will be respected.
235
- * @param _services - An object with stored service instances.
236
- * @param _configuration - Configuration object extended by each plugin
237
- * specific configuration.
238
- * @param _plugins - Topological sorted list of plugins.
239
- * @param _pluginAPI - Plugin api reference.
265
+ * @param state - Application state.
240
266
  *
241
- * @returns Given and maybe changed object of services.
267
+ * @returns Promise resolving to nothing.
242
268
  */
243
- shouldExit?(_services: Services, _configuration: Configuration, _plugins: Array<Plugin>, _pluginAPI: typeof PluginAPI): Promise<Services>;
269
+ shouldExit?(state: ServicePromisesState): Promise<void>;
244
270
  /**
245
271
  * Triggers if application will be closed immediately no asynchronous tasks
246
272
  * allowed anymore.
247
- * @param _services - An object with stored service instances.
248
- * @param _configuration - Configuration object extended by each plugin
249
- * specific configuration.
250
- * @param _plugins - Topological sorted list of plugins.
251
- * @param _pluginAPI - Plugin api reference.
273
+ * @param state - Application state.
252
274
  *
253
- * @returns Given and maybe changed object of services.
275
+ * @returns Nothing.
254
276
  */
255
- exit?(_services: Services, _configuration: Configuration, _plugins: Array<Plugin>, _pluginAPI: typeof PluginAPI): Services;
277
+ exit?(state: ServicePromisesState): void;
256
278
  }