@nestjs-mod/pm2
Version:
Production process manager for Node.JS applications with a built-in load balancer for NestJS-mod (Generator ecosystem.config.json for https://www.npmjs.com/package/pm2)
208 lines • 10.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Pm2Configuration = void 0;
const tslib_1 = require("tslib");
/* eslint-disable @typescript-eslint/no-explicit-any */
const common_1 = require("@nestjs-mod/common");
const class_validator_1 = require("class-validator");
let Pm2Configuration = class Pm2Configuration {
};
exports.Pm2Configuration = Pm2Configuration;
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'Configuration file for PM2',
}),
(0, class_validator_1.IsNotEmpty)(),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "ecosystemConfigFile", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'Application script file name for run',
}),
(0, class_validator_1.IsNotEmpty)(),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "applicationScriptFile", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'Enable or disable auto restart after process failure',
}),
tslib_1.__metadata("design:type", Boolean)
], Pm2Configuration.prototype, "autorestart", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: ' An arbitrary name that can be used to interact with (e.g. restart) the process later in other commands. Defaults to the script name without its extension (eg “testScript” for “testScript.js”)',
}),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "name", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The path of the script to run',
}),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "script", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'A string or array of strings composed of arguments to pass to the script',
}),
tslib_1.__metadata("design:type", Object)
], Pm2Configuration.prototype, "args", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'A string or array of strings composed of arguments to call the interpreter process with. Eg “–harmony” or [”–harmony”,”–debug”]. Only applies if interpreter is something other than “none”',
}),
tslib_1.__metadata("design:type", Object)
], Pm2Configuration.prototype, "interpreter_args", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The working directory to start the process with',
}),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "cwd", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The path to a file to append stdout output to. Can be the same file as error',
}),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "output", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The path to a file to append stderr output to. Can be the same file as output',
}),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "error", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The display format for log timestamps (eg “YYYY-MM-DD HH:mm Z”). The format is a moment display format',
}),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "log_date_format", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The path to a file to write the pid of the started process. The file will be overwritten. Note that the file is not used in any way by pm2 and so the user is free to manipulate or remove that file at any time. The file will be deleted when the process is stopped or the daemon killed',
}),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "pid", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The minimum uptime of the script before it’s considered successfully started',
transform: new common_1.NumberTransformer()
}),
tslib_1.__metadata("design:type", Number)
], Pm2Configuration.prototype, "min_uptime", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The maximum number of times in a row a script will be restarted if it exits in less than min_uptime',
transform: new common_1.NumberTransformer()
}),
tslib_1.__metadata("design:type", Number)
], Pm2Configuration.prototype, "max_restarts", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'If sets and script’s memory usage goes about the configured number, pm2 restarts the script. Uses human-friendly suffixes: ‘K’ for kilobytes, ‘M’ for megabytes, ‘G’ for gigabytes’, etc. Eg “150M”',
}),
tslib_1.__metadata("design:type", Object)
], Pm2Configuration.prototype, "max_memory_restart", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'Arguments to pass to the interpreter',
default: '-r dotenv/config',
}),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "node_args", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'Prefix logs with time',
}),
tslib_1.__metadata("design:type", Boolean)
], Pm2Configuration.prototype, "time", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: "This will make PM2 listen for that event. In your application you will need to add process.send('ready'); when you want your application to be considered as ready.",
}),
tslib_1.__metadata("design:type", Boolean)
], Pm2Configuration.prototype, "wait_ready", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The number of milliseconds to wait after a stop or restart command issues a SIGINT signal to kill the script forceably with a SIGKILL signal',
transform: new common_1.NumberTransformer()
}),
tslib_1.__metadata("design:type", Number)
], Pm2Configuration.prototype, "kill_timeout", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'Number of millseconds to wait before restarting a script that has exited',
transform: new common_1.NumberTransformer()
}),
tslib_1.__metadata("design:type", Number)
], Pm2Configuration.prototype, "restart_delay", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The interpreter for your script (eg “python”, “ruby”, “bash”, etc). The value “none” will execute the ‘script’ as a binary executable',
}),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "interpreter", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'If sets to ‘cluster’, will enable clustering (running multiple instances of the script)',
}),
tslib_1.__metadata("design:type", String)
], Pm2Configuration.prototype, "exec_mode", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'How many instances of script to create. Only relevant in exec_mode ‘cluster’',
transform: new common_1.NumberTransformer()
}),
tslib_1.__metadata("design:type", Number)
], Pm2Configuration.prototype, "instances", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'If true, merges the log files for all instances of script into one stderr log and one stdout log. Only applies in ‘cluster’ mode. For example, if you have 4 instances of ‘test.js’ started via pm2, normally you would have 4 stdout log files and 4 stderr log files, but with this option set to true you would only have one stdout file and one stderr file',
}),
tslib_1.__metadata("design:type", Boolean)
], Pm2Configuration.prototype, "merge_logs", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: ' If set to true, the application will be restarted on change of the script file',
}),
tslib_1.__metadata("design:type", Object)
], Pm2Configuration.prototype, "watch", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'By default, pm2 will only start a script if that script isn’t already running (a script is a path to an application, not the name of an application already running). If force is set to true, pm2 will start a new instance of that script',
}),
tslib_1.__metadata("design:type", Boolean)
], Pm2Configuration.prototype, "force", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)(),
tslib_1.__metadata("design:type", Array)
], Pm2Configuration.prototype, "ignore_watch", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)(),
tslib_1.__metadata("design:type", Object)
], Pm2Configuration.prototype, "cron", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)(),
tslib_1.__metadata("design:type", Object)
], Pm2Configuration.prototype, "execute_command", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)(),
tslib_1.__metadata("design:type", Object)
], Pm2Configuration.prototype, "write", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)(),
tslib_1.__metadata("design:type", Object)
], Pm2Configuration.prototype, "source_map_support", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)(),
tslib_1.__metadata("design:type", Object)
], Pm2Configuration.prototype, "disable_source_map_support", void 0);
tslib_1.__decorate([
(0, common_1.ConfigModelProperty)({
description: 'The environment variables to pass on to the process',
}),
tslib_1.__metadata("design:type", Object)
], Pm2Configuration.prototype, "env", void 0);
exports.Pm2Configuration = Pm2Configuration = tslib_1.__decorate([
(0, common_1.ConfigModel)()
], Pm2Configuration);
//# sourceMappingURL=pm2.configuration.js.map