nginxwebnodeplugin 1.0.309 → 1.0.311

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 +34 -35
  2. package/index.js +1 -1
  3. package/package.json +15 -14
package/index.d.ts CHANGED
@@ -1,41 +1,40 @@
1
1
  import { CheckReachabilityOptions, RecursivePartial } from 'clientnode';
2
- import { PluginHandler, PluginPromises } from 'web-node/type';
2
+ import { PluginPromises } from 'web-node/type';
3
3
  import { Configuration, ServicePromisesState } from './type';
4
4
  /**
5
5
  * Launches an application server und triggers all some pluginable hooks on
6
6
  * an event.
7
7
  */
8
- export declare class Nginx implements PluginHandler {
9
- /**
10
- * Start nginx's child process and return a Promise which observes this
11
- * service.
12
- * @param state - Application state.
13
- * @param state.configuration - Applications configuration.
14
- * @param state.configuration.applicationServer - Plugins configuration.
15
- * @param state.services - An object with stored service instances.
16
- * @returns A mapping to promises which correspond to the plugin specific
17
- * continues services.
18
- */
19
- static loadService({ configuration: { applicationServer: configuration }, services }: ServicePromisesState): Promise<null | PluginPromises>;
20
- /**
21
- * Application will be closed soon.
22
- * @param state - Application state.
23
- * @param state.configuration - Applications configuration.
24
- * @param state.services - Application services.
25
- * @returns Given object of services.
26
- */
27
- static shouldExit({ configuration, services }: ServicePromisesState): Promise<void>;
28
- /**
29
- * Check if a nginx server is currently (not) running.
30
- * @param serverConfiguration - Mutable by plugins extended configuration
31
- * object.
32
- * @param inverse - Boolean indicating if we should check for reachability
33
- * or un-reachability.
34
- * @param givenOptions - Tools reachability options to configure how to
35
- * check for reachability.
36
- * @returns A promise which will be resolved if a request to given url has
37
- * (not) finished. Otherwise returned promise will be rejected.
38
- */
39
- static checkReachability(serverConfiguration: Configuration['applicationServer'], inverse?: boolean, givenOptions?: RecursivePartial<CheckReachabilityOptions>): Promise<Response | Error | null | Promise<Error | null>>;
40
- }
41
- export default Nginx;
8
+ /**
9
+ * Start nginx's child process and return a Promise which observes this
10
+ * service.
11
+ * @param state - Application state.
12
+ * @param state.configuration - Applications configuration.
13
+ * @param state.configuration.applicationServer - Plugins configuration.
14
+ * @param state.services - An object with stored service instances.
15
+ * @returns A mapping to promises which correspond to the plugin specific
16
+ * continues services.
17
+ */
18
+ export declare const loadService: ({ configuration: { applicationServer: configuration }, services }: ServicePromisesState) => Promise<null | PluginPromises>;
19
+ /**
20
+ * Application will be closed soon.
21
+ * @param state - Application state.
22
+ * @param state.configuration - Applications configuration.
23
+ * @param state.services - Application services.
24
+ * @returns Given object of services.
25
+ */
26
+ export declare const shouldExit: ({ configuration, services }: ServicePromisesState) => Promise<void>;
27
+ /**
28
+ * Check if a nginx server is currently (not) running.
29
+ * @param serverConfiguration - Mutable by plugins extended configuration
30
+ * object.
31
+ * @param inverse - Boolean indicating if we should check for reachability or
32
+ * un-reachability.
33
+ * @param givenOptions - Tools reachability options to configure how to check
34
+ * for reachability.
35
+ * @returns A promise which will be resolved if a request to given url has
36
+ * (not) finished, otherwise returned promise will be rejected.
37
+ */
38
+ export declare const checkReachability: (serverConfiguration: Configuration["applicationServer"], inverse?: boolean, givenOptions?: RecursivePartial<CheckReachabilityOptions>) => Promise<Response | Error | null | Promise<Error | null>>;
39
+ export declare const nginx: any;
40
+ export default nginx;
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"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator","child_process","clientnode"],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")):r(e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/asyncToGenerator"],e["@babel/runtime/regenerator"],e.child_process,e.clientnode);for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(this,((e,r,n,t,o)=>(()=>{var a=[,r=>{r.exports=e},e=>{e.exports=r},e=>{e.exports=n},e=>{e.exports=t},e=>{e.exports=o}],i={};function l(e){var r=i[e];if(void 0!==r)return r.exports;var n=i[e]={exports:{}};return a[e](n,n.exports,l),n.exports}l.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return l.d(r,{a:r}),r},l.d=(e,r)=>{for(var n in r)l.o(r,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},l.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};l.r(u),l.d(u,{Nginx:()=>x,default:()=>g});var s=l(1),c=l.n(s),p=l(2),d=l.n(p),f=l(3),b=l.n(f),v=l(4),m=l(5);function h(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 y(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)?y(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 y(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}var x=function(){function e(){}return e.loadService=function(){var r=d()(b().mark((function r(n){var t,o,a,i;return b().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t=n.configuration.applicationServer,o=n.services,!Object.prototype.hasOwnProperty.call(o,"nginx")){r.next=3;break}return r.abrupt("return",null);case 3:return a=(0,v.spawn)("nginx",[],{cwd:process.cwd(),env:process.env,shell:!0,stdio:"inherit"}),o.nginx=a,a.reload=function(){return new Promise((function(e,r){return(0,v.exec)("nginx -s reload",(function(n,t,o){n?(n.standardErrorOutput=o,r(n)):e(t)}))}))},i=new Promise((function(e,r){for(var n,o,i=h(m.CLOSE_EVENT_NAMES);!(n=i()).done;)o=n.value,a.on(o,(0,m.getProcessCloseHandler)(e,t.proxy.optional?e:r,{reason:a,process:a}))})),r.prev=7,r.next=10,e.checkReachability(t);case 10:r.next=21;break;case 12:if(r.prev=12,r.t0=r.catch(7),!t.proxy.optional){r.next=20;break}o.nginx=null,i=null,r.next=21;break;case 20:throw r.t0;case 21:return r.abrupt("return",{nginx:i});case 22:case"end":return r.stop()}}),r,null,[[7,12]])})));return function(){return r.apply(this,arguments)}}(),e.shouldExit=function(){var r=d()(b().mark((function r(n){var t,o;return b().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t=n.configuration,null===(o=n.services).nginx){r.next=5;break}return o.nginx.kill("SIGINT"),r.next=5,e.checkReachability(t.applicationServer,!0);case 5:delete o.nginx;case 6:case"end":return r.stop()}}),r)})));return function(){return r.apply(this,arguments)}}(),e.checkReachability=function(e,r,n){if(void 0===r&&(r=!1),void 0===n&&(n={}),0<Object.values(e.proxy.ports.backend).length){var t="http"+(443===Object.values(e.proxy.ports.backend)[0]?"s":"")+"://"+e.hostName+":"+Object.values(e.proxy.ports.backend)[0],o=c()({options:{redirect:"manual"},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?m.checkUnreachability:m.checkReachability)(t,o)}return Promise.resolve(null)},e}();const g=x;return u})()));
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"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/extends","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator","child_process","clientnode"],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")):r(e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/asyncToGenerator"],e["@babel/runtime/regenerator"],e.child_process,e.clientnode);for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(this,((e,r,n,t,o)=>(()=>{var a=[(e,r,n)=>{n.r(r),n.d(r,{checkReachability:()=>m,default:()=>h,loadService:()=>f,nginx:()=>v,shouldExit:()=>b});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);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 d(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)?d(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 d(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 f=function(){var e=i()(u().mark((function e(r){var n,t,o,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.configuration.applicationServer,t=r.services,!Object.prototype.hasOwnProperty.call(t,"nginx")){e.next=3;break}return e.abrupt("return",null);case 3: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=7,e.next=10,m(n);case 10:e.next=21;break;case 12:if(e.prev=12,e.t0=e.catch(7),!n.proxy.optional){e.next=20;break}t.nginx=null,a=null,e.next=21;break;case 20:throw e.t0;case 21:return e.abrupt("return",{nginx:a});case 22:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(){return e.apply(this,arguments)}}(),b=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=5;break}return t.nginx.kill("SIGINT"),e.next=5,m(n.applicationServer,!0);case 5:delete t.nginx;case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),m=function(e,r,n){if(void 0===r&&(r=!1),void 0===n&&(n={}),0<Object.values(e.proxy.ports.backend).length){var t="http"+(443===Object.values(e.proxy.ports.backend)[0]?"s":"")+"://"+e.hostName+":"+Object.values(e.proxy.ports.backend)[0],a=o()({options:{redirect:"manual"},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)(t,a)}return Promise.resolve(null)},v=e.exports;const h=v},r=>{r.exports=e},e=>{e.exports=r},e=>{e.exports=n},e=>{e.exports=t},e=>{e.exports=o}],i={};function l(e){var r=i[e];if(void 0!==r)return r.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return a[e](n,n.exports,l),n.loaded=!0,n.exports}return l.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return l.d(r,{a:r}),r},l.d=(e,r)=>{for(var n in r)l.o(r,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},l.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),l.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l(0)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nginxwebnodeplugin",
3
- "version": "1.0.309",
3
+ "version": "1.0.311",
4
4
  "description": "A nginx proxy server configuration template for webNode.",
5
5
  "keywords": [
6
6
  "web",
@@ -48,23 +48,24 @@
48
48
  "watch": "weboptimizer build --watch"
49
49
  },
50
50
  "devDependencies": {
51
- "@babel/eslint-parser": "^7.24.7",
52
- "@babel/runtime": "^7.24.7",
53
- "@types/node": "^20.14.10",
54
- "@typescript-eslint/eslint-plugin": "^7.16.0",
55
- "@typescript-eslint/parser": "^7.16.0",
56
- "application-server-web-node-plugin": "^1.0.352",
57
- "clientnode": "^3.0.1157",
58
- "documentation-website": "^1.0.328",
59
- "eslint": "^9.6.0",
51
+ "@babel/eslint-parser": "^7.25.1",
52
+ "@babel/runtime": "^7.25.0",
53
+ "@stylistic/eslint-plugin": "^2.6.4",
54
+ "@types/node": "^22.4.2",
55
+ "@typescript-eslint/eslint-plugin": "^8.2.0",
56
+ "@typescript-eslint/parser": "^8.2.0",
57
+ "application-server-web-node-plugin": "^1.0.356",
58
+ "clientnode": "^3.0.1178",
59
+ "documentation-website": "^1.0.331",
60
+ "eslint": "^9.9.0",
60
61
  "eslint-config-google": "^0.14.0",
61
- "eslint-plugin-jsdoc": "^48.6.0",
62
+ "eslint-plugin-jsdoc": "^50.2.2",
62
63
  "jest": "^29.7.0",
63
64
  "jsdoc": "^4.0.3",
64
65
  "node-fetch": "^3.3.2",
65
- "typescript-eslint": "^7.16.0",
66
- "web-node": "^1.0.512",
67
- "weboptimizer": "^2.0.1483"
66
+ "typescript-eslint": "^8.2.0",
67
+ "web-node": "^1.0.518",
68
+ "weboptimizer": "^2.0.1498"
68
69
  },
69
70
  "peerDependencies": {
70
71
  "@babel/runtime": "*",