nginxwebnodeplugin 1.0.344 → 1.0.345

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.
Files changed (3) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +1 -1
  3. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { CheckReachabilityOptions, RecursivePartial } from 'clientnode';
1
+ import { CheckReachabilityOptions, Logger, RecursivePartial } from 'clientnode';
2
2
  import { PluginPromises } from 'web-node/type';
3
3
  import { Configuration, ServicePromisesState } from './type';
4
+ export declare const log: Logger;
4
5
  /**
5
6
  * Launches an application server und triggers all some pluginable hooks on
6
7
  * an event.
package/index.js CHANGED
@@ -1 +1 @@
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"),require("web-node"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator","child_process","clientnode","https","web-node"],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"),require("web-node")):r(e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/asyncToGenerator"],e["@babel/runtime/regenerator"],e.child_process,e.clientnode,e.https,e["web-node"]);for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(this,((e,r,n,t,o,i,a)=>(()=>{var l=[(e,r,n)=>{n.r(r),n.d(r,{checkReachability:()=>x,default:()=>y,loadService:()=>h,nginx:()=>v,shouldExit:()=>m});var t=n(1),o=n.n(t),i=n(2),a=n.n(i),l=n(3),u=n.n(l),s=n(4),c=n(5),d=n(6),p=n(7);function f(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 b(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)?b(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 b(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 h=function(){var e=a()(u().mark((function e(r){var n,t,o,i,a;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)}))}))},i=new Promise((function(e,r){for(var t,i,a=f(c.CLOSE_EVENT_NAMES);!(t=a()).done;)i=t.value,o.on(i,(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,a=e.catch(2),!n.proxy.optional){e.next=5;break}p.log.warn("Nginx couldn't be started (or at least",'"'+n.proxy.url+'" could not be reached) but was',"marked as optional."),t.nginx=null,i=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)(a));case 6:return e.abrupt("return",{nginx:i});case 7:case"end":return e.stop()}}),e,null,[[2,4]])})));return function(){return e.apply(this,arguments)}}(),m=function(){var e=a()(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://"),i=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,i)}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=i},e=>{e.exports=a}],u={};function s(e){var r=u[e];if(void 0!==r)return r.exports;var n=u[e]={id:e,loaded:!1,exports:{}};return l[e](n,n.exports,s),n.loaded=!0,n.exports}return s.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return s.d(r,{a:r}),r},s.d=(e,r)=>{for(var n in r)s.o(r,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},s.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),s.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s(0)})()));
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));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)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nginxwebnodeplugin",
3
- "version": "1.0.344",
3
+ "version": "1.0.345",
4
4
  "description": "A nginx proxy server configuration template for webNode.",
5
5
  "keywords": [
6
6
  "web",
@@ -54,7 +54,7 @@
54
54
  "@typescript-eslint/eslint-plugin": "^8.46.4",
55
55
  "@typescript-eslint/parser": "^8.46.4",
56
56
  "application-server-web-node-plugin": "^1.0.385",
57
- "clientnode": "^3.0.1315",
57
+ "clientnode": "^3.0.1318",
58
58
  "documentation-website": "^1.0.395",
59
59
  "eslint": "^9.39.1",
60
60
  "eslint-config-google": "^0.14.0",