web-node 1.0.513 → 1.0.514

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.
@@ -1,37 +1,34 @@
1
1
  import { Configuration, PluginHandler, PluginPromises, ServicePromisesState, Services } from '../type';
2
2
  /**
3
- * Dummy plugin implementing a test hook.
3
+ * Loads dummy service.
4
+ * @param state - Application state.
5
+ * @param state.services - Plugin services.
6
+ * @returns A mapping to promises which correspond to the plugin specific
7
+ * continues services.
4
8
  */
5
- export default class Dummy implements PluginHandler {
6
- /**
7
- * Loads dummy service.
8
- * @param state - Application state.
9
- * @param state.services - Plugin services.
10
- * @returns A mapping to promises which correspond to the plugin specific
11
- * continues services.
12
- */
13
- static loadService(this: void, { services }: ServicePromisesState): Promise<PluginPromises>;
14
- /**
15
- * Asynchronous mock test method.
16
- * @param state - Application state.
17
- * @param state.services - Plugin services.
18
- * @param state.services.dummy - Plugin service.
19
- * @returns A promise resolving to nothing.
20
- */
21
- static test(this: void, { services: { dummy } }: ServicePromisesState<undefined, Configuration, Services<{
22
- dummy: {
23
- hookCalled: boolean;
24
- };
25
- }>>): Promise<void>;
26
- /**
27
- * Synchronous mock test method.
28
- * @param state - Application state.
29
- * @param state.services - Plugin services.
30
- * @param state.services.dummy - Plugin service.
31
- */
32
- static testSynchronous(this: void, { services: { dummy } }: ServicePromisesState<undefined, Configuration, Services<{
33
- dummy: {
34
- synchronousHookCalled: boolean;
35
- };
36
- }>>): void;
37
- }
9
+ export declare const loadService: ({ services }: ServicePromisesState) => Promise<PluginPromises>;
10
+ /**
11
+ * Asynchronous mock test method.
12
+ * @param state - Application state.
13
+ * @param state.services - Plugin services.
14
+ * @param state.services.dummy - Plugin service.
15
+ * @returns A promise resolving to nothing.
16
+ */
17
+ export declare const test: ({ services: { dummy } }: ServicePromisesState<undefined, Configuration, Services<{
18
+ dummy: {
19
+ hookCalled: boolean;
20
+ };
21
+ }>>) => Promise<void>;
22
+ /**
23
+ * Synchronous mock test method.
24
+ * @param state - Application state.
25
+ * @param state.services - Plugin services.
26
+ * @param state.services.dummy - Plugin service.
27
+ */
28
+ export declare const testSynchronous: ({ services: { dummy } }: ServicePromisesState<undefined, Configuration, Services<{
29
+ dummy: {
30
+ synchronousHookCalled: boolean;
31
+ };
32
+ }>>) => void;
33
+ export declare const Dummy: PluginHandler;
34
+ export default Dummy;
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}module===eval("require.main")&&module.paths.unshift("/application/node_modules"),(()=>{var __webpack_modules__=[(e,_,r)=>{r.d(_,{H:()=>g,A:()=>I});var n=r(3),t=r.n(n),a=r(6),o=r(7),i=r.n(o),l=r(8),c=r.n(l),u=r(1);const s=JSON.parse('{"name":"web-node","version":"1.0.512","description":"High level javaScript backend plugin system and configuration merger.","keywords":["api","backend","management","plugin","web"],"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":"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":"yarn build:plain && yarn start","start":"./index.js \'{plugin: {hotReloading: true}}\'","prepare:test":"yarn clear && cd dummyPlugin && shx touch yarn.lock && 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 npm publish","update:documentation":"documentation-website","watch":"weboptimizer build --watch"},"runkitExample":"require(\'@babel/runtime/package.json\')\\nrequire(\'clientnode/package.json\')\\n\\nconst {PluginAPI} = require(\'web-node\')\\n\\nPluginAPI.loadFile(\'./unixCrypt.js\', \'crypt\')(\'test\')","devDependencies":{"@babel/cli":"^7.24.8","@babel/eslint-parser":"^7.24.8","@babel/runtime":"^7.24.8","@types/node":"^20.14.10","@typescript-eslint/eslint-plugin":"^7.16.0","@typescript-eslint/parser":"^7.16.0","clientnode":"^3.0.1166","documentation-website":"^1.0.328","eslint":"^9.7.0","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^48.7.0","jest":"^29.7.0","jsdoc":"^4.0.3","shx":"^0.3.4","typescript-eslint":"^7.16.0","weboptimizer":"^2.0.1486"},"peerDependencies":{"@babel/runtime":"*","clientnode":"*"},"peerDependenciesMeta":{"@babel/runtime":{"optional":true}},"engines":{"node":">=20","npm":">=10","yarn":">=4"},"resolutions":{"colors":"1.4.0","globals@npm:^14.0.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^11.1.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^9.18.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"},"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"}},"packageManager":"yarn@4.1.0+sha256.81a00df816059803e6b5148acf03ce313cad36b7f6e5af6efa040a15981a6ffb"}');var p,d;function E(e,_){(null==_||_>e.length)&&(_=e.length);for(var r=0,n=Array(_);r<_;r++)n[r]=e[r];return n}for(s.webNode.core.context={path:"/",type:"relative"};s.webNode.core.context.path=(0,l.resolve)(s.webNode.core.context.path,"../../"),"node_modules"===(0,l.basename)((0,l.dirname)(s.webNode.core.context.path)););if("/"===s.webNode.core.context.path||"node_modules"===(0,l.basename)((0,l.dirname)(process.cwd()))||".staging"===(0,l.basename)((0,l.dirname)(process.cwd()))&&"node_modules"===(0,l.basename)((0,l.dirname)((0,l.dirname)(process.cwd()))))s.webNode.core.context.path=process.cwd();else try{(0,o.lstatSync)((0,l.join)(process.cwd(),"node_modules")).isSymbolicLink()&&(s.webNode.core.context.path=process.cwd())}catch(e){}var b={name:"main"};try{b=(0,a.currentRequire)((0,l.join)(s.webNode.core.context.path,"package"))}catch(e){s.webNode.core.context.path=process.cwd()}var f=(null==(p=b.documentationWebsite)?void 0:p.name)||b.name||"main",m=b.webNode||((d={})[f]={name:f,package:b},d);s.webNode.core.name=s.documentationWebsite.name;var P=new Date,O=t()({},a.UTILITY_SCOPE,{currentPath:process.cwd(),fs:i(),path:c(),PluginAPI:u.Ay,webNodePath:"/",now:P,nowUTCTimestamp:(0,a.getUTCTimestamp)(P)}),g=(0,a.evaluateDynamicData)(s.webNode,O);delete s.webNode,(0,a.extend)(!0,(0,a.modifyObject)(g,m),m);for(var h,D={},M=function(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=function(e,_){if(e){if("string"==typeof e)return E(e,_);var r={}.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)?E(e,_):void 0}}(e))||_&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(process.argv.slice(1));!(h=M()).done;){var A=h.value,v=(0,a.parseEncodedObject)(A,g,"configuration");(0,a.isPlainObject)(v)&&(0,a.extend)(!0,D,v)}0<Object.keys(D).length&&((0,a.extend)(!0,(0,a.modifyObject)(g,D),D),g.core.runtimeConfiguration=D),(g=(0,a.evaluateDynamicData)((0,a.removeKeysInEvaluation)(g),O)).name=f,g.core.package=s;const I=g},(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{var __dirname="/";__webpack_require__.d(__webpack_exports__,{Ay:()=>__WEBPACK_DEFAULT_EXPORT__,Qq:()=>PluginAPI,lE:()=>currentRequire});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 n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}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={}.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,n=Array(_);r<_;r++)n[r]=e[r];return n}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 n,t,a,o,i,l,c,u,s,p,d,E,b,f,m,P,O,g=arguments;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:if(n=_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},r,{pluginAPI:e}),t=n.configuration,a=n.hook,o=n.plugins,i=a.endsWith("ConfigurationLoaded")||a.endsWith("ConfigurationHotLoaded"),!t.core.plugin.hotReloading){_.next=20;break}if(i){_.next=14;break}if(!(l=e.hotReloadConfigurationFile(o,t.core.plugin.configuration.propertyNames)).length){_.next=14;break}return t.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()({},n,{triggerHook:n.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,t),_.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 t.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()({},n,{hook:"apiFileReloaded",pluginsWithChangedAPIFiles:u,triggerHook:n.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];b=_createForOfIteratorHelperLoose(o);case 23:if((f=b()).done){_.next=42;break}if(!(m=f.value).api){_.next=40;break}return P=void 0,_.prev=27,_.next=30,m.api.apply(m,[n].concat(d));case 30:P=_.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 "'+m.internalName+'" '+(m.internalName===m.name?"":"("+m.name+") ")+"throws: "+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(_.t0)+' during asynchronous hook "'+a+'".');case 38:s=P,t.core.debug&&console.info('Ran asynchronous hook "'+a+'" for plugin "'+m.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}),n=r.configuration,t=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: "+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(e)+' during synchronous hook"'+t+'".')}o=d,n.core.debug&&console.info('Ran synchronous hook "'+t+'" for plugin "'+s.name+'".')}return o},e.determineInternalName=function(e,_){return(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.delimitedToCamelCase)(e.replace(_,(function(e,_){return"string"==typeof _?_:e})))},e.evaluateConfiguration=function(_){for(var r={},n=0,t=Object.entries(_);n<t.length;n++){var a=t[n],o=a[0],i=a[1];i.package&&(r[o]=i.package,delete i.package)}var l=new Date;_=(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.evaluateDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_4__.removeKeysInEvaluation)(_),_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},clientnode__WEBPACK_IMPORTED_MODULE_4__.UTILITY_SCOPE,{currentPath:process.cwd(),fs:fs__WEBPACK_IMPORTED_MODULE_5___default(),path:path__WEBPACK_IMPORTED_MODULE_7___default(),PluginAPI:e,webNodePath:__dirname,now:l,nowUTCTimestamp:(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.getUTCTimestamp)(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,n,t=[],a=_createForOfIteratorHelperLoose(e.hotReloadFiles("api","scope",_));!(r=a()).done;)if((n=r.value).oldScope){for(var o=0,i=Object.entries(n.oldScope);o<i.length;o++){var l=i[o],c=l[0],u=l[1];Object.prototype.hasOwnProperty.call(n.newScope,c)&&!(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFunction)(n.newScope[c])&&(n.newScope[c]=u)}t.push(n.plugin)}return t},e.hotReloadConfigurationFile=function(_,r){for(var n,t,a=[],o=_createForOfIteratorHelperLoose(e.hotReloadFiles("configuration","packageConfiguration",_));!(n=o()).done;)(t=n.value).plugin.configuration=e.loadConfiguration(t.plugin.internalName,t.plugin.packageConfiguration,r),a.push(t.plugin);return a},e.hotReloadFiles=function(_,r,n){for(var t,a,o=[],i=_createForOfIteratorHelperLoose(n);!(t=i()).done;)if((a=t.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,n,t,a,o,i){var l,c,u,s,p,d,E,b;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,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)(d);case 9:if(!_.sent){_.next=12;break}(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.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 n=c.webNodeInternalName||n,(b=e.loadConfiguration(n,c,a.propertyNames))[n].package.main&&(E[0]=b[n].package.main),_.next=21,e.loadAPI(E,o,r,n,t,i,b,l);case 21:return _.abrupt("return",_.sent);case 22:return _.next=24,e.loadAPI(E,o,r,n,t,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,n,t,a,o,i,l,c){var u,s,p,d,E,b,f,m,P,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)(n,r[0]),_.next=6,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)(E);case 6:if(_.sent){_.next=21;break}b=_createForOfIteratorHelperLoose((0,fs__WEBPACK_IMPORTED_MODULE_5__.readdirSync)(n));case 8:if((f=b()).done){_.next=21;break}if(m=f.value,_.t0=!c.map((function(e){return(0,path__WEBPACK_IMPORTED_MODULE_7__.basename)(e)})).includes(m),!_.t0){_.next=15;break}return _.next=14,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)((0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(n,m));case 14:_.t0=_.sent;case 15:if(!_.t0){_.next=19;break}if(E=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(n,E),!["index","main"].includes((0,path__WEBPACK_IMPORTED_MODULE_7__.basename)(E,(0,path__WEBPACK_IMPORTED_MODULE_7__.extname)(m)))){_.next=19;break}return _.abrupt("break",21);case 19:_.next=8;break;case 21:if(P=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,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)(E);case 27:_.t1=_.sent;case 28:if(!_.t1){_.next=30;break}E.endsWith(".js")?(O=!0,P=function(_){for(var r,n=arguments.length,a=Array(1<n?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];if(_.hook in o[t].scope)return(r=o[t].scope)[_.hook].apply(r,[_].concat(a,[e]));throw new Error('NotImplemented: API method "'+_.hook+'" is not implemented in plugin "'+t+'".')}):P=function(e){for(var _=e.hook,r=e.data,n=arguments.length,t=Array(1<n?n-1:0),a=1;a<n;a++)t[a-1]=arguments[a];var o=(0,child_process__WEBPACK_IMPORTED_MODULE_3__.spawnSync)(E,[_].concat(t.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:P,apiFileLoadTimestamps:P?[(0,fs__WEBPACK_IMPORTED_MODULE_5__.statSync)(E).mtime.getTime()]:[],apiFilePaths:P?[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:t,packageConfiguration:null==(d=g[a])?void 0:d.package,path:n,scope:O?e.loadFile(E,t):null});case 32:case"end":return _.stop()}}),_)})));return function(){return _.apply(this,arguments)}}(),e.loadConfiguration=function(e,_,r){for(var n,t,a,o=(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.removeKeyPrefixes)((0,clientnode__WEBPACK_IMPORTED_MODULE_4__.copy)(_)),i=((n={})[e]={package:o},n),l=_createForOfIteratorHelperLoose(r);!(t=l()).done;)if(_[a=t.value]){(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,i,_[a]),delete i[e].package[a];break}return i},e.loadConfigurations=function(_,r){for(var n=0,t=Object.keys(r);n<t.length;n++)delete r[t[n]];(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(r,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.copy)(_configurator__WEBPACK_IMPORTED_MODULE_8__.A));for(var a,o,i=_createForOfIteratorHelperLoose(_);!(a=i()).done;)if((o=a.value).configuration){var l=(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.copy)(o.configuration);(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.modifyObject)(r,l),l),r.core.runtimeConfiguration&&(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,r,r.core.runtimeConfiguration)}return e.evaluateConfiguration(r)},e.loadFile=function(e,_,r,n){var t,a;void 0===r&&(r=null),void 0===n&&(n=!0);try{t=currentRequire.resolve(e)}catch(e){}t&&t in currentRequire.cache&&delete currentRequire.cache[t];try{a=currentRequire(e)}catch(t){if(!r)throw new Error("Couldn't load plugin file \""+e+'" for plugin "'+_+'": '+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(t));a=r,n&&console.warn("Couln't load new api plugin file \""+e+'" for plugin "'+_+'": '+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(t)+". 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 n,t,a,o,i,l,c,u,s,p,d,E,b,f,m,P,O,g,h,D,M,A,v,I,k,y;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(_){for(;;)switch(_.prev=_.next){case 0:if(n={},"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)),n,r.core.plugin.configuration,r.core.context.path,r.core.encoding);case 4:n[r.name]=_.sent;case 5:t=0,a=Object.values(r.core.plugin.directories);case 6:if(!(t<a.length)){_.next=27;break}return o=a[t],_.next=10,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.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,n,r.core.plugin.configuration,s,r.core.encoding);case 21:n[u]=_.sent;case 22:_.next=13;break;case 24:t++,_.next=6;break;case 27:for(d={},E=0,b=Object.values(n);E<b.length;E++)if(f=b[E],d[f.internalName]=f.dependencies,Object.prototype.hasOwnProperty.call(r.core.interDependencies,f.internalName))for(m=_createForOfIteratorHelperLoose([].concat(r.core.interDependencies[f.internalName]));!(P=m()).done;)O=P.value,d[f.internalName].includes(O)||d[f.internalName].push(O);g=[],h=_createForOfIteratorHelperLoose((0,clientnode__WEBPACK_IMPORTED_MODULE_4__.sortTopological)(d));case 31:if((D=h()).done){_.next=44;break}M=D.value,A=0,v=Object.entries(n);case 34:if(!(A<v.length)){_.next=42;break}if(I=v[A],k=I[0],![(y=I[1]).internalName,k].includes(M)){_.next=39;break}return g.push(y),_.abrupt("break",42);case 39:A++,_.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,_){var r=e.core.context.path;return void 0===_&&(_=[]),(_=[].concat(_)).length?_.map((function(e){return(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(r,e)})):[r]},e.isInLocations=function(e,_,r,n){for(var t,a,o=_.map((function(e){return e.path})),i=_createForOfIteratorHelperLoose([].concat(n));!(t=i()).done;)if((a=t.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__.Qq,configuration:()=>_configurator__WEBPACK_IMPORTED_MODULE_3__.H,currentRequire:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.lE,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 n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}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={}.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,n=Array(_);r<_;r++)n[r]=e[r];return n}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__.Ay.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,n,t,a,o,i,l,c,u,s,p,d,E,b,f,m,P,O,g,h,D,M,A,v,I,k,y,T;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__.Ay.loadAll((0,clientnode__WEBPACK_IMPORTED_MODULE_5__.copy)(_configurator__WEBPACK_IMPORTED_MODULE_3__.A));case 2:return _=e.sent,r=_.configuration,n=_.plugins,e.next=7,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Ay.callStack({configuration:r,hook:"initialize",plugins:n});case 7:n.length&&console.info('Loaded plugins: "'+n.map((function(e){return e.internalName})).join('", "')+'".'),t=n.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__.Ay.callStack({configuration:r,hook:i+"ConfigurationLoaded",plugins:n,pluginsWithChangedConfiguration:t});case 14:e.next=10;break;case 16:return l={},c={},u=!1,e.prev=19,e.next=22,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Ay.callStack({configuration:r,hook:"preLoadService",plugins:n,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(n);case 24:if((b=E()).done){e.next=45;break}if(!(f=b.value).api){e.next=43;break}return e.next=29,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Ay.callStack({configuration:r,hook:"preLoad"+(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.capitalize)(f.internalName)+"Service",plugins:n,services:l});case 29:return m=null,e.prev=30,e.next=33,f.api({configuration:r,hook:"loadService",pluginAPI:_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Ay,plugins:n,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!=(P=e.t0.message)&&P.startsWith("NotImplemented:")){e.next=40;break}throw new Error('Plugin "'+f.internalName+'" '+(f.internalName===f.name?"":"("+f.name+") ")+"throws: "+(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.represent)(e.t0)+' \'during asynchrone hook "loadService".');case 40:if(m)for(O=0,g=Object.entries(m);O<g.length;O++)h=g[O],D=h[0],null!==(M=h[1])&&"object"==typeof M&&"then"in M?(console.info('Service "'+D+'" started.'),c[D]=M):console.info('Service "'+D+'" loaded.');return e.next=43,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Ay.callStack({configuration:r,hook:"postLoad"+(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.capitalize)(f.internalName)+"Service",plugins:n,services:l,servicePromises:c});case 43:e.next=24;break;case 45:return e.next=47,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Ay.callStack({configuration:r,hook:"postLoadService",plugins:n,servicePromises:c,services:l});case 47:for(A=!1,v=function(){A||_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Ay.callStackSynchronous({configuration:r,hook:"exit",plugins:n.slice().reverse(),servicePromises:c,services:l}),A=!0},I=_createForOfIteratorHelperLoose(clientnode__WEBPACK_IMPORTED_MODULE_5__.CLOSE_EVENT_NAMES);!(k=I()).done;)y=k.value,process.on(y,v);return T=!1,(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.isFunction)(process.stdin.setRawMode)&&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(!T){_.next=5;break}console.warn("Stopping ungracefully."),_.next=9;break;case 5:return T=!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__.Ay.callStack({configuration:r,hook:"shouldExit",plugins:n,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__.Ay.callStack({configuration:r,hook:"shouldExit",plugins:n,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:n,servicePromises:c,services:l});case 72:if(u){e.next=82;break}return e.prev=73,e.next=76,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.Ay.callStack({configuration:r,hook:"shouldExit",plugins:n,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:n,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]&&void 0!==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__})();
2
+ "use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}module===eval("require.main")&&module.paths.unshift("/application/node_modules"),(()=>{var __webpack_modules__=[(module,__webpack_exports__,__webpack_require__)=>{var __dirname="/";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{callStack:()=>callStack,callStackSynchronous:()=>callStackSynchronous,currentRequire:()=>currentRequire,determineInternalName:()=>determineInternalName,determineLocations:()=>determineLocations,evaluateConfiguration:()=>evaluateConfiguration,hotReloadAPIFile:()=>hotReloadAPIFile,hotReloadConfigurationFile:()=>hotReloadConfigurationFile,hotReloadFiles:()=>hotReloadFiles,isInLocations:()=>isInLocations,load:()=>load,loadAPI:()=>loadAPI,loadAll:()=>loadAll,loadConfiguration:()=>loadConfiguration,loadConfigurations:()=>loadConfigurations,loadFile:()=>loadFile});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__(1);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 n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}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={}.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,n=Array(_);r<_;r++)n[r]=e[r];return n}module=__webpack_require__.hmd(module);var currentRequire=eval("require"),oldResolveFilename=module__WEBPACK_IMPORTED_MODULE_6__.Module._resolveFilename;module__WEBPACK_IMPORTED_MODULE_6__.Module._resolveFilename=function(e,_,r){var n;return"web-node"===e&&null!=(n=currentRequire.main)&&n.id?oldResolveFilename(currentRequire.main.id,_,r):oldResolveFilename(e,_,r)};var callStack=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,n,t,a,o,i,l,c,u,s,p,d,E,b,f,P,m,O=arguments;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},_,{pluginAPI:module.exports}),n=r.configuration,t=r.hook,a=r.plugins,o=t.endsWith("ConfigurationLoaded")||t.endsWith("ConfigurationHotLoaded"),!n.core.plugin.hotReloading){e.next=20;break}if(o){e.next=14;break}if(!(i=hotReloadConfigurationFile(a,n.core.plugin.configuration.propertyNames)).length){e.next=14;break}return n.core.debug&&console.info('Configuration for "'+i.map((function(e){return e.name})).join('", "')+'" has been changed: reloading initialized.'),l=_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},r,{triggerHook:r.hook,pluginsWithChangedConfiguration:i}),e.next=11,callStack(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},l,{hook:"preConfigurationHotLoaded"}));case 11:return loadConfigurations(a,n),e.next=14,callStack(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},l,{hook:"postConfigurationHotLoaded"}));case 14:if("apiFileReloaded"===t){e.next=20;break}if(!(c=hotReloadAPIFile(a)).length){e.next=20;break}return n.core.debug&&console.info('API-file for "'+c.map((function(e){return e.name})).join('", "')+'" has been changed: reloading initialized.'),e.next=20,callStack(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},r,{hook:"apiFileReloaded",pluginsWithChangedAPIFiles:c,triggerHook:r.hook}));case 20:for(u=_.data,s=O.length,p=Array(1<s?s-1:0),d=1;d<s;d++)p[d-1]=O[d];E=_createForOfIteratorHelperLoose(a);case 23:if((b=E()).done){e.next=42;break}if(!(f=b.value).api){e.next=40;break}return P=void 0,e.prev=27,e.next=30,f.api.apply(f,[r].concat(p));case 30:P=e.sent,e.next=38;break;case 33:if(e.prev=33,e.t0=e.catch(27),null==(m=e.t0.message)||!m.startsWith("NotImplemented:")){e.next=37;break}return e.abrupt("continue",40);case 37:throw new Error('Plugin "'+f.internalName+'" '+(f.internalName===f.name?"":"("+f.name+") ")+"throws: "+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(e.t0)+' during asynchronous hook "'+t+'".');case 38:u=P,n.core.debug&&console.info('Ran asynchronous hook "'+t+'" for plugin "'+f.name+'".');case 40:e.next=23;break;case 42:return e.abrupt("return",u);case 43:case"end":return e.stop()}}),e,null,[[27,33]])})));return function(){return e.apply(this,arguments)}}(),callStackSynchronous=function(e){for(var _=_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},e,{pluginAPI:module.exports}),r=_.configuration,n=_.hook,t=_.plugins,a=e.data,o=arguments.length,i=Array(1<o?o-1:0),l=1;l<o;l++)i[l-1]=arguments[l];for(var c,u,s=_createForOfIteratorHelperLoose(t);!(c=s()).done;)if((u=c.value).api){var p=void 0;try{p=u.api.apply(u,[_].concat(i))}catch(e){var d;if(null!=(d=e.message)&&d.startsWith("NotImplemented:"))continue;throw new Error('Plugin "'+u.internalName+'" '+(u.internalName===u.name?"":"("+u.name+") ")+"throws: "+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(e)+' during synchronous hook"'+n+'".')}a=p,r.core.debug&&console.info('Ran synchronous hook "'+n+'" for plugin "'+u.name+'".')}return a},determineInternalName=function(e,_){return(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.delimitedToCamelCase)(e.replace(_,(function(e,_){return"string"==typeof _?_:e})))},evaluateConfiguration=function(e){for(var _={},r=0,n=Object.entries(e);r<n.length;r++){var t=n[r],a=t[0],o=t[1];o.package&&(_[a]=o.package,delete o.package)}var i=new Date;e=(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.evaluateDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_4__.removeKeysInEvaluation)(e),_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},clientnode__WEBPACK_IMPORTED_MODULE_4__.UTILITY_SCOPE,{currentPath:process.cwd(),fs:fs__WEBPACK_IMPORTED_MODULE_5___default(),path:path__WEBPACK_IMPORTED_MODULE_7___default(),module,webNodePath:__dirname,now:i,nowUTCTimestamp:(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.getUTCTimestamp)(i)}));for(var l=0,c=Object.entries(_);l<c.length;l++){var u=c[l],s=u[0],p=u[1];e[s].package=p}return e},hotReloadAPIFile=function(e){for(var _,r=[],n=0,t=hotReloadFiles("api","scope",e);n<t.length;n++)if((_=t[n]).oldScope){for(var a=0,o=Object.entries(_.oldScope);a<o.length;a++){var i=o[a],l=i[0],c=i[1];Object.prototype.hasOwnProperty.call(_.newScope,l)&&!(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFunction)(_.newScope[l])&&(_.newScope[l]=c)}r.push(_.plugin)}return r},hotReloadConfigurationFile=function(e,_){for(var r,n=[],t=0,a=hotReloadFiles("configuration","packageConfiguration",e);t<a.length;t++)(r=a[t]).plugin.configuration=loadConfiguration(r.plugin.internalName,r.plugin.packageConfiguration,_),n.push(r.plugin);return n},hotReloadFiles=function(e,_,r){for(var n,t,a=[],o=_createForOfIteratorHelperLoose(r);!(n=o()).done;)if((t=n.value)[_])for(var i,l=0,c=_createForOfIteratorHelperLoose(t[e+"FilePaths"]);!(i=c()).done;){var u=i.value,s=(0,fs__WEBPACK_IMPORTED_MODULE_5__.statSync)(u).mtime.getTime();if(t[e+"FileLoadTimestamps"][l]<s){delete currentRequire.cache[currentRequire.resolve(u)];var p=t[_];t[_]=loadFile(u,t.name,t[_]),a.push({newScope:t[_],oldScope:p,plugin:t,target:_})}t[e+"FileLoadTimestamps"][l]=s,l+=1}return a},load=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark((function e(_,r,n,t,a,o){var i,l,c,u,s,p,d,E;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:void 0===o&&(o="utf8"),i=[],l={},c=_createForOfIteratorHelperLoose(t.fileNames);case 4:if((u=c()).done){e.next=14;break}return s=u.value,p=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(a,s),e.next=9,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)(p);case 9:if(!e.sent){e.next=12;break}(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,l,loadFile(p,_)),i.push(p);case 12:e.next=4;break;case 14:if(d=["index.js"],!Object.keys(l).length){e.next=22;break}return r=l.webNodeInternalName||r,(E=loadConfiguration(r,l,t.propertyNames))[r].package.main&&(d[0]=E[r].package.main),e.next=21,loadAPI(d,a,_,r,n,o,E,i);case 21:return e.abrupt("return",e.sent);case 22:return e.next=24,loadAPI(d,a,_,r,n,o);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),loadAPI=function(){var e=_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark((function e(_,r,n,t,a,o,i,l){var c,u,s,p,d,E,b,f,P;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===o&&(o="utf8"),void 0===i&&(i=null),void 0===l&&(l=[]),s=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(r,_[0]),e.next=6,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)(s);case 6:if(e.sent){e.next=21;break}p=_createForOfIteratorHelperLoose((0,fs__WEBPACK_IMPORTED_MODULE_5__.readdirSync)(r));case 8:if((d=p()).done){e.next=21;break}if(E=d.value,e.t0=!l.map((function(e){return(0,path__WEBPACK_IMPORTED_MODULE_7__.basename)(e)})).includes(E),!e.t0){e.next=15;break}return e.next=14,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)((0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(r,E));case 14:e.t0=e.sent;case 15:if(!e.t0){e.next=19;break}if(s=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(r,s),!["index","main"].includes((0,path__WEBPACK_IMPORTED_MODULE_7__.basename)(s,(0,path__WEBPACK_IMPORTED_MODULE_7__.extname)(E)))){e.next=19;break}return e.abrupt("break",21);case 19:e.next=8;break;case 21:if(b=null,f=!1,e.t1=i&&(1<Object.keys(i).length||Object.prototype.hasOwnProperty.call(i,t)&&1<Object.keys(i[t]).length),!e.t1){e.next=28;break}return e.next=27,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isFile)(s);case 27:e.t1=e.sent;case 28:if(!e.t1){e.next=30;break}s.endsWith(".js")?(f=!0,b=function(e){for(var _,r=arguments.length,t=Array(1<r?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];if(a[n].scope&&e.hook in a[n].scope)return(_=a[n].scope)[e.hook].apply(_,[e].concat(t,[module]));throw new Error('NotImplemented: API method "'+e.hook+'" is not implemented in plugin "'+n+'".')}):b=function(e){for(var _=e.hook,r=e.data,n=arguments.length,t=Array(1<n?n-1:0),a=1;a<n;a++)t[a-1]=arguments[a];var i=(0,child_process__WEBPACK_IMPORTED_MODULE_3__.spawnSync)(s,[_].concat(t.map((function(e){return JSON.stringify(e)}))),{cwd:process.cwd(),encoding:o,env:process.env,input:JSON.stringify(r),shell:!0,stdio:"inherit"});return 404===i.status?r:i.stdout.startsWith("##!JSON!##")?JSON.parse(i.stdout.substring(10)):r};case 30:return P=null!==(c=i)&&void 0!==c?c:((u={})[t]={package:{}},u),e.abrupt("return",{api:b,apiFileLoadTimestamps:b?[(0,fs__WEBPACK_IMPORTED_MODULE_5__.statSync)(s).mtime.getTime()]:[],apiFilePaths:b?[s]:[],configuration:P,configurationFilePaths:l,configurationFileLoadTimestamps:l.map((function(e){return(0,fs__WEBPACK_IMPORTED_MODULE_5__.statSync)(e).mtime.getTime()})),dependencies:Object.prototype.hasOwnProperty.call(P,t)&&P[t].dependencies?P[t].dependencies:[],internalName:t,name:n,packageConfiguration:P[t].package,path:r,scope:f?loadFile(s,n):null});case 32:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),loadConfiguration=function(e,_,r){for(var n,t,a,o=(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.removeKeyPrefixes)((0,clientnode__WEBPACK_IMPORTED_MODULE_4__.copy)(_)),i=((n={})[e]={package:o},n),l=_createForOfIteratorHelperLoose(r);!(t=l()).done;)if(_[a=t.value]){(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,i,_[a]),delete i[e].package[a];break}return i},loadConfigurations=function(e,_){for(var r=0,n=Object.keys(_);r<n.length;r++)delete _[n[r]];(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(_,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.copy)(_configurator__WEBPACK_IMPORTED_MODULE_8__.A));for(var t,a,o=_createForOfIteratorHelperLoose(e);!(t=o()).done;)if(a=t.value,Object.prototype.hasOwnProperty.call(a,"configuration")){var i=(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.copy)(a.configuration);(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.modifyObject)(_,i),i),_.core.runtimeConfiguration&&(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.extend)(!0,_,_.core.runtimeConfiguration)}return evaluateConfiguration(_)},loadFile=function(e,_,r,n){var t,a;void 0===r&&(r=null),void 0===n&&(n=!0);try{t=currentRequire.resolve(e)}catch(e){}t&&t in currentRequire.cache&&delete currentRequire.cache[t];try{a=currentRequire(e)}catch(t){if(!r)throw new Error("Couldn't load plugin file \""+e+'" for plugin "'+_+'": '+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(t));a=r,n&&console.warn("Couln't load new api plugin file \""+e+'" for plugin "'+_+'": '+(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.represent)(t)+". Using fallback one.")}return Object.prototype.hasOwnProperty.call(a,"default")?a.default:a},loadAll=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,n,t,a,o,i,l,c,u,s,p,d,E,b,f,P,m,O,g,h,M,D,I,A,v,k;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r={},"web-node"===_.name){e.next=5;break}return e.next=4,load(_.name,determineInternalName(_.name,new RegExp(_.core.plugin.directories.external.nameRegularExpressionPattern)),r,_.core.plugin.configuration,_.core.context.path,_.core.encoding);case 4:r[_.name]=e.sent;case 5:n=0,t=Object.values(_.core.plugin.directories);case 6:if(!(n<t.length)){e.next=27;break}return a=t[n],e.next=10,(0,clientnode__WEBPACK_IMPORTED_MODULE_4__.isDirectory)(a.path);case 10:if(!e.sent){e.next=24;break}o=new RegExp(a.nameRegularExpressionPattern),i=_createForOfIteratorHelperLoose((0,fs__WEBPACK_IMPORTED_MODULE_5__.readdirSync)(a.path));case 13:if((l=i()).done){e.next=24;break}if(c=l.value,o.test(c)){e.next=17;break}return e.abrupt("continue",22);case 17:return u=(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(a.path,c),s=determineInternalName(c,o),e.next=21,load(c,s,r,_.core.plugin.configuration,u,_.core.encoding);case 21:r[c]=e.sent;case 22:e.next=13;break;case 24:n++,e.next=6;break;case 27:for(p={},d=0,E=Object.values(r);d<E.length;d++)if(b=E[d],p[b.internalName]=b.dependencies,Object.prototype.hasOwnProperty.call(_.core.interDependencies,b.internalName))for(f=_createForOfIteratorHelperLoose([].concat(_.core.interDependencies[b.internalName]));!(P=f()).done;)m=P.value,p[b.internalName].includes(m)||p[b.internalName].push(m);O=[],g=_createForOfIteratorHelperLoose((0,clientnode__WEBPACK_IMPORTED_MODULE_4__.sortTopological)(p));case 31:if((h=g()).done){e.next=44;break}M=h.value,D=0,I=Object.entries(r);case 34:if(!(D<I.length)){e.next=42;break}if(A=I[D],v=A[0],![(k=A[1]).internalName,v].includes(M)){e.next=39;break}return O.push(k),e.abrupt("break",42);case 39:D++,e.next=34;break;case 42:e.next=31;break;case 44:return e.abrupt("return",{configuration:loadConfigurations(O,_),plugins:O});case 45:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),determineLocations=function(e,_){var r=e.core.context.path;return void 0===_&&(_=[]),(_=[].concat(_)).length?_.map((function(e){return(0,path__WEBPACK_IMPORTED_MODULE_7__.resolve)(r,e)})):[r]},isInLocations=function(e,_,r,n){for(var t,a,o=_.map((function(e){return e.path})),i=_createForOfIteratorHelperLoose([].concat(n));!(t=i()).done;)if((a=t.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,_,r)=>{r.d(_,{H:()=>h,A:()=>k});var n=r(3),t=r.n(n),a=r(6),o=r(7),i=r.n(o),l=r(8),c=r.n(l);const u=JSON.parse('{"name":"web-node","version":"1.0.513","description":"High level javaScript backend plugin system and configuration merger.","keywords":["api","backend","management","plugin","web"],"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":"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":"yarn build:plain && yarn start","start":"./index.js \'{plugin: {hotReloading: true}}\'","prepare:test":"yarn clear && cd dummyPlugin && shx touch yarn.lock && 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 npm publish","update:documentation":"documentation-website","watch":"weboptimizer build --watch"},"runkitExample":"require(\'@babel/runtime/package.json\')\\nrequire(\'clientnode/package.json\')\\n\\nconst {PluginAPI} = require(\'web-node\')\\n\\nPluginAPI.loadFile(\'./unixCrypt.js\', \'crypt\')(\'test\')","devDependencies":{"@babel/cli":"^7.24.8","@babel/eslint-parser":"^7.25.1","@babel/runtime":"^7.25.0","@stylistic/eslint-plugin":"^2.6.4","@types/node":"^22.4.1","@typescript-eslint/eslint-plugin":"^8.2.0","@typescript-eslint/parser":"^8.2.0","clientnode":"^3.0.1172","documentation-website":"^1.0.330","eslint":"^9.9.0","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^50.2.2","jest":"^29.7.0","jsdoc":"^4.0.3","shx":"^0.3.4","typescript-eslint":"^8.2.0","weboptimizer":"^2.0.1495"},"peerDependencies":{"@babel/runtime":"*","clientnode":"*"},"peerDependenciesMeta":{"@babel/runtime":{"optional":true}},"engines":{"node":">=20","npm":">=10","yarn":">=4"},"resolutions":{"colors":"1.4.0","globals@npm:^14.0.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^11.1.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^9.18.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"},"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"}},"packageManager":"yarn@4.1.0+sha256.81a00df816059803e6b5148acf03ce313cad36b7f6e5af6efa040a15981a6ffb"}');var s,p,d=r(0);function E(e,_){(null==_||_>e.length)&&(_=e.length);for(var r=0,n=Array(_);r<_;r++)n[r]=e[r];return n}u.webNode.core.context={path:"/",type:"relative"};for(var b=0;b<a.MAXIMAL_NUMBER_OF_ITERATIONS.value&&(u.webNode.core.context.path=(0,l.resolve)(u.webNode.core.context.path,"../../"),"node_modules"===(0,l.basename)((0,l.dirname)(u.webNode.core.context.path)));b++);if("/"===u.webNode.core.context.path||"node_modules"===(0,l.basename)((0,l.dirname)(process.cwd()))||".staging"===(0,l.basename)((0,l.dirname)(process.cwd()))&&"node_modules"===(0,l.basename)((0,l.dirname)((0,l.dirname)(process.cwd()))))u.webNode.core.context.path=process.cwd();else try{(0,o.lstatSync)((0,l.join)(process.cwd(),"node_modules")).isSymbolicLink()&&(u.webNode.core.context.path=process.cwd())}catch(e){}var f={name:"main"};try{f=(0,a.currentRequire)((0,l.join)(u.webNode.core.context.path,"package"))}catch(e){u.webNode.core.context.path=process.cwd()}var P=(null==(s=f.documentationWebsite)?void 0:s.name)||f.name||"main",m=f.webNode||((p={})[P]={name:P,package:f},p);u.webNode.core.name=u.documentationWebsite.name;var O=new Date,g=t()({},a.UTILITY_SCOPE,{currentPath:process.cwd(),fs:i(),path:c(),PluginAPI:d,webNodePath:"/",now:O,nowUTCTimestamp:(0,a.getUTCTimestamp)(O)}),h=(0,a.evaluateDynamicData)(u.webNode,g);delete u.webNode,(0,a.extend)(!0,(0,a.modifyObject)(h,m),m);for(var M,D={},I=function(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=function(e,_){if(e){if("string"==typeof e)return E(e,_);var r={}.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)?E(e,_):void 0}}(e))||_&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(process.argv.slice(1));!(M=I()).done;){var A=M.value,v=(0,a.parseEncodedObject)(A,h,"configuration");(0,a.isPlainObject)(v)&&(0,a.extend)(!0,D,v)}0<Object.keys(D).length&&((0,a.extend)(!0,(0,a.modifyObject)(h,D),D),h.core.runtimeConfiguration=D),(h=(0,a.evaluateDynamicData)((0,a.removeKeysInEvaluation)(h),g)).name=P,h.core.package=u;const k=h},(module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{callStack:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStack,callStackSynchronous:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStackSynchronous,configuration:()=>_configurator__WEBPACK_IMPORTED_MODULE_3__.H,currentRequire:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.currentRequire,default:()=>__WEBPACK_DEFAULT_EXPORT__,determineInternalName:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.determineInternalName,determineLocations:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.determineLocations,evaluateConfiguration:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.evaluateConfiguration,hotReloadAPIFile:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.hotReloadAPIFile,hotReloadConfigurationFile:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.hotReloadConfigurationFile,hotReloadFiles:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.hotReloadFiles,isInLocations:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.isInLocations,load:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.load,loadAPI:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.loadAPI,loadAll:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.loadAll,loadConfiguration:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.loadConfiguration,loadConfigurations:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.loadConfigurations,loadFile:()=>_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.loadFile,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__(1),_pluginAPI__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(0),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 n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}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={}.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,n=Array(_);r<_;r++)n[r]=e[r];return n}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,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.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,n,t,a,o,i,l,c,u,s,p,d,E,b,f,P,m,O,g,h,M,D,I,A,v,k,C,L;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.loadAll)((0,clientnode__WEBPACK_IMPORTED_MODULE_5__.copy)(_configurator__WEBPACK_IMPORTED_MODULE_3__.A));case 2:return _=e.sent,r=_.configuration,n=_.plugins,e.next=7,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStack)({configuration:r,hook:"initialize",plugins:n});case 7:n.length&&console.info('Loaded plugins: "'+n.map((function(e){return e.internalName})).join('", "')+'".'),t=n.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,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStack)({configuration:r,hook:i+"ConfigurationLoaded",plugins:n,pluginsWithChangedConfiguration:t});case 14:e.next=10;break;case 16:return l={},c={},u=!1,e.prev=19,e.next=22,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStack)({configuration:r,hook:"preLoadService",plugins:n,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(n);case 24:if((b=E()).done){e.next=45;break}if(!(f=b.value).api){e.next=43;break}return e.next=29,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStack)({configuration:r,hook:"preLoad"+(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.capitalize)(f.internalName)+"Service",plugins:n,services:l});case 29:return P=null,e.prev=30,e.next=33,f.api({configuration:r,hook:"loadService",pluginAPI:_pluginAPI__WEBPACK_IMPORTED_MODULE_4__,plugins:n,servicePromises:c,services:l});case 33:P=e.sent,e.next=40;break;case 36:if(e.prev=36,e.t0=e.catch(30),null!=e.t0&&null!=(m=e.t0.message)&&m.startsWith("NotImplemented:")){e.next=40;break}throw new Error('Plugin "'+f.internalName+'" '+(f.internalName===f.name?"":"("+f.name+") ")+"throws: "+(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.represent)(e.t0)+' \'during asynchrone hook "loadService".');case 40:if(P)for(O=0,g=Object.entries(P);O<g.length;O++)h=g[O],M=h[0],null!==(D=h[1])&&"object"==typeof D&&"then"in D?(console.info('Service "'+M+'" started.'),c[M]=D):console.info('Service "'+M+'" loaded.');return e.next=43,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStack)({configuration:r,hook:"postLoad"+(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.capitalize)(f.internalName)+"Service",plugins:n,services:l,servicePromises:c});case 43:e.next=24;break;case 45:return e.next=47,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStack)({configuration:r,hook:"postLoadService",plugins:n,servicePromises:c,services:l});case 47:for(I=!1,A=function(){I||(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStackSynchronous)({configuration:r,hook:"exit",plugins:n.slice().reverse(),servicePromises:c,services:l}),I=!0},v=_createForOfIteratorHelperLoose(clientnode__WEBPACK_IMPORTED_MODULE_5__.CLOSE_EVENT_NAMES);!(k=v()).done;)C=k.value,process.on(C,A);return L=!1,(0,clientnode__WEBPACK_IMPORTED_MODULE_5__.isFunction)(process.stdin.setRawMode)&&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(!L){_.next=5;break}console.warn("Stopping ungracefully."),_.next=9;break;case 5:return L=!0,console.info("You have requested to shut down all services. A second request will force to stop ungracefully."),_.next=9,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStack)({configuration:r,hook:"shouldExit",plugins:n,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,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStack)({configuration:r,hook:"shouldExit",plugins:n,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:n,servicePromises:c,services:l});case 72:if(u){e.next=82;break}return e.prev=73,e.next=76,(0,_pluginAPI__WEBPACK_IMPORTED_MODULE_4__.callStack)({configuration:r,hook:"shouldExit",plugins:n,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:n,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]&&void 0!==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.513",
3
+ "version": "1.0.514",
4
4
  "description": "High level javaScript backend plugin system and configuration merger.",
5
5
  "keywords": [
6
6
  "api",
@@ -57,21 +57,22 @@
57
57
  "runkitExample": "require('@babel/runtime/package.json')\nrequire('clientnode/package.json')\n\nconst {PluginAPI} = require('web-node')\n\nPluginAPI.loadFile('./unixCrypt.js', 'crypt')('test')",
58
58
  "devDependencies": {
59
59
  "@babel/cli": "^7.24.8",
60
- "@babel/eslint-parser": "^7.24.8",
61
- "@babel/runtime": "^7.24.8",
62
- "@types/node": "^20.14.10",
63
- "@typescript-eslint/eslint-plugin": "^7.16.0",
64
- "@typescript-eslint/parser": "^7.16.0",
65
- "clientnode": "^3.0.1166",
66
- "documentation-website": "^1.0.328",
67
- "eslint": "^9.7.0",
60
+ "@babel/eslint-parser": "^7.25.1",
61
+ "@babel/runtime": "^7.25.0",
62
+ "@stylistic/eslint-plugin": "^2.6.4",
63
+ "@types/node": "^22.4.1",
64
+ "@typescript-eslint/eslint-plugin": "^8.2.0",
65
+ "@typescript-eslint/parser": "^8.2.0",
66
+ "clientnode": "^3.0.1172",
67
+ "documentation-website": "^1.0.330",
68
+ "eslint": "^9.9.0",
68
69
  "eslint-config-google": "^0.14.0",
69
- "eslint-plugin-jsdoc": "^48.7.0",
70
+ "eslint-plugin-jsdoc": "^50.2.2",
70
71
  "jest": "^29.7.0",
71
72
  "jsdoc": "^4.0.3",
72
73
  "shx": "^0.3.4",
73
- "typescript-eslint": "^7.16.0",
74
- "weboptimizer": "^2.0.1486"
74
+ "typescript-eslint": "^8.2.0",
75
+ "weboptimizer": "^2.0.1495"
75
76
  },
76
77
  "peerDependencies": {
77
78
  "@babel/runtime": "*",
package/pluginAPI.d.ts CHANGED
@@ -2,158 +2,146 @@ import { Encoding, Mapping, RecursiveEvaluateable } from 'clientnode';
2
2
  import { BaseState, Configuration, EvaluateablePartialConfiguration, MetaPluginConfiguration, PackageConfiguration, Plugin, PluginChange, ServicePromisesState } from './type';
3
3
  export declare const currentRequire: typeof require;
4
4
  /**
5
- * A dumm plugin interface with all available hooks.
5
+ * Calls all plugin methods for given trigger description asynchronous and
6
+ * waits for their resolved promises.
7
+ * @param givenState - Contains runtime information about current hook.
8
+ * @param parameters - Additional parameters to forward into plugin api.
9
+ * @returns A promise which resolves when all callbacks have resolved their
10
+ * promise holding given potentially modified data.
6
11
  */
7
- export declare class PluginAPI {
8
- /**
9
- * Calls all plugin methods for given trigger description asynchronous and
10
- * waits for their resolved promises.
11
- * @param givenState - Contains runtime information about current hook.
12
- * @param parameters - Additional parameters to forward into plugin api.
13
- * @returns A promise which resolves when all callbacks have resolved their
14
- * promise holding given potentially modified data.
15
- */
16
- static callStack<State extends BaseState<unknown> = ServicePromisesState, Output = void>(this: void, givenState: Omit<State, 'pluginAPI'>, ...parameters: Array<unknown>): Promise<Output>;
17
- /**
18
- * Calls all plugin methods for given trigger description synchronous.
19
- * @param givenState - Contains runtime information about current hook.
20
- * @param parameters - Additional parameters to forward into plugin api.
21
- * @returns Given potentially modified data.
22
- */
23
- static callStackSynchronous<State extends BaseState<unknown> = ServicePromisesState, Output = void>(this: void, givenState: Omit<State, 'pluginAPI'>, ...parameters: Array<unknown>): Output;
24
- /**
25
- * Converts given plugin name into the corresponding internal
26
- * representation.
27
- * @param name - Name to convert.
28
- * @param regularExpression - Regular expression pattern which extracts
29
- * relevant name path as first match group.
30
- * @returns Transformed name.
31
- */
32
- static determineInternalName(this: void, name: string, regularExpression: RegExp): string;
33
- /**
34
- * Evaluates given configuration object by letting plugins package sub
35
- * structure untouched.
36
- * @param configuration - Evaluateable configuration structure.
37
- * @returns Resolved configuration.
38
- */
39
- static evaluateConfiguration<Type extends Mapping<unknown> = Configuration>(this: void, configuration: RecursiveEvaluateable<Type> | Type): Type;
40
- /**
41
- * Checks for changed plugin api file in given plugins and reloads them if
42
- * necessary (new timestamp).
43
- * @param plugins - List of plugins to search for updates in.
44
- * @returns A list with plugins which have a changed api scope.
45
- */
46
- static hotReloadAPIFile(this: void, plugins: Array<Plugin>): Array<Plugin>;
47
- /**
48
- * Checks for changed plugin configurations in given plugins and reloads
49
- * them if necessary (new timestamp).
50
- * @param plugins - List of plugins to search for updates in.
51
- * @param configurationPropertyNames - Property names to search for to use
52
- * as entry in plugin configuration file.
53
- * @returns A list with plugins which have a changed configurations.
54
- */
55
- static hotReloadConfigurationFile(this: void, plugins: Array<Plugin>, configurationPropertyNames: Array<string>): Array<Plugin>;
56
- /**
57
- * Checks for changed plugin file type in given plugins and reloads them
58
- * if necessary (timestamp has changed).
59
- * @param type - Plugin file type to search for updates.
60
- * @param target - Property name existing in plugin meta informations
61
- * objects which should be updated.
62
- * @param plugins - List of plugins to search for updates in.
63
- * @returns A list with plugin changes.
64
- */
65
- static hotReloadFiles(this: void, type: 'api' | 'configuration', target: 'packageConfiguration' | 'scope', plugins: Array<Plugin>): Array<PluginChange>;
66
- /**
67
- * Extends given configuration object with given plugin specific ones and
68
- * returns a plugin specific meta information object.
69
- * @param name - Name of plugin to extend.
70
- * @param internalName - Internal name of plugin to extend.
71
- * @param plugins - List of all yet determined plugin informations.
72
- * @param metaConfiguration - Configuration file configuration.
73
- * @param pluginPath - Path to given plugin.
74
- * @param encoding - Encoding to use to read and write from child
75
- * process's.
76
- * @returns An object of plugin specific meta informations.
77
- */
78
- static load(this: void, name: string, internalName: string, plugins: Mapping<Plugin>, metaConfiguration: MetaPluginConfiguration, pluginPath: string, encoding?: Encoding): Promise<Plugin>;
79
- /**
80
- * Load given plugin api file in given path and generates a plugin
81
- * specific data structure with useful meta informations.
82
- * @param relativeFilePaths - Paths to file to load relatively from given
83
- * plugin path.
84
- * @param pluginPath - Path to plugin directory.
85
- * @param name - Plugin name to use for proper error messages.
86
- * @param internalName - Internal plugin name to use for proper error
87
- * messages.
88
- * @param plugins - List of plugins to search for trigger callbacks in.
89
- * @param encoding - Encoding to use to read and write from child
90
- * process.
91
- * @param configuration - Plugin specific configurations.
92
- * @param configurationFilePaths - Plugin specific configuration file
93
- * paths.
94
- * @returns Plugin meta informations object.
95
- */
96
- static loadAPI(this: void, relativeFilePaths: Array<string>, pluginPath: string, name: string, internalName: string, plugins: Mapping<Plugin>, encoding?: Encoding, configuration?: null | EvaluateablePartialConfiguration, configurationFilePaths?: Array<string>): Promise<Plugin>;
97
- /**
98
- * Loads plugin specific configuration object.
99
- * @param name - Property name where to inject resolved configuration into
100
- * global one.
101
- * @param packageConfiguration - Plugin specific package configuration
102
- * object.
103
- * @param configurationPropertyNames - Property names to search for to use
104
- * as entry in plugin configuration file.
105
- * @returns Determined configuration object.
106
- */
107
- static loadConfiguration(this: void, name: string, packageConfiguration: PackageConfiguration, configurationPropertyNames: Array<string>): EvaluateablePartialConfiguration;
108
- /**
109
- * Loads given plugin configurations into global configuration.
110
- * @param plugins - Topological sorted list of plugins to check for
111
- * configurations.
112
- * @param configuration - Global configuration to extend with.
113
- * @returns Updated given configuration object.
114
- */
115
- static loadConfigurations(this: void, plugins: Array<Plugin>, configuration: Configuration): Configuration;
116
- /**
117
- * Load given api file path and returns exported scope.
118
- * @param filePath - Path to file to load.
119
- * @param name - Plugin name to use for proper error messages.
120
- * @param fallbackScope - Scope to return if an error occurs during
121
- * loading. If a "null" is given an error will be thrown.
122
- * @param log - Enables logging.
123
- * @returns Exported api file scope.
124
- */
125
- static loadFile(this: void, filePath: string, name: string, fallbackScope?: null | object, log?: boolean): object;
126
- /**
127
- * Extends given configuration object with all plugin specific ones and
128
- * returns a topological sorted list of plugins with plugins specific
129
- * meta information stored.
130
- * @param configuration - Configuration object to extend and use.
131
- * @returns A topological sorted list of plugins objects.
132
- */
133
- static loadAll(this: void, configuration: Configuration): Promise<{
134
- configuration: Configuration;
135
- plugins: Array<Plugin>;
136
- }>;
137
- /**
138
- * Transform a list of absolute paths respecting the application context.
139
- * @param configuration - Configuration object.
140
- * @param configuration.core - Sub configuration web-node.
141
- * @param configuration.core.context - Sub web-node context configurations.
142
- * @param configuration.core.context.path - Current web-nodes path.
143
- * @param locations - Locations to process.
144
- * @returns Given and processed locations.
145
- */
146
- static determineLocations(this: void, { core: { context: { path: contextPath } } }: Configuration, locations?: Array<string> | string): Array<string>;
147
- /**
148
- * Ignore absolute defined locations (relativ to application context) and
149
- * relative defined in each loaded plugin location.
150
- * @param configuration - Configuration object.
151
- * @param plugins - List of acctive plugins.
152
- * @param filePath - Path to search for.
153
- * @param locations - Locations to search in.
154
- * @returns A boolean indicating whether given file path is in provided
155
- * locations.
156
- */
157
- static isInLocations(this: void, configuration: Configuration, plugins: Array<Plugin>, filePath: string, locations: Array<string> | string): boolean;
158
- }
159
- export default PluginAPI;
12
+ export declare const callStack: <State extends BaseState<unknown> = ServicePromisesState<undefined, Configuration<Mapping<unknown>>, Mapping<unknown>, import("./type").ServicePromises<Mapping<unknown>>>, Output = void>(givenState: Omit<State, "pluginAPI">, ...parameters: Array<unknown>) => Promise<Output>;
13
+ /**
14
+ * Calls all plugin methods for given trigger description synchronous.
15
+ * @param givenState - Contains runtime information about current hook.
16
+ * @param parameters - Additional parameters to forward into plugin api.
17
+ * @returns Given potentially modified data.
18
+ */
19
+ export declare const callStackSynchronous: <State extends BaseState<unknown> = ServicePromisesState<undefined, Configuration<Mapping<unknown>>, Mapping<unknown>, import("./type").ServicePromises<Mapping<unknown>>>, Output = void>(givenState: Omit<State, "pluginAPI">, ...parameters: Array<unknown>) => Output;
20
+ /**
21
+ * Converts given plugin name into the corresponding internal representation.
22
+ * @param name - Name to convert.
23
+ * @param regularExpression - Regular expression pattern which extracts
24
+ * relevant name path as first match group.
25
+ * @returns Transformed name.
26
+ */
27
+ export declare const determineInternalName: (name: string, regularExpression: RegExp) => string;
28
+ /**
29
+ * Evaluates given configuration object by letting plugins package sub
30
+ * structure untouched.
31
+ * @param configuration - Evaluateable configuration structure.
32
+ * @returns Resolved configuration.
33
+ */
34
+ export declare const evaluateConfiguration: <Type extends Mapping<unknown> = Configuration>(configuration: RecursiveEvaluateable<Type> | Type) => Type;
35
+ /**
36
+ * Checks for changed plugin api file in given plugins and reloads them if
37
+ * necessary (new timestamp).
38
+ * @param plugins - List of plugins to search for updates in.
39
+ * @returns A list with plugins which have a changed api scope.
40
+ */
41
+ export declare const hotReloadAPIFile: (plugins: Array<Plugin>) => Array<Plugin>;
42
+ /**
43
+ * Checks for changed plugin configurations in given plugins and reloads them
44
+ * if necessary (new timestamp).
45
+ * @param plugins - List of plugins to search for updates in.
46
+ * @param configurationPropertyNames - Property names to search for to use as
47
+ * entry in plugin configuration file.
48
+ * @returns A list with plugins which have a changed configurations.
49
+ */
50
+ export declare const hotReloadConfigurationFile: (plugins: Array<Plugin>, configurationPropertyNames: Array<string>) => Array<Plugin>;
51
+ /**
52
+ * Checks for changed plugin file type in given plugins and reloads them if
53
+ * necessary (timestamp has changed).
54
+ * @param type - Plugin file type to search for updates.
55
+ * @param target - Property name existing in plugin meta information objects
56
+ * which should be updated.
57
+ * @param plugins - List of plugins to search for updates in.
58
+ * @returns A list with plugin changes.
59
+ */
60
+ export declare const hotReloadFiles: (type: "api" | "configuration", target: "packageConfiguration" | "scope", plugins: Array<Plugin>) => Array<PluginChange>;
61
+ /**
62
+ * Extends given configuration object with given plugin specific ones and
63
+ * returns a plugin specific meta information object.
64
+ * @param name - Name of plugin to extend.
65
+ * @param internalName - Internal name of plugin to extend.
66
+ * @param plugins - List of all yet determined plugin information.
67
+ * @param metaConfiguration - Configuration file configuration.
68
+ * @param pluginPath - Path to given plugin.
69
+ * @param encoding - Encoding to use to read and write from child process's.
70
+ * @returns An object of plugin specific meta information.
71
+ */
72
+ export declare const load: (name: string, internalName: string, plugins: Mapping<Plugin>, metaConfiguration: MetaPluginConfiguration, pluginPath: string, encoding?: Encoding) => Promise<Plugin>;
73
+ /**
74
+ * Load given plugin api file in given path and generates a plugin specific
75
+ * data structure with useful meta information.
76
+ * @param relativeFilePaths - Paths to file to load relatively from given
77
+ * plugin path.
78
+ * @param pluginPath - Path to plugin directory.
79
+ * @param name - Plugin name to use for proper error messages.
80
+ * @param internalName - Internal plugin name to use for proper error messages.
81
+ * @param plugins - List of plugins to search for trigger callbacks in.
82
+ * @param encoding - Encoding to use to read and write from child process.
83
+ * @param configuration - Plugin specific configurations.
84
+ * @param configurationFilePaths - Plugin specific configuration file paths.
85
+ * @returns Plugin meta information object.
86
+ */
87
+ export declare const loadAPI: (relativeFilePaths: Array<string>, pluginPath: string, name: string, internalName: string, plugins: Mapping<Plugin>, encoding?: Encoding, configuration?: null | EvaluateablePartialConfiguration, configurationFilePaths?: Array<string>) => Promise<Plugin>;
88
+ /**
89
+ * Loads plugin specific configuration object.
90
+ * @param name - Property name where to inject resolved configuration into
91
+ * global one.
92
+ * @param packageConfiguration - Plugin specific package configuration object.
93
+ * @param configurationPropertyNames - Property names to search for to use as
94
+ * entry in plugin configuration file.
95
+ * @returns Determined configuration object.
96
+ */
97
+ export declare const loadConfiguration: (name: string, packageConfiguration: PackageConfiguration, configurationPropertyNames: Array<string>) => EvaluateablePartialConfiguration;
98
+ /**
99
+ * Loads given plugin configurations into global configuration.
100
+ * @param plugins - Topological sorted list of plugins to check for
101
+ * configurations.
102
+ * @param configuration - Global configuration to extend with.
103
+ * @returns Updated given configuration object.
104
+ */
105
+ export declare const loadConfigurations: (plugins: Array<Plugin>, configuration: Configuration) => Configuration;
106
+ /**
107
+ * Load given api file path and returns exported scope.
108
+ * @param filePath - Path to file to load.
109
+ * @param name - Plugin name to use for proper error messages.
110
+ * @param fallbackScope - Scope to return if an error occurs during loading.
111
+ * If a "null" is given an error will be thrown.
112
+ * @param log - Enables logging.
113
+ * @returns Exported api file scope.
114
+ */
115
+ export declare const loadFile: (filePath: string, name: string, fallbackScope?: null | object, log?: boolean) => object;
116
+ /**
117
+ * Extends given configuration object with all plugin specific ones and returns
118
+ * a topological sorted list of plugins with plugins specific meta information
119
+ * stored.
120
+ * @param configuration - Configuration object to extend and use.
121
+ * @returns A topological sorted list of plugins objects.
122
+ */
123
+ export declare const loadAll: (configuration: Configuration) => Promise<{
124
+ configuration: Configuration;
125
+ plugins: Array<Plugin>;
126
+ }>;
127
+ /**
128
+ * Transform a list of absolute paths respecting the application context.
129
+ * @param configuration - Configuration object.
130
+ * @param configuration.core - Sub configuration web-node.
131
+ * @param configuration.core.context - Sub web-node context configurations.
132
+ * @param configuration.core.context.path - Current web-nodes path.
133
+ * @param locations - Locations to process.
134
+ * @returns Given and processed locations.
135
+ */
136
+ export declare const determineLocations: ({ core: { context: { path: contextPath } } }: Configuration, locations?: Array<string> | string) => Array<string>;
137
+ /**
138
+ * Ignore absolute defined locations (relativ to application context) and
139
+ * relative defined in each loaded plugin location.
140
+ * @param configuration - Configuration object.
141
+ * @param plugins - List of active plugins.
142
+ * @param filePath - Path to search for.
143
+ * @param locations - Locations to search in.
144
+ * @returns A boolean indicating whether given file path is in provided
145
+ * locations.
146
+ */
147
+ export declare const isInLocations: (configuration: Configuration, plugins: Array<Plugin>, filePath: string, locations: Array<string> | string) => boolean;
package/type.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { Encoding, Mapping, RecursiveEvaluateable, RecursivePartial, UTILITY_SCOPE } from 'clientnode';
2
- import { PluginAPI } from './pluginAPI';
2
+ import * as PluginAPIModule from './pluginAPI';
3
3
  export type EvaluateConfigurationScope = typeof UTILITY_SCOPE & {
4
4
  currentPath: string;
5
5
  fs: typeof import('fs');
6
6
  path: typeof import('path');
7
- PluginAPI: PluginAPI;
7
+ PluginAPI: typeof PluginAPIModule;
8
8
  webNodePath: string;
9
9
  now: Date;
10
10
  nowUTCTimestamp: number;
@@ -89,7 +89,7 @@ export interface BaseState<Type = undefined, ConfigurationType extends Configura
89
89
  data?: Type;
90
90
  hook: string;
91
91
  plugins: Array<Plugin>;
92
- pluginAPI: typeof PluginAPI;
92
+ pluginAPI: typeof PluginAPIModule;
93
93
  }
94
94
  export interface ChangedState<Type = unknown, ConfigurationType extends Configuration = Configuration> extends BaseState<Type, ConfigurationType> {
95
95
  triggerHook?: string;
package/unixCrypt.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var r={d:(o,a)=>{for(var f in a)r.o(a,f)&&!r.o(o,f)&&Object.defineProperty(o,f,{enumerable:!0,get:a[f]})},o:(r,o)=>Object.prototype.hasOwnProperty.call(r,o),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},o={};r.r(o),r.d(o,{default:()=>T,unixCrypt:()=>M});for(var a=[58,50,42,34,26,18,10,2,60,52,44,36,28,20,12,4,62,54,46,38,30,22,14,6,64,56,48,40,32,24,16,8,57,49,41,33,25,17,9,1,59,51,43,35,27,19,11,3,61,53,45,37,29,21,13,5,63,55,47,39,31,23,15,7],f=[40,8,48,16,56,24,64,32,39,7,47,15,55,23,63,31,38,6,46,14,54,22,62,30,37,5,45,13,53,21,61,29,36,4,44,12,52,20,60,28,35,3,43,11,51,19,59,27,34,2,42,10,50,18,58,26,33,1,41,9,49,17,57,25],v=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36],e=[63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],t=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2],i=[41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[],d=[],l=[],c=0;16>c;c++)l[c]=[];var p=function(r){for(var o=0;28>o;o++)u[o]=r[v[o]-1],d[o]=r[e[o]-1];for(var a=0;16>a;a++){for(var f,c=0;c<t[a];c++){f=u[0];for(var p=0;p<27;p++)u[p]=u[p+1];u[27]=f,f=d[0];for(var y=0;y<27;y++)d[y]=d[y+1];d[27]=f}for(var g=0;24>g;g++)l[a][g]=u[n[g]-1],l[a][g+24]=d[i[g]-28-1]}},y=[],g=[32,1,2,3,4,5,4,5,6,7,8,9,8,9,10,11,12,13,12,13,14,15,16,17,16,17,18,19,20,21,20,21,22,23,24,25,24,25,26,27,28,29,28,29,30,31,32,1],b=[[14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7,0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8,4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0,15,12,8,2,4,9,1,7,5,11,3,14,10,0,6,13],[15,1,8,14,6,11,3,4,9,7,2,13,12,0,5,10,3,13,4,7,15,2,8,14,12,0,1,10,6,9,11,5,0,14,7,11,10,4,13,1,5,8,12,6,9,3,2,15,13,8,10,1,3,15,4,2,11,6,7,12,0,5,14,9],[10,0,9,14,6,3,15,5,1,13,12,7,11,4,2,8,13,7,0,9,3,4,6,10,2,8,5,14,12,11,15,1,13,6,4,9,8,15,3,0,11,1,2,12,5,10,14,7,1,10,13,0,6,9,8,7,4,15,14,3,11,5,2,12],[7,13,14,3,0,6,9,10,1,2,8,5,11,12,4,15,13,8,11,5,6,15,0,3,4,7,2,12,1,10,14,9,10,6,9,0,12,11,7,13,15,1,3,14,5,2,8,4,3,15,0,6,10,1,13,8,9,4,5,11,12,7,2,14],[2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9,14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6,4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14,11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3],[12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11,10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8,9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6,4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13],[4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1,13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6,1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2,6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12],[13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7,1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2,7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8,2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11]],s=[16,7,20,21,29,12,28,17,1,15,23,26,5,18,31,10,2,8,24,14,32,27,3,9,19,13,30,6,22,11,4,25],S=[],m=[],O=[],h=[],j=[],C=function(r,o){void 0===o&&(o=!1);for(var v=[],e=0;64>e;e++)v[e]=r[a[e]-1];for(var t=0;32>t;t++)S[t]=v[t],m[t]=v[t+32];for(var n,i=0;16>i;i++){n=o?15-i:i;for(var u=0;32>u;u++)O[u]=m[u];for(var d=0;48>d;d++)j[d]=m[y[d]-1]^l[n][d];for(var c=0;8>c;c++){var p=6*c,g=b[c][(j[p+0]<<5)+(j[p+1]<<3)+(j[p+2]<<2)+(j[p+3]<<1)+(j[p+4]<<0)+(j[p+5]<<4)];h[(p=4*c)+0]=1&g>>3,h[p+1]=1&g>>2,h[p+2]=1&g>>1,h[p+3]=1&g>>0}for(var C=0;32>C;C++)m[C]=S[C]^h[s[C]-1];for(var P=0;32>P;P++)S[P]=O[P]}for(var x,M=0;32>M;M++)x=S[M],S[M]=m[M],m[M]=x;for(var T=0;32>T;T++)v[T]=S[T],v[T+32]=m[T];for(var _=0;64>_;_++)r[_]=v[f[_]-1]},P=function(r){for(var o=[],a=0;a<r.length;a++)o[a]=r.charCodeAt(a);return o},x=function(r){return String.fromCharCode.apply(String,r)};function M(r,o,a){void 0===o&&(o="aa"),void 0===a&&(a=!1);var f="string"==typeof r?P(r):r,v=o;"string"==typeof o&&(""===o&&(o="aa"),v=P(o));for(var e=[],t=[],n=0;66>n;n++)e[n]=0;for(var i,u=0,d=0;(i=f[d])&&64>u;d++){for(var l=0;7>l;l++,u++)e[u]=1&i>>6-l;u++}p(e);for(var c=0;66>c;c++)e[c]=0;for(var b=0;48>b;b++)y[b]=g[b];for(var s,S=0,m=0;2>S;S++,m++){s=v[m],t[S]=s,90<s&&(s-=6),57<s&&(s-=7),s-=46;for(var O=0;6>O;O++)if(1&s>>O){var h=y[6*S+O];y[6*S+O]=y[6*S+O+24],y[6*S+O+24]=h}}for(var j=0;25>j;j++)C(e);for(var M=0;11>M;M++){i=0;for(var T=0;6>T;T++)i<<=1,i|=e[6*M+T];57<(i+=46)&&(i+=7),90<i&&(i+=6),t[M+2]=i}return 0===t[1]&&(t[1]=t[0]),a?t:x(t)}const T=M;module.exports=o})();
1
+ (()=>{"use strict";var r={d:(o,a)=>{for(var f in a)r.o(a,f)&&!r.o(o,f)&&Object.defineProperty(o,f,{enumerable:!0,get:a[f]})},o:(r,o)=>Object.prototype.hasOwnProperty.call(r,o),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},o={};r.r(o),r.d(o,{default:()=>T,unixCrypt:()=>M});for(var a=[58,50,42,34,26,18,10,2,60,52,44,36,28,20,12,4,62,54,46,38,30,22,14,6,64,56,48,40,32,24,16,8,57,49,41,33,25,17,9,1,59,51,43,35,27,19,11,3,61,53,45,37,29,21,13,5,63,55,47,39,31,23,15,7],f=[40,8,48,16,56,24,64,32,39,7,47,15,55,23,63,31,38,6,46,14,54,22,62,30,37,5,45,13,53,21,61,29,36,4,44,12,52,20,60,28,35,3,43,11,51,19,59,27,34,2,42,10,50,18,58,26,33,1,41,9,49,17,57,25],v=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36],e=[63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],t=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2],i=[41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[],d=[],l=[],c=0;16>c;c++)l[c]=[];var p=function(r){for(var o=0;28>o;o++)u[o]=r[v[o]-1],d[o]=r[e[o]-1];for(var a=0;16>a;a++){for(var f,c=0;c<t[a];c++){f=u[0];for(var p=0;p<27;p++)u[p]=u[p+1];u[27]=f,f=d[0];for(var y=0;y<27;y++)d[y]=d[y+1];d[27]=f}for(var g=0;24>g;g++)l[a][g]=u[n[g]-1],l[a][g+24]=d[i[g]-28-1]}},y=[],g=[32,1,2,3,4,5,4,5,6,7,8,9,8,9,10,11,12,13,12,13,14,15,16,17,16,17,18,19,20,21,20,21,22,23,24,25,24,25,26,27,28,29,28,29,30,31,32,1],b=[[14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7,0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8,4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0,15,12,8,2,4,9,1,7,5,11,3,14,10,0,6,13],[15,1,8,14,6,11,3,4,9,7,2,13,12,0,5,10,3,13,4,7,15,2,8,14,12,0,1,10,6,9,11,5,0,14,7,11,10,4,13,1,5,8,12,6,9,3,2,15,13,8,10,1,3,15,4,2,11,6,7,12,0,5,14,9],[10,0,9,14,6,3,15,5,1,13,12,7,11,4,2,8,13,7,0,9,3,4,6,10,2,8,5,14,12,11,15,1,13,6,4,9,8,15,3,0,11,1,2,12,5,10,14,7,1,10,13,0,6,9,8,7,4,15,14,3,11,5,2,12],[7,13,14,3,0,6,9,10,1,2,8,5,11,12,4,15,13,8,11,5,6,15,0,3,4,7,2,12,1,10,14,9,10,6,9,0,12,11,7,13,15,1,3,14,5,2,8,4,3,15,0,6,10,1,13,8,9,4,5,11,12,7,2,14],[2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9,14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6,4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14,11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3],[12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11,10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8,9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6,4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13],[4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1,13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6,1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2,6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12],[13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7,1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2,7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8,2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11]],s=[16,7,20,21,29,12,28,17,1,15,23,26,5,18,31,10,2,8,24,14,32,27,3,9,19,13,30,6,22,11,4,25],S=[],m=[],O=[],h=[],j=[],C=function(r,o){void 0===o&&(o=!1);for(var v=[],e=0;64>e;e++)v[e]=r[a[e]-1];for(var t=0;32>t;t++)S[t]=v[t],m[t]=v[t+32];for(var n,i=0;16>i;i++){n=o?15-i:i;for(var u=0;32>u;u++)O[u]=m[u];for(var d=0;48>d;d++)j[d]=m[y[d]-1]^l[n][d];for(var c=0;8>c;c++){var p=6*c,g=b[c][(j[p]<<5)+(j[p+1]<<3)+(j[p+2]<<2)+(j[p+3]<<1)+(j[p+4]<<0)+(j[p+5]<<4)];h[p=4*c]=1&g>>3,h[p+1]=1&g>>2,h[p+2]=1&g>>1,h[p+3]=1&g>>0}for(var C=0;32>C;C++)m[C]=S[C]^h[s[C]-1];for(var P=0;32>P;P++)S[P]=O[P]}for(var x,M=0;32>M;M++)x=S[M],S[M]=m[M],m[M]=x;for(var T=0;32>T;T++)v[T]=S[T],v[T+32]=m[T];for(var _=0;64>_;_++)r[_]=v[f[_]-1]},P=function(r){for(var o=[],a=0;a<r.length;a++)o[a]=r.charCodeAt(a);return o},x=function(r){return String.fromCharCode.apply(String,r)};function M(r,o,a){void 0===o&&(o="aa"),void 0===a&&(a=!1);var f="string"==typeof r?P(r):r,v=o;"string"==typeof o&&(""===o&&(o="aa"),v=P(o));for(var e=[],t=[],n=0;66>n;n++)e[n]=0;for(var i,u=0,d=0;(i=f[d])&&64>u;d++){for(var l=0;7>l;l++,u++)e[u]=1&i>>6-l;u++}p(e);for(var c=0;66>c;c++)e[c]=0;for(var b=0;48>b;b++)y[b]=g[b];for(var s,S=0,m=0;2>S;S++,m++){s=v[m],t[S]=s,90<s&&(s-=6),57<s&&(s-=7),s-=46;for(var O=0;6>O;O++)if(1&s>>O){var h=y[6*S+O];y[6*S+O]=y[6*S+O+24],y[6*S+O+24]=h}}for(var j=0;25>j;j++)C(e);for(var M=0;11>M;M++){i=0;for(var T=0;6>T;T++)i<<=1,i|=e[6*M+T];57<(i+=46)&&(i+=7),90<i&&(i+=6),t[M+2]=i}return 0===t[1]&&(t[1]=t[0]),a?t:x(t)}const T=M;module.exports=o})();