nginxwebnodeplugin 1.0.250 → 1.0.253

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 +43 -0
  2. package/package.json +2 -2
  3. package/type.d.ts +32 -0
package/index.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ import { CheckReachabilityOptions, RecursivePartial } from 'clientnode/type';
2
+ import { PluginHandler } from 'web-node/type';
3
+ import { Configuration, Service, ServicePromises, Services } from './type';
4
+ /**
5
+ * Launches an application server und triggers all some pluginable hooks on
6
+ * an event.
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 servicePromises - An object with stored service promise
13
+ * instances.
14
+ * @param services - An object with stored service instances.
15
+ * @param configuration - Mutable by plugins extended configuration object.
16
+ *
17
+ * @returns A promise which correspond to the plugin specific continues
18
+ * service.
19
+ */
20
+ static loadService(servicePromises: Omit<ServicePromises, 'nginx'>, services: Services, configuration: Configuration): Promise<null | Service>;
21
+ /**
22
+ * Application will be closed soon.
23
+ * @param services - An object with stored service instances.
24
+ * @param configuration - Mutable by plugins extended configuration object.
25
+ *
26
+ * @returns Given object of services.
27
+ */
28
+ static shouldExit(services: Services, configuration: Configuration): Promise<Services>;
29
+ /**
30
+ * Check if a nginx server is currently (not) running.
31
+ * @param serverConfiguration - Mutable by plugins extended configuration
32
+ * object.
33
+ * @param inverse - Boolean indicating if we should check for reachability
34
+ * or un-reachability.
35
+ * @param givenOptions - Tools reachability options to configure how to
36
+ * check for reachability.
37
+ *
38
+ * @returns A promise which will be resolved if a request to given url has
39
+ * (not) finished. Otherwise returned promise will be rejected.
40
+ */
41
+ static checkReachability(serverConfiguration: Configuration['applicationServer'], inverse?: boolean, givenOptions?: RecursivePartial<CheckReachabilityOptions>): Promise<Response | Error | null | Promise<Error | null>>;
42
+ }
43
+ export default Nginx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nginxwebnodeplugin",
3
- "version": "1.0.250",
3
+ "version": "1.0.253",
4
4
  "description": "A nginx proxy server configuration template for webNode.",
5
5
  "keywords": [
6
6
  "web",
@@ -31,7 +31,7 @@
31
31
  "url": "https://github.com/thaibault/nginx-web-node-plugin.git"
32
32
  },
33
33
  "scripts": {
34
- "build": "weboptimizer build",
34
+ "build": "weboptimizer build:types && weboptimizer build",
35
35
  "check": "yarn check:types; yarn lint",
36
36
  "check:types": "weboptimizer check:types",
37
37
  "clear": "weboptimizer clear",
package/type.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ /// <reference types="node" />
2
+ import { ChildProcess } from 'child_process';
3
+ import { Mapping, ProcessCloseReason } from 'clientnode/type';
4
+ import { Configuration as BaseConfiguration, Services as BaseServices, ServicePromises as BaseServicePromises } from 'application-server-web-node-plugin/type';
5
+ import { Service as BaseService } from 'web-node/type';
6
+ export declare type Configuration<PluginConfigurationType = Mapping<unknown>> = BaseConfiguration<{
7
+ applicationServer: {
8
+ proxy: {
9
+ optional: boolean;
10
+ logFilePath: {
11
+ access: string;
12
+ error: string;
13
+ };
14
+ ports: {
15
+ backend: Mapping<number>;
16
+ };
17
+ };
18
+ };
19
+ }> & PluginConfigurationType;
20
+ export interface Service extends BaseService {
21
+ name: 'nginx';
22
+ promise: null | Promise<ProcessCloseReason>;
23
+ }
24
+ export interface ServiceProcess extends ChildProcess {
25
+ reload(): Promise<string>;
26
+ }
27
+ export declare type ServicePromises<ServicePromiseType = Mapping<unknown>> = BaseServicePromises<{
28
+ nginx: Promise<ProcessCloseReason>;
29
+ }> & ServicePromiseType;
30
+ export declare type Services<ServiceType = Mapping<unknown>> = BaseServices<{
31
+ nginx: null | ServiceProcess;
32
+ }> & ServiceType;