nginxwebnodeplugin 1.0.356-2 → 1.0.357

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { CheckReachabilityOptions, Logger, RecursivePartial } from 'clientnode';
2
- import { PluginPromises } from 'web-node/type';
3
- import { Configuration, ServicePromisesState } from './type';
1
+ import type { CheckReachabilityOptions, RecursivePartial } from 'clientnode';
2
+ import type { PluginPromises } from 'web-node/type';
3
+ import type { Configuration, PluginHandler, ServicePromisesState } from './type';
4
+ import { Logger } from 'clientnode';
4
5
  export declare const log: Logger;
5
6
  /**
6
7
  * Launches an application server und triggers all some pluginable hooks on
@@ -37,5 +38,5 @@ export declare const shouldExit: ({ configuration, services }: ServicePromisesSt
37
38
  * (not) finished, otherwise returned promise will be rejected.
38
39
  */
39
40
  export declare const checkReachability: (serverConfiguration: Configuration["applicationServer"], inverse?: boolean, givenOptions?: RecursivePartial<CheckReachabilityOptions>) => Promise<Error | null | Promise<Error | null> | Response>;
40
- export declare const nginx: any;
41
+ export declare const nginx: PluginHandler;
41
42
  export default nginx;
package/index.js CHANGED
@@ -1 +1,69 @@
1
- "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)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("child_process"),require("clientnode"),require("https"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator","child_process","clientnode","https"],r);else{var n="object"==typeof exports?r(require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("child_process"),require("clientnode"),require("https")):r(e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/asyncToGenerator"],e["@babel/runtime/regenerator"],e.child_process,e.clientnode,e.https);for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(this,((e,r,n,t,o,a)=>(()=>{var i=[(e,r,n)=>{n.r(r),n.d(r,{checkReachability:()=>x,default:()=>y,loadService:()=>m,log:()=>b,nginx:()=>v,shouldExit:()=>h});var t=n(1),o=n.n(t),a=n(2),i=n.n(a),l=n(3),u=n.n(l),s=n(4),c=n(5),d=n(6);function p(e,r){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,r){if(e){if("string"==typeof e)return f(e,r);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n<r;n++)t[n]=e[n];return t}e=n.hmd(e);var b=new c.Logger({name:"web-node.nginx"}),m=function(){var e=i()(u().mark((function e(r){var n,t,o,a,i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.configuration.applicationServer,!(t=r.services).nginx){e.next=1;break}return e.abrupt("return",null);case 1:return o=(0,s.spawn)("nginx",[],{cwd:process.cwd(),env:process.env,shell:!0,stdio:"inherit"}),t.nginx=o,o.reload=function(){return new Promise((function(e,r){return(0,s.exec)("nginx -s reload",(function(n,t,o){n?(n.standardErrorOutput=o,r(n)):e(t)}))}))},a=new Promise((function(e,r){for(var t,a,i=p(c.CLOSE_EVENT_NAMES);!(t=i()).done;)a=t.value,o.on(a,(0,c.getProcessCloseHandler)(e,n.proxy.optional?e:r,{reason:o,process:o}))})),e.prev=2,e.next=3,x(n);case 3:e.next=6;break;case 4:if(e.prev=4,i=e.catch(2),!n.proxy.optional){e.next=5;break}b.warn("Nginx couldn't be started (or at least",'"'+n.proxy.url+'" could not be reached) but was',"marked as optional."),t.nginx=null,a=null,e.next=6;break;case 5:throw new Error('Could not acknowledge that nginx is running because "'+n.proxy.url+'" is not reachable: '+(0,c.represent)(i),{cause:i});case 6:return e.abrupt("return",{nginx:a});case 7:case"end":return e.stop()}}),e,null,[[2,4]])})));return function(){return e.apply(this,arguments)}}(),h=function(){var e=i()(u().mark((function e(r){var n,t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.configuration,null===(t=r.services).nginx){e.next=1;break}return t.nginx.kill("SIGINT"),e.next=1,x(n.applicationServer,!0);case 1:delete t.nginx;case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(e,r,n){if(void 0===r&&(r=!1),void 0===n&&(n={}),e.proxy.url){var t=e.proxy.url.startsWith("https://"),a=o()({options:o()({redirect:"manual"},t?{agent:new d.Agent({rejectUnauthorized:!1})}:{}),pollIntervallInSeconds:.1,statusCodes:[100,101,102,200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308],timeoutInSeconds:3,wait:!0},n);return(r?c.checkUnreachability:c.checkReachability)(e.proxy.url,a)}return Promise.resolve(null)},v=e.exports;const y=v},r=>{r.exports=e},e=>{e.exports=r},e=>{e.exports=n},e=>{e.exports=t},e=>{e.exports=o},e=>{e.exports=a}],l={};function u(e){var r=l[e];if(void 0!==r)return r.exports;var n=l[e]={id:e,loaded:!1,exports:{}};return i[e](n,n.exports,u),n.loaded=!0,n.exports}return u.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return u.d(r,{a:r}),r},u.d=(e,r)=>{for(var n in r)u.o(r,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},u.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),u.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u(0)})()));
1
+ if(typeof window==='undefined'||window===null)var window=(typeof globalThis==='undefined'||globalThis===null)?{}:globalThis;import { exec as __WEBPACK_EXTERNAL_MODULE_child_process_exec__, spawn as __WEBPACK_EXTERNAL_MODULE_child_process_spawn__ } from "child_process";
2
+ import { CLOSE_EVENT_NAMES as __WEBPACK_EXTERNAL_MODULE_clientnode_CLOSE_EVENT_NAMES__, Logger as __WEBPACK_EXTERNAL_MODULE_clientnode_Logger__, checkReachability as __WEBPACK_EXTERNAL_MODULE_clientnode_checkReachability__, checkUnreachability as __WEBPACK_EXTERNAL_MODULE_clientnode_checkUnreachability__, getProcessCloseHandler as __WEBPACK_EXTERNAL_MODULE_clientnode_getProcessCloseHandler__, represent as __WEBPACK_EXTERNAL_MODULE_clientnode_represent__ } from "clientnode";
3
+ import { Agent as __WEBPACK_EXTERNAL_MODULE_https_Agent__ } from "https";
4
+
5
+ ;// external "child_process"
6
+
7
+ ;// external "clientnode"
8
+
9
+ ;// external "https"
10
+
11
+ ;// ./index.ts
12
+ // #!/usr/bin/env babel-node
13
+ // -*- coding: utf-8 -*-
14
+ /** @module nginx-web-node-plugin *//* !
15
+ region header
16
+ [Project page](https://torben.website/nginx-web-node-plugin)
17
+
18
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
19
+
20
+ License
21
+ -------
22
+
23
+ This library written by Torben Sickert stands under a creative commons
24
+ naming 3.0 unported license.
25
+ See https://creativecommons.org/licenses/by/3.0/deed.de
26
+ endregion
27
+ */// region imports
28
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}};// endregion
29
+ var log=new __WEBPACK_EXTERNAL_MODULE_clientnode_Logger__({name:"web-node.nginx"});// region plugins/classes
30
+ /**
31
+ * Launches an application server und triggers all some pluginable hooks on
32
+ * an event.
33
+ */// region api
34
+ /**
35
+ * Start nginx's child process and return a Promise which observes this
36
+ * service.
37
+ * @param state - Application state.
38
+ * @param state.configuration - Applications configuration.
39
+ * @param state.configuration.applicationServer - Plugins configuration.
40
+ * @param state.services - An object with stored service instances.
41
+ * @returns A mapping to promises which correspond to the plugin specific
42
+ * continues services.
43
+ */var loadService=/*#__PURE__*/function(){var _loadService=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref){var configuration,services,nginx,promise,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:configuration=_ref.configuration.applicationServer,services=_ref.services;if(!services.nginx){_context.n=1;break}return _context.a(2,null);case 1:nginx=__WEBPACK_EXTERNAL_MODULE_child_process_spawn__("nginx",[],{cwd:process.cwd(),env:process.env,shell:true,stdio:"inherit"});services.nginx=nginx;nginx.reload=function(){return new Promise(function(resolve,reject){return __WEBPACK_EXTERNAL_MODULE_child_process_exec__("nginx -s reload",function(error,standardOutput,standardErrorOutput){if(error){error.standardErrorOutput=standardErrorOutput;/*
44
+ eslint-disable
45
+ @typescript-eslint/prefer-promise-reject-errors
46
+ */reject(error);/*
47
+ eslint-enable
48
+ @typescript-eslint/prefer-promise-reject-errors
49
+ */}else resolve(standardOutput)})})};promise=new Promise(function(resolve,reject){var _iterator=_createForOfIteratorHelper(__WEBPACK_EXTERNAL_MODULE_clientnode_CLOSE_EVENT_NAMES__),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var closeEventName=_step.value;nginx.on(closeEventName,__WEBPACK_EXTERNAL_MODULE_clientnode_getProcessCloseHandler__(resolve,configuration.proxy.optional?resolve:reject,{reason:nginx,process:nginx}))}}catch(err){_iterator.e(err)}finally{_iterator.f()}});_context.p=2;_context.n=3;return checkReachability(configuration);case 3:_context.n=6;break;case 4:_context.p=4;_t=_context.v;if(!configuration.proxy.optional){_context.n=5;break}log.warn("Nginx couldn't be started (or at least","\"".concat(configuration.proxy.url,"\" could not be reached) but was"),"marked as optional.");services.nginx=null;promise=null;_context.n=6;break;case 5:throw new Error("Could not acknowledge that nginx is running because "+"\"".concat(configuration.proxy.url,"\" is not reachable: ")+__WEBPACK_EXTERNAL_MODULE_clientnode_represent__(_t),{cause:_t});case 6:return _context.a(2,{nginx:promise})}},_callee,null,[[2,4]])}));function loadService(_x){return _loadService.apply(this,arguments)}return loadService}();/**
50
+ * Application will be closed soon.
51
+ * @param state - Application state.
52
+ * @param state.configuration - Applications configuration.
53
+ * @param state.services - Application services.
54
+ * @returns Given object of services.
55
+ */var shouldExit=/*#__PURE__*/function(){var _shouldExit=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref2){var configuration,services;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:configuration=_ref2.configuration,services=_ref2.services;if(!(services.nginx!==null)){_context2.n=1;break}services.nginx.kill("SIGINT");_context2.n=1;return checkReachability(configuration.applicationServer,true);case 1:delete services.nginx;case 2:return _context2.a(2)}},_callee2)}));function shouldExit(_x2){return _shouldExit.apply(this,arguments)}return shouldExit}();// endregion
56
+ // region helper
57
+ /**
58
+ * Check if a nginx server is currently (not) running.
59
+ * @param serverConfiguration - Mutable by plugins extended configuration
60
+ * object.
61
+ * @param inverse - Boolean indicating if we should check for reachability or
62
+ * un-reachability.
63
+ * @param givenOptions - Tools reachability options to configure how to check
64
+ * for reachability.
65
+ * @returns A promise which will be resolved if a request to given url has
66
+ * (not) finished, otherwise returned promise will be rejected.
67
+ */var checkReachability=function checkReachability(serverConfiguration,inverse,givenOptions){if(inverse===void 0){inverse=false}if(givenOptions===void 0){givenOptions={}}if(serverConfiguration.proxy.url){var isSSL=serverConfiguration.proxy.url.startsWith("https://");var options=_objectSpread({options:_objectSpread({redirect:"manual"},isSSL?{agent:new __WEBPACK_EXTERNAL_MODULE_https_Agent__({rejectUnauthorized:false})}:{}),pollIntervallInSeconds:.1,statusCodes:[100,101,102,200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308],timeoutInSeconds:3,wait:true},givenOptions);return(inverse?__WEBPACK_EXTERNAL_MODULE_clientnode_checkUnreachability__:__WEBPACK_EXTERNAL_MODULE_clientnode_checkReachability__)(serverConfiguration.proxy.url,options)}return Promise.resolve(null)};// endregion
68
+ var nginx={loadService:loadService,shouldExit:shouldExit,checkReachability:checkReachability};/* harmony default export */ const index = (nginx);// endregion
69
+ export { checkReachability, index as default, loadService, log, nginx, shouldExit };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nginxwebnodeplugin",
3
- "version": "1.0.356-2",
3
+ "version": "1.0.357",
4
4
  "description": "A nginx proxy server configuration template for webNode.",
5
5
  "keywords": [
6
6
  "web",
@@ -47,38 +47,31 @@
47
47
  "watch": "weboptimizer build --watch"
48
48
  },
49
49
  "devDependencies": {
50
- "@babel/eslint-parser": "^7.28.6",
51
- "@babel/runtime": "^7.29.2",
50
+ "@babel/eslint-parser": "^8.0.1",
52
51
  "@eslint/js": "^10.0.1",
53
52
  "@stylistic/eslint-plugin": "^5.10.0",
54
- "@types/node": "^25.6.0",
53
+ "@types/node": "^26.1.2",
55
54
  "@types/webpack-env": "^1.18.8",
56
- "@typescript-eslint/eslint-plugin": "^8.59.0",
57
- "@typescript-eslint/parser": "^8.59.0",
58
- "application-server-web-node-plugin": "^1.0.402",
59
- "clientnode": "^4.0.1388",
60
- "eslint": "^10.2.1",
55
+ "@typescript-eslint/eslint-plugin": "^8.65.0",
56
+ "@typescript-eslint/parser": "^8.65.0",
57
+ "application-server-web-node-plugin": "^1.0.403",
58
+ "clientnode": "^4.0.1482",
59
+ "eslint": "^10.8.0",
61
60
  "eslint-config-google": "^0.14.0",
62
- "eslint-plugin-jsdoc": "^62.9.0",
63
- "jest": "^30.3.0",
61
+ "eslint-plugin-jsdoc": "^63.3.2",
62
+ "jest": "^30.4.2",
64
63
  "jsdoc": "^4.0.5",
65
64
  "node-fetch": "^3.3.2",
66
- "typescript-eslint": "^8.59.0",
67
- "web-documentation": "^1.0.3",
68
- "web-node": "^1.0.581",
69
- "weboptimizer": "^3.0.22"
65
+ "typescript-eslint": "^8.65.0",
66
+ "web-documentation": "^1.0.45",
67
+ "web-node": "^1.0.585",
68
+ "weboptimizer": "^4.0.48"
70
69
  },
71
70
  "peerDependencies": {
72
- "@babel/runtime": "*",
73
71
  "application-server-web-node-plugin": "*",
74
72
  "node-fetch": "*",
75
73
  "web-node": "*"
76
74
  },
77
- "peerDependenciesMeta": {
78
- "@babel/runtime": {
79
- "optional": true
80
- }
81
- },
82
75
  "engines": {
83
76
  "node": ">=24",
84
77
  "npm": ">=11",
@@ -91,7 +84,8 @@
91
84
  "globals@npm:^14.0.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"
92
85
  },
93
86
  "sideEffects": false,
94
- "documentationWebsite": {
87
+ "type": "module",
88
+ "webDocumentation": {
95
89
  "name": "nginx-web-node-plugin",
96
90
  "trackingCode": "UA-40192634-23"
97
91
  },
package/readme.md CHANGED
@@ -6,7 +6,7 @@ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
6
6
  License
7
7
  -------
8
8
 
9
- This library written by Torben Sickert stand under a creative commons naming
9
+ This library written by Torben Sickert stands under a creative commons naming
10
10
  3.0 unported license. See https://creativecommons.org/licenses/by/3.0/deed.de
11
11
  endregion -->
12
12
 
@@ -26,9 +26,9 @@ Project status
26
26
  [![code coverage](https://img.shields.io/coverallsCoverage/github/thaibault/nginx-web-node-plugin?label=code%20coverage&style=for-the-badge)](https://coveralls.io/github/thaibault/nginx-web-node-plugin)
27
27
 
28
28
  [![deploy web documentation](https://img.shields.io/github/actions/workflow/status/thaibault/nginx-web-node-plugin/deploy-web-documentation.yaml?label=deploy%20web%20documentation&style=for-the-badge)](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/deploy-web-documentation.yaml)
29
- [![documentation website](https://img.shields.io/website-up-down-green-red/https/torben.website/nginx-web-node-plugin.svg?label=documentation-website&style=for-the-badge)](https://torben.website/nginx-web-node-plugin)
29
+ [![web documentation](https://img.shields.io/website-up-down-green-red/https/torben.website/nginx-web-node-plugin.svg?label=web-documentation&style=for-the-badge)](https://torben.website/nginx-web-node-plugin)
30
30
 
31
31
  Use case
32
32
  --------
33
33
 
34
- Nginx server as web-node plugin.
34
+ Nginx server as WebNode plugin.
package/type.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Configuration as BaseConfiguration, ServicePromises as BaseServicePromises, Services as BaseServices } from 'application-server-web-node-plugin/type';
2
- import { ChildProcess } from 'child_process';
3
- import { Mapping, ProcessCloseReason } from 'clientnode';
4
- import { ServicePromisesState as BaseServicePromisesState, ServicesState as BaseServicesState } from 'web-node/type';
1
+ import type { Configuration as BaseConfiguration, ServicePromises as BaseServicePromises, Services as BaseServices, PluginHandler as BasePluginHandler } from 'application-server-web-node-plugin/type';
2
+ import type { ChildProcess } from 'child_process';
3
+ import type { CheckReachabilityOptions, Mapping, ProcessCloseReason, RecursivePartial } from 'clientnode';
4
+ import type { ServicePromisesState as BaseServicePromisesState, ServicesState as BaseServicesState } from 'web-node/type';
5
5
  export type Configuration<PluginConfigurationType = Mapping<unknown>> = BaseConfiguration<{
6
6
  applicationServer: {
7
7
  proxy: {
@@ -25,3 +25,6 @@ export type Services<Type = Mapping<unknown>> = BaseServices<{
25
25
  }> & Type;
26
26
  export type ServicesState = BaseServicesState<undefined, Configuration, Services>;
27
27
  export type ServicePromisesState = BaseServicePromisesState<undefined, Configuration, Services, ServicePromises>;
28
+ export interface PluginHandler extends BasePluginHandler {
29
+ checkReachability(serverConfiguration: Configuration['applicationServer'], inverse: boolean, givenOptions: RecursivePartial<CheckReachabilityOptions>): Promise<Error | null | Promise<Error | null> | Response>;
30
+ }