+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+.
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/README.md b/node_modules/@pm2/agent/README.md
new file mode 100644
index 0000000..4d43f9b
--- /dev/null
+++ b/node_modules/@pm2/agent/README.md
@@ -0,0 +1,95 @@
+# pm2-io-agent
+
+This module is used by [PM2](https://github.com/Unitech/pm2) to communicate with [PM2.io](https://pm2.io/plus)'s servers.
+
+## Transporters
+
+Two transporters are available now, AxonTransporter and WebsocketTransporter.
+
+AxonTransporter is using [axon pub-emitter](https://github.com/tj/axon) to send data (PushInteractor) to interaction server and [nssocket](https://github.com/foreverjs/nssocket) to receive data from reverse interaction server.
+
+WebsocketTransporter is using [websocket](https://github.com/websockets/ws) to send and receive data from websocket server.
+
+## Launch
+
+### Using daemon
+
+To launch using daemon you need to run :
+
+`node src/InteractorDaemon.js`
+
+
+Before, you need to set these environment vars
+
+| Key | Value |
+|------------------|-------------------------------------------|
+| KEYMETRICS_NODE | Where bucket's endpoints will be resolved |
+| PM2_SECRET_KEY | Bucket's secret key |
+| PM2_PUBLIC_KEY | Bucket's public key |
+| PM2_MACHINE_NAME | Machine name |
+| PM2_VERSION | PM2 Version |
+
+### Using client
+
+You can use `src/InteractorClient.js` and method `launchAndInteract` with constants as first argument (empty object is authorized), options as second argument which is an object with key `secret_key`, `public_key`, `machine_name` and callback as third argument.
+
+```js
+const InteractorClient = require('keymetrics-agent/src/InteractorClient')
+
+InteractorClient.launchAndInteract({}, {
+ secret_key: '',
+ public_key: '',
+ machine_name: ''
+}, (err, msg) => {
+})
+```
+
+## Configuration
+
+To configure this agent you can use `config.json`.
+
+### Default
+
+By default `AxonTransporter` is enabled and using `push` and `reverse` bucket's endpoint.
+You can override this endpoints with `AGENT_PUSH_ENDPOINT` and `AGENT_REVERSE_ENDPOINT` environements' vars
+
+By default `WebsocketTransporter` is disabled, you can enabled it with `AGENT_TRANSPORT_WEBSOCKET` environement's var, it's using `websocket` bucket's endpoint but you can override it with `AGENT_WEBSOCKET_ENDPOINT` environement's var.
+
+### Transporters
+
+Into this configuration you can put `transporter name` as key and for values, two keys are available `enabled` and `endpoints`.
+
+The `enabled` key is using to disable or enable transporter.
+
+The `endpoints` key can be a string or an object. It depends on what the connect method of the transporter needs.
+If you set a string, the connect method will be called with endpoint's value or raw value if no endpoint is matched.
+For objects, the connect method will be called with this object, and value of the keys will be replaced by endpoint's value or raw value if no endpoint is matched.
+
+## Release
+
+To release a new version, first install [gren](https://github.com/github-tools/github-release-notes) :
+```bash
+yarn global add github-release-notes
+```
+
+Push a commit in github with the new version you want to release :
+```
+git commit -am "version: major|minor|patch bump to X.X.X"
+```
+
+Care for the **versionning**, we use the [semver versioning](https://semver.org/) currently. Please be careful about the version when pushing a new package.
+
+Then tag a version with git :
+```bash
+git tag -s vX.X.X
+```
+
+Push the tag into github (this will trigger the publish to npm) :
+```
+git push origin vX.X.X
+```
+
+To finish update the changelog of the release on github with `gren` (be sure that gren has selected the right tags):
+```
+gren release -o -D commits -u keymetrics -r pm2-io-agent
+```
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/config.js b/node_modules/@pm2/agent/config.js
new file mode 100644
index 0000000..83437cd
--- /dev/null
+++ b/node_modules/@pm2/agent/config.js
@@ -0,0 +1,30 @@
+'use strict'
+
+/**
+ * Convert value to boolean but false if undefined
+ * @param {String} value
+ * @param {String} fallback default value
+ * @return {Boolean}
+ */
+const useIfDefined = (value, fallback) => {
+ if (typeof value === 'undefined') {
+ return fallback
+ } else {
+ return value === 'true'
+ }
+}
+
+/**
+ * Configuration for transporters
+ * Configuration by transporter :
+ * @param {Integer} enabled
+ * @param {Object|String} endpoints sended as first arg with connect() method
+ */
+module.exports = {
+ transporters: {
+ websocket: {
+ enabled: true, // useIfDefined(process.env.AGENT_TRANSPORT_WEBSOCKET, true),
+ endpoints: process.env.AGENT_WEBSOCKET_ENDPOINT || 'ws'
+ }
+ }
+}
diff --git a/node_modules/@pm2/agent/constants.js b/node_modules/@pm2/agent/constants.js
new file mode 100644
index 0000000..c50d3a2
--- /dev/null
+++ b/node_modules/@pm2/agent/constants.js
@@ -0,0 +1,98 @@
+/**
+ * Copyright Keymetrics Team. All rights reserved.
+ * Use of this source code is governed by a license that
+ * can be found in the LICENSE file.
+ */
+
+'use strict'
+
+const path = require('path')
+let PM2_HOME
+
+if (process.env.PM2_HOME) {
+ PM2_HOME = process.env.PM2_HOME
+} else if (process.env.HOME && !process.env.HOMEPATH) {
+ PM2_HOME = path.resolve(process.env.HOME, '.pm2')
+} else if (process.env.HOME || process.env.HOMEPATH) {
+ PM2_HOME = path.resolve(process.env.HOMEDRIVE, process.env.HOME || process.env.HOMEPATH, '.pm2')
+} else {
+ PM2_HOME = path.resolve('/etc', '.pm2')
+}
+
+const getUniqueId = () => {
+ var s = []
+ var hexDigits = '0123456789abcdef'
+ for (var i = 0; i < 36; i++) {
+ s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1)
+ }
+ s[14] = '4'
+ s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1)
+ s[8] = s[13] = s[18] = s[23] = '-'
+ return s.join('')
+}
+
+/**
+ * Convert value to boolean but false if undefined
+ * @param {String} value
+ * @param {String} fallback default value
+ * @return {Boolean}
+ */
+const useIfDefined = (value, fallback) => {
+ if (typeof value === 'undefined') {
+ return fallback
+ } else {
+ return value === 'true'
+ }
+}
+
+let cst = {
+ DEBUG: process.env.PM2_DEBUG || false,
+ KEYMETRICS_ROOT_URL: process.env.KEYMETRICS_NODE || 'https://root.keymetrics.io',
+
+ PROTOCOL_VERSION: 1,
+ COMPRESS_PROTOCOL: false,
+ STATUS_INTERVAL: 1000,
+ PACKET_QUEUE_SIZE: 200,
+ PROXY: process.env.PM2_PROXY,
+
+ LOGS_BUFFER: 8,
+ CONTEXT_ON_ERROR: 4,
+ TRANSACTION_FLUSH_INTERVAL: useIfDefined(process.env.PM2_DEBUG, process.env.NODE_ENV === 'local_test') ? 1000 : 30000,
+ AGGREGATION_DURATION: useIfDefined(process.env.PM2_DEBUG, process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'development') ? 0 : 60 * 10,
+ TRACE_FLUSH_INTERVAL: useIfDefined(process.env.PM2_DEBUG, process.env.NODE_ENV === 'local_test') ? 1000 : 60000,
+
+ PM2_HOME: PM2_HOME,
+ DAEMON_RPC_PORT: path.resolve(PM2_HOME, 'rpc.sock'),
+ DAEMON_PUB_PORT: path.resolve(PM2_HOME, 'pub.sock'),
+ INTERACTOR_RPC_PORT: path.resolve(PM2_HOME, 'interactor.sock'),
+ INTERACTOR_LOG_FILE_PATH: path.resolve(PM2_HOME, 'agent.log'),
+ INTERACTOR_PID_PATH: path.resolve(PM2_HOME, 'agent.pid'),
+ INTERACTION_CONF: path.resolve(PM2_HOME, 'agent.json5'),
+
+ DUMP_FILE_PATH: path.resolve(PM2_HOME, 'dump.pm2'),
+
+ UNIQUE_SERVER_ID: getUniqueId(),
+
+ ENABLE_CONTEXT_ON_ERROR: useIfDefined(process.env.PM2_AGENT_ENABLE_CONTEXT_ON_ERROR, true),
+
+ SUCCESS_EXIT: 0,
+ ERROR_EXIT: 1
+}
+
+// allow overide of file paths via environnement
+let keys = Object.keys(cst)
+keys.forEach((key) => {
+ var envKey = key.indexOf('PM2_') > -1 ? key : 'PM2_' + key
+ if (process.env[envKey] && key !== 'PM2_HOME' && key !== 'PM2_ROOT_PATH') {
+ cst[key] = process.env[envKey]
+ }
+})
+
+if (process.platform === 'win32' || process.platform === 'win64') {
+ // @todo instead of static unique rpc/pub file custom with PM2_HOME or UID
+ cst.DAEMON_RPC_PORT = '\\\\.\\pipe\\rpc.sock'
+ cst.DAEMON_PUB_PORT = '\\\\.\\pipe\\pub.sock'
+ cst.INTERACTOR_RPC_PORT = '\\\\.\\pipe\\interactor.sock'
+}
+
+module.exports = cst
diff --git a/node_modules/@pm2/agent/index.js b/node_modules/@pm2/agent/index.js
new file mode 100644
index 0000000..2378a11
--- /dev/null
+++ b/node_modules/@pm2/agent/index.js
@@ -0,0 +1,2 @@
+
+module.exports = require('./src/InteractorClient.js')
diff --git a/node_modules/@pm2/agent/node_modules/.bin/semver b/node_modules/@pm2/agent/node_modules/.bin/semver
new file mode 120000
index 0000000..5aaadf4
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/.bin/semver
@@ -0,0 +1 @@
+../semver/bin/semver.js
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/.editorconfig b/node_modules/@pm2/agent/node_modules/dayjs/.editorconfig
new file mode 100644
index 0000000..14c1d8c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/.editorconfig
@@ -0,0 +1,6 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/CHANGELOG.md b/node_modules/@pm2/agent/node_modules/dayjs/CHANGELOG.md
new file mode 100644
index 0000000..b8b5ae9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/CHANGELOG.md
@@ -0,0 +1,562 @@
+## [1.8.36](https://github.com/iamkun/dayjs/compare/v1.8.35...v1.8.36) (2020-09-17)
+
+
+### Bug Fixes
+
+* Add Amharic (am) locale ([#1046](https://github.com/iamkun/dayjs/issues/1046)) ([cdc49a1](https://github.com/iamkun/dayjs/commit/cdc49a1911c74b7ea96ed222f42796d53715cfed))
+* Export Duration type in duration plugin ([#1043](https://github.com/iamkun/dayjs/issues/1043)) ([0f20c3a](https://github.com/iamkun/dayjs/commit/0f20c3ac75d9ac1026a15a7bb343d3a150d9b30f))
+* Fix duration plugin parsing milliseconds bug ([#1042](https://github.com/iamkun/dayjs/issues/1042)) ([fe2301b](https://github.com/iamkun/dayjs/commit/fe2301b22318886aaa89ed1620e0a118e98c2b8a))
+* Timezone plugin set default timezone ([#1033](https://github.com/iamkun/dayjs/issues/1033)) ([0c2050a](https://github.com/iamkun/dayjs/commit/0c2050a152da708b01edd6150a5013f642b14576))
+* Timezone plugin should have the same behavior in latest ICU version ([#1032](https://github.com/iamkun/dayjs/issues/1032)) ([de31592](https://github.com/iamkun/dayjs/commit/de315921575cc50c38464b27d0338e30a54d8e2a))
+* Update Finnish (fi) locale ([#963](https://github.com/iamkun/dayjs/issues/963)) ([cf8b6a0](https://github.com/iamkun/dayjs/commit/cf8b6a096f24b54cbdb95675ac386d8ac85ea616))
+* Update Polish (pl) , Hungarian (hr) and Lithuanian (lt) localization ([#1045](https://github.com/iamkun/dayjs/issues/1045)) ([638fd39](https://github.com/iamkun/dayjs/commit/638fd394fc24f4188390faf387da6b156e7c6320))
+
+## [1.8.35](https://github.com/iamkun/dayjs/compare/v1.8.34...v1.8.35) (2020-09-02)
+
+
+### Bug Fixes
+
+* Fix BadMutable plugin bug in .diff ([#1023](https://github.com/iamkun/dayjs/issues/1023)) ([40ab6d9](https://github.com/iamkun/dayjs/commit/40ab6d9a53e8047cfca63c611c25dd045372d021))
+* fix LocaleData plugin to support instance.weekdays() API ([#1019](https://github.com/iamkun/dayjs/issues/1019)) ([a09d259](https://github.com/iamkun/dayjs/commit/a09d259a407b81d1cb6bb5623fad551c775d8674)), closes [#1017](https://github.com/iamkun/dayjs/issues/1017)
+* Update Dutch (nl) locale to set correct yearStart ([1533a2c](https://github.com/iamkun/dayjs/commit/1533a2cc1475270032da2d87b19fc3d62327e6e3))
+
+## [1.8.34](https://github.com/iamkun/dayjs/compare/v1.8.33...v1.8.34) (2020-08-20)
+
+
+### Bug Fixes
+
+* Fix Timezone plugin to preserve milliseconds while changing timezone ([#1003](https://github.com/iamkun/dayjs/issues/1003)) ([5f446ed](https://github.com/iamkun/dayjs/commit/5f446eda770fa97e895c81a8195b3ba5d082cef0)), closes [#1002](https://github.com/iamkun/dayjs/issues/1002)
+* support parsing unlimited decimals of millisecond ([#1010](https://github.com/iamkun/dayjs/issues/1010)) ([d1bdd36](https://github.com/iamkun/dayjs/commit/d1bdd36a56e3d1786523a180e3fc18068f609135)), closes [#544](https://github.com/iamkun/dayjs/issues/544)
+* update Duration plugin to support global locale ([#1008](https://github.com/iamkun/dayjs/issues/1008)) ([1c49c83](https://github.com/iamkun/dayjs/commit/1c49c83e79811eede13db6372b5d65db598aee77)), closes [#1007](https://github.com/iamkun/dayjs/issues/1007)
+
+## [1.8.33](https://github.com/iamkun/dayjs/compare/v1.8.32...v1.8.33) (2020-08-10)
+
+
+### Bug Fixes
+
+* Add PluralGetSet plugin for plural getters/setters ([#996](https://github.com/iamkun/dayjs/issues/996)) ([f76e3ce](https://github.com/iamkun/dayjs/commit/f76e3ce2fbe5d3e9ed9121086baf55eb0cc4d355))
+* Add typescript type defs in esm build ([#985](https://github.com/iamkun/dayjs/issues/985)) ([50e3b3c](https://github.com/iamkun/dayjs/commit/50e3b3c6719cb0b4ec6eff394dacd63d5db8f253))
+* Fix isoWeek Plugin cal bug in UTC mode ([#993](https://github.com/iamkun/dayjs/issues/993)) ([f2e5f32](https://github.com/iamkun/dayjs/commit/f2e5f327aaf12b4572296ec6e107ecc05fcf76e7))
+* Fix Timezone plugin parsing js date, Day.js object, timestamp bug && update type file ([#994](https://github.com/iamkun/dayjs/issues/994)) ([22f3d49](https://github.com/iamkun/dayjs/commit/22f3d49405da98db6da56d1673eebcd01b57554b)), closes [#992](https://github.com/iamkun/dayjs/issues/992) [#989](https://github.com/iamkun/dayjs/issues/989)
+* Fix Timezone plugin UTCOffset rounding bug ([#987](https://github.com/iamkun/dayjs/issues/987)) ([b07182b](https://github.com/iamkun/dayjs/commit/b07182bbdf5aef7f6bf1e88fcd38432e2b8ee465)), closes [#986](https://github.com/iamkun/dayjs/issues/986)
+* Fix UTC plugin bug while comparing an utc instance to a local one ([#995](https://github.com/iamkun/dayjs/issues/995)) ([747c0fb](https://github.com/iamkun/dayjs/commit/747c0fb4eba6353755b5dad3417fd8d5a408c378))
+* Update pt-br locale weekStart 0 ([#984](https://github.com/iamkun/dayjs/issues/984)) ([0f881c1](https://github.com/iamkun/dayjs/commit/0f881c18efb02b9d0ba7f76cba92bb504226fa95))
+
+## [1.8.32](https://github.com/iamkun/dayjs/compare/v1.8.31...v1.8.32) (2020-08-04)
+
+
+### Bug Fixes
+
+* Add Experimental Timezone Plugin ([#974](https://github.com/iamkun/dayjs/issues/974)) ([e69caba](https://github.com/iamkun/dayjs/commit/e69caba1b0957241a855aa0ae38db899fa2c3795))
+* fix parse date string error e.g. '2020/9/30' ([#980](https://github.com/iamkun/dayjs/issues/980)) ([231790d](https://github.com/iamkun/dayjs/commit/231790da62af0494732960c2c50d86ae9bf63ec6)), closes [#979](https://github.com/iamkun/dayjs/issues/979)
+* update monthDiff function to get more accurate results ([19e8a7f](https://github.com/iamkun/dayjs/commit/19e8a7f2f7582b717f49d446822e39603694433c))
+* Update UTC plugin to support keepLocalTime ([#973](https://github.com/iamkun/dayjs/issues/973)) ([9f488e5](https://github.com/iamkun/dayjs/commit/9f488e5aca92f0b4c2951459436829d79f86d8d7))
+
+## [1.8.31](https://github.com/iamkun/dayjs/compare/v1.8.30...v1.8.31) (2020-07-29)
+
+
+### Bug Fixes
+
+* Rollback LocalePresetType to string ([#968](https://github.com/iamkun/dayjs/issues/968)) ([b342bd3](https://github.com/iamkun/dayjs/commit/b342bd3d84987d6c7587a0c4590d614fb0e670d7))
+* Update Regex to parse 'YYYY' correctly ([#969](https://github.com/iamkun/dayjs/issues/969)) ([70c1239](https://github.com/iamkun/dayjs/commit/70c123990dcc6bd479fa2b5d7f9985127872a826))
+
+## [1.8.30](https://github.com/iamkun/dayjs/compare/v1.8.29...v1.8.30) (2020-07-22)
+
+
+### Bug Fixes
+
+* Add Haitian Creole (ht) and Spanish Puerto Rico (es-pr) locale configs ([#958](https://github.com/iamkun/dayjs/issues/958)) ([b2642e2](https://github.com/iamkun/dayjs/commit/b2642e2d1f87734a34808c66e5176cb18bc0414d))
+* Fix UTC plugin wrong hour bug while adding month or year ([#957](https://github.com/iamkun/dayjs/issues/957)) ([28ae070](https://github.com/iamkun/dayjs/commit/28ae070024ff26685c88ce4cc8747307e86923c9))
+* Update French (fr) locale to set correct yearStart ([14ab808](https://github.com/iamkun/dayjs/commit/14ab808a7b7e226f2eb2cbe894916a18ed5d967d)), closes [#956](https://github.com/iamkun/dayjs/issues/956)
+
+## [1.8.29](https://github.com/iamkun/dayjs/compare/v1.8.28...v1.8.29) (2020-07-02)
+
+
+### Bug Fixes
+
+* Duration plugin supports parse ISO string with week (W) ([#950](https://github.com/iamkun/dayjs/issues/950)) ([f0fc12a](https://github.com/iamkun/dayjs/commit/f0fc12adadcab53fb0577ad8f5e2f1cf784fd8f5))
+* LocaleData plugin supports locale order ([#938](https://github.com/iamkun/dayjs/issues/938)) ([62f429d](https://github.com/iamkun/dayjs/commit/62f429db73a0a069b1267231dea172b85f4b90e3)), closes [#936](https://github.com/iamkun/dayjs/issues/936)
+* Update type definition to support array format ([#945](https://github.com/iamkun/dayjs/issues/945)) ([81d4740](https://github.com/iamkun/dayjs/commit/81d4740511d47e34f891b21afeb0449ef8a28688)), closes [#944](https://github.com/iamkun/dayjs/issues/944)
+* Update type definition to support strict mode ([#951](https://github.com/iamkun/dayjs/issues/951)) ([8d54f3f](https://github.com/iamkun/dayjs/commit/8d54f3f7d4d161e72c767fa09699e70a2b3d681c))
+
+## [1.8.28](https://github.com/iamkun/dayjs/compare/v1.8.27...v1.8.28) (2020-05-28)
+
+
+### Bug Fixes
+
+* Fix CustomParseFormat plugin month index error ([#918](https://github.com/iamkun/dayjs/issues/918)) ([fa2ec7f](https://github.com/iamkun/dayjs/commit/fa2ec7fcb980dcd2c7498dafe2f9ca2e52d735cf)), closes [#915](https://github.com/iamkun/dayjs/issues/915)
+* Update Ukrainian (uk) locale monthFormat and monthStandalone ([#899](https://github.com/iamkun/dayjs/issues/899)) ([a08756e](https://github.com/iamkun/dayjs/commit/a08756e80bd1d7126fca28c5ad9e382613fc86c4))
+
+## [1.8.27](https://github.com/iamkun/dayjs/compare/v1.8.26...v1.8.27) (2020-05-14)
+
+
+### Bug Fixes
+
+* Add Kinyarwanda (rw) locale ([#903](https://github.com/iamkun/dayjs/issues/903)) ([f355235](https://github.com/iamkun/dayjs/commit/f355235a836540d77880959fb1b614c87e9f7b3e))
+* Add plugin objectSupport ([#887](https://github.com/iamkun/dayjs/issues/887)) ([52dfb13](https://github.com/iamkun/dayjs/commit/52dfb13a6b84f0a753cc5761192b92416f440961))
+* Add Turkmen (tk) locale ([#893](https://github.com/iamkun/dayjs/issues/893)) ([a9ca8dc](https://github.com/iamkun/dayjs/commit/a9ca8dcbbd0964c5b9abb4e8a2d620c983cf091a))
+* Fix CustomParseFormat plugin set locale error ([#896](https://github.com/iamkun/dayjs/issues/896)) ([8035c8a](https://github.com/iamkun/dayjs/commit/8035c8a760549b631252252718db3cdc4ab2f68f))
+* Fix locale month function bug ([#908](https://github.com/iamkun/dayjs/issues/908)) ([bf347c3](https://github.com/iamkun/dayjs/commit/bf347c36e401f50727fb5afcc537497b54b90d6b))
+* Update CustomParseFormat plugin to support Array formats ([#906](https://github.com/iamkun/dayjs/issues/906)) ([97856c6](https://github.com/iamkun/dayjs/commit/97856c603ef5fbbeb1cf8a42387479e56a77dbe8))
+
+## [1.8.26](https://github.com/iamkun/dayjs/compare/v1.8.25...v1.8.26) (2020-04-30)
+
+
+### Bug Fixes
+
+* Fix Duration plugin `.toISOString` format bug ([#889](https://github.com/iamkun/dayjs/issues/889)) ([058d624](https://github.com/iamkun/dayjs/commit/058d624808fd2be024ae846bcb2e03885f39b556)), closes [#888](https://github.com/iamkun/dayjs/issues/888)
+* Fix WeekOfYear plugin bug while using BadMutable plugin ([#884](https://github.com/iamkun/dayjs/issues/884)) ([2977438](https://github.com/iamkun/dayjs/commit/2977438458542573a4500e21f7ba5d1f8442960e))
+* Update CustomParseFormat plugin strict mode ([#882](https://github.com/iamkun/dayjs/issues/882)) ([db642ac](https://github.com/iamkun/dayjs/commit/db642ac73e52e00d8c41546b2935c9e691cf66e0))
+* Update RelativeTime plugin default config ([#883](https://github.com/iamkun/dayjs/issues/883)) ([0606f42](https://github.com/iamkun/dayjs/commit/0606f425aef8ccbfc3da3e43cba368130603b0cc))
+
+## [1.8.25](https://github.com/iamkun/dayjs/compare/v1.8.24...v1.8.25) (2020-04-21)
+
+
+### Bug Fixes
+
+* Fix CustomParseFormat plugin of parsing only YYYY / YYYY-MM bug ([#873](https://github.com/iamkun/dayjs/issues/873)) ([3cea04d](https://github.com/iamkun/dayjs/commit/3cea04d33d54d44bbdd3d026b5c7f67ebf176116)), closes [#849](https://github.com/iamkun/dayjs/issues/849)
+* Fix Duration plugin get seconds ([#867](https://github.com/iamkun/dayjs/issues/867)) ([62b092d](https://github.com/iamkun/dayjs/commit/62b092d9f9a3db5506ef01f798bdf211f163f53f))
+* Fix type definition of locale ([9790b85](https://github.com/iamkun/dayjs/commit/9790b853e6113243a7f4a81dd12c6509e406a102))
+* Fix UTC plugin startOf, endOf bug ([#872](https://github.com/iamkun/dayjs/issues/872)) ([4141084](https://github.com/iamkun/dayjs/commit/4141084ba96d35cadcda3f1e661bf1d0f6c8e4de)), closes [#809](https://github.com/iamkun/dayjs/issues/809) [#808](https://github.com/iamkun/dayjs/issues/808)
+
+## [1.8.24](https://github.com/iamkun/dayjs/compare/v1.8.23...v1.8.24) (2020-04-10)
+
+
+### Bug Fixes
+
+* Add config option to RelativeTime plugin ([#851](https://github.com/iamkun/dayjs/issues/851)) ([bd24034](https://github.com/iamkun/dayjs/commit/bd24034b95bfc656024b75ef3f3c986708845fed))
+* add Duration plugin ([#858](https://github.com/iamkun/dayjs/issues/858)) ([d568273](https://github.com/iamkun/dayjs/commit/d568273223199ca0497f238e2cc3a8d3dcf32d0f))
+* Add en-in, en-tt locales ([#855](https://github.com/iamkun/dayjs/issues/855)) ([c39fb96](https://github.com/iamkun/dayjs/commit/c39fb96e2a9102c14b004c14a6c073af9d266f2f))
+* add isToday, isTomorrow, isYesterday plugins ([#857](https://github.com/iamkun/dayjs/issues/857)) ([fc08ab6](https://github.com/iamkun/dayjs/commit/fc08ab68f8a28269802deeab9d6b0473b92cdc51))
+* Add option callback to Calendar plugin ([#839](https://github.com/iamkun/dayjs/issues/839)) ([b25be90](https://github.com/iamkun/dayjs/commit/b25be9094325295310c8fc5e617fb058be8a5f68))
+* Fix monthsShort for locale fr ([#862](https://github.com/iamkun/dayjs/issues/862)) ([d2de9a0](https://github.com/iamkun/dayjs/commit/d2de9a0b44b830038ed0094f79bfd40726311f2a))
+* Update Breton locale (br) meridiem config ([#856](https://github.com/iamkun/dayjs/issues/856)) ([a2a6672](https://github.com/iamkun/dayjs/commit/a2a66720abb788a8f1cffbfd0929b35579f29c72))
+* Update Ukrainian (uk) locale relative time ([#842](https://github.com/iamkun/dayjs/issues/842)) ([578bc1a](https://github.com/iamkun/dayjs/commit/578bc1a23c6e737783bbac3da12c0ed5d1edcf82))
+
+## [1.8.23](https://github.com/iamkun/dayjs/compare/v1.8.22...v1.8.23) (2020-03-16)
+
+
+### Bug Fixes
+
+* Add Chinese (zh) locale ([f9b8945](https://github.com/iamkun/dayjs/commit/f9b89453166d8b53d33b1d7eefd9942022552e6e))
+* Fix IsoWeek plugin typescript definition ([#828](https://github.com/iamkun/dayjs/issues/828)) ([30aab0c](https://github.com/iamkun/dayjs/commit/30aab0c7bce85dfac0ae208a891def30f88b5cb4))
+* Update Arabic (ar) locale relative time ([#836](https://github.com/iamkun/dayjs/issues/836)) ([14044c6](https://github.com/iamkun/dayjs/commit/14044c6fda1229e3f0e5473d3f886bd79589b15f))
+* Update Slovak (sk) locale, Czech (cs) locale ([#833](https://github.com/iamkun/dayjs/issues/833)) ([f0d451f](https://github.com/iamkun/dayjs/commit/f0d451f795e9ebf752cd854d51b25b11de2343a3))
+* Update Thai (th) locale relativeTime ([#826](https://github.com/iamkun/dayjs/issues/826)) ([63b7c03](https://github.com/iamkun/dayjs/commit/63b7c03a6dbb0507d60776e8bad6cccde3828b88)), closes [#816](https://github.com/iamkun/dayjs/issues/816)
+
+## [1.8.22](https://github.com/iamkun/dayjs/compare/v1.8.21...v1.8.22) (2020-03-08)
+
+
+### Bug Fixes
+
+* Add IsoWeek plugin ([#811](https://github.com/iamkun/dayjs/issues/811)) ([28a2207](https://github.com/iamkun/dayjs/commit/28a2207ef9849afbac15dd29267b2e7a09cd3c16))
+* Fix unsupported locale fallback to previous one ([#819](https://github.com/iamkun/dayjs/issues/819)) ([4868715](https://github.com/iamkun/dayjs/commit/48687152cf5bee6a4c1b8ceea4bda8b9bab9be10))
+
+## [1.8.21](https://github.com/iamkun/dayjs/compare/v1.8.20...v1.8.21) (2020-02-26)
+
+
+### Bug Fixes
+
+* Set + Get accept 'D' as the short version of 'date' ([#795](https://github.com/iamkun/dayjs/issues/795)) ([523c038](https://github.com/iamkun/dayjs/commit/523c03880fa8bbad83214494ad02cd606cdb8b30))
+* Update DayOfYear plugin type ([#799](https://github.com/iamkun/dayjs/issues/799)) ([5809652](https://github.com/iamkun/dayjs/commit/5809652e40245b7759827d9bf317abdcfa75a330))
+* Update fi (Finnish) locale relativeTime ([#797](https://github.com/iamkun/dayjs/issues/797)) ([4a470fb](https://github.com/iamkun/dayjs/commit/4a470fbd6fef9e051727d0f26d53cc050b85935d))
+
+## [1.8.20](https://github.com/iamkun/dayjs/compare/v1.8.19...v1.8.20) (2020-02-04)
+
+
+### Bug Fixes
+
+* Add Bislama Locale (bi) ([#780](https://github.com/iamkun/dayjs/issues/780)) ([9ac6ab4](https://github.com/iamkun/dayjs/commit/9ac6ab481bc883dd4ecc02caab12c8b2fc218a42))
+* Fix weekOfYear plugin to support yearStart locale for better week number result ([#769](https://github.com/iamkun/dayjs/issues/769)) ([f00db36](https://github.com/iamkun/dayjs/commit/f00db36e70bc7beaca1abadeb30a9b1fbb3261ee))
+* Update et (Estonian) locale relativeTime ([#790](https://github.com/iamkun/dayjs/issues/790)) ([d8e0f45](https://github.com/iamkun/dayjs/commit/d8e0f45f6cd2d5e5704b9797929227454c92d1a5))
+* Update LocaleData plugin to support dayjs.localeData().weekdays() API ([287fed6](https://github.com/iamkun/dayjs/commit/287fed6db9eb4fd979b4861aca4dacbd32422533)), closes [#779](https://github.com/iamkun/dayjs/issues/779)
+* Update LocaleData plugin to support dayjs.months dayjs.weekdays API ([144c2ae](https://github.com/iamkun/dayjs/commit/144c2ae6e15fbf89e3acd7c8cb9e237c5f6e1348)), closes [#779](https://github.com/iamkun/dayjs/issues/779)
+* Update pl locale fusional config ([d372475](https://github.com/iamkun/dayjs/commit/d3724758bb27d5b17587b995ba14e7e80dcd1151))
+
+## [1.8.19](https://github.com/iamkun/dayjs/compare/v1.8.18...v1.8.19) (2020-01-06)
+
+
+### Bug Fixes
+
+* Add UpdateLocale plugin to update a locale's properties ([#766](https://github.com/iamkun/dayjs/issues/766)) ([82ce2ba](https://github.com/iamkun/dayjs/commit/82ce2ba8d7e402e40f6d005d400eb5356a0b0633))
+* Fix CustomParseFormat Plugin 'YYYY-MM' use first day of the month ([ba709ec](https://github.com/iamkun/dayjs/commit/ba709eca86a71ae648bc68bf67d9abdc229198d4)), closes [#761](https://github.com/iamkun/dayjs/issues/761)
+* Fix CustomParseFormat Plugin to set correct locale ([66ce23f](https://github.com/iamkun/dayjs/commit/66ce23f2e18c5506e8f1a7ef20d3483a4df80087))
+* Fix WeekOfYear Plugin wrong calender week number bug ([79b86db](https://github.com/iamkun/dayjs/commit/79b86dbbf3cfd3f1e2165b3d479a7061ad1b6925)), closes [#760](https://github.com/iamkun/dayjs/issues/760)
+* Update RelativeTime plugin to support function to make additional processing ([#767](https://github.com/iamkun/dayjs/issues/767)) ([4bd9250](https://github.com/iamkun/dayjs/commit/4bd9250fbe7131e2fddfb5fa1b3350e8c2262ca9))
+* Update ru, uk, cs locale to support relativeTime with plural ([3f080f7](https://github.com/iamkun/dayjs/commit/3f080f7d6bfdc4018cbb7c4d0112ff1ead4ef6b8))
+
+## [1.8.18](https://github.com/iamkun/dayjs/compare/v1.8.17...v1.8.18) (2019-12-18)
+
+
+### Bug Fixes
+
+* Add missing locale type definition ([#716](https://github.com/iamkun/dayjs/issues/716)) ([cde5d0b](https://github.com/iamkun/dayjs/commit/cde5d0b91be7b2f5f3098de4aa0b9a4f0f28ea5c))
+* Fix .locale() handel unsupported locale ([78ec173](https://github.com/iamkun/dayjs/commit/78ec173fcecc1299516ab7b44f4554d431b4b2fd))
+* Update Italian locale (it) ([#727](https://github.com/iamkun/dayjs/issues/727)) ([5b53e98](https://github.com/iamkun/dayjs/commit/5b53e98c0a3ba0eb9573a9c77caeb907439be9e7))
+* Update locale (fa) ([#733](https://github.com/iamkun/dayjs/issues/733)) ([9ad2e47](https://github.com/iamkun/dayjs/commit/9ad2e47e0569b23991bb0d5578f49c792c12df08))
+* Update locale (zh-cn) ([#706](https://github.com/iamkun/dayjs/issues/706)) ([e31e544](https://github.com/iamkun/dayjs/commit/e31e54414fb90e1f54da13a117748ba37f52645d))
+* Update locale (zh-cn) meridiem ([#735](https://github.com/iamkun/dayjs/issues/735)) ([15d1b81](https://github.com/iamkun/dayjs/commit/15d1b813e7faf5a1f9d1ea6fc673fd27ac49d8b1))
+* Update LocaleData plugin to support dayjs().longDateFormat() ([#734](https://github.com/iamkun/dayjs/issues/734)) ([aa0f210](https://github.com/iamkun/dayjs/commit/aa0f210a1e3c4f6aba61c3b96f9eb445b43a33f0)), closes [#680](https://github.com/iamkun/dayjs/issues/680)
+* Update Mongolian (mn) locale relativeTime ([#753](https://github.com/iamkun/dayjs/issues/753)) ([6d51435](https://github.com/iamkun/dayjs/commit/6d51435092c0c94d8e50256d3f0f058cdd15febe))
+* Update Swedish locale (sv) fix ordinal error ([#745](https://github.com/iamkun/dayjs/issues/745)) ([49670d5](https://github.com/iamkun/dayjs/commit/49670d5ae31e4e21636cc5a8bfe35fef0f6d9e4a)), closes [#743](https://github.com/iamkun/dayjs/issues/743)
+
+## [1.8.17](https://github.com/iamkun/dayjs/compare/v1.8.16...v1.8.17) (2019-11-06)
+
+
+### Bug Fixes
+
+* Fix set utcOffset in utc mode ([d148115](https://github.com/iamkun/dayjs/commit/d148115dad8f1a5afc0a64e9b8163dfeba4616b6))
+* Update advancedFormat plugin to support w ww wo week tokens … ([#678](https://github.com/iamkun/dayjs/issues/678)) ([26cfa63](https://github.com/iamkun/dayjs/commit/26cfa63a524b803f7966dac5464f9cbf8f63387e)), closes [#676](https://github.com/iamkun/dayjs/issues/676)
+* Update ka locale weekdays ([f8ca3d4](https://github.com/iamkun/dayjs/commit/f8ca3d4ba1d3cbe41613d3909c0627935a51a0c4))
+* Update nb locale ([#679](https://github.com/iamkun/dayjs/issues/679)) ([1063b0e](https://github.com/iamkun/dayjs/commit/1063b0e1b5c19a1354d233cc0f21438e7073233a))
+* Update Polish locale (pl)([#713](https://github.com/iamkun/dayjs/issues/713)) ([30d2f02](https://github.com/iamkun/dayjs/commit/30d2f026b47188833a4f44fee4bab52467d4a718))
+* Update Ukrainian locale (uk) ([#710](https://github.com/iamkun/dayjs/issues/710)) ([360161c](https://github.com/iamkun/dayjs/commit/360161cac75f597fdd51d9d1ff138601282a1b4b))
+* UTC plugin set utcOffset value ([#668](https://github.com/iamkun/dayjs/issues/668)) ([8877883](https://github.com/iamkun/dayjs/commit/88778838e71dd309e79cd1a8094d5bea36ca3390))
+
+## [1.8.16](https://github.com/iamkun/dayjs/compare/v1.8.15...v1.8.16) (2019-08-27)
+
+
+### Bug Fixes
+
+* Fix relativeTime Plugin .FromNow() result error in UTC mode ([a385d5c](https://github.com/iamkun/dayjs/commit/a385d5c))
+* Handle locale in WeekOfYear plugin ([#658](https://github.com/iamkun/dayjs/issues/658)) ([0e45b0a](https://github.com/iamkun/dayjs/commit/0e45b0a))
+* LocaleData plugin returns all months and weekdays data when pas no argument ([#645](https://github.com/iamkun/dayjs/issues/645)) ([95e70b4](https://github.com/iamkun/dayjs/commit/95e70b4))
+* Return null in toJSON if not valid ([#633](https://github.com/iamkun/dayjs/issues/633)) ([19affc8](https://github.com/iamkun/dayjs/commit/19affc8))
+* Update Danish (da) locale ([#626](https://github.com/iamkun/dayjs/issues/626)) ([ac2ec77](https://github.com/iamkun/dayjs/commit/ac2ec77))
+* Update Korean locale meridiem ([#642](https://github.com/iamkun/dayjs/issues/642)) ([b457146](https://github.com/iamkun/dayjs/commit/b457146))
+* update Occitan locale Catalan locale ([#630](https://github.com/iamkun/dayjs/issues/630)) ([fef135e](https://github.com/iamkun/dayjs/commit/fef135e))
+* update pt-br locale ([#628](https://github.com/iamkun/dayjs/issues/628)) ([ccf596d](https://github.com/iamkun/dayjs/commit/ccf596d))
+* Update weekdaysShort to some locale files ([#643](https://github.com/iamkun/dayjs/issues/643)) ([cc1f15f](https://github.com/iamkun/dayjs/commit/cc1f15f))
+
+## [1.8.15](https://github.com/iamkun/dayjs/compare/v1.8.14...v1.8.15) (2019-07-08)
+
+
+### Bug Fixes
+
+* Fix dayjs.locale() returns current global locale ([#602](https://github.com/iamkun/dayjs/issues/602)) ([790cd1a](https://github.com/iamkun/dayjs/commit/790cd1a))
+* Fix incorrect Thai locale translation of July ([#607](https://github.com/iamkun/dayjs/issues/607)) ([43cbfd3](https://github.com/iamkun/dayjs/commit/43cbfd3))
+* Lowercase french locale months and weekdays ([#615](https://github.com/iamkun/dayjs/issues/615)) ([e5a257c](https://github.com/iamkun/dayjs/commit/e5a257c))
+* Type - Export Ls object to query all available locales ([#623](https://github.com/iamkun/dayjs/issues/623)) ([f6bfae0](https://github.com/iamkun/dayjs/commit/f6bfae0))
+* Update nb (Norsk Bokmål) locale ([#604](https://github.com/iamkun/dayjs/issues/604)) ([907f5c9](https://github.com/iamkun/dayjs/commit/907f5c9))
+* Update types of `.diff` API ([#617](https://github.com/iamkun/dayjs/issues/617)) ([f0f43d2](https://github.com/iamkun/dayjs/commit/f0f43d2))
+
+## [1.8.14](https://github.com/iamkun/dayjs/compare/v1.8.13...v1.8.14) (2019-05-07)
+
+
+### Bug Fixes
+
+* Fix `.format` API returns UTC offset when value is 0 bug ([b254964](https://github.com/iamkun/dayjs/commit/b254964))
+* Fix QuarterOfYear plugin bug ([#591](https://github.com/iamkun/dayjs/issues/591)) ([434f774](https://github.com/iamkun/dayjs/commit/434f774))
+* Fix UTC plugin add day DST bug ([#590](https://github.com/iamkun/dayjs/issues/590)) ([86cd839](https://github.com/iamkun/dayjs/commit/86cd839))
+
+## [1.8.13](https://github.com/iamkun/dayjs/compare/v1.8.12...v1.8.13) (2019-04-26)
+
+
+### Bug Fixes
+
+* Add missing relativeTime and formats for some locales ([#560](https://github.com/iamkun/dayjs/issues/560)) ([96b917e](https://github.com/iamkun/dayjs/commit/96b917e))
+* Add weekday (locale aware day of the week) plugin ([#569](https://github.com/iamkun/dayjs/issues/569)) ([9007cc5](https://github.com/iamkun/dayjs/commit/9007cc5)), closes [#559](https://github.com/iamkun/dayjs/issues/559)
+* Allow customizing "am" / "pm" strings with locale meridiem function ([#580](https://github.com/iamkun/dayjs/issues/580)) ([576e93e](https://github.com/iamkun/dayjs/commit/576e93e)), closes [#578](https://github.com/iamkun/dayjs/issues/578)
+* Fix `.add` day/week decimal rouding bug ([800f6c9](https://github.com/iamkun/dayjs/commit/800f6c9))
+* Fix `.diff` type definition error ([#565](https://github.com/iamkun/dayjs/issues/565)) ([c4921ae](https://github.com/iamkun/dayjs/commit/c4921ae)), closes [#561](https://github.com/iamkun/dayjs/issues/561)
+* Fix CustomParseFormat plugin bug ([#568](https://github.com/iamkun/dayjs/issues/568)) ([1f5a9db](https://github.com/iamkun/dayjs/commit/1f5a9db)), closes [#555](https://github.com/iamkun/dayjs/issues/555)
+* Fix relativeTime plugin Math.round bug ([40bea40](https://github.com/iamkun/dayjs/commit/40bea40))
+* skip square brackets in buddhistEra, advancedFormat plugins ([#556](https://github.com/iamkun/dayjs/issues/556)) ([9279718](https://github.com/iamkun/dayjs/commit/9279718)), closes [#554](https://github.com/iamkun/dayjs/issues/554)
+* Update Indonesian locale([#574](https://github.com/iamkun/dayjs/issues/574)) ([0aa7143](https://github.com/iamkun/dayjs/commit/0aa7143))
+* Update locale month to support both array and function ([#581](https://github.com/iamkun/dayjs/issues/581)) ([b6599d3](https://github.com/iamkun/dayjs/commit/b6599d3))
+* Update LocalizedFormat plugin lowercase formats logic ([#557](https://github.com/iamkun/dayjs/issues/557)) ([d409304](https://github.com/iamkun/dayjs/commit/d409304))
+
+## [1.8.12](https://github.com/iamkun/dayjs/compare/v1.8.11...v1.8.12) (2019-04-02)
+
+
+### Bug Fixes
+
+* Add .get API ([7318797](https://github.com/iamkun/dayjs/commit/7318797))
+* Add 79 locales ([#541](https://github.com/iamkun/dayjs/issues/541)) ([f75a125](https://github.com/iamkun/dayjs/commit/f75a125))
+* Add Calendar plugin ([d1b9cf9](https://github.com/iamkun/dayjs/commit/d1b9cf9))
+* Add isoWeeksInYear plugin ([2db8631](https://github.com/iamkun/dayjs/commit/2db8631))
+* Add Occitan (oc-lnc) locale file ([#551](https://github.com/iamkun/dayjs/issues/551)) ([c30b715](https://github.com/iamkun/dayjs/commit/c30b715))
+* Add plugin minMax to sopport .max .min ([2870a23](https://github.com/iamkun/dayjs/commit/2870a23))
+* Fix set Month Year error in last day of the month ([d058f4a](https://github.com/iamkun/dayjs/commit/d058f4a))
+* Update ko locale weekdaysShort ([#543](https://github.com/iamkun/dayjs/issues/543)) ([317fd3e](https://github.com/iamkun/dayjs/commit/317fd3e))
+* Update localizedFormat plugin to support lowercase localizable formats (l, ll, lll, llll) ([#546](https://github.com/iamkun/dayjs/issues/546)) ([f2b5ebf](https://github.com/iamkun/dayjs/commit/f2b5ebf))
+
+## [1.8.11](https://github.com/iamkun/dayjs/compare/v1.8.10...v1.8.11) (2019-03-21)
+
+
+### Bug Fixes
+
+* Add .add('quarter') .startOf('quarter') through plugin quarterOfYear ([dde39e9](https://github.com/iamkun/dayjs/commit/dde39e9)), closes [#537](https://github.com/iamkun/dayjs/issues/537) [#531](https://github.com/iamkun/dayjs/issues/531)
+* Add locale support for Azerbaijani language (az) ([#535](https://github.com/iamkun/dayjs/issues/535)) ([eeb20fa](https://github.com/iamkun/dayjs/commit/eeb20fa))
+* Correct typescript definition `add` ([22a249c](https://github.com/iamkun/dayjs/commit/22a249c)), closes [#531](https://github.com/iamkun/dayjs/issues/531)
+* Fix CustomParseFormat plugin formatting bug ([#536](https://github.com/iamkun/dayjs/issues/536)) ([8578546](https://github.com/iamkun/dayjs/commit/8578546)), closes [#533](https://github.com/iamkun/dayjs/issues/533)
+* Update pt locale ([#538](https://github.com/iamkun/dayjs/issues/538)) ([1ac9e1e](https://github.com/iamkun/dayjs/commit/1ac9e1e))
+
+## [1.8.10](https://github.com/iamkun/dayjs/compare/v1.8.9...v1.8.10) (2019-03-10)
+
+
+### Bug Fixes
+
+* **locale:** Add nepali (ne) locale ([#524](https://github.com/iamkun/dayjs/issues/524)) ([bdbec01](https://github.com/iamkun/dayjs/commit/bdbec01))
+* Add WeekYear plugin ([a892608](https://github.com/iamkun/dayjs/commit/a892608))
+* API .locale() with no argument should return current locale name string ([8d63d88](https://github.com/iamkun/dayjs/commit/8d63d88))
+* CustomParseFormat correct parse HH:mm:ss with only one digit like 0:12:10 ([600d547](https://github.com/iamkun/dayjs/commit/600d547))
+* CustomParseFormat plugin parse Do format string ([bf27fda](https://github.com/iamkun/dayjs/commit/bf27fda)), closes [#522](https://github.com/iamkun/dayjs/issues/522)
+* Expand setters like .year(2000) .hour(12) ([ac532a0](https://github.com/iamkun/dayjs/commit/ac532a0))
+* Move toObject, toArray API to separate plugin from core ([40a3431](https://github.com/iamkun/dayjs/commit/40a3431))
+
+## [1.8.9](https://github.com/iamkun/dayjs/compare/v1.8.8...v1.8.9) (2019-03-06)
+
+
+### Features
+
+* Add UTC mode with UTC plugin ([#517](https://github.com/iamkun/dayjs/issues/517)) ([caf335c](https://github.com/iamkun/dayjs/commit/caf335c))
+
+> For plugin developers: Please note, we have changed the name of some method in `Utils` in order to reduce the file size. ([#517](https://github.com/iamkun/dayjs/issues/517)) ([detail](https://github.com/iamkun/dayjs/pull/517/files#diff-2b4ca49d4bb0a774c4d4c1672d7aa781R46))
+
+### Bug Fixes
+
+* Add locale de-AT ([#515](https://github.com/iamkun/dayjs/issues/515)) ([d93f7b6](https://github.com/iamkun/dayjs/commit/d93f7b6))
+* Add locale zh-hk ([#516](https://github.com/iamkun/dayjs/issues/516)) ([5fc05a6](https://github.com/iamkun/dayjs/commit/5fc05a6))
+
+## [1.8.8](https://github.com/iamkun/dayjs/compare/v1.8.7...v1.8.8) (2019-02-25)
+
+
+### Bug Fixes
+
+* Update relativeTime plugin type definition ([de56f2c](https://github.com/iamkun/dayjs/commit/de56f2c))
+
+## [1.8.7](https://github.com/iamkun/dayjs/compare/v1.8.6...v1.8.7) (2019-02-24)
+
+
+### Bug Fixes
+
+* Add plugin type definitions ([#418](https://github.com/iamkun/dayjs/issues/418)) ([361d437](https://github.com/iamkun/dayjs/commit/361d437))
+* Add Swahili locale ([#508](https://github.com/iamkun/dayjs/issues/508)) ([b9cee84](https://github.com/iamkun/dayjs/commit/b9cee84))
+* Parse month string 'MMMM MMM (February, Feb)' in customParseFormat ([#457](https://github.com/iamkun/dayjs/issues/457)) ([f343206](https://github.com/iamkun/dayjs/commit/f343206))
+* Update declaration file .diff .isBefore .isSame .isAfter ([#496](https://github.com/iamkun/dayjs/issues/496)) ([4523275](https://github.com/iamkun/dayjs/commit/4523275))
+* Word orders corrections for locale 'fa' ([#491](https://github.com/iamkun/dayjs/issues/491)) ([56050c2](https://github.com/iamkun/dayjs/commit/56050c2))
+
+## [1.8.6](https://github.com/iamkun/dayjs/compare/v1.8.5...v1.8.6) (2019-02-14)
+
+
+### Bug Fixes
+
+* Add Bahasa Melayu (Malaysia) locale ([#485](https://github.com/iamkun/dayjs/issues/485)) ([cb208b0](https://github.com/iamkun/dayjs/commit/cb208b0))
+* Copy & export built-in en locale to /locale folder as a separate file ([a7e05e0](https://github.com/iamkun/dayjs/commit/a7e05e0))
+* Fix bug in customParseFormat plugin while month(MM) is '01' ([9884ca5](https://github.com/iamkun/dayjs/commit/9884ca5)), closes [#494](https://github.com/iamkun/dayjs/issues/494)
+* Fix startOf week bug while week start is not Sunday ([5eaf77b](https://github.com/iamkun/dayjs/commit/5eaf77b))
+* Implemented isBetween inclusivity ([#464](https://github.com/iamkun/dayjs/issues/464)) ([af2f4f1](https://github.com/iamkun/dayjs/commit/af2f4f1))
+* Update Swedish and Finnish locales ([#488](https://github.com/iamkun/dayjs/issues/488)) ([f142082](https://github.com/iamkun/dayjs/commit/f142082))
+* Fix commonJS require ES Module bug in webpack4 ([23f9f3d](https://github.com/iamkun/dayjs/commit/23f9f3d)), check [#492](https://github.com/iamkun/dayjs/issues/492)
+
+> Get access to ESM code with `import dayjs from 'dayjs/esm'`
+
+## [1.8.5](https://github.com/iamkun/dayjs/compare/v1.8.4...v1.8.5) (2019-02-07)
+
+
+### Bug Fixes
+
+* Add en-gb locale ([#478](https://github.com/iamkun/dayjs/issues/478)) ([508c3a7](https://github.com/iamkun/dayjs/commit/508c3a7))
+* **module:** transpile everything except ES6 modules in the 'module' entrypoint ([#477](https://github.com/iamkun/dayjs/issues/477)) ([#480](https://github.com/iamkun/dayjs/issues/480)) ([#482](https://github.com/iamkun/dayjs/issues/482)) ([767017d](https://github.com/iamkun/dayjs/commit/767017d))
+* update customParseFormat plugin support hh:mm ([54947cc](https://github.com/iamkun/dayjs/commit/54947cc)), closes [#484](https://github.com/iamkun/dayjs/issues/484)
+* Update module in package.json ([5c5a7a0](https://github.com/iamkun/dayjs/commit/5c5a7a0))
+
+## [1.8.4](https://github.com/iamkun/dayjs/compare/v1.8.3...v1.8.4) (2019-02-05)
+
+* Allow set start day of week in locale && Allow set week in weekOfYear plugin ([1295591](https://github.com/iamkun/dayjs/commit/1295591))
+### Bug Fixes
+* update all locale files with correct week start ([5b03412](https://github.com/iamkun/dayjs/commit/5b03412))
+* update es es-do locale adding weekStart && update weekStart test ([66e42ec](https://github.com/iamkun/dayjs/commit/66e42ec))
+* Revert default export ([b00da1b](https://github.com/iamkun/dayjs/commit/b00da1b))
+
+## [1.8.3](https://github.com/iamkun/dayjs/compare/v1.8.2...v1.8.3) (2019-02-04)
+
+
+### Bug Fixes
+
+* fix ios safari YYYY-MM-DD HH:mm parse BUG ([e02ae82](https://github.com/iamkun/dayjs/commit/e02ae82)), closes [#254](https://github.com/iamkun/dayjs/issues/254)
+
+## [1.8.2](https://github.com/iamkun/dayjs/compare/v1.8.1...v1.8.2) (2019-02-02)
+
+
+### Bug Fixes
+
+* Add missing czech language locale ([#461](https://github.com/iamkun/dayjs/issues/461)) ([7e04004](https://github.com/iamkun/dayjs/commit/7e04004))
+* Add utcOffset api method and fix calculating diff error in DST ([#453](https://github.com/iamkun/dayjs/issues/453)) ([ce2e30e](https://github.com/iamkun/dayjs/commit/ce2e30e))
+* Fix it locale error ([#458](https://github.com/iamkun/dayjs/issues/458)) ([f6d9a64](https://github.com/iamkun/dayjs/commit/f6d9a64))
+* Add DayOfYear plugin (#454)
+* Fix es locale monthsShort error
+
+## [1.8.1](https://github.com/iamkun/dayjs/compare/v1.8.0...v1.8.1) (2019-02-02)
+
+* Add LocalizedFormat plugin supplying format like LTS, LT, LLLL
+
+* update declaration File with default export (#278)
+> From v1.8.1, in TypeScript Project, just `import from dayjs from 'dayjs'`
+* add ES2015 module support (#451)
+
+### Performance Improvements
+
+* **format:** reuse matches instead of created when replacing ([#441](https://github.com/iamkun/dayjs/issues/441)) ([10b79d8](https://github.com/iamkun/dayjs/commit/10b79d8))
+
+# [1.8.0](https://github.com/iamkun/dayjs/compare/v1.7.8...v1.8.0) (2019-01-14)
+
+
+### Features
+
+* add CustomParseFormat plugin and QuarterOfYear plugin ([#450](https://github.com/iamkun/dayjs/issues/450)) ([8f6f63c](https://github.com/iamkun/dayjs/commit/8f6f63c))
+
+## [1.7.8](https://github.com/iamkun/dayjs/compare/v1.7.7...v1.7.8) (2018-12-13)
+
+
+### Feature
+
+* update isSame isBefore isAfter supports units ([fd65464](https://github.com/iamkun/dayjs/commit/fd65464))
+
+* add greek lithuanian locales
+
+## [1.7.7](https://github.com/iamkun/dayjs/compare/v1.7.6...v1.7.7) (2018-09-26)
+
+
+### Bug Fixes
+
+* **DST:** fix daylight saving time DST bug && add test ([#354](https://github.com/iamkun/dayjs/issues/354)) ([6fca6d5](https://github.com/iamkun/dayjs/commit/6fca6d5))
+
+## [1.7.6](https://github.com/iamkun/dayjs/compare/v1.7.5...v1.7.6) (2018-09-25)
+
+
+### Bug Fixes
+
+* **add dayjs.unix:** add dayjs.unix to parse timestamp in seconds && locale update ([5711c5e](https://github.com/iamkun/dayjs/commit/5711c5e))
+
+## [1.7.5](https://github.com/iamkun/dayjs/compare/v1.7.4...v1.7.5) (2018-08-10)
+
+
+### Bug Fixes
+
+* add isBetween API & update ([b5fc3d1](https://github.com/iamkun/dayjs/commit/b5fc3d1))
+
+## [1.7.4](https://github.com/iamkun/dayjs/compare/v1.7.3...v1.7.4) (2018-07-11)
+
+
+### Bug Fixes
+
+* update set week logic ([60b6325](https://github.com/iamkun/dayjs/commit/60b6325)), closes [#276](https://github.com/iamkun/dayjs/issues/276)
+
+## [1.7.3](https://github.com/iamkun/dayjs/compare/v1.7.2...v1.7.3) (2018-07-10)
+
+
+### Bug Fixes
+
+* **locale-nl:** set correct weekdays and months ([6d089d7](https://github.com/iamkun/dayjs/commit/6d089d7))
+
+## [1.7.2](https://github.com/iamkun/dayjs/compare/v1.7.1...v1.7.2) (2018-07-04)
+
+
+### Bug Fixes
+
+* DEPRECATED isLeapYear, use IsLeapYear plugin instead ([e2e5116](https://github.com/iamkun/dayjs/commit/e2e5116))
+
+## [1.7.1](https://github.com/iamkun/dayjs/compare/v1.7.0...v1.7.1) (2018-07-03)
+
+
+### Bug Fixes
+
+* fix week() error near the end of the year ([fa03689](https://github.com/iamkun/dayjs/commit/fa03689))
+
+# [1.7.0](https://github.com/iamkun/dayjs/compare/v1.6.10...v1.7.0) (2018-07-02)
+
+
+### Features
+
+* Added method `.week()` to retrieve week of the year ([e1c1b1c](https://github.com/iamkun/dayjs/commit/e1c1b1c))
+* Updated Japanese locae
+
+## [1.6.10](https://github.com/iamkun/dayjs/compare/v1.6.9...v1.6.10) (2018-06-25)
+
+
+### Bug Fixes
+
+* Add relative locales to russian language ([c7e9898](https://github.com/iamkun/dayjs/commit/c7e9898)), closes [#256](https://github.com/iamkun/dayjs/issues/256)
+
+## [1.6.9](https://github.com/iamkun/dayjs/compare/v1.6.8...v1.6.9) (2018-06-14)
+
+
+### Bug Fixes
+
+* add isDayjs => boolean API ([6227c8b](https://github.com/iamkun/dayjs/commit/6227c8b))
+
+## [1.6.8](https://github.com/iamkun/dayjs/compare/v1.6.7...v1.6.8) (2018-06-14)
+
+
+### Bug Fixes
+
+* fix Advanced format bug in zh-cn ([0c07874](https://github.com/iamkun/dayjs/commit/0c07874)), closes [#242](https://github.com/iamkun/dayjs/issues/242)
+
+## [1.6.7](https://github.com/iamkun/dayjs/compare/v1.6.6...v1.6.7) (2018-06-11)
+
+
+### Bug Fixes
+
+* fix id locale ([1ebbeb8](https://github.com/iamkun/dayjs/commit/1ebbeb8)), closes [#234](https://github.com/iamkun/dayjs/issues/234)
+
+
+## [1.6.6](https://github.com/iamkun/dayjs/compare/v1.6.5...v1.6.6) (2018-06-06)
+
+
+### Bug Fixes
+
+* format API update and locale file update ([5ca48f0](https://github.com/iamkun/dayjs/commit/5ca48f0)), closes [#228](https://github.com/iamkun/dayjs/issues/228)
+
+
+## [1.6.5](https://github.com/iamkun/dayjs/compare/v1.6.4...v1.6.5) (2018-05-31)
+
+
+### Bug Fixes
+
+* bugfix, utils update and locale file update ([ebcb6d5](https://github.com/iamkun/dayjs/commit/ebcb6d5)), closes [#214](https://github.com/iamkun/dayjs/issues/214)
+
+
+## [1.6.4](https://github.com/iamkun/dayjs/compare/v1.6.3...v1.6.4) (2018-05-25)
+
+
+### Bug Fixes
+
+* add RelativeTime plugin and locale file update ([c1fbbca](https://github.com/iamkun/dayjs/commit/c1fbbca)), closes [#198](https://github.com/iamkun/dayjs/issues/198)
+
+
+## [1.6.3](https://github.com/iamkun/dayjs/compare/v1.6.2...v1.6.3) (2018-05-21)
+
+
+### Bug Fixes
+
+* Changing locales locally is immutable from this release ([2cce729](https://github.com/iamkun/dayjs/commit/2cce729)), closes [#182](https://github.com/iamkun/dayjs/issues/182)
+* instance locale change should be immutable ([84597c9](https://github.com/iamkun/dayjs/commit/84597c9))
+* Add more locales
+* english ordinal fix
+
+
+## [1.6.2](https://github.com/iamkun/dayjs/compare/v1.6.1...v1.6.2) (2018-05-18)
+
+
+### Bug Fixes
+
+* change-log update && test new npm release ([aa49cba](https://github.com/iamkun/dayjs/commit/aa49cba)), closes [#163](https://github.com/iamkun/dayjs/issues/163)
+
+
+## [1.6.1](https://github.com/iamkun/dayjs/compare/v1.6.0...v1.6.1) (2018-05-18)
+
+
+### Bug Fixes
+
+* Add German, Brazilian Portuguese locales
+* add() & parse() bug fix & add locale de, pt-br ([bf1331e](https://github.com/iamkun/dayjs/commit/bf1331e))
+
+
+# [1.6.0](https://github.com/iamkun/dayjs/compare/v1.5.24...v1.6.0) (2018-05-15)
+
+
+### Features
+
+* Locale && Plugin ([2342c55](https://github.com/iamkun/dayjs/commit/2342c55)), closes [#141](https://github.com/iamkun/dayjs/issues/141)
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/LICENSE b/node_modules/@pm2/agent/node_modules/dayjs/LICENSE
new file mode 100644
index 0000000..caf9315
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018-present, iamkun
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/README.md b/node_modules/@pm2/agent/node_modules/dayjs/README.md
new file mode 100644
index 0000000..585e1c1
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/README.md
@@ -0,0 +1,127 @@
+English | [简体中文](./docs/zh-cn/README.zh-CN.md) | [日本語](./docs/ja/README-ja.md) | [Português Brasileiro](./docs/pt-br/README-pt-br.md) | [한국어](./docs/ko/README-ko.md) | [Español (España)](./docs/es-es/README-es-es.md) | [Русский](./docs/ru/README-ru.md)
+
+
+Fast 2kB alternative to Moment.js with the same modern API
+
+
+
+
+
+
+
+
+
+
+
+
+
+> Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. If you use Moment.js, you already know how to use Day.js.
+
+```js
+dayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH:mm:ss');
+```
+
+* 🕒 Familiar Moment.js API & patterns
+* 💪 Immutable
+* 🔥 Chainable
+* 🌐 I18n support
+* 📦 2kb mini library
+* 👫 All browsers supported
+
+---
+
+## Getting Started
+
+### Documentation
+
+You can find for more details, API, and other docs on [day.js.org](https://day.js.org/) website.
+
+### Installation
+
+```console
+npm install dayjs --save
+```
+
+📚[Installation Guide](https://day.js.org/docs/en/installation/installation)
+
+### API
+
+It's easy to use Day.js APIs to parse, validate, manipulate, and display dates and times.
+
+```javascript
+dayjs('2018-08-08') // parse
+
+dayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // display
+
+dayjs().set('month', 3).month() // get & set
+
+dayjs().add(1, 'year') // manipulate
+
+dayjs().isBefore(dayjs()) // query
+```
+
+📚[API Reference](https://day.js.org/docs/en/parse/parse)
+
+### I18n
+
+Day.js has great support for internationalization.
+
+But none of them will be included in your build unless you use it.
+
+```javascript
+import 'dayjs/locale/es' // load on demand
+
+dayjs.locale('es') // use Spanish locale globally
+
+dayjs('2018-05-05').locale('zh-cn').format() // use Chinese Simplified locale in a specific instance
+```
+📚[Internationalization](https://day.js.org/docs/en/i18n/i18n)
+
+### Plugin
+
+A plugin is an independent module that can be added to Day.js to extend functionality or add new features.
+
+```javascript
+import advancedFormat from 'dayjs/plugin/advancedFormat' // load on demand
+
+dayjs.extend(advancedFormat) // use plugin
+
+dayjs().format('Q Do k kk X x') // more available formats
+```
+
+📚[Plugin List](https://day.js.org/docs/en/plugin/plugin)
+
+## Sponsors
+
+Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/dayjs#sponsor)]
+
+
+
+
+
+
+## Contributors
+
+This project exists thanks to all the people who contribute.
+
+Please give us a 💖 star 💖 to support us. Thank you.
+
+And thank you to all our backers! 🙏
+
+
+
+
+
+
+
+## License
+
+Day.js is licensed under a [MIT License](./LICENSE).
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/dayjs.min.js b/node_modules/@pm2/agent/node_modules/dayjs/dayjs.min.js
new file mode 100644
index 0000000..c000edf
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/dayjs.min.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs=e()}(this,function(){"use strict";var t="millisecond",e="second",n="minute",r="hour",i="day",s="week",u="month",a="quarter",o="year",f="date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/,c=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},$={s:d,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+d(r,2,"0")+":"+d(i,2,"0")},m:function t(e,n){if(e.date()
+
+export = dayjs;
+
+declare function dayjs (date?: dayjs.ConfigType): dayjs.Dayjs
+
+declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs
+
+declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs
+
+declare namespace dayjs {
+ export type ConfigType = string | number | Date | Dayjs
+
+ export type OptionType = { locale?: string, format?: string, utc?: boolean } | string | string[]
+
+ type UnitTypeShort = 'd' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms'
+ export type UnitType = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date' | UnitTypeShort;
+
+ export type OpUnitType = UnitType | "week" | 'w';
+ export type QUnitType = UnitType | "quarter" | 'Q';
+
+ class Dayjs {
+ constructor (config?: ConfigType)
+
+ clone(): Dayjs
+
+ isValid(): boolean
+
+ year(): number
+
+ year(value: number): Dayjs
+
+ month(): number
+
+ month(value: number): Dayjs
+
+ date(): number
+
+ date(value: number): Dayjs
+
+ day(): number
+
+ day(value: number): Dayjs
+
+ hour(): number
+
+ hour(value: number): Dayjs
+
+ minute(): number
+
+ minute(value: number): Dayjs
+
+ second(): number
+
+ second(value: number): Dayjs
+
+ millisecond(): number
+
+ millisecond(value: number): Dayjs
+
+ set(unit: UnitType, value: number): Dayjs
+
+ get(unit: UnitType): number
+
+ add(value: number, unit: OpUnitType): Dayjs
+
+ subtract(value: number, unit: OpUnitType): Dayjs
+
+ startOf(unit: OpUnitType): Dayjs
+
+ endOf(unit: OpUnitType): Dayjs
+
+ format(template?: string): string
+
+ diff(date: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number
+
+ valueOf(): number
+
+ unix(): number
+
+ daysInMonth(): number
+
+ toDate(): Date
+
+ toJSON(): string
+
+ toISOString(): string
+
+ toString(): string
+
+ utcOffset(): number
+
+ isBefore(date: ConfigType, unit?: OpUnitType): boolean
+
+ isSame(date: ConfigType, unit?: OpUnitType): boolean
+
+ isAfter(date: ConfigType, unit?: OpUnitType): boolean
+
+ locale(): string
+
+ locale(preset: string | ILocale, object?: Partial): Dayjs
+ }
+
+ export type PluginFunc = (option: T, c: typeof Dayjs, d: typeof dayjs) => void
+
+ export function extend(plugin: PluginFunc, option?: T): Dayjs
+
+ export function locale(preset?: string | ILocale, object?: Partial, isLocal?: boolean): string
+
+ export function isDayjs(d: any): d is Dayjs
+
+ export function unix(t: number): Dayjs
+
+ const Ls : { [key: string] : ILocale }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/index.js
new file mode 100644
index 0000000..52df96c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/index.js
@@ -0,0 +1,425 @@
+import * as C from './constant';
+import U from './utils';
+import en from './locale/en';
+var L = 'en'; // global locale
+
+var Ls = {}; // global loaded locale
+
+Ls[L] = en;
+
+var isDayjs = function isDayjs(d) {
+ return d instanceof Dayjs;
+}; // eslint-disable-line no-use-before-define
+
+
+var parseLocale = function parseLocale(preset, object, isLocal) {
+ var l;
+ if (!preset) return L;
+
+ if (typeof preset === 'string') {
+ if (Ls[preset]) {
+ l = preset;
+ }
+
+ if (object) {
+ Ls[preset] = object;
+ l = preset;
+ }
+ } else {
+ var name = preset.name;
+ Ls[name] = preset;
+ l = name;
+ }
+
+ if (!isLocal && l) L = l;
+ return l || !isLocal && L;
+};
+
+var dayjs = function dayjs(date, c) {
+ if (isDayjs(date)) {
+ return date.clone();
+ } // eslint-disable-next-line no-nested-ternary
+
+
+ var cfg = typeof c === 'object' ? c : {};
+ cfg.date = date;
+ cfg.args = arguments; // eslint-disable-line prefer-rest-params
+
+ return new Dayjs(cfg); // eslint-disable-line no-use-before-define
+};
+
+var wrapper = function wrapper(date, instance) {
+ return dayjs(date, {
+ locale: instance.$L,
+ utc: instance.$u,
+ $offset: instance.$offset // todo: refactor; do not use this.$offset in you code
+
+ });
+};
+
+var Utils = U; // for plugin use
+
+Utils.l = parseLocale;
+Utils.i = isDayjs;
+Utils.w = wrapper;
+
+var parseDate = function parseDate(cfg) {
+ var date = cfg.date,
+ utc = cfg.utc;
+ if (date === null) return new Date(NaN); // null is invalid
+
+ if (Utils.u(date)) return new Date(); // today
+
+ if (date instanceof Date) return new Date(date);
+
+ if (typeof date === 'string' && !/Z$/i.test(date)) {
+ var d = date.match(C.REGEX_PARSE);
+
+ if (d) {
+ var m = d[2] - 1 || 0;
+ var ms = (d[7] || '0').substring(0, 3);
+
+ if (utc) {
+ return new Date(Date.UTC(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms));
+ }
+
+ return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);
+ }
+ }
+
+ return new Date(date); // everything else
+};
+
+var Dayjs = /*#__PURE__*/function () {
+ function Dayjs(cfg) {
+ this.$L = this.$L || parseLocale(cfg.locale, null, true);
+ this.parse(cfg); // for plugin
+ }
+
+ var _proto = Dayjs.prototype;
+
+ _proto.parse = function parse(cfg) {
+ this.$d = parseDate(cfg);
+ this.init();
+ };
+
+ _proto.init = function init() {
+ var $d = this.$d;
+ this.$y = $d.getFullYear();
+ this.$M = $d.getMonth();
+ this.$D = $d.getDate();
+ this.$W = $d.getDay();
+ this.$H = $d.getHours();
+ this.$m = $d.getMinutes();
+ this.$s = $d.getSeconds();
+ this.$ms = $d.getMilliseconds();
+ } // eslint-disable-next-line class-methods-use-this
+ ;
+
+ _proto.$utils = function $utils() {
+ return Utils;
+ };
+
+ _proto.isValid = function isValid() {
+ return !(this.$d.toString() === C.INVALID_DATE_STRING);
+ };
+
+ _proto.isSame = function isSame(that, units) {
+ var other = dayjs(that);
+ return this.startOf(units) <= other && other <= this.endOf(units);
+ };
+
+ _proto.isAfter = function isAfter(that, units) {
+ return dayjs(that) < this.startOf(units);
+ };
+
+ _proto.isBefore = function isBefore(that, units) {
+ return this.endOf(units) < dayjs(that);
+ };
+
+ _proto.$g = function $g(input, get, set) {
+ if (Utils.u(input)) return this[get];
+ return this.set(set, input);
+ };
+
+ _proto.unix = function unix() {
+ return Math.floor(this.valueOf() / 1000);
+ };
+
+ _proto.valueOf = function valueOf() {
+ // timezone(hour) * 60 * 60 * 1000 => ms
+ return this.$d.getTime();
+ };
+
+ _proto.startOf = function startOf(units, _startOf) {
+ var _this = this;
+
+ // startOf -> endOf
+ var isStartOf = !Utils.u(_startOf) ? _startOf : true;
+ var unit = Utils.p(units);
+
+ var instanceFactory = function instanceFactory(d, m) {
+ var ins = Utils.w(_this.$u ? Date.UTC(_this.$y, m, d) : new Date(_this.$y, m, d), _this);
+ return isStartOf ? ins : ins.endOf(C.D);
+ };
+
+ var instanceFactorySet = function instanceFactorySet(method, slice) {
+ var argumentStart = [0, 0, 0, 0];
+ var argumentEnd = [23, 59, 59, 999];
+ return Utils.w(_this.toDate()[method].apply( // eslint-disable-line prefer-spread
+ _this.toDate('s'), (isStartOf ? argumentStart : argumentEnd).slice(slice)), _this);
+ };
+
+ var $W = this.$W,
+ $M = this.$M,
+ $D = this.$D;
+ var utcPad = "set" + (this.$u ? 'UTC' : '');
+
+ switch (unit) {
+ case C.Y:
+ return isStartOf ? instanceFactory(1, 0) : instanceFactory(31, 11);
+
+ case C.M:
+ return isStartOf ? instanceFactory(1, $M) : instanceFactory(0, $M + 1);
+
+ case C.W:
+ {
+ var weekStart = this.$locale().weekStart || 0;
+ var gap = ($W < weekStart ? $W + 7 : $W) - weekStart;
+ return instanceFactory(isStartOf ? $D - gap : $D + (6 - gap), $M);
+ }
+
+ case C.D:
+ case C.DATE:
+ return instanceFactorySet(utcPad + "Hours", 0);
+
+ case C.H:
+ return instanceFactorySet(utcPad + "Minutes", 1);
+
+ case C.MIN:
+ return instanceFactorySet(utcPad + "Seconds", 2);
+
+ case C.S:
+ return instanceFactorySet(utcPad + "Milliseconds", 3);
+
+ default:
+ return this.clone();
+ }
+ };
+
+ _proto.endOf = function endOf(arg) {
+ return this.startOf(arg, false);
+ };
+
+ _proto.$set = function $set(units, _int) {
+ var _C$D$C$DATE$C$M$C$Y$C;
+
+ // private set
+ var unit = Utils.p(units);
+ var utcPad = "set" + (this.$u ? 'UTC' : '');
+ var name = (_C$D$C$DATE$C$M$C$Y$C = {}, _C$D$C$DATE$C$M$C$Y$C[C.D] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[C.DATE] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[C.M] = utcPad + "Month", _C$D$C$DATE$C$M$C$Y$C[C.Y] = utcPad + "FullYear", _C$D$C$DATE$C$M$C$Y$C[C.H] = utcPad + "Hours", _C$D$C$DATE$C$M$C$Y$C[C.MIN] = utcPad + "Minutes", _C$D$C$DATE$C$M$C$Y$C[C.S] = utcPad + "Seconds", _C$D$C$DATE$C$M$C$Y$C[C.MS] = utcPad + "Milliseconds", _C$D$C$DATE$C$M$C$Y$C)[unit];
+ var arg = unit === C.D ? this.$D + (_int - this.$W) : _int;
+
+ if (unit === C.M || unit === C.Y) {
+ // clone is for badMutable plugin
+ var date = this.clone().set(C.DATE, 1);
+ date.$d[name](arg);
+ date.init();
+ this.$d = date.set(C.DATE, Math.min(this.$D, date.daysInMonth())).$d;
+ } else if (name) this.$d[name](arg);
+
+ this.init();
+ return this;
+ };
+
+ _proto.set = function set(string, _int2) {
+ return this.clone().$set(string, _int2);
+ };
+
+ _proto.get = function get(unit) {
+ return this[Utils.p(unit)]();
+ };
+
+ _proto.add = function add(number, units) {
+ var _this2 = this,
+ _C$MIN$C$H$C$S$unit;
+
+ number = Number(number); // eslint-disable-line no-param-reassign
+
+ var unit = Utils.p(units);
+
+ var instanceFactorySet = function instanceFactorySet(n) {
+ var d = dayjs(_this2);
+ return Utils.w(d.date(d.date() + Math.round(n * number)), _this2);
+ };
+
+ if (unit === C.M) {
+ return this.set(C.M, this.$M + number);
+ }
+
+ if (unit === C.Y) {
+ return this.set(C.Y, this.$y + number);
+ }
+
+ if (unit === C.D) {
+ return instanceFactorySet(1);
+ }
+
+ if (unit === C.W) {
+ return instanceFactorySet(7);
+ }
+
+ var step = (_C$MIN$C$H$C$S$unit = {}, _C$MIN$C$H$C$S$unit[C.MIN] = C.MILLISECONDS_A_MINUTE, _C$MIN$C$H$C$S$unit[C.H] = C.MILLISECONDS_A_HOUR, _C$MIN$C$H$C$S$unit[C.S] = C.MILLISECONDS_A_SECOND, _C$MIN$C$H$C$S$unit)[unit] || 1; // ms
+
+ var nextTimeStamp = this.$d.getTime() + number * step;
+ return Utils.w(nextTimeStamp, this);
+ };
+
+ _proto.subtract = function subtract(number, string) {
+ return this.add(number * -1, string);
+ };
+
+ _proto.format = function format(formatStr) {
+ var _this3 = this;
+
+ if (!this.isValid()) return C.INVALID_DATE_STRING;
+ var str = formatStr || C.FORMAT_DEFAULT;
+ var zoneStr = Utils.z(this);
+ var locale = this.$locale();
+ var $H = this.$H,
+ $m = this.$m,
+ $M = this.$M;
+ var weekdays = locale.weekdays,
+ months = locale.months,
+ meridiem = locale.meridiem;
+
+ var getShort = function getShort(arr, index, full, length) {
+ return arr && (arr[index] || arr(_this3, str)) || full[index].substr(0, length);
+ };
+
+ var get$H = function get$H(num) {
+ return Utils.s($H % 12 || 12, num, '0');
+ };
+
+ var meridiemFunc = meridiem || function (hour, minute, isLowercase) {
+ var m = hour < 12 ? 'AM' : 'PM';
+ return isLowercase ? m.toLowerCase() : m;
+ };
+
+ var matches = {
+ YY: String(this.$y).slice(-2),
+ YYYY: this.$y,
+ M: $M + 1,
+ MM: Utils.s($M + 1, 2, '0'),
+ MMM: getShort(locale.monthsShort, $M, months, 3),
+ MMMM: getShort(months, $M),
+ D: this.$D,
+ DD: Utils.s(this.$D, 2, '0'),
+ d: String(this.$W),
+ dd: getShort(locale.weekdaysMin, this.$W, weekdays, 2),
+ ddd: getShort(locale.weekdaysShort, this.$W, weekdays, 3),
+ dddd: weekdays[this.$W],
+ H: String($H),
+ HH: Utils.s($H, 2, '0'),
+ h: get$H(1),
+ hh: get$H(2),
+ a: meridiemFunc($H, $m, true),
+ A: meridiemFunc($H, $m, false),
+ m: String($m),
+ mm: Utils.s($m, 2, '0'),
+ s: String(this.$s),
+ ss: Utils.s(this.$s, 2, '0'),
+ SSS: Utils.s(this.$ms, 3, '0'),
+ Z: zoneStr // 'ZZ' logic below
+
+ };
+ return str.replace(C.REGEX_FORMAT, function (match, $1) {
+ return $1 || matches[match] || zoneStr.replace(':', '');
+ }); // 'ZZ'
+ };
+
+ _proto.utcOffset = function utcOffset() {
+ // Because a bug at FF24, we're rounding the timezone offset around 15 minutes
+ // https://github.com/moment/moment/pull/1871
+ return -Math.round(this.$d.getTimezoneOffset() / 15) * 15;
+ };
+
+ _proto.diff = function diff(input, units, _float) {
+ var _C$Y$C$M$C$Q$C$W$C$D$;
+
+ var unit = Utils.p(units);
+ var that = dayjs(input);
+ var zoneDelta = (that.utcOffset() - this.utcOffset()) * C.MILLISECONDS_A_MINUTE;
+ var diff = this - that;
+ var result = Utils.m(this, that);
+ result = (_C$Y$C$M$C$Q$C$W$C$D$ = {}, _C$Y$C$M$C$Q$C$W$C$D$[C.Y] = result / 12, _C$Y$C$M$C$Q$C$W$C$D$[C.M] = result, _C$Y$C$M$C$Q$C$W$C$D$[C.Q] = result / 3, _C$Y$C$M$C$Q$C$W$C$D$[C.W] = (diff - zoneDelta) / C.MILLISECONDS_A_WEEK, _C$Y$C$M$C$Q$C$W$C$D$[C.D] = (diff - zoneDelta) / C.MILLISECONDS_A_DAY, _C$Y$C$M$C$Q$C$W$C$D$[C.H] = diff / C.MILLISECONDS_A_HOUR, _C$Y$C$M$C$Q$C$W$C$D$[C.MIN] = diff / C.MILLISECONDS_A_MINUTE, _C$Y$C$M$C$Q$C$W$C$D$[C.S] = diff / C.MILLISECONDS_A_SECOND, _C$Y$C$M$C$Q$C$W$C$D$)[unit] || diff; // milliseconds
+
+ return _float ? result : Utils.a(result);
+ };
+
+ _proto.daysInMonth = function daysInMonth() {
+ return this.endOf(C.M).$D;
+ };
+
+ _proto.$locale = function $locale() {
+ // get locale object
+ return Ls[this.$L];
+ };
+
+ _proto.locale = function locale(preset, object) {
+ if (!preset) return this.$L;
+ var that = this.clone();
+ var nextLocaleName = parseLocale(preset, object, true);
+ if (nextLocaleName) that.$L = nextLocaleName;
+ return that;
+ };
+
+ _proto.clone = function clone() {
+ return Utils.w(this.$d, this);
+ };
+
+ _proto.toDate = function toDate() {
+ return new Date(this.valueOf());
+ };
+
+ _proto.toJSON = function toJSON() {
+ return this.isValid() ? this.toISOString() : null;
+ };
+
+ _proto.toISOString = function toISOString() {
+ // ie 8 return
+ // new Dayjs(this.valueOf() + this.$d.getTimezoneOffset() * 60000)
+ // .format('YYYY-MM-DDTHH:mm:ss.SSS[Z]')
+ return this.$d.toISOString();
+ };
+
+ _proto.toString = function toString() {
+ return this.$d.toUTCString();
+ };
+
+ return Dayjs;
+}();
+
+var proto = Dayjs.prototype;
+dayjs.prototype = proto;
+[['$ms', C.MS], ['$s', C.S], ['$m', C.MIN], ['$H', C.H], ['$W', C.D], ['$M', C.M], ['$y', C.Y], ['$D', C.DATE]].forEach(function (g) {
+ proto[g[1]] = function (input) {
+ return this.$g(input, g[0], g[1]);
+ };
+});
+
+dayjs.extend = function (plugin, option) {
+ plugin(option, Dayjs, dayjs);
+ return dayjs;
+};
+
+dayjs.locale = parseLocale;
+dayjs.isDayjs = isDayjs;
+
+dayjs.unix = function (timestamp) {
+ return dayjs(timestamp * 1e3);
+};
+
+dayjs.en = Ls[L];
+dayjs.Ls = Ls;
+export default dayjs;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/af.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/af.js
new file mode 100644
index 0000000..ce0c285
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/af.js
@@ -0,0 +1,39 @@
+// Afrikaans [af]
+import dayjs from '../index';
+var locale = {
+ name: 'af',
+ weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
+ months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
+ monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
+ weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'oor %s',
+ past: '%s gelede',
+ s: "'n paar sekondes",
+ m: "'n minuut",
+ mm: '%d minute',
+ h: "'n uur",
+ hh: '%d ure',
+ d: "'n dag",
+ dd: '%d dae',
+ M: "'n maand",
+ MM: '%d maande',
+ y: "'n jaar",
+ yy: '%d jaar'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/am.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/am.js
new file mode 100644
index 0000000..cf25510
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/am.js
@@ -0,0 +1,40 @@
+// Amharic [am]
+import dayjs from '../index';
+var locale = {
+ name: 'am',
+ weekdays: 'እሑድ_ሰኞ_ማክሰኞ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ'.split('_'),
+ weekdaysShort: 'እሑድ_ሰኞ_ማክሰ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ'.split('_'),
+ weekdaysMin: 'እሑ_ሰኞ_ማክ_ረቡ_ሐሙ_አር_ቅዳ'.split('_'),
+ months: 'ጃንዋሪ_ፌብሯሪ_ማርች_ኤፕሪል_ሜይ_ጁን_ጁላይ_ኦገስት_ሴፕቴምበር_ኦክቶበር_ኖቬምበር_ዲሴምበር'.split('_'),
+ monthsShort: 'ጃንዋ_ፌብሯ_ማርች_ኤፕሪ_ሜይ_ጁን_ጁላይ_ኦገስ_ሴፕቴ_ኦክቶ_ኖቬም_ዲሴም'.split('_'),
+ weekStart: 1,
+ yearStart: 4,
+ relativeTime: {
+ future: 'በ%s',
+ past: '%s በፊት',
+ s: 'ጥቂት ሰከንዶች',
+ m: 'አንድ ደቂቃ',
+ mm: '%d ደቂቃዎች',
+ h: 'አንድ ሰዓት',
+ hh: '%d ሰዓታት',
+ d: 'አንድ ቀን',
+ dd: '%d ቀናት',
+ M: 'አንድ ወር',
+ MM: '%d ወራት',
+ y: 'አንድ ዓመት',
+ yy: '%d ዓመታት'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'MMMM D ፣ YYYY',
+ LLL: 'MMMM D ፣ YYYY HH:mm',
+ LLLL: 'dddd ፣ MMMM D ፣ YYYY HH:mm'
+ },
+ ordinal: function ordinal(n) {
+ return n + "\u129B";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-dz.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-dz.js
new file mode 100644
index 0000000..7adaea4
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-dz.js
@@ -0,0 +1,38 @@
+// Arabic (Algeria) [ar-dz]
+import dayjs from '../index';
+var locale = {
+ name: 'ar-dz',
+ weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
+ monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ weekdaysMin: 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-kw.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-kw.js
new file mode 100644
index 0000000..a4b1a31
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-kw.js
@@ -0,0 +1,38 @@
+// Arabic (Kuwait) [ar-kw]
+import dayjs from '../index';
+var locale = {
+ name: 'ar-kw',
+ weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
+ weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
+ monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
+ weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-ly.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-ly.js
new file mode 100644
index 0000000..7e3611b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-ly.js
@@ -0,0 +1,24 @@
+// Arabic (Lybia) [ar-ly]
+import dayjs from '../index';
+var locale = {
+ name: 'ar-ly',
+ weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ weekStart: 6,
+ weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
+ monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'D/M/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-ma.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-ma.js
new file mode 100644
index 0000000..c91120d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-ma.js
@@ -0,0 +1,39 @@
+// Arabic (Morocco) [ar-ma]
+import dayjs from '../index';
+var locale = {
+ name: 'ar-ma',
+ weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
+ weekStart: 6,
+ weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
+ monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
+ weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-sa.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-sa.js
new file mode 100644
index 0000000..1a98531
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-sa.js
@@ -0,0 +1,38 @@
+// Arabic (Saudi Arabia) [ar-sa]
+import dayjs from '../index';
+var locale = {
+ name: 'ar-sa',
+ weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
+ monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-tn.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-tn.js
new file mode 100644
index 0000000..dcf9450
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar-tn.js
@@ -0,0 +1,39 @@
+// Arabic (Tunisia) [ar-tn]
+import dayjs from '../index';
+var locale = {
+ name: 'ar-tn',
+ weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
+ monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar.js
new file mode 100644
index 0000000..44f8605
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ar.js
@@ -0,0 +1,40 @@
+// Arabic [ar]
+import dayjs from '../index';
+var months = 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_');
+var locale = {
+ name: 'ar',
+ weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
+ weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
+ months: months,
+ monthsShort: months,
+ weekStart: 6,
+ relativeTime: {
+ future: 'بعد %s',
+ past: 'منذ %s',
+ s: 'ثانية واحدة',
+ m: 'دقيقة واحدة',
+ mm: '%d دقائق',
+ h: 'ساعة واحدة',
+ hh: '%d ساعات',
+ d: 'يوم واحد',
+ dd: '%d أيام',
+ M: 'شهر واحد',
+ MM: '%d أشهر',
+ y: 'عام واحد',
+ yy: '%d أعوام'
+ },
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'D/M/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/az.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/az.js
new file mode 100644
index 0000000..3505c8a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/az.js
@@ -0,0 +1,39 @@
+// Azerbaijani [az]
+import dayjs from '../index';
+var locale = {
+ name: 'az',
+ weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
+ weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
+ weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
+ months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
+ monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY г.',
+ LLL: 'D MMMM YYYY г., H:mm',
+ LLLL: 'dddd, D MMMM YYYY г., H:mm'
+ },
+ relativeTime: {
+ future: '%s sonra',
+ past: '%s əvvəl',
+ s: 'bir neçə saniyə',
+ m: 'bir dəqiqə',
+ mm: '%d dəqiqə',
+ h: 'bir saat',
+ hh: '%d saat',
+ d: 'bir gün',
+ dd: '%d gün',
+ M: 'bir ay',
+ MM: '%d ay',
+ y: 'bir il',
+ yy: '%d il'
+ },
+ ordinal: function ordinal(n) {
+ return n;
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/be.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/be.js
new file mode 100644
index 0000000..5642e39
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/be.js
@@ -0,0 +1,24 @@
+// Belarusian [be]
+import dayjs from '../index';
+var locale = {
+ name: 'be',
+ weekdays: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),
+ months: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
+ monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
+ weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY г.',
+ LLL: 'D MMMM YYYY г., HH:mm',
+ LLLL: 'dddd, D MMMM YYYY г., HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bg.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bg.js
new file mode 100644
index 0000000..39bbdc0
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bg.js
@@ -0,0 +1,39 @@
+// Bulgarian [bg]
+import dayjs from '../index';
+var locale = {
+ name: 'bg',
+ weekdays: 'Неделя_Понеделник_Вторник_Сряда_Четвъртък_Петък_Събота'.split('_'),
+ weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
+ weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
+ months: 'Януари_Февруари_Март_Април_Май_Юни_Юли_Август_Септември_Октомври_Ноември_Декември'.split('_'),
+ monthsShort: 'Янр_Фев_Мар_Апр_Май_Юни_Юли_Авг_Сеп_Окт_Ное_Дек'.split('_'),
+ weekStart: 1,
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'D.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY H:mm',
+ LLLL: 'dddd, D MMMM YYYY H:mm'
+ },
+ relativeTime: {
+ future: 'след %s',
+ past: 'преди %s',
+ s: 'няколко секунди',
+ m: 'минута',
+ mm: '%d минути',
+ h: 'час',
+ hh: '%d часа',
+ d: 'ден',
+ dd: '%d дни',
+ M: 'месец',
+ MM: '%d месеца',
+ y: 'година',
+ yy: '%d години'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bi.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bi.js
new file mode 100644
index 0000000..6230f25
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bi.js
@@ -0,0 +1,39 @@
+// Bislama [bi]
+import dayjs from '../index';
+var locale = {
+ name: 'bi',
+ weekdays: 'Sande_Mande_Tusde_Wenesde_Tosde_Fraede_Sarade'.split('_'),
+ months: 'Januari_Februari_Maj_Eprel_Mei_Jun_Julae_Okis_Septemba_Oktoba_Novemba_Disemba'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'San_Man_Tus_Wen_Tos_Frae_Sar'.split('_'),
+ monthsShort: 'Jan_Feb_Maj_Epr_Mai_Jun_Jul_Oki_Sep_Okt_Nov_Dis'.split('_'),
+ weekdaysMin: 'San_Ma_Tu_We_To_Fr_Sar'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'lo %s',
+ past: '%s bifo',
+ s: 'sam seken',
+ m: 'wan minit',
+ mm: '%d minit',
+ h: 'wan haoa',
+ hh: '%d haoa',
+ d: 'wan dei',
+ dd: '%d dei',
+ M: 'wan manis',
+ MM: '%d manis',
+ y: 'wan yia',
+ yy: '%d yia'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bm.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bm.js
new file mode 100644
index 0000000..0d61093
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bm.js
@@ -0,0 +1,39 @@
+// Bambara [bm]
+import dayjs from '../index';
+var locale = {
+ name: 'bm',
+ weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
+ months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
+ monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
+ weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'MMMM [tile] D [san] YYYY',
+ LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
+ LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm'
+ },
+ relativeTime: {
+ future: '%s kɔnɔ',
+ past: 'a bɛ %s bɔ',
+ s: 'sanga dama dama',
+ m: 'miniti kelen',
+ mm: 'miniti %d',
+ h: 'lɛrɛ kelen',
+ hh: 'lɛrɛ %d',
+ d: 'tile kelen',
+ dd: 'tile %d',
+ M: 'kalo kelen',
+ MM: 'kalo %d',
+ y: 'san kelen',
+ yy: 'san %d'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bn.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bn.js
new file mode 100644
index 0000000..b3538f7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bn.js
@@ -0,0 +1,38 @@
+// Bengali [bn]
+import dayjs from '../index';
+var locale = {
+ name: 'bn',
+ weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'),
+ months: 'জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),
+ weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
+ monthsShort: 'জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'),
+ weekdaysMin: 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm সময়',
+ LTS: 'A h:mm:ss সময়',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm সময়',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm সময়'
+ },
+ relativeTime: {
+ future: '%s পরে',
+ past: '%s আগে',
+ s: 'কয়েক সেকেন্ড',
+ m: 'এক মিনিট',
+ mm: '%d মিনিট',
+ h: 'এক ঘন্টা',
+ hh: '%d ঘন্টা',
+ d: 'এক দিন',
+ dd: '%d দিন',
+ M: 'এক মাস',
+ MM: '%d মাস',
+ y: 'এক বছর',
+ yy: '%d বছর'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bo.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bo.js
new file mode 100644
index 0000000..75ab560
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bo.js
@@ -0,0 +1,38 @@
+// Tibetan [bo]
+import dayjs from '../index';
+var locale = {
+ name: 'bo',
+ weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),
+ months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
+ weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
+ monthsShort: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
+ weekdaysMin: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm',
+ LTS: 'A h:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm'
+ },
+ relativeTime: {
+ future: '%s ལ་',
+ past: '%s སྔན་ལ',
+ s: 'ལམ་སང',
+ m: 'སྐར་མ་གཅིག',
+ mm: '%d སྐར་མ',
+ h: 'ཆུ་ཚོད་གཅིག',
+ hh: '%d ཆུ་ཚོད',
+ d: 'ཉིན་གཅིག',
+ dd: '%d ཉིན་',
+ M: 'ཟླ་བ་གཅིག',
+ MM: '%d ཟླ་བ',
+ y: 'ལོ་གཅིག',
+ yy: '%d ལོ'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/br.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/br.js
new file mode 100644
index 0000000..71ac702
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/br.js
@@ -0,0 +1,28 @@
+// Breton [br]
+import dayjs from '../index';
+var locale = {
+ name: 'br',
+ weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),
+ months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
+ monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
+ weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'h[e]mm A',
+ LTS: 'h[e]mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D [a viz] MMMM YYYY',
+ LLL: 'D [a viz] MMMM YYYY h[e]mm A',
+ LLLL: 'dddd, D [a viz] MMMM YYYY h[e]mm A'
+ },
+ meridiem: function meridiem(hour) {
+ return hour < 12 ? 'a.m.' : 'g.m.';
+ } // a-raok merenn | goude merenn
+
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bs.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bs.js
new file mode 100644
index 0000000..328a1fe
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/bs.js
@@ -0,0 +1,24 @@
+// Bosnian [bs]
+import dayjs from '../index';
+var locale = {
+ name: 'bs',
+ weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
+ months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
+ monthsShort: 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
+ weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ca.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ca.js
new file mode 100644
index 0000000..1b42dcd
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ca.js
@@ -0,0 +1,42 @@
+// Catalan [ca]
+import dayjs from '../index';
+var locale = {
+ name: 'ca',
+ weekdays: 'Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte'.split('_'),
+ weekdaysShort: 'Dg._Dl._Dt._Dc._Dj._Dv._Ds.'.split('_'),
+ weekdaysMin: 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),
+ months: 'Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre'.split('_'),
+ monthsShort: 'Gen._Febr._Març_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM [de] YYYY',
+ LLL: 'D MMMM [de] YYYY [a les] H:mm',
+ LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',
+ ll: 'D MMM YYYY',
+ lll: 'D MMM YYYY, H:mm',
+ llll: 'ddd D MMM YYYY, H:mm'
+ },
+ relativeTime: {
+ future: 'd\'aquí %s',
+ past: 'fa %s',
+ s: 'uns segons',
+ m: 'un minut',
+ mm: '%d minuts',
+ h: 'una hora',
+ hh: '%d hores',
+ d: 'un dia',
+ dd: '%d dies',
+ M: 'un mes',
+ MM: '%d mesos',
+ y: 'un any',
+ yy: '%d anys'
+ },
+ ordinal: function ordinal(n) {
+ return n + "\xBA";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/cs.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/cs.js
new file mode 100644
index 0000000..165b662
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/cs.js
@@ -0,0 +1,120 @@
+// Czech [cs]
+import dayjs from '../index';
+
+function plural(n) {
+ return n > 1 && n < 5 && ~~(n / 10) !== 1; // eslint-disable-line
+}
+/* eslint-disable */
+
+
+function translate(number, withoutSuffix, key, isFuture) {
+ var result = number + " ";
+
+ switch (key) {
+ case 's':
+ // a few seconds / in a few seconds / a few seconds ago
+ return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';
+
+ case 'm':
+ // a minute / in a minute / a minute ago
+ return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou';
+
+ case 'mm':
+ // 9 minutes / in 9 minutes / 9 minutes ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'minuty' : 'minut');
+ }
+
+ return result + "minutami";
+
+ case 'h':
+ // an hour / in an hour / an hour ago
+ return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
+
+ case 'hh':
+ // 9 hours / in 9 hours / 9 hours ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'hodiny' : 'hodin');
+ }
+
+ return result + "hodinami";
+
+ case 'd':
+ // a day / in a day / a day ago
+ return withoutSuffix || isFuture ? 'den' : 'dnem';
+
+ case 'dd':
+ // 9 days / in 9 days / 9 days ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'dny' : 'dní');
+ }
+
+ return result + "dny";
+
+ case 'M':
+ // a month / in a month / a month ago
+ return withoutSuffix || isFuture ? 'měsíc' : 'měsícem';
+
+ case 'MM':
+ // 9 months / in 9 months / 9 months ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'měsíce' : 'měsíců');
+ }
+
+ return result + "m\u011Bs\xEDci";
+
+ case 'y':
+ // a year / in a year / a year ago
+ return withoutSuffix || isFuture ? 'rok' : 'rokem';
+
+ case 'yy':
+ // 9 years / in 9 years / 9 years ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'roky' : 'let');
+ }
+
+ return result + "lety";
+ }
+}
+/* eslint-enable */
+
+
+var locale = {
+ name: 'cs',
+ weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
+ weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),
+ weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),
+ months: 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),
+ monthsShort: 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'),
+ weekStart: 1,
+ yearStart: 4,
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd D. MMMM YYYY H:mm',
+ l: 'D. M. YYYY'
+ },
+ relativeTime: {
+ future: 'za %s',
+ past: 'před %s',
+ s: translate,
+ m: translate,
+ mm: translate,
+ h: translate,
+ hh: translate,
+ d: translate,
+ dd: translate,
+ M: translate,
+ MM: translate,
+ y: translate,
+ yy: translate
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/cv.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/cv.js
new file mode 100644
index 0000000..7dc41f7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/cv.js
@@ -0,0 +1,24 @@
+// Chuvash [cv]
+import dayjs from '../index';
+var locale = {
+ name: 'cv',
+ weekdays: 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'),
+ months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
+ monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
+ weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD-MM-YYYY',
+ LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
+ LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
+ LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/cy.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/cy.js
new file mode 100644
index 0000000..63e6c33
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/cy.js
@@ -0,0 +1,39 @@
+// Welsh [cy]
+import dayjs from '../index';
+var locale = {
+ name: 'cy',
+ weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),
+ months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
+ monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
+ weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'mewn %s',
+ past: '%s yn ôl',
+ s: 'ychydig eiliadau',
+ m: 'munud',
+ mm: '%d munud',
+ h: 'awr',
+ hh: '%d awr',
+ d: 'diwrnod',
+ dd: '%d diwrnod',
+ M: 'mis',
+ MM: '%d mis',
+ y: 'blwyddyn',
+ yy: '%d flynedd'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/da.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/da.js
new file mode 100644
index 0000000..38fd134
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/da.js
@@ -0,0 +1,39 @@
+// Danish [da]
+import dayjs from '../index';
+var locale = {
+ name: 'da',
+ weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
+ weekdaysShort: 'søn._man._tirs._ons._tors._fre._lør.'.split('_'),
+ weekdaysMin: 'sø._ma._ti._on._to._fr._lø.'.split('_'),
+ months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),
+ monthsShort: 'jan._feb._mar._apr._maj_juni_juli_aug._sept._okt._nov._dec.'.split('_'),
+ weekStart: 1,
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY HH:mm',
+ LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm'
+ },
+ relativeTime: {
+ future: 'om %s',
+ past: '%s siden',
+ s: 'få sekunder',
+ m: 'et minut',
+ mm: '%d minutter',
+ h: 'en time',
+ hh: '%d timer',
+ d: 'en dag',
+ dd: '%d dage',
+ M: 'en måned',
+ MM: '%d måneder',
+ y: 'et år',
+ yy: '%d år'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/de-at.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/de-at.js
new file mode 100644
index 0000000..d50ef44
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/de-at.js
@@ -0,0 +1,39 @@
+// German (Austria) [de-at]
+import dayjs from '../index';
+var locale = {
+ name: 'de-at',
+ weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
+ weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
+ weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
+ months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
+ monthsShort: 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ weekStart: 1,
+ formats: {
+ LTS: 'HH:mm:ss',
+ LT: 'HH:mm',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY HH:mm',
+ LLLL: 'dddd, D. MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: 'vor %s',
+ s: 'ein paar Sekunden',
+ m: 'einer Minute',
+ mm: '%d Minuten',
+ h: 'einer Stunde',
+ hh: '%d Stunden',
+ d: 'einem Tag',
+ dd: '%d Tagen',
+ M: 'einem Monat',
+ MM: '%d Monaten',
+ y: 'einem Jahr',
+ yy: '%d Jahren'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/de-ch.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/de-ch.js
new file mode 100644
index 0000000..0580b92
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/de-ch.js
@@ -0,0 +1,24 @@
+// German (Switzerland) [de-ch]
+import dayjs from '../index';
+var locale = {
+ name: 'de-ch',
+ weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
+ months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
+ monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
+ weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY HH:mm',
+ LLLL: 'dddd, D. MMMM YYYY HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/de.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/de.js
new file mode 100644
index 0000000..ad57863
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/de.js
@@ -0,0 +1,39 @@
+// German [de]
+import dayjs from '../index';
+var locale = {
+ name: 'de',
+ weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
+ weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
+ weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
+ months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
+ monthsShort: 'Jan_Feb_März_Apr_Mai_Juni_Juli_Aug_Sept_Okt_Nov_Dez'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ weekStart: 1,
+ formats: {
+ LTS: 'HH:mm:ss',
+ LT: 'HH:mm',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY HH:mm',
+ LLLL: 'dddd, D. MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: 'vor %s',
+ s: 'wenigen Sekunden',
+ m: 'einer Minute',
+ mm: '%d Minuten',
+ h: 'einer Stunde',
+ hh: '%d Stunden',
+ d: 'einem Tag',
+ dd: '%d Tagen',
+ M: 'einem Monat',
+ MM: '%d Monaten',
+ y: 'einem Jahr',
+ yy: '%d Jahren'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/dv.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/dv.js
new file mode 100644
index 0000000..8943fdd
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/dv.js
@@ -0,0 +1,39 @@
+// Maldivian [dv]
+import dayjs from '../index';
+var locale = {
+ name: 'dv',
+ weekdays: 'އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު'.split('_'),
+ months: 'ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު'.split('_'),
+ weekStart: 7,
+ weekdaysShort: 'އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު'.split('_'),
+ monthsShort: 'ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު'.split('_'),
+ weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'D/M/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'ތެރޭގައި %s',
+ past: 'ކުރިން %s',
+ s: 'ސިކުންތުކޮޅެއް',
+ m: 'މިނިޓެއް',
+ mm: 'މިނިޓު %d',
+ h: 'ގަޑިއިރެއް',
+ hh: 'ގަޑިއިރު %d',
+ d: 'ދުވަހެއް',
+ dd: 'ދުވަސް %d',
+ M: 'މަހެއް',
+ MM: 'މަސް %d',
+ y: 'އަހަރެއް',
+ yy: 'އަހަރު %d'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/el.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/el.js
new file mode 100644
index 0000000..2aa9917
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/el.js
@@ -0,0 +1,39 @@
+// Greek [el]
+import dayjs from '../index';
+var locale = {
+ name: 'el',
+ weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),
+ weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
+ weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
+ months: 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
+ monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαι_Ιουν_Ιουλ_Αυγ_Σεπτ_Οκτ_Νοε_Δεκ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ weekStart: 1,
+ relativeTime: {
+ future: 'σε %s',
+ past: 'πριν %s',
+ s: 'μερικά δευτερόλεπτα',
+ m: 'ένα λεπτό',
+ mm: '%d λεπτά',
+ h: 'μία ώρα',
+ hh: '%d ώρες',
+ d: 'μία μέρα',
+ dd: '%d μέρες',
+ M: 'ένα μήνα',
+ MM: '%d μήνες',
+ y: 'ένα χρόνο',
+ yy: '%d χρόνια'
+ },
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-SG.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-SG.js
new file mode 100644
index 0000000..6a0ada6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-SG.js
@@ -0,0 +1,39 @@
+// English (Singapore) [en-sg]
+import dayjs from '../index';
+var locale = {
+ name: 'en-SG',
+ weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-au.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-au.js
new file mode 100644
index 0000000..f9dde03
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-au.js
@@ -0,0 +1,39 @@
+// English (Australia) [en-au]
+import dayjs from '../index';
+var locale = {
+ name: 'en-au',
+ weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-ca.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-ca.js
new file mode 100644
index 0000000..8e416c9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-ca.js
@@ -0,0 +1,38 @@
+// English (Canada) [en-ca]
+import dayjs from '../index';
+var locale = {
+ name: 'en-ca',
+ weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'YYYY-MM-DD',
+ LL: 'MMMM D, YYYY',
+ LLL: 'MMMM D, YYYY h:mm A',
+ LLLL: 'dddd, MMMM D, YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-gb.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-gb.js
new file mode 100644
index 0000000..f979b44
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-gb.js
@@ -0,0 +1,42 @@
+// English (United Kingdom) [en-gb]
+import dayjs from '../index';
+var locale = {
+ name: 'en-gb',
+ weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekStart: 1,
+ yearStart: 4,
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ ordinal: function ordinal(n) {
+ var s = ['th', 'st', 'nd', 'rd'];
+ var v = n % 100;
+ return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-ie.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-ie.js
new file mode 100644
index 0000000..8098d2f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-ie.js
@@ -0,0 +1,39 @@
+// English (Ireland) [en-ie]
+import dayjs from '../index';
+var locale = {
+ name: 'en-ie',
+ weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-il.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-il.js
new file mode 100644
index 0000000..56c241a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-il.js
@@ -0,0 +1,38 @@
+// English (Israel) [en-il]
+import dayjs from '../index';
+var locale = {
+ name: 'en-il',
+ weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-in.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-in.js
new file mode 100644
index 0000000..7ccb206
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-in.js
@@ -0,0 +1,42 @@
+// English (India) [en-in]
+import dayjs from '../index';
+var locale = {
+ name: 'en-in',
+ weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekStart: 1,
+ yearStart: 4,
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ ordinal: function ordinal(n) {
+ var s = ['th', 'st', 'nd', 'rd'];
+ var v = n % 100;
+ return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-nz.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-nz.js
new file mode 100644
index 0000000..02c7d25
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-nz.js
@@ -0,0 +1,39 @@
+// English (New Zealand) [en-nz]
+import dayjs from '../index';
+var locale = {
+ name: 'en-nz',
+ weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-tt.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-tt.js
new file mode 100644
index 0000000..ef47eeb
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en-tt.js
@@ -0,0 +1,42 @@
+// English (Trinidad & Tobago) [en-tt]
+import dayjs from '../index';
+var locale = {
+ name: 'en-tt',
+ weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekStart: 1,
+ yearStart: 4,
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ ordinal: function ordinal(n) {
+ var s = ['th', 'st', 'nd', 'rd'];
+ var v = n % 100;
+ return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en.js
new file mode 100644
index 0000000..cc2ca40
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/en.js
@@ -0,0 +1,7 @@
+// English [en]
+// We don't need weekdaysShort, weekdaysMin, monthsShort in en.js locale
+export default {
+ name: 'en',
+ weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_')
+};
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/eo.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/eo.js
new file mode 100644
index 0000000..e62599a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/eo.js
@@ -0,0 +1,39 @@
+// Esperanto [eo]
+import dayjs from '../index';
+var locale = {
+ name: 'eo',
+ weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),
+ months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),
+ monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),
+ weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'D[-a de] MMMM, YYYY',
+ LLL: 'D[-a de] MMMM, YYYY HH:mm',
+ LLLL: 'dddd, [la] D[-a de] MMMM, YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'post %s',
+ past: 'antaŭ %s',
+ s: 'sekundoj',
+ m: 'minuto',
+ mm: '%d minutoj',
+ h: 'horo',
+ hh: '%d horoj',
+ d: 'tago',
+ dd: '%d tagoj',
+ M: 'monato',
+ MM: '%d monatoj',
+ y: 'jaro',
+ yy: '%d jaroj'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es-do.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es-do.js
new file mode 100644
index 0000000..48b41d9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es-do.js
@@ -0,0 +1,39 @@
+// Spanish (Dominican Republic) [es-do]
+import dayjs from '../index';
+var locale = {
+ name: 'es-do',
+ weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
+ weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
+ weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
+ months: 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'),
+ monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
+ weekStart: 1,
+ relativeTime: {
+ future: 'en %s',
+ past: 'hace %s',
+ s: 'unos segundos',
+ m: 'un minuto',
+ mm: '%d minutos',
+ h: 'una hora',
+ hh: '%d horas',
+ d: 'un día',
+ dd: '%d días',
+ M: 'un mes',
+ MM: '%d meses',
+ y: 'un año',
+ yy: '%d años'
+ },
+ ordinal: function ordinal(n) {
+ return n + "\xBA";
+ },
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D [de] MMMM [de] YYYY',
+ LLL: 'D [de] MMMM [de] YYYY h:mm A',
+ LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es-pr.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es-pr.js
new file mode 100644
index 0000000..608883e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es-pr.js
@@ -0,0 +1,39 @@
+// Spanish (Puerto Rico) [es-PR]
+import dayjs from '../index';
+var locale = {
+ name: 'es-pr',
+ monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
+ weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
+ weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
+ weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
+ months: 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'MM/DD/YYYY',
+ LL: 'D [de] MMMM [de] YYYY',
+ LLL: 'D [de] MMMM [de] YYYY h:mm A',
+ LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'en %s',
+ past: 'hace %s',
+ s: 'unos segundos',
+ m: 'un minuto',
+ mm: '%d minutos',
+ h: 'una hora',
+ hh: '%d horas',
+ d: 'un día',
+ dd: '%d días',
+ M: 'un mes',
+ MM: '%d meses',
+ y: 'un año',
+ yy: '%d años'
+ },
+ ordinal: function ordinal(n) {
+ return n + "\xBA";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es-us.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es-us.js
new file mode 100644
index 0000000..3efca85
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es-us.js
@@ -0,0 +1,38 @@
+// Spanish (United States) [es-us]
+import dayjs from '../index';
+var locale = {
+ name: 'es-us',
+ weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
+ weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
+ weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
+ months: 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'),
+ monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
+ relativeTime: {
+ future: 'en %s',
+ past: 'hace %s',
+ s: 'unos segundos',
+ m: 'un minuto',
+ mm: '%d minutos',
+ h: 'una hora',
+ hh: '%d horas',
+ d: 'un día',
+ dd: '%d días',
+ M: 'un mes',
+ MM: '%d meses',
+ y: 'un año',
+ yy: '%d años'
+ },
+ ordinal: function ordinal(n) {
+ return n + "\xBA";
+ },
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'MM/DD/YYYY',
+ LL: 'D [de] MMMM [de] YYYY',
+ LLL: 'D [de] MMMM [de] YYYY h:mm A',
+ LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es.js
new file mode 100644
index 0000000..08f046d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/es.js
@@ -0,0 +1,39 @@
+// Spanish [es]
+import dayjs from '../index';
+var locale = {
+ name: 'es',
+ monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
+ weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
+ weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
+ weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
+ months: 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D [de] MMMM [de] YYYY',
+ LLL: 'D [de] MMMM [de] YYYY H:mm',
+ LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
+ },
+ relativeTime: {
+ future: 'en %s',
+ past: 'hace %s',
+ s: 'unos segundos',
+ m: 'un minuto',
+ mm: '%d minutos',
+ h: 'una hora',
+ hh: '%d horas',
+ d: 'un día',
+ dd: '%d días',
+ M: 'un mes',
+ MM: '%d meses',
+ y: 'un año',
+ yy: '%d años'
+ },
+ ordinal: function ordinal(n) {
+ return n + "\xBA";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/et.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/et.js
new file mode 100644
index 0000000..7f7c5ff
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/et.js
@@ -0,0 +1,65 @@
+// Estonian [et]
+import dayjs from '../index';
+
+function relativeTimeWithTense(number, withoutSuffix, key, isFuture) {
+ var format = {
+ s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
+ m: ['ühe minuti', 'üks minut'],
+ mm: ['%d minuti', '%d minutit'],
+ h: ['ühe tunni', 'tund aega', 'üks tund'],
+ hh: ['%d tunni', '%d tundi'],
+ d: ['ühe päeva', 'üks päev'],
+ M: ['kuu aja', 'kuu aega', 'üks kuu'],
+ MM: ['%d kuu', '%d kuud'],
+ y: ['ühe aasta', 'aasta', 'üks aasta'],
+ yy: ['%d aasta', '%d aastat']
+ };
+
+ if (withoutSuffix) {
+ return (format[key][2] ? format[key][2] : format[key][1]).replace('%d', number);
+ }
+
+ return (isFuture ? format[key][0] : format[key][1]).replace('%d', number);
+}
+
+var locale = {
+ name: 'et',
+ // Estonian
+ weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),
+ // Note weekdays are not capitalized in Estonian
+ weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),
+ // There is no short form of weekdays in Estonian except this 1 letter format so it is used for both 'weekdaysShort' and 'weekdaysMin'
+ weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),
+ months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),
+ // Note month names are not capitalized in Estonian
+ monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ weekStart: 1,
+ relativeTime: {
+ future: '%s pärast',
+ past: '%s tagasi',
+ s: relativeTimeWithTense,
+ m: relativeTimeWithTense,
+ mm: relativeTimeWithTense,
+ h: relativeTimeWithTense,
+ hh: relativeTimeWithTense,
+ d: relativeTimeWithTense,
+ dd: '%d päeva',
+ M: relativeTimeWithTense,
+ MM: relativeTimeWithTense,
+ y: relativeTimeWithTense,
+ yy: relativeTimeWithTense
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/eu.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/eu.js
new file mode 100644
index 0000000..5cb73d0
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/eu.js
@@ -0,0 +1,43 @@
+// Basque [eu]
+import dayjs from '../index';
+var locale = {
+ name: 'eu',
+ weekdays: 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),
+ months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'),
+ monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),
+ weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'YYYY[ko] MMMM[ren] D[a]',
+ LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm',
+ LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
+ l: 'YYYY-M-D',
+ ll: 'YYYY[ko] MMM D[a]',
+ lll: 'YYYY[ko] MMM D[a] HH:mm',
+ llll: 'ddd, YYYY[ko] MMM D[a] HH:mm'
+ },
+ relativeTime: {
+ future: '%s barru',
+ past: 'duela %s',
+ s: 'segundo batzuk',
+ m: 'minutu bat',
+ mm: '%d minutu',
+ h: 'ordu bat',
+ hh: '%d ordu',
+ d: 'egun bat',
+ dd: '%d egun',
+ M: 'hilabete bat',
+ MM: '%d hilabete',
+ y: 'urte bat',
+ yy: '%d urte'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fa.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fa.js
new file mode 100644
index 0000000..089459e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fa.js
@@ -0,0 +1,39 @@
+// Persian [fa]
+import dayjs from '../index';
+var locale = {
+ name: 'fa',
+ weekdays: 'یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه'.split('_'),
+ weekdaysShort: "\u06CC\u06A9\u200C\u0634\u0646\u0628\u0647_\u062F\u0648\u0634\u0646\u0628\u0647_\u0633\u0647\u200C\u0634\u0646\u0628\u0647_\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647_\u067E\u0646\u062C\u200C\u0634\u0646\u0628\u0647_\u062C\u0645\u0639\u0647_\u0634\u0646\u0628\u0647".split('_'),
+ weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),
+ weekStart: 6,
+ months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
+ monthsShort: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'در %s',
+ past: '%s پیش',
+ s: 'چند ثانیه',
+ m: 'یک دقیقه',
+ mm: '%d دقیقه',
+ h: 'یک ساعت',
+ hh: '%d ساعت',
+ d: 'یک روز',
+ dd: '%d روز',
+ M: 'یک ماه',
+ MM: '%d ماه',
+ y: 'یک سال',
+ yy: '%d سال'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fi.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fi.js
new file mode 100644
index 0000000..975e1fa
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fi.js
@@ -0,0 +1,87 @@
+// Finnish [fi]
+import dayjs from '../index';
+
+function relativeTimeFormatter(number, withoutSuffix, key, isFuture) {
+ var past = {
+ s: 'muutama sekunti',
+ m: 'minuutti',
+ mm: '%d minuuttia',
+ h: 'tunti',
+ hh: '%d tuntia',
+ d: 'päivä',
+ dd: '%d päivää',
+ M: 'kuukausi',
+ MM: '%d kuukautta',
+ y: 'vuosi',
+ yy: '%d vuotta',
+ numbers: 'nolla_yksi_kaksi_kolme_neljä_viisi_kuusi_seitsemän_kahdeksan_yhdeksän'.split('_')
+ };
+ var future = {
+ s: 'muutaman sekunnin',
+ m: 'minuutin',
+ mm: '%d minuutin',
+ h: 'tunnin',
+ hh: '%d tunnin',
+ d: 'päivän',
+ dd: '%d päivän',
+ M: 'kuukauden',
+ MM: '%d kuukauden',
+ y: 'vuoden',
+ yy: '%d vuoden',
+ numbers: 'nollan_yhden_kahden_kolmen_neljän_viiden_kuuden_seitsemän_kahdeksan_yhdeksän'.split('_')
+ };
+ var words = isFuture && !withoutSuffix ? future : past;
+ var result = words[key];
+
+ if (number < 10) {
+ return result.replace('%d', words.numbers[number]);
+ }
+
+ return result.replace('%d', number);
+}
+
+var locale = {
+ name: 'fi',
+ // Finnish
+ weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
+ // Note weekdays are not capitalized in Finnish
+ weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),
+ // There is no short form of weekdays in Finnish except this 2 letter format so it is used for both 'weekdaysShort' and 'weekdaysMin'
+ weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),
+ months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
+ // Note month names are not capitalized in Finnish
+ monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ weekStart: 1,
+ relativeTime: {
+ future: '%s päästä',
+ past: '%s sitten',
+ s: relativeTimeFormatter,
+ m: relativeTimeFormatter,
+ mm: relativeTimeFormatter,
+ h: relativeTimeFormatter,
+ hh: relativeTimeFormatter,
+ d: relativeTimeFormatter,
+ dd: relativeTimeFormatter,
+ M: relativeTimeFormatter,
+ MM: relativeTimeFormatter,
+ y: relativeTimeFormatter,
+ yy: relativeTimeFormatter
+ },
+ formats: {
+ LT: 'HH.mm',
+ LTS: 'HH.mm.ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM[ta] YYYY',
+ LLL: 'D. MMMM[ta] YYYY, [klo] HH.mm',
+ LLLL: 'dddd, D. MMMM[ta] YYYY, [klo] HH.mm',
+ l: 'D.M.YYYY',
+ ll: 'D. MMM YYYY',
+ lll: 'D. MMM YYYY, [klo] HH.mm',
+ llll: 'ddd, D. MMM YYYY, [klo] HH.mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fo.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fo.js
new file mode 100644
index 0000000..07c3761
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fo.js
@@ -0,0 +1,39 @@
+// Faroese [fo]
+import dayjs from '../index';
+var locale = {
+ name: 'fo',
+ weekdays: 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),
+ months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
+ monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
+ weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D. MMMM, YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'um %s',
+ past: '%s síðani',
+ s: 'fá sekund',
+ m: 'ein minuttur',
+ mm: '%d minuttir',
+ h: 'ein tími',
+ hh: '%d tímar',
+ d: 'ein dagur',
+ dd: '%d dagar',
+ M: 'ein mánaður',
+ MM: '%d mánaðir',
+ y: 'eitt ár',
+ yy: '%d ár'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fr-ca.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fr-ca.js
new file mode 100644
index 0000000..688d695
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fr-ca.js
@@ -0,0 +1,38 @@
+// French (Canada) [fr-ca]
+import dayjs from '../index';
+var locale = {
+ name: 'fr-ca',
+ weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
+ months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
+ weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
+ monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
+ weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'dans %s',
+ past: 'il y a %s',
+ s: 'quelques secondes',
+ m: 'une minute',
+ mm: '%d minutes',
+ h: 'une heure',
+ hh: '%d heures',
+ d: 'un jour',
+ dd: '%d jours',
+ M: 'un mois',
+ MM: '%d mois',
+ y: 'un an',
+ yy: '%d ans'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fr-ch.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fr-ch.js
new file mode 100644
index 0000000..593dba8
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fr-ch.js
@@ -0,0 +1,39 @@
+// French (Switzerland) [fr-ch]
+import dayjs from '../index';
+var locale = {
+ name: 'fr-ch',
+ weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
+ months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
+ monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
+ weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'dans %s',
+ past: 'il y a %s',
+ s: 'quelques secondes',
+ m: 'une minute',
+ mm: '%d minutes',
+ h: 'une heure',
+ hh: '%d heures',
+ d: 'un jour',
+ dd: '%d jours',
+ M: 'un mois',
+ MM: '%d mois',
+ y: 'un an',
+ yy: '%d ans'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fr.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fr.js
new file mode 100644
index 0000000..b31c11d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fr.js
@@ -0,0 +1,41 @@
+// French [fr]
+import dayjs from '../index';
+var locale = {
+ name: 'fr',
+ weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
+ weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
+ weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
+ months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
+ monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
+ weekStart: 1,
+ yearStart: 4,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'dans %s',
+ past: 'il y a %s',
+ s: 'quelques secondes',
+ m: 'une minute',
+ mm: '%d minutes',
+ h: 'une heure',
+ hh: '%d heures',
+ d: 'un jour',
+ dd: '%d jours',
+ M: 'un mois',
+ MM: '%d mois',
+ y: 'un an',
+ yy: '%d ans'
+ },
+ ordinal: function ordinal(n) {
+ var o = n === 1 ? 'er' : '';
+ return "" + n + o;
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fy.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fy.js
new file mode 100644
index 0000000..4b9f9de
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/fy.js
@@ -0,0 +1,39 @@
+// Frisian [fy]
+import dayjs from '../index';
+var locale = {
+ name: 'fy',
+ weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),
+ months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),
+ monthsShort: 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),
+ weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD-MM-YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'oer %s',
+ past: '%s lyn',
+ s: 'in pear sekonden',
+ m: 'ien minút',
+ mm: '%d minuten',
+ h: 'ien oere',
+ hh: '%d oeren',
+ d: 'ien dei',
+ dd: '%d dagen',
+ M: 'ien moanne',
+ MM: '%d moannen',
+ y: 'ien jier',
+ yy: '%d jierren'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ga.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ga.js
new file mode 100644
index 0000000..8cdfa9f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ga.js
@@ -0,0 +1,39 @@
+// Irish or Irish Gaelic [ga]
+import dayjs from '../index';
+var locale = {
+ name: 'ga',
+ weekdays: 'Dé Domhnaigh_Dé Luain_Dé Máirt_Dé Céadaoin_Déardaoin_Dé hAoine_Dé Satharn'.split('_'),
+ months: 'Eanáir_Feabhra_Márta_Aibreán_Bealtaine_Méitheamh_Iúil_Lúnasa_Meán Fómhair_Deaireadh Fómhair_Samhain_Nollaig'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Dom_Lua_Mái_Céa_Déa_hAo_Sat'.split('_'),
+ monthsShort: 'Eaná_Feab_Márt_Aibr_Beal_Méit_Iúil_Lúna_Meán_Deai_Samh_Noll'.split('_'),
+ weekdaysMin: 'Do_Lu_Má_Ce_Dé_hA_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'i %s',
+ past: '%s ó shin',
+ s: 'cúpla soicind',
+ m: 'nóiméad',
+ mm: '%d nóiméad',
+ h: 'uair an chloig',
+ hh: '%d uair an chloig',
+ d: 'lá',
+ dd: '%d lá',
+ M: 'mí',
+ MM: '%d mí',
+ y: 'bliain',
+ yy: '%d bliain'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gd.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gd.js
new file mode 100644
index 0000000..fcf62cd
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gd.js
@@ -0,0 +1,39 @@
+// Scottish Gaelic [gd]
+import dayjs from '../index';
+var locale = {
+ name: 'gd',
+ weekdays: 'Didòmhnaich_Diluain_Dimàirt_Diciadain_Diardaoin_Dihaoine_Disathairne'.split('_'),
+ months: 'Am Faoilleach_An Gearran_Am Màrt_An Giblean_An Cèitean_An t-Ògmhios_An t-Iuchar_An Lùnastal_An t-Sultain_An Dàmhair_An t-Samhain_An Dùbhlachd'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Did_Dil_Dim_Dic_Dia_Dih_Dis'.split('_'),
+ monthsShort: 'Faoi_Gear_Màrt_Gibl_Cèit_Ògmh_Iuch_Lùn_Sult_Dàmh_Samh_Dùbh'.split('_'),
+ weekdaysMin: 'Dò_Lu_Mà_Ci_Ar_Ha_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'ann an %s',
+ past: 'bho chionn %s',
+ s: 'beagan diogan',
+ m: 'mionaid',
+ mm: '%d mionaidean',
+ h: 'uair',
+ hh: '%d uairean',
+ d: 'latha',
+ dd: '%d latha',
+ M: 'mìos',
+ MM: '%d mìosan',
+ y: 'bliadhna',
+ yy: '%d bliadhna'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gl.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gl.js
new file mode 100644
index 0000000..1969819
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gl.js
@@ -0,0 +1,24 @@
+// Galician [gl]
+import dayjs from '../index';
+var locale = {
+ name: 'gl',
+ weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
+ months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
+ monthsShort: 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'),
+ weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D [de] MMMM [de] YYYY',
+ LLL: 'D [de] MMMM [de] YYYY H:mm',
+ LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gom-latn.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gom-latn.js
new file mode 100644
index 0000000..d621f5b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gom-latn.js
@@ -0,0 +1,25 @@
+// Konkani Latin script [gom-latn]
+import dayjs from '../index';
+var locale = {
+ name: 'gom-latn',
+ weekdays: "Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split('_'),
+ months: 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
+ monthsShort: 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'),
+ weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm [vazta]',
+ LTS: 'A h:mm:ss [vazta]',
+ L: 'DD-MM-YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY A h:mm [vazta]',
+ LLLL: 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]',
+ llll: 'ddd, D MMM YYYY, A h:mm [vazta]'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gu.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gu.js
new file mode 100644
index 0000000..e05f44b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/gu.js
@@ -0,0 +1,38 @@
+// Gujarati [gu]
+import dayjs from '../index';
+var locale = {
+ name: 'gu',
+ weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split('_'),
+ months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split('_'),
+ weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
+ monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split('_'),
+ weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm વાગ્યે',
+ LTS: 'A h:mm:ss વાગ્યે',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે'
+ },
+ relativeTime: {
+ future: '%s મા',
+ past: '%s પેહલા',
+ s: 'અમુક પળો',
+ m: 'એક મિનિટ',
+ mm: '%d મિનિટ',
+ h: 'એક કલાક',
+ hh: '%d કલાક',
+ d: 'એક દિવસ',
+ dd: '%d દિવસ',
+ M: 'એક મહિનો',
+ MM: '%d મહિનો',
+ y: 'એક વર્ષ',
+ yy: '%d વર્ષ'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/he.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/he.js
new file mode 100644
index 0000000..54fa150
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/he.js
@@ -0,0 +1,54 @@
+// Hebrew [he]
+import dayjs from '../index';
+var locale = {
+ name: 'he',
+ weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
+ weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
+ weekdaysMin: 'א׳_ב׳_ג׳_ד׳_ה׳_ו_ש׳'.split('_'),
+ months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
+ monthsShort: 'ינו_פבר_מרץ_אפר_מאי_יונ_יול_אוג_ספט_אוק_נוב_דצמ'.split('_'),
+ relativeTime: {
+ future: 'בעוד %s',
+ past: 'לפני %s',
+ s: 'כמה שניות',
+ m: 'דקה',
+ mm: '%d דקות',
+ h: 'שעה',
+ hh: '%d שעות',
+ d: 'יום',
+ dd: '%d ימים',
+ M: 'חודש',
+ MM: '%d חודשים',
+ y: 'שנה',
+ yy: '%d שנים'
+ },
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ format: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D [ב]MMMM YYYY',
+ LLL: 'D [ב]MMMM YYYY HH:mm',
+ LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
+ l: 'D/M/YYYY',
+ ll: 'D MMM YYYY',
+ lll: 'D MMM YYYY HH:mm',
+ llll: 'ddd, D MMM YYYY HH:mm'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D [ב]MMMM YYYY',
+ LLL: 'D [ב]MMMM YYYY HH:mm',
+ LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
+ l: 'D/M/YYYY',
+ ll: 'D MMM YYYY',
+ lll: 'D MMM YYYY HH:mm',
+ llll: 'ddd, D MMM YYYY HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hi.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hi.js
new file mode 100644
index 0000000..e877ed6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hi.js
@@ -0,0 +1,38 @@
+// Hindi [hi]
+import dayjs from '../index';
+var locale = {
+ name: 'hi',
+ weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
+ months: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
+ weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
+ monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
+ weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm बजे',
+ LTS: 'A h:mm:ss बजे',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm बजे',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm बजे'
+ },
+ relativeTime: {
+ future: '%s में',
+ past: '%s पहले',
+ s: 'कुछ ही क्षण',
+ m: 'एक मिनट',
+ mm: '%d मिनट',
+ h: 'एक घंटा',
+ hh: '%d घंटे',
+ d: 'एक दिन',
+ dd: '%d दिन',
+ M: 'एक महीने',
+ MM: '%d महीने',
+ y: 'एक वर्ष',
+ yy: '%d वर्ष'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hr.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hr.js
new file mode 100644
index 0000000..a760fe3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hr.js
@@ -0,0 +1,53 @@
+// Croatian [hr]
+import dayjs from '../index';
+var monthFormat = 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_');
+var monthStandalone = 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_');
+var MONTHS_IN_FORMAT = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;
+
+var months = function months(dayjsInstance, format) {
+ if (MONTHS_IN_FORMAT.test(format)) {
+ return monthFormat[dayjsInstance.month()];
+ }
+
+ return monthStandalone[dayjsInstance.month()];
+};
+
+months.s = monthStandalone;
+months.f = monthFormat;
+var locale = {
+ name: 'hr',
+ weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
+ weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
+ weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
+ months: months,
+ monthsShort: 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ },
+ relativeTime: {
+ future: 'za %s',
+ past: 'prije %s',
+ s: 'sekunda',
+ m: 'minuta',
+ mm: '%d minuta',
+ h: 'sat',
+ hh: '%d sati',
+ d: 'dan',
+ dd: '%d dana',
+ M: 'mjesec',
+ MM: '%d mjeseci',
+ y: 'godina',
+ yy: '%d godine'
+ },
+ ordinal: function ordinal(n) {
+ return n + ".";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ht.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ht.js
new file mode 100644
index 0000000..896739e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ht.js
@@ -0,0 +1,38 @@
+// Haitian Creole (Haiti) [ht]
+import dayjs from '../index';
+var locale = {
+ name: 'ht',
+ weekdays: 'dimanch_lendi_madi_mèkredi_jedi_vandredi_samdi'.split('_'),
+ months: 'janvye_fevriye_mas_avril_me_jen_jiyè_out_septanm_oktòb_novanm_desanm'.split('_'),
+ weekdaysShort: 'dim._len._mad._mèk._jed._van._sam.'.split('_'),
+ monthsShort: 'jan._fev._mas_avr._me_jen_jiyè._out_sept._okt._nov._des.'.split('_'),
+ weekdaysMin: 'di_le_ma_mè_je_va_sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'nan %s',
+ past: 'sa gen %s',
+ s: 'kèk segond',
+ m: 'yon minit',
+ mm: '%d minit',
+ h: 'inèdtan',
+ hh: '%d zè',
+ d: 'yon jou',
+ dd: '%d jou',
+ M: 'yon mwa',
+ MM: '%d mwa',
+ y: 'yon ane',
+ yy: '%d ane'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hu.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hu.js
new file mode 100644
index 0000000..3d4795c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hu.js
@@ -0,0 +1,39 @@
+// Hungarian [hu]
+import dayjs from '../index';
+var locale = {
+ name: 'hu',
+ weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
+ weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
+ weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),
+ months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
+ monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ weekStart: 1,
+ relativeTime: {
+ future: '%s múlva',
+ past: '%s',
+ s: 'néhány másodperc',
+ m: 'egy perc',
+ mm: '%d perc',
+ h: 'egy óra',
+ hh: '%d óra',
+ d: 'egy nap',
+ dd: '%d nap',
+ M: 'egy hónap',
+ MM: '%d hónap',
+ y: 'egy éve',
+ yy: '%d év'
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'YYYY.MM.DD.',
+ LL: 'YYYY. MMMM D.',
+ LLL: 'YYYY. MMMM D. H:mm',
+ LLLL: 'YYYY. MMMM D., dddd H:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hy-am.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hy-am.js
new file mode 100644
index 0000000..937f2be
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/hy-am.js
@@ -0,0 +1,39 @@
+// Armenian [hy-am]
+import dayjs from '../index';
+var locale = {
+ name: 'hy-am',
+ weekdays: 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'),
+ months: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
+ monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
+ weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY թ.',
+ LLL: 'D MMMM YYYY թ., HH:mm',
+ LLLL: 'dddd, D MMMM YYYY թ., HH:mm'
+ },
+ relativeTime: {
+ future: '%s հետո',
+ past: '%s առաջ',
+ s: 'մի քանի վայրկյան',
+ m: 'րոպե',
+ mm: '%d րոպե',
+ h: 'ժամ',
+ hh: '%d ժամ',
+ d: 'օր',
+ dd: '%d օր',
+ M: 'ամիս',
+ MM: '%d ամիս',
+ y: 'տարի',
+ yy: '%d տարի'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/id.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/id.js
new file mode 100644
index 0000000..f743a12
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/id.js
@@ -0,0 +1,39 @@
+// Indonesian [id]
+import dayjs from '../index';
+var locale = {
+ name: 'id',
+ weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
+ months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
+ weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),
+ weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'HH.mm',
+ LTS: 'HH.mm.ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY [pukul] HH.mm',
+ LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
+ },
+ relativeTime: {
+ future: 'dalam %s',
+ past: '%s yang lalu',
+ s: 'beberapa detik',
+ m: 'semenit',
+ mm: '%d menit',
+ h: 'sejam',
+ hh: '%d jam',
+ d: 'sehari',
+ dd: '%d hari',
+ M: 'sebulan',
+ MM: '%d bulan',
+ y: 'setahun',
+ yy: '%d tahun'
+ },
+ ordinal: function ordinal(n) {
+ return n + ".";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/index.d.ts
new file mode 100644
index 0000000..beb0d36
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/index.d.ts
@@ -0,0 +1,11 @@
+///
+
+declare module 'dayjs/esm/locale/*' {
+ namespace locale {
+ interface Locale extends ILocale {}
+ }
+
+ const locale: locale.Locale
+
+ export = locale
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/is.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/is.js
new file mode 100644
index 0000000..f03eda5
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/is.js
@@ -0,0 +1,24 @@
+// Icelandic [is]
+import dayjs from '../index';
+var locale = {
+ name: 'is',
+ weekdays: 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),
+ months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
+ monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
+ weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY [kl.] H:mm',
+ LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/it-ch.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/it-ch.js
new file mode 100644
index 0000000..9055d6d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/it-ch.js
@@ -0,0 +1,24 @@
+// Italian (Switzerland) [it-ch]
+import dayjs from '../index';
+var locale = {
+ name: 'it-ch',
+ weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
+ months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
+ monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
+ weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/it.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/it.js
new file mode 100644
index 0000000..e8d2490
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/it.js
@@ -0,0 +1,39 @@
+// Italian [it]
+import dayjs from '../index';
+var locale = {
+ name: 'it',
+ weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
+ weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
+ weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
+ months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
+ weekStart: 1,
+ monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'tra %s',
+ past: '%s fa',
+ s: 'qualche secondo',
+ m: 'un minuto',
+ mm: '%d minuti',
+ h: 'un\' ora',
+ hh: '%d ore',
+ d: 'un giorno',
+ dd: '%d giorni',
+ M: 'un mese',
+ MM: '%d mesi',
+ y: 'un anno',
+ yy: '%d anni'
+ },
+ ordinal: function ordinal(n) {
+ return n + "\xBA";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ja.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ja.js
new file mode 100644
index 0000000..6568e13
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ja.js
@@ -0,0 +1,45 @@
+// Japanese [ja]
+import dayjs from '../index';
+var locale = {
+ name: 'ja',
+ weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
+ weekdaysShort: '日_月_火_水_木_金_土'.split('_'),
+ weekdaysMin: '日_月_火_水_木_金_土'.split('_'),
+ months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
+ monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + "\u65E5";
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY/MM/DD',
+ LL: 'YYYY年M月D日',
+ LLL: 'YYYY年M月D日 HH:mm',
+ LLLL: 'YYYY年M月D日 dddd HH:mm',
+ l: 'YYYY/MM/DD',
+ ll: 'YYYY年M月D日',
+ lll: 'YYYY年M月D日 HH:mm',
+ llll: 'YYYY年M月D日(ddd) HH:mm'
+ },
+ meridiem: function meridiem(hour) {
+ return hour < 12 ? '午前' : '午後';
+ },
+ relativeTime: {
+ future: '%s後',
+ past: '%s前',
+ s: '数秒',
+ m: '1分',
+ mm: '%d分',
+ h: '1時間',
+ hh: '%d時間',
+ d: '1日',
+ dd: '%d日',
+ M: '1ヶ月',
+ MM: '%dヶ月',
+ y: '1年',
+ yy: '%d年'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/jv.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/jv.js
new file mode 100644
index 0000000..81a3f66
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/jv.js
@@ -0,0 +1,39 @@
+// Javanese [jv]
+import dayjs from '../index';
+var locale = {
+ name: 'jv',
+ weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
+ months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
+ weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH.mm',
+ LTS: 'HH.mm.ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY [pukul] HH.mm',
+ LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
+ },
+ relativeTime: {
+ future: 'wonten ing %s',
+ past: '%s ingkang kepengker',
+ s: 'sawetawis detik',
+ m: 'setunggal menit',
+ mm: '%d menit',
+ h: 'setunggal jam',
+ hh: '%d jam',
+ d: 'sedinten',
+ dd: '%d dinten',
+ M: 'sewulan',
+ MM: '%d wulan',
+ y: 'setaun',
+ yy: '%d taun'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ka.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ka.js
new file mode 100644
index 0000000..381fffa
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ka.js
@@ -0,0 +1,39 @@
+// Georgian [ka]
+import dayjs from '../index';
+var locale = {
+ name: 'ka',
+ weekdays: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
+ weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
+ weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
+ months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),
+ monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ },
+ relativeTime: {
+ future: '%s შემდეგ',
+ past: '%s წინ',
+ s: 'წამი',
+ m: 'წუთი',
+ mm: '%d წუთი',
+ h: 'საათი',
+ hh: '%d საათის',
+ d: 'დღეს',
+ dd: '%d დღის განმავლობაში',
+ M: 'თვის',
+ MM: '%d თვის',
+ y: 'წელი',
+ yy: '%d წლის'
+ },
+ ordinal: function ordinal(n) {
+ return n;
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/kk.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/kk.js
new file mode 100644
index 0000000..f2ca045
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/kk.js
@@ -0,0 +1,39 @@
+// Kazakh [kk]
+import dayjs from '../index';
+var locale = {
+ name: 'kk',
+ weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'),
+ weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
+ weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
+ months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'),
+ monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
+ weekStart: 1,
+ relativeTime: {
+ future: '%s ішінде',
+ past: '%s бұрын',
+ s: 'бірнеше секунд',
+ m: 'бір минут',
+ mm: '%d минут',
+ h: 'бір сағат',
+ hh: '%d сағат',
+ d: 'бір күн',
+ dd: '%d күн',
+ M: 'бір ай',
+ MM: '%d ай',
+ y: 'бір жыл',
+ yy: '%d жыл'
+ },
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/km.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/km.js
new file mode 100644
index 0000000..7fd185b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/km.js
@@ -0,0 +1,39 @@
+// Cambodian [km]
+import dayjs from '../index';
+var locale = {
+ name: 'km',
+ weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
+ months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
+ monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
+ weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%sទៀត',
+ past: '%sមុន',
+ s: 'ប៉ុន្មានវិនាទី',
+ m: 'មួយនាទី',
+ mm: '%d នាទី',
+ h: 'មួយម៉ោង',
+ hh: '%d ម៉ោង',
+ d: 'មួយថ្ងៃ',
+ dd: '%d ថ្ងៃ',
+ M: 'មួយខែ',
+ MM: '%d ខែ',
+ y: 'មួយឆ្នាំ',
+ yy: '%d ឆ្នាំ'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/kn.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/kn.js
new file mode 100644
index 0000000..b9ca9b9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/kn.js
@@ -0,0 +1,38 @@
+// Kannada [kn]
+import dayjs from '../index';
+var locale = {
+ name: 'kn',
+ weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split('_'),
+ months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split('_'),
+ weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),
+ monthsShort: 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split('_'),
+ weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm',
+ LTS: 'A h:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm'
+ },
+ relativeTime: {
+ future: '%s ನಂತರ',
+ past: '%s ಹಿಂದೆ',
+ s: 'ಕೆಲವು ಕ್ಷಣಗಳು',
+ m: 'ಒಂದು ನಿಮಿಷ',
+ mm: '%d ನಿಮಿಷ',
+ h: 'ಒಂದು ಗಂಟೆ',
+ hh: '%d ಗಂಟೆ',
+ d: 'ಒಂದು ದಿನ',
+ dd: '%d ದಿನ',
+ M: 'ಒಂದು ತಿಂಗಳು',
+ MM: '%d ತಿಂಗಳು',
+ y: 'ಒಂದು ವರ್ಷ',
+ yy: '%d ವರ್ಷ'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ko.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ko.js
new file mode 100644
index 0000000..1caff27
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ko.js
@@ -0,0 +1,45 @@
+// Korean [ko]
+import dayjs from '../index';
+var locale = {
+ name: 'ko',
+ weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
+ weekdaysShort: '일_월_화_수_목_금_토'.split('_'),
+ weekdaysMin: '일_월_화_수_목_금_토'.split('_'),
+ months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
+ monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm',
+ LTS: 'A h:mm:ss',
+ L: 'YYYY.MM.DD.',
+ LL: 'YYYY년 MMMM D일',
+ LLL: 'YYYY년 MMMM D일 A h:mm',
+ LLLL: 'YYYY년 MMMM D일 dddd A h:mm',
+ l: 'YYYY.MM.DD.',
+ ll: 'YYYY년 MMMM D일',
+ lll: 'YYYY년 MMMM D일 A h:mm',
+ llll: 'YYYY년 MMMM D일 dddd A h:mm'
+ },
+ meridiem: function meridiem(hour) {
+ return hour < 12 ? '오전' : '오후';
+ },
+ relativeTime: {
+ future: '%s 후',
+ past: '%s 전',
+ s: '몇 초',
+ m: '1분',
+ mm: '%d분',
+ h: '한 시간',
+ hh: '%d시간',
+ d: '하루',
+ dd: '%d일',
+ M: '한 달',
+ MM: '%d달',
+ y: '일 년',
+ yy: '%d년'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ku.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ku.js
new file mode 100644
index 0000000..cd3d98d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ku.js
@@ -0,0 +1,39 @@
+// Kurdish [ku]
+import dayjs from '../index';
+var locale = {
+ name: 'ku',
+ weekdays: 'یهكشهممه_دووشهممه_سێشهممه_چوارشهممه_پێنجشهممه_ههینی_شهممه'.split('_'),
+ months: 'کانونی دووەم_شوبات_ئازار_نیسان_ئایار_حوزەیران_تەمموز_ئاب_ئەیلوول_تشرینی یەكەم_تشرینی دووەم_كانونی یەکەم'.split('_'),
+ weekStart: 6,
+ weekdaysShort: 'یهكشهم_دووشهم_سێشهم_چوارشهم_پێنجشهم_ههینی_شهممه'.split('_'),
+ monthsShort: 'کانونی دووەم_شوبات_ئازار_نیسان_ئایار_حوزەیران_تەمموز_ئاب_ئەیلوول_تشرینی یەكەم_تشرینی دووەم_كانونی یەکەم'.split('_'),
+ weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'له %s',
+ past: '%s',
+ s: 'چهند چركهیهك',
+ m: 'یهك خولهك',
+ mm: '%d خولهك',
+ h: 'یهك كاتژمێر',
+ hh: '%d كاتژمێر',
+ d: 'یهك ڕۆژ',
+ dd: '%d ڕۆژ',
+ M: 'یهك مانگ',
+ MM: '%d مانگ',
+ y: 'یهك ساڵ',
+ yy: '%d ساڵ'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ky.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ky.js
new file mode 100644
index 0000000..fd04477
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ky.js
@@ -0,0 +1,39 @@
+// Kyrgyz [ky]
+import dayjs from '../index';
+var locale = {
+ name: 'ky',
+ weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'),
+ months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
+ monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
+ weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%s ичинде',
+ past: '%s мурун',
+ s: 'бирнече секунд',
+ m: 'бир мүнөт',
+ mm: '%d мүнөт',
+ h: 'бир саат',
+ hh: '%d саат',
+ d: 'бир күн',
+ dd: '%d күн',
+ M: 'бир ай',
+ MM: '%d ай',
+ y: 'бир жыл',
+ yy: '%d жыл'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lb.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lb.js
new file mode 100644
index 0000000..21ef4aa
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lb.js
@@ -0,0 +1,24 @@
+// Luxembourgish [lb]
+import dayjs from '../index';
+var locale = {
+ name: 'lb',
+ weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
+ months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
+ monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
+ weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'H:mm [Auer]',
+ LTS: 'H:mm:ss [Auer]',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm [Auer]',
+ LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lo.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lo.js
new file mode 100644
index 0000000..7732ec4
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lo.js
@@ -0,0 +1,38 @@
+// Lao [lo]
+import dayjs from '../index';
+var locale = {
+ name: 'lo',
+ weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
+ months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
+ weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
+ monthsShort: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
+ weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'ວັນdddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'ອີກ %s',
+ past: '%sຜ່ານມາ',
+ s: 'ບໍ່ເທົ່າໃດວິນາທີ',
+ m: '1 ນາທີ',
+ mm: '%d ນາທີ',
+ h: '1 ຊົ່ວໂມງ',
+ hh: '%d ຊົ່ວໂມງ',
+ d: '1 ມື້',
+ dd: '%d ມື້',
+ M: '1 ເດືອນ',
+ MM: '%d ເດືອນ',
+ y: '1 ປີ',
+ yy: '%d ປີ'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lt.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lt.js
new file mode 100644
index 0000000..189d772
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lt.js
@@ -0,0 +1,70 @@
+// Lithuanian [lt]
+import dayjs from '../index';
+var monthFormat = 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_');
+var monthStandalone = 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'); // eslint-disable-next-line no-useless-escape
+
+var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/;
+
+var months = function months(dayjsInstance, format) {
+ if (MONTHS_IN_FORMAT.test(format)) {
+ return monthFormat[dayjsInstance.month()];
+ }
+
+ return monthStandalone[dayjsInstance.month()];
+};
+
+months.s = monthStandalone;
+months.f = monthFormat;
+var locale = {
+ name: 'lt',
+ weekdays: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'),
+ weekdaysShort: 'sek_pir_ant_tre_ket_pen_šeš'.split('_'),
+ weekdaysMin: 's_p_a_t_k_pn_š'.split('_'),
+ months: months,
+ monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ weekStart: 1,
+ relativeTime: {
+ future: 'už %s',
+ past: 'prieš %s',
+ s: 'kelias sekundes',
+ m: 'minutę',
+ mm: '%d minutes',
+ h: 'valandą',
+ hh: '%d valandas',
+ d: 'dieną',
+ dd: '%d dienas',
+ M: 'menesį',
+ MM: '%d mėnesius',
+ y: 'metus',
+ yy: '%d metus'
+ },
+ format: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'YYYY [m.] MMMM D [d.]',
+ LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
+ LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
+ l: 'YYYY-MM-DD',
+ ll: 'YYYY [m.] MMMM D [d.]',
+ lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
+ llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'YYYY [m.] MMMM D [d.]',
+ LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
+ LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
+ l: 'YYYY-MM-DD',
+ ll: 'YYYY [m.] MMMM D [d.]',
+ lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
+ llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lv.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lv.js
new file mode 100644
index 0000000..6fcb6e1
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/lv.js
@@ -0,0 +1,24 @@
+// Latvian [lv]
+import dayjs from '../index';
+var locale = {
+ name: 'lv',
+ weekdays: 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
+ months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),
+ monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
+ weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY.',
+ LL: 'YYYY. [gada] D. MMMM',
+ LLL: 'YYYY. [gada] D. MMMM, HH:mm',
+ LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/me.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/me.js
new file mode 100644
index 0000000..465c0ff
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/me.js
@@ -0,0 +1,24 @@
+// Montenegrin [me]
+import dayjs from '../index';
+var locale = {
+ name: 'me',
+ weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
+ months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
+ monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
+ weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mi.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mi.js
new file mode 100644
index 0000000..3b56f0e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mi.js
@@ -0,0 +1,39 @@
+// Maori [mi]
+import dayjs from '../index';
+var locale = {
+ name: 'mi',
+ weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
+ months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
+ monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split('_'),
+ weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY [i] HH:mm',
+ LLLL: 'dddd, D MMMM YYYY [i] HH:mm'
+ },
+ relativeTime: {
+ future: 'i roto i %s',
+ past: '%s i mua',
+ s: 'te hēkona ruarua',
+ m: 'he meneti',
+ mm: '%d meneti',
+ h: 'te haora',
+ hh: '%d haora',
+ d: 'he ra',
+ dd: '%d ra',
+ M: 'he marama',
+ MM: '%d marama',
+ y: 'he tau',
+ yy: '%d tau'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mk.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mk.js
new file mode 100644
index 0000000..8522c26
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mk.js
@@ -0,0 +1,39 @@
+// Macedonian [mk]
+import dayjs from '../index';
+var locale = {
+ name: 'mk',
+ weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),
+ months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
+ monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
+ weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'D.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY H:mm',
+ LLLL: 'dddd, D MMMM YYYY H:mm'
+ },
+ relativeTime: {
+ future: 'после %s',
+ past: 'пред %s',
+ s: 'неколку секунди',
+ m: 'минута',
+ mm: '%d минути',
+ h: 'час',
+ hh: '%d часа',
+ d: 'ден',
+ dd: '%d дена',
+ M: 'месец',
+ MM: '%d месеци',
+ y: 'година',
+ yy: '%d години'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ml.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ml.js
new file mode 100644
index 0000000..bfcc277
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ml.js
@@ -0,0 +1,38 @@
+// Malayalam [ml]
+import dayjs from '../index';
+var locale = {
+ name: 'ml',
+ weekdays: 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),
+ months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),
+ weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
+ monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),
+ weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm -നു',
+ LTS: 'A h:mm:ss -നു',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm -നു',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm -നു'
+ },
+ relativeTime: {
+ future: '%s കഴിഞ്ഞ്',
+ past: '%s മുൻപ്',
+ s: 'അൽപ നിമിഷങ്ങൾ',
+ m: 'ഒരു മിനിറ്റ്',
+ mm: '%d മിനിറ്റ്',
+ h: 'ഒരു മണിക്കൂർ',
+ hh: '%d മണിക്കൂർ',
+ d: 'ഒരു ദിവസം',
+ dd: '%d ദിവസം',
+ M: 'ഒരു മാസം',
+ MM: '%d മാസം',
+ y: 'ഒരു വർഷം',
+ yy: '%d വർഷം'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mn.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mn.js
new file mode 100644
index 0000000..d93cae2
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mn.js
@@ -0,0 +1,38 @@
+// Mongolian [mn]
+import dayjs from '../index';
+var locale = {
+ name: 'mn',
+ weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),
+ months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split('_'),
+ weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
+ monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split('_'),
+ weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'YYYY оны MMMMын D',
+ LLL: 'YYYY оны MMMMын D HH:mm',
+ LLLL: 'dddd, YYYY оны MMMMын D HH:mm'
+ },
+ relativeTime: {
+ future: '%s',
+ past: '%s',
+ s: 'саяхан',
+ m: 'м',
+ mm: '%dм',
+ h: '1ц',
+ hh: '%dц',
+ d: '1ө',
+ dd: '%dө',
+ M: '1с',
+ MM: '%dс',
+ y: '1ж',
+ yy: '%dж'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mr.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mr.js
new file mode 100644
index 0000000..9eac8a7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mr.js
@@ -0,0 +1,23 @@
+// Marathi [mr]
+import dayjs from '../index';
+var locale = {
+ name: 'mr',
+ weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
+ months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),
+ weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
+ monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
+ weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm वाजता',
+ LTS: 'A h:mm:ss वाजता',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm वाजता',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ms-my.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ms-my.js
new file mode 100644
index 0000000..5138219
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ms-my.js
@@ -0,0 +1,39 @@
+// Malay [ms-my]
+import dayjs from '../index';
+var locale = {
+ name: 'ms-my',
+ weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
+ months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
+ monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
+ weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH.mm',
+ LTS: 'HH.mm.ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY [pukul] HH.mm',
+ LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
+ },
+ relativeTime: {
+ future: 'dalam %s',
+ past: '%s yang lepas',
+ s: 'beberapa saat',
+ m: 'seminit',
+ mm: '%d minit',
+ h: 'sejam',
+ hh: '%d jam',
+ d: 'sehari',
+ dd: '%d hari',
+ M: 'sebulan',
+ MM: '%d bulan',
+ y: 'setahun',
+ yy: '%d tahun'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ms.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ms.js
new file mode 100644
index 0000000..86349f3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ms.js
@@ -0,0 +1,39 @@
+// Malay [ms]
+import dayjs from '../index';
+var locale = {
+ name: 'ms',
+ weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
+ weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
+ weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
+ months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
+ monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'HH.mm',
+ LTS: 'HH.mm.ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH.mm',
+ LLLL: 'dddd, D MMMM YYYY HH.mm'
+ },
+ relativeTime: {
+ future: 'dalam %s',
+ past: '%s yang lepas',
+ s: 'beberapa saat',
+ m: 'seminit',
+ mm: '%d minit',
+ h: 'sejam',
+ hh: '%d jam',
+ d: 'sehari',
+ dd: '%d hari',
+ M: 'sebulan',
+ MM: '%d bulan',
+ y: 'setahun',
+ yy: '%d tahun'
+ },
+ ordinal: function ordinal(n) {
+ return n + ".";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mt.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mt.js
new file mode 100644
index 0000000..9c90953
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/mt.js
@@ -0,0 +1,39 @@
+// Maltese (Malta) [mt]
+import dayjs from '../index';
+var locale = {
+ name: 'mt',
+ weekdays: 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split('_'),
+ months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),
+ monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),
+ weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'f’ %s',
+ past: '%s ilu',
+ s: 'ftit sekondi',
+ m: 'minuta',
+ mm: '%d minuti',
+ h: 'siegħa',
+ hh: '%d siegħat',
+ d: 'ġurnata',
+ dd: '%d ġranet',
+ M: 'xahar',
+ MM: '%d xhur',
+ y: 'sena',
+ yy: '%d sni'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/my.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/my.js
new file mode 100644
index 0000000..73b2633
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/my.js
@@ -0,0 +1,39 @@
+// Burmese [my]
+import dayjs from '../index';
+var locale = {
+ name: 'my',
+ weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),
+ months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
+ monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
+ weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'လာမည့် %s မှာ',
+ past: 'လွန်ခဲ့သော %s က',
+ s: 'စက္ကန်.အနည်းငယ်',
+ m: 'တစ်မိနစ်',
+ mm: '%d မိနစ်',
+ h: 'တစ်နာရီ',
+ hh: '%d နာရီ',
+ d: 'တစ်ရက်',
+ dd: '%d ရက်',
+ M: 'တစ်လ',
+ MM: '%d လ',
+ y: 'တစ်နှစ်',
+ yy: '%d နှစ်'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nb.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nb.js
new file mode 100644
index 0000000..e2d10f5
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nb.js
@@ -0,0 +1,39 @@
+// Norwegian Bokmål [nb]
+import dayjs from '../index';
+var locale = {
+ name: 'nb',
+ weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
+ weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),
+ weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
+ months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
+ monthsShort: 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ weekStart: 1,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY [kl.] HH:mm',
+ LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm'
+ },
+ relativeTime: {
+ future: 'om %s',
+ past: '%s siden',
+ s: 'noen sekunder',
+ m: 'ett minutt',
+ mm: '%d minutter',
+ h: 'en time',
+ hh: '%d timer',
+ d: 'en dag',
+ dd: '%d dager',
+ M: 'en måned',
+ MM: '%d måneder',
+ y: 'ett år',
+ yy: '%d år'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ne.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ne.js
new file mode 100644
index 0000000..4f5a004
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ne.js
@@ -0,0 +1,40 @@
+// Nepalese [ne]
+import dayjs from '../index';
+var locale = {
+ name: 'ne',
+ weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),
+ weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
+ weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
+ months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मे_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),
+ monthsShort: 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),
+ relativeTime: {
+ future: '%s पछि',
+ past: '%s अघि',
+ s: 'सेकेन्ड',
+ m: 'एक मिनेट',
+ mm: '%d मिनेट',
+ h: 'घन्टा',
+ hh: '%d घन्टा',
+ d: 'एक दिन',
+ dd: '%d दिन',
+ M: 'एक महिना',
+ MM: '%d महिना',
+ y: 'एक वर्ष',
+ yy: '%d वर्ष'
+ },
+ ordinal: function ordinal(n) {
+ return ("" + n).replace(/\d/g, function (i) {
+ return '०१२३४५६७८९'[i];
+ });
+ },
+ formats: {
+ LT: 'Aको h:mm बजे',
+ LTS: 'Aको h:mm:ss बजे',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, Aको h:mm बजे',
+ LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nl-be.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nl-be.js
new file mode 100644
index 0000000..51465b7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nl-be.js
@@ -0,0 +1,39 @@
+// Dutch (Belgium) [nl-be]
+import dayjs from '../index';
+var locale = {
+ name: 'nl-be',
+ weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
+ months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
+ monthsShort: 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
+ weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'over %s',
+ past: '%s geleden',
+ s: 'een paar seconden',
+ m: 'één minuut',
+ mm: '%d minuten',
+ h: 'één uur',
+ hh: '%d uur',
+ d: 'één dag',
+ dd: '%d dagen',
+ M: 'één maand',
+ MM: '%d maanden',
+ y: 'één jaar',
+ yy: '%d jaar'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nl.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nl.js
new file mode 100644
index 0000000..d60f9fc
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nl.js
@@ -0,0 +1,40 @@
+// Dutch [nl]
+import dayjs from '../index';
+var locale = {
+ name: 'nl',
+ weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
+ weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
+ weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
+ months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
+ monthsShort: 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ weekStart: 1,
+ yearStart: 4,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD-MM-YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'over %s',
+ past: '%s geleden',
+ s: 'een paar seconden',
+ m: 'een minuut',
+ mm: '%d minuten',
+ h: 'een uur',
+ hh: '%d uur',
+ d: 'een dag',
+ dd: '%d dagen',
+ M: 'een maand',
+ MM: '%d maanden',
+ y: 'een jaar',
+ yy: '%d jaar'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nn.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nn.js
new file mode 100644
index 0000000..43767a4
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/nn.js
@@ -0,0 +1,39 @@
+// Nynorsk [nn]
+import dayjs from '../index';
+var locale = {
+ name: 'nn',
+ weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
+ weekdaysShort: 'sun_mån_tys_ons_tor_fre_lau'.split('_'),
+ weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'),
+ months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
+ monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ weekStart: 1,
+ relativeTime: {
+ future: 'om %s',
+ past: 'for %s sidan',
+ s: 'nokre sekund',
+ m: 'eitt minutt',
+ mm: '%d minutt',
+ h: 'ein time',
+ hh: '%d timar',
+ d: 'ein dag',
+ dd: '%d dagar',
+ M: 'ein månad',
+ MM: '%d månadar',
+ y: 'eitt år',
+ yy: '%d år'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY [kl.] H:mm',
+ LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/oc-lnc.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/oc-lnc.js
new file mode 100644
index 0000000..91e2f0d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/oc-lnc.js
@@ -0,0 +1,39 @@
+// Occitan, lengadocian dialecte [oc-lnc]
+import dayjs from '../index';
+var locale = {
+ name: 'oc-lnc',
+ weekdays: 'dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte'.split('_'),
+ weekdaysShort: 'Dg_Dl_Dm_Dc_Dj_Dv_Ds'.split('_'),
+ weekdaysMin: 'dg_dl_dm_dc_dj_dv_ds'.split('_'),
+ months: 'genièr_febrièr_març_abrial_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre'.split('_'),
+ monthsShort: 'gen_feb_març_abr_mai_junh_julh_ago_set_oct_nov_dec'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM [de] YYYY',
+ LLL: 'D MMMM [de] YYYY [a] H:mm',
+ LLLL: 'dddd D MMMM [de] YYYY [a] H:mm'
+ },
+ relativeTime: {
+ future: 'd\'aquí %s',
+ past: 'fa %s',
+ s: 'unas segondas',
+ m: 'una minuta',
+ mm: '%d minutas',
+ h: 'una ora',
+ hh: '%d oras',
+ d: 'un jorn',
+ dd: '%d jorns',
+ M: 'un mes',
+ MM: '%d meses',
+ y: 'un an',
+ yy: '%d ans'
+ },
+ ordinal: function ordinal(n) {
+ return n + "\xBA";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pa-in.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pa-in.js
new file mode 100644
index 0000000..624a852
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pa-in.js
@@ -0,0 +1,38 @@
+// Punjabi (India) [pa-in]
+import dayjs from '../index';
+var locale = {
+ name: 'pa-in',
+ weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'),
+ months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
+ weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
+ monthsShort: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
+ weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm ਵਜੇ',
+ LTS: 'A h:mm:ss ਵਜੇ',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm ਵਜੇ',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ'
+ },
+ relativeTime: {
+ future: '%s ਵਿੱਚ',
+ past: '%s ਪਿਛਲੇ',
+ s: 'ਕੁਝ ਸਕਿੰਟ',
+ m: 'ਇਕ ਮਿੰਟ',
+ mm: '%d ਮਿੰਟ',
+ h: 'ਇੱਕ ਘੰਟਾ',
+ hh: '%d ਘੰਟੇ',
+ d: 'ਇੱਕ ਦਿਨ',
+ dd: '%d ਦਿਨ',
+ M: 'ਇੱਕ ਮਹੀਨਾ',
+ MM: '%d ਮਹੀਨੇ',
+ y: 'ਇੱਕ ਸਾਲ',
+ yy: '%d ਸਾਲ'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pl.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pl.js
new file mode 100644
index 0000000..dd9ccb7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pl.js
@@ -0,0 +1,86 @@
+// Polish [pl]
+import dayjs from '../index';
+
+function plural(n) {
+ return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1; // eslint-disable-line
+}
+/* eslint-disable */
+
+
+function translate(number, withoutSuffix, key) {
+ var result = number + " ";
+
+ switch (key) {
+ case 'm':
+ return withoutSuffix ? 'minuta' : 'minutę';
+
+ case 'mm':
+ return result + (plural(number) ? 'minuty' : 'minut');
+
+ case 'h':
+ return withoutSuffix ? 'godzina' : 'godzinę';
+
+ case 'hh':
+ return result + (plural(number) ? 'godziny' : 'godzin');
+
+ case 'MM':
+ return result + (plural(number) ? 'miesiące' : 'miesięcy');
+
+ case 'yy':
+ return result + (plural(number) ? 'lata' : 'lat');
+ }
+}
+/* eslint-enable */
+
+
+var monthFormat = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
+var monthStandalone = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_');
+var MONTHS_IN_FORMAT = /D MMMM/;
+
+var months = function months(dayjsInstance, format) {
+ if (MONTHS_IN_FORMAT.test(format)) {
+ return monthFormat[dayjsInstance.month()];
+ }
+
+ return monthStandalone[dayjsInstance.month()];
+};
+
+months.s = monthStandalone;
+months.f = monthFormat;
+var locale = {
+ name: 'pl',
+ weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
+ weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
+ weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
+ months: months,
+ monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ weekStart: 1,
+ relativeTime: {
+ future: 'za %s',
+ past: '%s temu',
+ s: 'kilka sekund',
+ m: translate,
+ mm: translate,
+ h: translate,
+ hh: translate,
+ d: '1 dzień',
+ dd: '%d dni',
+ M: 'miesiąc',
+ MM: translate,
+ y: 'rok',
+ yy: translate
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pt-br.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pt-br.js
new file mode 100644
index 0000000..e317417
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pt-br.js
@@ -0,0 +1,38 @@
+// Portuguese (Brazil) [pt-br]
+import dayjs from '../index';
+var locale = {
+ name: 'pt-br',
+ weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
+ weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
+ weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
+ months: 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
+ monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + "\xBA";
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D [de] MMMM [de] YYYY',
+ LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
+ LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
+ },
+ relativeTime: {
+ future: 'em %s',
+ past: 'há %s',
+ s: 'poucos segundos',
+ m: 'um minuto',
+ mm: '%d minutos',
+ h: 'uma hora',
+ hh: '%d horas',
+ d: 'um dia',
+ dd: '%d dias',
+ M: 'um mês',
+ MM: '%d meses',
+ y: 'um ano',
+ yy: '%d anos'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pt.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pt.js
new file mode 100644
index 0000000..fffeb9d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/pt.js
@@ -0,0 +1,39 @@
+// Portuguese [pt]
+import dayjs from '../index';
+var locale = {
+ name: 'pt',
+ weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
+ weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sab'.split('_'),
+ weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sa'.split('_'),
+ months: 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
+ monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + "\xBA";
+ },
+ weekStart: 1,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D [de] MMMM [de] YYYY',
+ LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
+ LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
+ },
+ relativeTime: {
+ future: 'em %s',
+ past: 'há %s',
+ s: 'alguns segundos',
+ m: 'um minuto',
+ mm: '%d minutos',
+ h: 'uma hora',
+ hh: '%d horas',
+ d: 'um dia',
+ dd: '%d dias',
+ M: 'um mês',
+ MM: '%d meses',
+ y: 'um ano',
+ yy: '%d anos'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ro.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ro.js
new file mode 100644
index 0000000..93ef6bf
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ro.js
@@ -0,0 +1,39 @@
+// Romanian [ro]
+import dayjs from '../index';
+var locale = {
+ name: 'ro',
+ weekdays: 'Duminică_Luni_Marți_Miercuri_Joi_Vineri_Sâmbătă'.split('_'),
+ weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
+ weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
+ months: 'Ianuarie_Februarie_Martie_Aprilie_Mai_Iunie_Iulie_August_Septembrie_Octombrie_Noiembrie_Decembrie'.split('_'),
+ monthsShort: 'Ian._Febr._Mart._Apr._Mai_Iun._Iul._Aug._Sept._Oct._Nov._Dec.'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY H:mm',
+ LLLL: 'dddd, D MMMM YYYY H:mm'
+ },
+ relativeTime: {
+ future: 'peste %s',
+ past: 'acum %s',
+ s: 'câteva secunde',
+ m: 'un minut',
+ mm: '%d minute',
+ h: 'o oră',
+ hh: '%d ore',
+ d: 'o zi',
+ dd: '%d zile',
+ M: 'o lună',
+ MM: '%d luni',
+ y: 'un an',
+ yy: '%d ani'
+ },
+ ordinal: function ordinal(n) {
+ return n;
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ru.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ru.js
new file mode 100644
index 0000000..4903d80
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ru.js
@@ -0,0 +1,87 @@
+// Russian [ru]
+import dayjs from '../index';
+var monthFormat = 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_');
+var monthStandalone = 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_');
+var monthShortFormat = 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_');
+var monthShortStandalone = 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_');
+var MONTHS_IN_FORMAT = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;
+
+function plural(word, num) {
+ var forms = word.split('_');
+ return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; // eslint-disable-line
+}
+
+function relativeTimeWithPlural(number, withoutSuffix, key) {
+ var format = {
+ mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
+ hh: 'час_часа_часов',
+ dd: 'день_дня_дней',
+ MM: 'месяц_месяца_месяцев',
+ yy: 'год_года_лет'
+ };
+
+ if (key === 'm') {
+ return withoutSuffix ? 'минута' : 'минуту';
+ }
+
+ return number + " " + plural(format[key], +number);
+}
+
+var months = function months(dayjsInstance, format) {
+ if (MONTHS_IN_FORMAT.test(format)) {
+ return monthFormat[dayjsInstance.month()];
+ }
+
+ return monthStandalone[dayjsInstance.month()];
+};
+
+months.s = monthStandalone;
+months.f = monthFormat;
+
+var monthsShort = function monthsShort(dayjsInstance, format) {
+ if (MONTHS_IN_FORMAT.test(format)) {
+ return monthShortFormat[dayjsInstance.month()];
+ }
+
+ return monthShortStandalone[dayjsInstance.month()];
+};
+
+monthsShort.s = monthShortStandalone;
+monthsShort.f = monthShortFormat;
+var locale = {
+ name: 'ru',
+ weekdays: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
+ weekdaysShort: 'вск_пнд_втр_срд_чтв_птн_сбт'.split('_'),
+ weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
+ months: months,
+ monthsShort: monthsShort,
+ weekStart: 1,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY г.',
+ LLL: 'D MMMM YYYY г., H:mm',
+ LLLL: 'dddd, D MMMM YYYY г., H:mm'
+ },
+ relativeTime: {
+ future: 'через %s',
+ past: '%s назад',
+ s: 'несколько секунд',
+ m: relativeTimeWithPlural,
+ mm: relativeTimeWithPlural,
+ h: 'час',
+ hh: relativeTimeWithPlural,
+ d: 'день',
+ dd: relativeTimeWithPlural,
+ M: 'месяц',
+ MM: relativeTimeWithPlural,
+ y: 'год',
+ yy: relativeTimeWithPlural
+ },
+ ordinal: function ordinal(n) {
+ return n;
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/rw.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/rw.js
new file mode 100644
index 0000000..1e53ac7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/rw.js
@@ -0,0 +1,35 @@
+// Kinyarwanda (Rwanda) [rw]
+import dayjs from '../index';
+var locale = {
+ name: 'rw',
+ weekdays: 'Ku Cyumweru_Kuwa Mbere_Kuwa Kabiri_Kuwa Gatatu_Kuwa Kane_Kuwa Gatanu_Kuwa Gatandatu'.split('_'),
+ months: 'Mutarama_Gashyantare_Werurwe_Mata_Gicurasi_Kamena_Nyakanga_Kanama_Nzeri_Ukwakira_Ugushyingo_Ukuboza'.split('_'),
+ relativeTime: {
+ future: 'mu %s',
+ past: '%s',
+ s: 'amasegonda',
+ m: 'Umunota',
+ mm: '%d iminota',
+ h: 'isaha',
+ hh: '%d amasaha',
+ d: 'Umunsi',
+ dd: '%d iminsi',
+ M: 'ukwezi',
+ MM: '%d amezi',
+ y: 'umwaka',
+ yy: '%d imyaka'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ ordinal: function ordinal(n) {
+ return n;
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sd.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sd.js
new file mode 100644
index 0000000..a429f8d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sd.js
@@ -0,0 +1,39 @@
+// Sindhi [sd]
+import dayjs from '../index';
+var locale = {
+ name: 'sd',
+ weekdays: 'آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر'.split('_'),
+ months: 'جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر'.split('_'),
+ monthsShort: 'جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر'.split('_'),
+ weekdaysMin: 'آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd، D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%s پوء',
+ past: '%s اڳ',
+ s: 'چند سيڪنڊ',
+ m: 'هڪ منٽ',
+ mm: '%d منٽ',
+ h: 'هڪ ڪلاڪ',
+ hh: '%d ڪلاڪ',
+ d: 'هڪ ڏينهن',
+ dd: '%d ڏينهن',
+ M: 'هڪ مهينو',
+ MM: '%d مهينا',
+ y: 'هڪ سال',
+ yy: '%d سال'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/se.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/se.js
new file mode 100644
index 0000000..691099c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/se.js
@@ -0,0 +1,39 @@
+// Northern Sami [se]
+import dayjs from '../index';
+var locale = {
+ name: 'se',
+ weekdays: 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'),
+ months: 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
+ monthsShort: 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),
+ weekdaysMin: 's_v_m_g_d_b_L'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'MMMM D. [b.] YYYY',
+ LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',
+ LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm'
+ },
+ relativeTime: {
+ future: '%s geažes',
+ past: 'maŋit %s',
+ s: 'moadde sekunddat',
+ m: 'okta minuhta',
+ mm: '%d minuhtat',
+ h: 'okta diimmu',
+ hh: '%d diimmut',
+ d: 'okta beaivi',
+ dd: '%d beaivvit',
+ M: 'okta mánnu',
+ MM: '%d mánut',
+ y: 'okta jahki',
+ yy: '%d jagit'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/si.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/si.js
new file mode 100644
index 0000000..7a71ec0
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/si.js
@@ -0,0 +1,38 @@
+// Sinhalese [si]
+import dayjs from '../index';
+var locale = {
+ name: 'si',
+ weekdays: 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'),
+ months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'),
+ weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන'.split('_'),
+ monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'),
+ weekdaysMin: 'ඉ_ස_අ_බ_බ්ර_සි_සෙ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'a h:mm',
+ LTS: 'a h:mm:ss',
+ L: 'YYYY/MM/DD',
+ LL: 'YYYY MMMM D',
+ LLL: 'YYYY MMMM D, a h:mm',
+ LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'
+ },
+ relativeTime: {
+ future: '%sකින්',
+ past: '%sකට පෙර',
+ s: 'තත්පර කිහිපය',
+ m: 'මිනිත්තුව',
+ mm: 'මිනිත්තු %d',
+ h: 'පැය',
+ hh: 'පැය %d',
+ d: 'දිනය',
+ dd: 'දින %d',
+ M: 'මාසය',
+ MM: 'මාස %d',
+ y: 'වසර',
+ yy: 'වසර %d'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sk.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sk.js
new file mode 100644
index 0000000..222401f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sk.js
@@ -0,0 +1,121 @@
+// Slovak [sk]
+import dayjs from '../index';
+
+function plural(n) {
+ return n > 1 && n < 5 && ~~(n / 10) !== 1; // eslint-disable-line
+}
+/* eslint-disable */
+
+
+function translate(number, withoutSuffix, key, isFuture) {
+ var result = number + " ";
+
+ switch (key) {
+ case 's':
+ // a few seconds / in a few seconds / a few seconds ago
+ return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
+
+ case 'm':
+ // a minute / in a minute / a minute ago
+ return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';
+
+ case 'mm':
+ // 9 minutes / in 9 minutes / 9 minutes ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'minúty' : 'minút');
+ }
+
+ return result + "min\xFAtami";
+
+ case 'h':
+ // an hour / in an hour / an hour ago
+ return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
+
+ case 'hh':
+ // 9 hours / in 9 hours / 9 hours ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'hodiny' : 'hodín');
+ }
+
+ return result + "hodinami";
+
+ case 'd':
+ // a day / in a day / a day ago
+ return withoutSuffix || isFuture ? 'deň' : 'dňom';
+
+ case 'dd':
+ // 9 days / in 9 days / 9 days ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'dni' : 'dní');
+ }
+
+ return result + "d\u0148ami";
+
+ case 'M':
+ // a month / in a month / a month ago
+ return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';
+
+ case 'MM':
+ // 9 months / in 9 months / 9 months ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'mesiace' : 'mesiacov');
+ }
+
+ return result + "mesiacmi";
+
+ case 'y':
+ // a year / in a year / a year ago
+ return withoutSuffix || isFuture ? 'rok' : 'rokom';
+
+ case 'yy':
+ // 9 years / in 9 years / 9 years ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'roky' : 'rokov');
+ }
+
+ return result + "rokmi";
+ }
+}
+/* eslint-enable */
+
+
+var locale = {
+ name: 'sk',
+ weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
+ weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
+ weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
+ months: 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),
+ monthsShort: 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'),
+ weekStart: 1,
+ yearStart: 4,
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd D. MMMM YYYY H:mm',
+ l: 'D. M. YYYY'
+ },
+ relativeTime: {
+ future: 'za %s',
+ // Should be `o %s` (change when moment/moment#5408 is fixed)
+ past: 'pred %s',
+ s: translate,
+ m: translate,
+ mm: translate,
+ h: translate,
+ hh: translate,
+ d: translate,
+ dd: translate,
+ M: translate,
+ MM: translate,
+ y: translate,
+ yy: translate
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sl.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sl.js
new file mode 100644
index 0000000..f7a4356
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sl.js
@@ -0,0 +1,24 @@
+// Slovenian [sl]
+import dayjs from '../index';
+var locale = {
+ name: 'sl',
+ weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
+ months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
+ monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
+ weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sq.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sq.js
new file mode 100644
index 0000000..625b701
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sq.js
@@ -0,0 +1,39 @@
+// Albanian [sq]
+import dayjs from '../index';
+var locale = {
+ name: 'sq',
+ weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),
+ months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
+ monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
+ weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'në %s',
+ past: '%s më parë',
+ s: 'disa sekonda',
+ m: 'një minutë',
+ mm: '%d minuta',
+ h: 'një orë',
+ hh: '%d orë',
+ d: 'një ditë',
+ dd: '%d ditë',
+ M: 'një muaj',
+ MM: '%d muaj',
+ y: 'një vit',
+ yy: '%d vite'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sr-cyrl.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sr-cyrl.js
new file mode 100644
index 0000000..aa4c0f7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sr-cyrl.js
@@ -0,0 +1,39 @@
+// Serbian Cyrillic [sr-cyrl]
+import dayjs from '../index';
+var locale = {
+ name: 'sr-cyrl',
+ weekdays: 'Недеља_Понедељак_Уторак_Среда_Четвртак_Петак_Субота'.split('_'),
+ weekdaysShort: 'Нед._Пон._Уто._Сре._Чет._Пет._Суб.'.split('_'),
+ weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
+ months: 'Јануар_Фебруар_Март_Април_Мај_Јун_Јул_Август_Септембар_Октобар_Новембар_Децембар'.split('_'),
+ monthsShort: 'Јан._Феб._Мар._Апр._Мај_Јун_Јул_Авг._Сеп._Окт._Нов._Дец.'.split('_'),
+ weekStart: 1,
+ relativeTime: {
+ future: 'за %s',
+ past: 'пре %s',
+ s: 'секунда',
+ m: 'минут',
+ mm: '%d минута',
+ h: 'сат',
+ hh: '%d сати',
+ d: 'дан',
+ dd: '%d дана',
+ M: 'месец',
+ MM: '%d месеци',
+ y: 'година',
+ yy: '%d године'
+ },
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sr.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sr.js
new file mode 100644
index 0000000..adc08b5
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sr.js
@@ -0,0 +1,39 @@
+// Serbian [sr]
+import dayjs from '../index';
+var locale = {
+ name: 'sr',
+ weekdays: 'Nedelja_Ponedeljak_Utorak_Sreda_Četvrtak_Petak_Subota'.split('_'),
+ weekdaysShort: 'Ned._Pon._Uto._Sre._Čet._Pet._Sub.'.split('_'),
+ weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
+ months: 'Januar_Februar_Mart_April_Maj_Jun_Jul_Avgust_Septembar_Oktobar_Novembar_Decembar'.split('_'),
+ monthsShort: 'Jan._Feb._Mar._Apr._Maj_Jun_Jul_Avg._Sep._Okt._Nov._Dec.'.split('_'),
+ weekStart: 1,
+ relativeTime: {
+ future: 'za %s',
+ past: 'pre %s',
+ s: 'sekunda',
+ m: 'minut',
+ mm: '%d minuta',
+ h: 'sat',
+ hh: '%d sati',
+ d: 'dan',
+ dd: '%d dana',
+ M: 'mesec',
+ MM: '%d meseci',
+ y: 'godina',
+ yy: '%d godine'
+ },
+ ordinal: function ordinal(n) {
+ return n + ".";
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ss.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ss.js
new file mode 100644
index 0000000..4354a48
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ss.js
@@ -0,0 +1,39 @@
+// siSwati [ss]
+import dayjs from '../index';
+var locale = {
+ name: 'ss',
+ weekdays: 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'),
+ months: "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
+ monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
+ weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'nga %s',
+ past: 'wenteka nga %s',
+ s: 'emizuzwana lomcane',
+ m: 'umzuzu',
+ mm: '%d emizuzu',
+ h: 'lihora',
+ hh: '%d emahora',
+ d: 'lilanga',
+ dd: '%d emalanga',
+ M: 'inyanga',
+ MM: '%d tinyanga',
+ y: 'umnyaka',
+ yy: '%d iminyaka'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sv.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sv.js
new file mode 100644
index 0000000..0adc44a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sv.js
@@ -0,0 +1,43 @@
+// Swedish [sv]
+import dayjs from '../index';
+var locale = {
+ name: 'sv',
+ weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
+ weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
+ weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),
+ months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
+ monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
+ weekStart: 1,
+ ordinal: function ordinal(n) {
+ var b = n % 10;
+ var o = b === 1 || b === 2 ? 'a' : 'e';
+ return "[" + n + o + "]";
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY [kl.] HH:mm',
+ LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',
+ lll: 'D MMM YYYY HH:mm',
+ llll: 'ddd D MMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'om %s',
+ past: 'för %s sedan',
+ s: 'några sekunder',
+ m: 'en minut',
+ mm: '%d minuter',
+ h: 'en timme',
+ hh: '%d timmar',
+ d: 'en dag',
+ dd: '%d dagar',
+ M: 'en månad',
+ MM: '%d månader',
+ y: 'ett år',
+ yy: '%d år'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sw.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sw.js
new file mode 100644
index 0000000..287bf33
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/sw.js
@@ -0,0 +1,39 @@
+// Swahili [sw]
+import dayjs from '../index';
+var locale = {
+ name: 'sw',
+ weekdays: 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'),
+ weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
+ weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
+ months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'),
+ monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
+ weekStart: 1,
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ relativeTime: {
+ future: '%s baadaye',
+ past: 'tokea %s',
+ s: 'hivi punde',
+ m: 'dakika moja',
+ mm: 'dakika %d',
+ h: 'saa limoja',
+ hh: 'masaa %d',
+ d: 'siku moja',
+ dd: 'masiku %d',
+ M: 'mwezi mmoja',
+ MM: 'miezi %d',
+ y: 'mwaka mmoja',
+ yy: 'miaka %d'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ta.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ta.js
new file mode 100644
index 0000000..6df25f8
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ta.js
@@ -0,0 +1,38 @@
+// Tamil [ta]
+import dayjs from '../index';
+var locale = {
+ name: 'ta',
+ weekdays: 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),
+ months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
+ weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),
+ monthsShort: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
+ weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, HH:mm',
+ LLLL: 'dddd, D MMMM YYYY, HH:mm'
+ },
+ relativeTime: {
+ future: '%s இல்',
+ past: '%s முன்',
+ s: 'ஒரு சில விநாடிகள்',
+ m: 'ஒரு நிமிடம்',
+ mm: '%d நிமிடங்கள்',
+ h: 'ஒரு மணி நேரம்',
+ hh: '%d மணி நேரம்',
+ d: 'ஒரு நாள்',
+ dd: '%d நாட்கள்',
+ M: 'ஒரு மாதம்',
+ MM: '%d மாதங்கள்',
+ y: 'ஒரு வருடம்',
+ yy: '%d ஆண்டுகள்'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/te.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/te.js
new file mode 100644
index 0000000..392a247
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/te.js
@@ -0,0 +1,38 @@
+// Telugu [te]
+import dayjs from '../index';
+var locale = {
+ name: 'te',
+ weekdays: 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'),
+ months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'),
+ weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
+ monthsShort: 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'),
+ weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'A h:mm',
+ LTS: 'A h:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm'
+ },
+ relativeTime: {
+ future: '%s లో',
+ past: '%s క్రితం',
+ s: 'కొన్ని క్షణాలు',
+ m: 'ఒక నిమిషం',
+ mm: '%d నిమిషాలు',
+ h: 'ఒక గంట',
+ hh: '%d గంటలు',
+ d: 'ఒక రోజు',
+ dd: '%d రోజులు',
+ M: 'ఒక నెల',
+ MM: '%d నెలలు',
+ y: 'ఒక సంవత్సరం',
+ yy: '%d సంవత్సరాలు'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tet.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tet.js
new file mode 100644
index 0000000..ff83eea
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tet.js
@@ -0,0 +1,39 @@
+// Tetun Dili (East Timor) [tet]
+import dayjs from '../index';
+var locale = {
+ name: 'tet',
+ weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'),
+ months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),
+ monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
+ weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'iha %s',
+ past: '%s liuba',
+ s: 'minutu balun',
+ m: 'minutu ida',
+ mm: 'minutu %d',
+ h: 'oras ida',
+ hh: 'oras %d',
+ d: 'loron ida',
+ dd: 'loron %d',
+ M: 'fulan ida',
+ MM: 'fulan %d',
+ y: 'tinan ida',
+ yy: 'tinan %d'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tg.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tg.js
new file mode 100644
index 0000000..536df0b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tg.js
@@ -0,0 +1,39 @@
+// Tajik [tg]
+import dayjs from '../index';
+var locale = {
+ name: 'tg',
+ weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split('_'),
+ months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),
+ monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
+ weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'баъди %s',
+ past: '%s пеш',
+ s: 'якчанд сония',
+ m: 'як дақиқа',
+ mm: '%d дақиқа',
+ h: 'як соат',
+ hh: '%d соат',
+ d: 'як рӯз',
+ dd: '%d рӯз',
+ M: 'як моҳ',
+ MM: '%d моҳ',
+ y: 'як сол',
+ yy: '%d сол'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/th.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/th.js
new file mode 100644
index 0000000..5cbcdf2
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/th.js
@@ -0,0 +1,38 @@
+// Thai [th]
+import dayjs from '../index';
+var locale = {
+ name: 'th',
+ weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
+ weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'),
+ weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
+ months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
+ monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY เวลา H:mm',
+ LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm'
+ },
+ relativeTime: {
+ future: 'อีก %s',
+ past: '%sที่แล้ว',
+ s: 'ไม่กี่วินาที',
+ m: '1 นาที',
+ mm: '%d นาที',
+ h: '1 ชั่วโมง',
+ hh: '%d ชั่วโมง',
+ d: '1 วัน',
+ dd: '%d วัน',
+ M: '1 เดือน',
+ MM: '%d เดือน',
+ y: '1 ปี',
+ yy: '%d ปี'
+ },
+ ordinal: function ordinal(n) {
+ return n + ".";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tk.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tk.js
new file mode 100644
index 0000000..93390f1
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tk.js
@@ -0,0 +1,39 @@
+// Turkmen [tk]
+import dayjs from '../index';
+var locale = {
+ name: 'tk',
+ weekdays: 'Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe'.split('_'),
+ weekdaysShort: 'Ýek_Duş_Siş_Çar_Pen_Ann_Şen'.split('_'),
+ weekdaysMin: 'Ýk_Dş_Sş_Çr_Pn_An_Şn'.split('_'),
+ months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split('_'),
+ monthsShort: 'Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%s soň',
+ past: '%s öň',
+ s: 'birnäçe sekunt',
+ m: 'bir minut',
+ mm: '%d minut',
+ h: 'bir sagat',
+ hh: '%d sagat',
+ d: 'bir gün',
+ dd: '%d gün',
+ M: 'bir aý',
+ MM: '%d aý',
+ y: 'bir ýyl',
+ yy: '%d ýyl'
+ },
+ ordinal: function ordinal(n) {
+ return n + ".";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tl-ph.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tl-ph.js
new file mode 100644
index 0000000..0fa84f3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tl-ph.js
@@ -0,0 +1,39 @@
+// Tagalog (Philippines) [tl-ph]
+import dayjs from '../index';
+var locale = {
+ name: 'tl-ph',
+ weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),
+ months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
+ monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
+ weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'MM/D/YYYY',
+ LL: 'MMMM D, YYYY',
+ LLL: 'MMMM D, YYYY HH:mm',
+ LLLL: 'dddd, MMMM DD, YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'sa loob ng %s',
+ past: '%s ang nakalipas',
+ s: 'ilang segundo',
+ m: 'isang minuto',
+ mm: '%d minuto',
+ h: 'isang oras',
+ hh: '%d oras',
+ d: 'isang araw',
+ dd: '%d araw',
+ M: 'isang buwan',
+ MM: '%d buwan',
+ y: 'isang taon',
+ yy: '%d taon'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tlh.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tlh.js
new file mode 100644
index 0000000..30f52fe
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tlh.js
@@ -0,0 +1,24 @@
+// Klingon [tlh]
+import dayjs from '../index';
+var locale = {
+ name: 'tlh',
+ weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
+ months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
+ monthsShort: 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),
+ weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tr.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tr.js
new file mode 100644
index 0000000..e7fe24f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tr.js
@@ -0,0 +1,39 @@
+// Turkish [tr]
+import dayjs from '../index';
+var locale = {
+ name: 'tr',
+ weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
+ weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
+ weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
+ months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
+ monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
+ weekStart: 1,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%s sonra',
+ past: '%s önce',
+ s: 'birkaç saniye',
+ m: 'bir dakika',
+ mm: '%d dakika',
+ h: 'bir saat',
+ hh: '%d saat',
+ d: 'bir gün',
+ dd: '%d gün',
+ M: 'bir ay',
+ MM: '%d ay',
+ y: 'bir yıl',
+ yy: '%d yıl'
+ },
+ ordinal: function ordinal(n) {
+ return n + ".";
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/types.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/types.d.ts
new file mode 100644
index 0000000..2c24a64
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/types.d.ts
@@ -0,0 +1,33 @@
+declare interface ILocale {
+ name: string
+ weekdays?: string[]
+ months?: string[]
+ weekStart?: number
+ weekdaysShort?: string[]
+ monthsShort?: string[]
+ weekdaysMin?: string[]
+ ordinal?: (n: number) => number | string
+ formats: Partial<{
+ LT: string
+ LTS: string
+ L: string
+ LL: string
+ LLL: string
+ LLLL: string
+ }>
+ relativeTime: Partial<{
+ future: string
+ past: string
+ s: string
+ m: string
+ mm: string
+ h: string
+ hh: string
+ d: string
+ dd: string
+ M: string
+ MM: string
+ y: string
+ yy: string
+ }>
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tzl.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tzl.js
new file mode 100644
index 0000000..9fa0cd2
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tzl.js
@@ -0,0 +1,24 @@
+// Talossan [tzl]
+import dayjs from '../index';
+var locale = {
+ name: 'tzl',
+ weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
+ months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
+ monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
+ weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH.mm',
+ LTS: 'HH.mm.ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM [dallas] YYYY',
+ LLL: 'D. MMMM [dallas] YYYY HH.mm',
+ LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tzm-latn.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tzm-latn.js
new file mode 100644
index 0000000..e5ac6af
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tzm-latn.js
@@ -0,0 +1,39 @@
+// Central Atlas Tamazight Latin [tzm-latn]
+import dayjs from '../index';
+var locale = {
+ name: 'tzm-latn',
+ weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
+ months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
+ weekStart: 6,
+ weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
+ monthsShort: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
+ weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'dadkh s yan %s',
+ past: 'yan %s',
+ s: 'imik',
+ m: 'minuḍ',
+ mm: '%d minuḍ',
+ h: 'saɛa',
+ hh: '%d tassaɛin',
+ d: 'ass',
+ dd: '%d ossan',
+ M: 'ayowr',
+ MM: '%d iyyirn',
+ y: 'asgas',
+ yy: '%d isgasn'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tzm.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tzm.js
new file mode 100644
index 0000000..d94a6c0
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/tzm.js
@@ -0,0 +1,39 @@
+// Central Atlas Tamazight [tzm]
+import dayjs from '../index';
+var locale = {
+ name: 'tzm',
+ weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
+ months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
+ weekStart: 6,
+ weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
+ monthsShort: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
+ weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
+ past: 'ⵢⴰⵏ %s',
+ s: 'ⵉⵎⵉⴽ',
+ m: 'ⵎⵉⵏⵓⴺ',
+ mm: '%d ⵎⵉⵏⵓⴺ',
+ h: 'ⵙⴰⵄⴰ',
+ hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
+ d: 'ⴰⵙⵙ',
+ dd: '%d oⵙⵙⴰⵏ',
+ M: 'ⴰⵢoⵓⵔ',
+ MM: '%d ⵉⵢⵢⵉⵔⵏ',
+ y: 'ⴰⵙⴳⴰⵙ',
+ yy: '%d ⵉⵙⴳⴰⵙⵏ'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ug-cn.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ug-cn.js
new file mode 100644
index 0000000..d3d6392
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ug-cn.js
@@ -0,0 +1,39 @@
+// Uyghur (China) [ug-cn]
+import dayjs from '../index';
+var locale = {
+ name: 'ug-cn',
+ weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split('_'),
+ months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
+ monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split('_'),
+ weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',
+ LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
+ LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm'
+ },
+ relativeTime: {
+ future: '%s كېيىن',
+ past: '%s بۇرۇن',
+ s: 'نەچچە سېكونت',
+ m: 'بىر مىنۇت',
+ mm: '%d مىنۇت',
+ h: 'بىر سائەت',
+ hh: '%d سائەت',
+ d: 'بىر كۈن',
+ dd: '%d كۈن',
+ M: 'بىر ئاي',
+ MM: '%d ئاي',
+ y: 'بىر يىل',
+ yy: '%d يىل'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/uk.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/uk.js
new file mode 100644
index 0000000..ab4c1f8
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/uk.js
@@ -0,0 +1,77 @@
+// Ukrainian [uk]
+import dayjs from '../index';
+var monthFormat = 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_');
+var monthStandalone = 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_');
+var MONTHS_IN_FORMAT = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;
+
+function plural(word, num) {
+ var forms = word.split('_');
+ return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; // eslint-disable-line
+}
+
+function relativeTimeWithPlural(number, withoutSuffix, key) {
+ var format = {
+ ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
+ mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
+ hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
+ dd: 'день_дні_днів',
+ MM: 'місяць_місяці_місяців',
+ yy: 'рік_роки_років'
+ };
+
+ if (key === 'm') {
+ return withoutSuffix ? 'хвилина' : 'хвилину';
+ } else if (key === 'h') {
+ return withoutSuffix ? 'година' : 'годину';
+ }
+
+ return number + " " + plural(format[key], +number);
+}
+
+var months = function months(dayjsInstance, format) {
+ if (MONTHS_IN_FORMAT.test(format)) {
+ return monthFormat[dayjsInstance.month()];
+ }
+
+ return monthStandalone[dayjsInstance.month()];
+};
+
+months.s = monthStandalone;
+months.f = monthFormat;
+var locale = {
+ name: 'uk',
+ weekdays: 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
+ weekdaysShort: 'ндл_пнд_втр_срд_чтв_птн_сбт'.split('_'),
+ weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
+ months: months,
+ monthsShort: 'сiч_лют_бер_квiт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
+ weekStart: 1,
+ relativeTime: {
+ future: 'за %s',
+ past: '%s тому',
+ s: 'декілька секунд',
+ m: relativeTimeWithPlural,
+ mm: relativeTimeWithPlural,
+ h: relativeTimeWithPlural,
+ hh: relativeTimeWithPlural,
+ d: 'день',
+ dd: relativeTimeWithPlural,
+ M: 'місяць',
+ MM: relativeTimeWithPlural,
+ y: 'рік',
+ yy: relativeTimeWithPlural
+ },
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY р.',
+ LLL: 'D MMMM YYYY р., HH:mm',
+ LLLL: 'dddd, D MMMM YYYY р., HH:mm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ur.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ur.js
new file mode 100644
index 0000000..7464c1e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/ur.js
@@ -0,0 +1,39 @@
+// Urdu [ur]
+import dayjs from '../index';
+var locale = {
+ name: 'ur',
+ weekdays: 'اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ'.split('_'),
+ months: 'جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ'.split('_'),
+ monthsShort: 'جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر'.split('_'),
+ weekdaysMin: 'اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd، D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%s بعد',
+ past: '%s قبل',
+ s: 'چند سیکنڈ',
+ m: 'ایک منٹ',
+ mm: '%d منٹ',
+ h: 'ایک گھنٹہ',
+ hh: '%d گھنٹے',
+ d: 'ایک دن',
+ dd: '%d دن',
+ M: 'ایک ماہ',
+ MM: '%d ماہ',
+ y: 'ایک سال',
+ yy: '%d سال'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/uz-latn.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/uz-latn.js
new file mode 100644
index 0000000..4dc2108
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/uz-latn.js
@@ -0,0 +1,39 @@
+// Uzbek Latin [uz-latn]
+import dayjs from '../index';
+var locale = {
+ name: 'uz-latn',
+ weekdays: 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split('_'),
+ months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
+ monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
+ weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'D MMMM YYYY, dddd HH:mm'
+ },
+ relativeTime: {
+ future: 'Yaqin %s ichida',
+ past: 'Bir necha %s oldin',
+ s: 'soniya',
+ m: 'bir daqiqa',
+ mm: '%d daqiqa',
+ h: 'bir soat',
+ hh: '%d soat',
+ d: 'bir kun',
+ dd: '%d kun',
+ M: 'bir oy',
+ MM: '%d oy',
+ y: 'bir yil',
+ yy: '%d yil'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/uz.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/uz.js
new file mode 100644
index 0000000..459fd58
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/uz.js
@@ -0,0 +1,39 @@
+// Uzbek [uz]
+import dayjs from '../index';
+var locale = {
+ name: 'uz',
+ weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
+ months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
+ monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
+ weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'D MMMM YYYY, dddd HH:mm'
+ },
+ relativeTime: {
+ future: 'Якин %s ичида',
+ past: 'Бир неча %s олдин',
+ s: 'фурсат',
+ m: 'бир дакика',
+ mm: '%d дакика',
+ h: 'бир соат',
+ hh: '%d соат',
+ d: 'бир кун',
+ dd: '%d кун',
+ M: 'бир ой',
+ MM: '%d ой',
+ y: 'бир йил',
+ yy: '%d йил'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/vi.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/vi.js
new file mode 100644
index 0000000..f55cc73
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/vi.js
@@ -0,0 +1,43 @@
+// Vietnamese [vi]
+import dayjs from '../index';
+var locale = {
+ name: 'vi',
+ weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
+ months: 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
+ monthsShort: 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
+ weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM [năm] YYYY',
+ LLL: 'D MMMM [năm] YYYY HH:mm',
+ LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',
+ l: 'DD/M/YYYY',
+ ll: 'D MMM YYYY',
+ lll: 'D MMM YYYY HH:mm',
+ llll: 'ddd, D MMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%s tới',
+ past: '%s trước',
+ s: 'vài giây',
+ m: 'một phút',
+ mm: '%d phút',
+ h: 'một giờ',
+ hh: '%d giờ',
+ d: 'một ngày',
+ dd: '%d ngày',
+ M: 'một tháng',
+ MM: '%d tháng',
+ y: 'một năm',
+ yy: '%d năm'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/x-pseudo.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/x-pseudo.js
new file mode 100644
index 0000000..ceb6782
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/x-pseudo.js
@@ -0,0 +1,39 @@
+// Pseudo [x-pseudo]
+import dayjs from '../index';
+var locale = {
+ name: 'x-pseudo',
+ weekdays: 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'),
+ months: 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
+ monthsShort: 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'),
+ weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'í~ñ %s',
+ past: '%s á~gó',
+ s: 'á ~féw ~sécó~ñds',
+ m: 'á ~míñ~úté',
+ mm: '%d m~íñú~tés',
+ h: 'á~ñ hó~úr',
+ hh: '%d h~óúrs',
+ d: 'á ~dáý',
+ dd: '%d d~áýs',
+ M: 'á ~móñ~th',
+ MM: '%d m~óñt~hs',
+ y: 'á ~ýéár',
+ yy: '%d ý~éárs'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/yo.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/yo.js
new file mode 100644
index 0000000..1f79468
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/yo.js
@@ -0,0 +1,39 @@
+// Yoruba Nigeria [yo]
+import dayjs from '../index';
+var locale = {
+ name: 'yo',
+ weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
+ months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split('_'),
+ weekStart: 1,
+ weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
+ monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
+ weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
+ ordinal: function ordinal(n) {
+ return n;
+ },
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'ní %s',
+ past: '%s kọjá',
+ s: 'ìsẹjú aayá die',
+ m: 'ìsẹjú kan',
+ mm: 'ìsẹjú %d',
+ h: 'wákati kan',
+ hh: 'wákati %d',
+ d: 'ọjọ́ kan',
+ dd: 'ọjọ́ %d',
+ M: 'osù kan',
+ MM: 'osù %d',
+ y: 'ọdún kan',
+ yy: 'ọdún %d'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh-cn.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh-cn.js
new file mode 100644
index 0000000..933e13f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh-cn.js
@@ -0,0 +1,67 @@
+// Chinese (China) [zh-cn]
+import dayjs from '../index';
+var locale = {
+ name: 'zh-cn',
+ weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
+ weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
+ weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
+ months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
+ monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
+ ordinal: function ordinal(number, period) {
+ switch (period) {
+ case 'W':
+ return number + "\u5468";
+
+ default:
+ return number + "\u65E5";
+ }
+ },
+ weekStart: 1,
+ yearStart: 4,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY/MM/DD',
+ LL: 'YYYY年M月D日',
+ LLL: 'YYYY年M月D日Ah点mm分',
+ LLLL: 'YYYY年M月D日ddddAh点mm分',
+ l: 'YYYY/M/D',
+ ll: 'YYYY年M月D日',
+ lll: 'YYYY年M月D日 HH:mm',
+ llll: 'YYYY年M月D日dddd HH:mm'
+ },
+ relativeTime: {
+ future: '%s内',
+ past: '%s前',
+ s: '几秒',
+ m: '1 分钟',
+ mm: '%d 分钟',
+ h: '1 小时',
+ hh: '%d 小时',
+ d: '1 天',
+ dd: '%d 天',
+ M: '1 个月',
+ MM: '%d 个月',
+ y: '1 年',
+ yy: '%d 年'
+ },
+ meridiem: function meridiem(hour, minute) {
+ var hm = hour * 100 + minute;
+
+ if (hm < 600) {
+ return '凌晨';
+ } else if (hm < 900) {
+ return '早上';
+ } else if (hm < 1130) {
+ return '上午';
+ } else if (hm < 1230) {
+ return '中午';
+ } else if (hm < 1800) {
+ return '下午';
+ }
+
+ return '晚上';
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh-hk.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh-hk.js
new file mode 100644
index 0000000..c0c2e2b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh-hk.js
@@ -0,0 +1,38 @@
+// Chinese (Hong Kong) [zh-hk]
+import dayjs from '../index';
+var locale = {
+ name: 'zh-hk',
+ months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
+ monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
+ weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
+ weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
+ weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + "\u65E5";
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY/MM/DD',
+ LL: 'YYYY年M月D日',
+ LLL: 'YYYY年M月D日 HH:mm',
+ LLLL: 'YYYY年M月D日dddd HH:mm'
+ },
+ relativeTime: {
+ future: '%s內',
+ past: '%s前',
+ s: '幾秒',
+ m: '一分鐘',
+ mm: '%d 分鐘',
+ h: '一小時',
+ hh: '%d 小時',
+ d: '一天',
+ dd: '%d 天',
+ M: '一個月',
+ MM: '%d 個月',
+ y: '一年',
+ yy: '%d 年'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh-tw.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh-tw.js
new file mode 100644
index 0000000..002a27d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh-tw.js
@@ -0,0 +1,42 @@
+// Chinese (Taiwan) [zh-tw]
+import dayjs from '../index';
+var locale = {
+ name: 'zh-tw',
+ weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
+ weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
+ weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
+ months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
+ monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
+ ordinal: function ordinal(n) {
+ return n + "\u65E5";
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY/MM/DD',
+ LL: 'YYYY年M月D日',
+ LLL: 'YYYY年M月D日 HH:mm',
+ LLLL: 'YYYY年M月D日dddd HH:mm',
+ l: 'YYYY/M/D',
+ ll: 'YYYY年M月D日',
+ lll: 'YYYY年M月D日 HH:mm',
+ llll: 'YYYY年M月D日dddd HH:mm'
+ },
+ relativeTime: {
+ future: '%s內',
+ past: '%s前',
+ s: '幾秒',
+ m: '1 分鐘',
+ mm: '%d 分鐘',
+ h: '1 小時',
+ hh: '%d 小時',
+ d: '1 天',
+ dd: '%d 天',
+ M: '1 個月',
+ MM: '%d 個月',
+ y: '1 年',
+ yy: '%d 年'
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh.js
new file mode 100644
index 0000000..ae0d874
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/locale/zh.js
@@ -0,0 +1,67 @@
+// Chinese [zh]
+import dayjs from '../index';
+var locale = {
+ name: 'zh',
+ weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
+ weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
+ weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
+ months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
+ monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
+ ordinal: function ordinal(number, period) {
+ switch (period) {
+ case 'W':
+ return number + "\u5468";
+
+ default:
+ return number + "\u65E5";
+ }
+ },
+ weekStart: 1,
+ yearStart: 4,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY/MM/DD',
+ LL: 'YYYY年M月D日',
+ LLL: 'YYYY年M月D日Ah点mm分',
+ LLLL: 'YYYY年M月D日ddddAh点mm分',
+ l: 'YYYY/M/D',
+ ll: 'YYYY年M月D日',
+ lll: 'YYYY年M月D日 HH:mm',
+ llll: 'YYYY年M月D日dddd HH:mm'
+ },
+ relativeTime: {
+ future: '%s后',
+ past: '%s前',
+ s: '几秒',
+ m: '1 分钟',
+ mm: '%d 分钟',
+ h: '1 小时',
+ hh: '%d 小时',
+ d: '1 天',
+ dd: '%d 天',
+ M: '1 个月',
+ MM: '%d 个月',
+ y: '1 年',
+ yy: '%d 年'
+ },
+ meridiem: function meridiem(hour, minute) {
+ var hm = hour * 100 + minute;
+
+ if (hm < 600) {
+ return '凌晨';
+ } else if (hm < 900) {
+ return '早上';
+ } else if (hm < 1130) {
+ return '上午';
+ } else if (hm < 1230) {
+ return '中午';
+ } else if (hm < 1800) {
+ return '下午';
+ }
+
+ return '晚上';
+ }
+};
+dayjs.locale(locale, null, true);
+export default locale;
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/advancedFormat/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/advancedFormat/index.d.ts
new file mode 100644
index 0000000..a17c896
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/advancedFormat/index.d.ts
@@ -0,0 +1,4 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/advancedFormat/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/advancedFormat/index.js
new file mode 100644
index 0000000..eb9660e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/advancedFormat/index.js
@@ -0,0 +1,55 @@
+import { FORMAT_DEFAULT } from '../../constant';
+export default (function (o, c, d) {
+ // locale needed later
+ var proto = c.prototype;
+ var oldFormat = proto.format;
+
+ d.en.ordinal = function (number) {
+ var s = ['th', 'st', 'nd', 'rd'];
+ var v = number % 100;
+ return "[" + number + (s[(v - 20) % 10] || s[v] || s[0]) + "]";
+ }; // extend en locale here
+
+
+ proto.format = function (formatStr) {
+ var _this = this;
+
+ var locale = this.$locale();
+ var utils = this.$utils();
+ var str = formatStr || FORMAT_DEFAULT;
+ var result = str.replace(/\[([^\]]+)]|Q|wo|ww|w|gggg|Do|X|x|k{1,2}|S/g, function (match) {
+ switch (match) {
+ case 'Q':
+ return Math.ceil((_this.$M + 1) / 3);
+
+ case 'Do':
+ return locale.ordinal(_this.$D);
+
+ case 'gggg':
+ return _this.weekYear();
+
+ case 'wo':
+ return locale.ordinal(_this.week(), 'W');
+ // W for week
+
+ case 'w':
+ case 'ww':
+ return utils.s(_this.week(), match === 'w' ? 1 : 2, '0');
+
+ case 'k':
+ case 'kk':
+ return utils.s(String(_this.$H === 0 ? 24 : _this.$H), match === 'k' ? 1 : 2, '0');
+
+ case 'X':
+ return Math.floor(_this.$d.getTime() / 1000);
+
+ case 'x':
+ return _this.$d.getTime();
+
+ default:
+ return match;
+ }
+ });
+ return oldFormat.bind(this)(result);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/badMutable/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/badMutable/index.d.ts
new file mode 100644
index 0000000..a17c896
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/badMutable/index.d.ts
@@ -0,0 +1,4 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/badMutable/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/badMutable/index.js
new file mode 100644
index 0000000..679edee
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/badMutable/index.js
@@ -0,0 +1,61 @@
+export default (function (o, c) {
+ // locale needed later
+ var proto = c.prototype;
+
+ proto.$g = function (input, get, set) {
+ if (this.$utils().u(input)) return this[get];
+ return this.$set(set, input);
+ };
+
+ proto.set = function (string, _int) {
+ return this.$set(string, _int);
+ };
+
+ var oldStartOf = proto.startOf;
+
+ proto.startOf = function (units, startOf) {
+ this.$d = oldStartOf.bind(this)(units, startOf).toDate();
+ this.init();
+ return this;
+ };
+
+ var oldAdd = proto.add;
+
+ proto.add = function (number, units) {
+ this.$d = oldAdd.bind(this)(number, units).toDate();
+ this.init();
+ return this;
+ };
+
+ var oldLocale = proto.locale;
+
+ proto.locale = function (preset, object) {
+ if (!preset) return this.$L;
+ this.$L = oldLocale.bind(this)(preset, object).$L;
+ return this;
+ };
+
+ var oldDaysInMonth = proto.daysInMonth;
+
+ proto.daysInMonth = function () {
+ return oldDaysInMonth.bind(this.clone())();
+ };
+
+ var oldIsSame = proto.isSame;
+
+ proto.isSame = function (that, units) {
+ return oldIsSame.bind(this.clone())(that, units);
+ };
+
+ var oldIsBefore = proto.isBefore;
+
+ proto.isBefore = function (that, units) {
+ return oldIsBefore.bind(this.clone())(that, units);
+ };
+
+ var oldIsAfter = proto.isAfter;
+
+ proto.isAfter = function (that, units) {
+ return oldIsAfter.bind(this.clone())(that, units);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/buddhistEra/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/buddhistEra/index.d.ts
new file mode 100644
index 0000000..a17c896
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/buddhistEra/index.d.ts
@@ -0,0 +1,4 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/buddhistEra/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/buddhistEra/index.js
new file mode 100644
index 0000000..76ce44c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/buddhistEra/index.js
@@ -0,0 +1,21 @@
+import { FORMAT_DEFAULT } from '../../constant';
+export default (function (o, c) {
+ // locale needed later
+ var proto = c.prototype;
+ var oldFormat = proto.format; // extend en locale here
+
+ proto.format = function (formatStr) {
+ var _this = this;
+
+ var yearBias = 543;
+ var str = formatStr || FORMAT_DEFAULT;
+ var result = str.replace(/(\[[^\]]+])|BBBB|BB/g, function (match, a) {
+ var _this$$utils;
+
+ var year = String(_this.$y + yearBias);
+ var args = match === 'BB' ? [year.slice(-2), 2] : [year, 4];
+ return a || (_this$$utils = _this.$utils()).s.apply(_this$$utils, args.concat(['0']));
+ });
+ return oldFormat.bind(this)(result);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/calendar/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/calendar/index.d.ts
new file mode 100644
index 0000000..42bff4b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/calendar/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc, ConfigType } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ calendar(referenceTime?: ConfigType, formats?: object): string
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/calendar/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/calendar/index.js
new file mode 100644
index 0000000..9abf1e9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/calendar/index.js
@@ -0,0 +1,32 @@
+export default (function (o, c, d) {
+ var LT = 'h:mm A';
+ var L = 'MM/DD/YYYY';
+ var calendarFormat = {
+ lastDay: "[Yesterday at] " + LT,
+ sameDay: "[Today at] " + LT,
+ nextDay: "[Tomorrow at] " + LT,
+ nextWeek: "dddd [at] " + LT,
+ lastWeek: "[Last] dddd [at] " + LT,
+ sameElse: L
+ };
+ var proto = c.prototype;
+
+ proto.calendar = function (referenceTime, formats) {
+ var format = formats || this.$locale().calendar || calendarFormat;
+ var referenceStartOfDay = d(referenceTime || undefined).startOf('d');
+ var diff = this.diff(referenceStartOfDay, 'd', true);
+ var sameElse = 'sameElse';
+ /* eslint-disable no-nested-ternary */
+
+ var retVal = diff < -6 ? sameElse : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : sameElse;
+ /* eslint-enable no-nested-ternary */
+
+ var currentFormat = format[retVal] || calendarFormat[retVal];
+
+ if (typeof currentFormat === 'function') {
+ return currentFormat.call(this, d());
+ }
+
+ return this.format(currentFormat);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/customParseFormat/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/customParseFormat/index.d.ts
new file mode 100644
index 0000000..a17c896
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/customParseFormat/index.d.ts
@@ -0,0 +1,4 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/customParseFormat/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/customParseFormat/index.js
new file mode 100644
index 0000000..b11b201
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/customParseFormat/index.js
@@ -0,0 +1,280 @@
+var formattingTokens = /(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g;
+var match1 = /\d/; // 0 - 9
+
+var match2 = /\d\d/; // 00 - 99
+
+var match3 = /\d{3}/; // 000 - 999
+
+var match4 = /\d{4}/; // 0000 - 9999
+
+var match1to2 = /\d\d?/; // 0 - 99
+
+var matchUpperCaseAMPM = /[AP]M/;
+var matchLowerCaseAMPM = /[ap]m/;
+var matchSigned = /[+-]?\d+/; // -inf - inf
+
+var matchOffset = /[+-]\d\d:?\d\d/; // +00:00 -00:00 +0000 or -0000
+
+var matchWord = /\d*[^\s\d-:/()]+/; // Word
+
+var locale;
+
+function offsetFromString(string) {
+ var parts = string.match(/([+-]|\d\d)/g);
+ var minutes = +(parts[1] * 60) + +parts[2];
+ return minutes === 0 ? 0 : parts[0] === '+' ? -minutes : minutes; // eslint-disable-line no-nested-ternary
+}
+
+var addInput = function addInput(property) {
+ return function (input) {
+ this[property] = +input;
+ };
+};
+
+var zoneExpressions = [matchOffset, function (input) {
+ var zone = this.zone || (this.zone = {});
+ zone.offset = offsetFromString(input);
+}];
+
+var getLocalePart = function getLocalePart(name) {
+ var part = locale[name];
+ return part && (part.indexOf ? part : part.s.concat(part.f));
+};
+
+var expressions = {
+ A: [matchUpperCaseAMPM, function (input) {
+ this.afternoon = input === 'PM';
+ }],
+ a: [matchLowerCaseAMPM, function (input) {
+ this.afternoon = input === 'pm';
+ }],
+ S: [match1, function (input) {
+ this.milliseconds = +input * 100;
+ }],
+ SS: [match2, function (input) {
+ this.milliseconds = +input * 10;
+ }],
+ SSS: [match3, function (input) {
+ this.milliseconds = +input;
+ }],
+ s: [match1to2, addInput('seconds')],
+ ss: [match1to2, addInput('seconds')],
+ m: [match1to2, addInput('minutes')],
+ mm: [match1to2, addInput('minutes')],
+ H: [match1to2, addInput('hours')],
+ h: [match1to2, addInput('hours')],
+ HH: [match1to2, addInput('hours')],
+ hh: [match1to2, addInput('hours')],
+ D: [match1to2, addInput('day')],
+ DD: [match2, addInput('day')],
+ Do: [matchWord, function (input) {
+ var _locale = locale,
+ ordinal = _locale.ordinal;
+
+ var _input$match = input.match(/\d+/);
+
+ this.day = _input$match[0];
+ if (!ordinal) return;
+
+ for (var i = 1; i <= 31; i += 1) {
+ if (ordinal(i).replace(/\[|\]/g, '') === input) {
+ this.day = i;
+ }
+ }
+ }],
+ M: [match1to2, addInput('month')],
+ MM: [match2, addInput('month')],
+ MMM: [matchWord, function (input) {
+ var months = getLocalePart('months');
+ var monthsShort = getLocalePart('monthsShort');
+ var matchIndex = (monthsShort || months.map(function (_) {
+ return _.substr(0, 3);
+ })).indexOf(input) + 1;
+
+ if (matchIndex < 1) {
+ throw new Error();
+ }
+
+ this.month = matchIndex % 12 || matchIndex;
+ }],
+ MMMM: [matchWord, function (input) {
+ var months = getLocalePart('months');
+ var matchIndex = months.indexOf(input) + 1;
+
+ if (matchIndex < 1) {
+ throw new Error();
+ }
+
+ this.month = matchIndex % 12 || matchIndex;
+ }],
+ Y: [matchSigned, addInput('year')],
+ YY: [match2, function (input) {
+ input = +input;
+ this.year = input + (input > 68 ? 1900 : 2000);
+ }],
+ YYYY: [match4, addInput('year')],
+ Z: zoneExpressions,
+ ZZ: zoneExpressions
+};
+
+function correctHours(time) {
+ var afternoon = time.afternoon;
+
+ if (afternoon !== undefined) {
+ var hours = time.hours;
+
+ if (afternoon) {
+ if (hours < 12) {
+ time.hours += 12;
+ }
+ } else if (hours === 12) {
+ time.hours = 0;
+ }
+
+ delete time.afternoon;
+ }
+}
+
+function makeParser(format) {
+ var array = format.match(formattingTokens);
+ var length = array.length;
+
+ for (var i = 0; i < length; i += 1) {
+ var token = array[i];
+ var parseTo = expressions[token];
+ var regex = parseTo && parseTo[0];
+ var parser = parseTo && parseTo[1];
+
+ if (parser) {
+ array[i] = {
+ regex: regex,
+ parser: parser
+ };
+ } else {
+ array[i] = token.replace(/^\[|\]$/g, '');
+ }
+ }
+
+ return function (input) {
+ var time = {};
+
+ for (var _i = 0, start = 0; _i < length; _i += 1) {
+ var _token = array[_i];
+
+ if (typeof _token === 'string') {
+ start += _token.length;
+ } else {
+ var _regex = _token.regex,
+ _parser = _token.parser;
+ var part = input.substr(start);
+
+ var match = _regex.exec(part);
+
+ var value = match[0];
+
+ _parser.call(time, value);
+
+ input = input.replace(value, '');
+ }
+ }
+
+ correctHours(time);
+ return time;
+ };
+}
+
+var parseFormattedInput = function parseFormattedInput(input, format, utc) {
+ try {
+ var parser = makeParser(format);
+
+ var _parser2 = parser(input),
+ year = _parser2.year,
+ month = _parser2.month,
+ day = _parser2.day,
+ hours = _parser2.hours,
+ minutes = _parser2.minutes,
+ seconds = _parser2.seconds,
+ milliseconds = _parser2.milliseconds,
+ zone = _parser2.zone;
+
+ var now = new Date();
+ var d = day || (!year && !month ? now.getDate() : 1);
+ var y = year || now.getFullYear();
+ var M = 0;
+
+ if (!(year && !month)) {
+ M = month > 0 ? month - 1 : now.getMonth();
+ }
+
+ var h = hours || 0;
+ var m = minutes || 0;
+ var s = seconds || 0;
+ var ms = milliseconds || 0;
+
+ if (zone) {
+ return new Date(Date.UTC(y, M, d, h, m, s, ms + zone.offset * 60 * 1000));
+ }
+
+ if (utc) {
+ return new Date(Date.UTC(y, M, d, h, m, s, ms));
+ }
+
+ return new Date(y, M, d, h, m, s, ms);
+ } catch (e) {
+ return new Date(''); // Invalid Date
+ }
+};
+
+export default (function (o, C, d) {
+ var proto = C.prototype;
+ var oldParse = proto.parse;
+
+ proto.parse = function (cfg) {
+ var date = cfg.date,
+ utc = cfg.utc,
+ args = cfg.args;
+ this.$u = utc;
+ var format = args[1];
+
+ if (typeof format === 'string') {
+ var isStrictWithoutLocale = args[2] === true;
+ var isStrictWithLocale = args[3] === true;
+ var isStrict = isStrictWithoutLocale || isStrictWithLocale;
+ var pl = args[2];
+
+ if (isStrictWithLocale) {
+ pl = args[2];
+ }
+
+ if (!isStrictWithoutLocale) {
+ locale = pl ? d.Ls[pl] : this.$locale();
+ }
+
+ this.$d = parseFormattedInput(date, format, utc);
+ this.init();
+ if (pl && pl !== true) this.$L = this.locale(pl).$L;
+
+ if (isStrict && date !== this.format(format)) {
+ this.$d = new Date('');
+ }
+ } else if (format instanceof Array) {
+ var len = format.length;
+
+ for (var i = 1; i <= len; i += 1) {
+ args[1] = format[i - 1];
+ var result = d.apply(this, args);
+
+ if (result.isValid()) {
+ this.$d = result.$d;
+ this.$L = result.$L;
+ this.init();
+ break;
+ }
+
+ if (i === len) this.$d = new Date('');
+ }
+ } else {
+ oldParse.call(this, cfg);
+ }
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/dayOfYear/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/dayOfYear/index.d.ts
new file mode 100644
index 0000000..4b9601e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/dayOfYear/index.d.ts
@@ -0,0 +1,11 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ dayOfYear(): number
+ dayOfYear(value: number): Dayjs
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/dayOfYear/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/dayOfYear/index.js
new file mode 100644
index 0000000..34d255f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/dayOfYear/index.js
@@ -0,0 +1,8 @@
+export default (function (o, c) {
+ var proto = c.prototype;
+
+ proto.dayOfYear = function (input) {
+ var dayOfYear = Math.round((this.startOf('day') - this.startOf('year')) / 864e5) + 1;
+ return input == null ? dayOfYear : this.add(input - dayOfYear, 'day');
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/duration/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/duration/index.d.ts
new file mode 100644
index 0000000..5cbd912
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/duration/index.d.ts
@@ -0,0 +1,58 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export default plugin
+
+type DurationInputType = string | number | object
+type DurationAddType = number | object | Duration
+
+export declare class Duration {
+ constructor (input: DurationInputType, unit?: string, locale?: string)
+
+ clone(): Duration
+
+ humanize(withSuffix: boolean): string
+
+ milliseconds(): number
+ asMilliseconds(): number
+
+ seconds(): number
+ asSeconds(): number
+
+ minutes(): number
+ asMinutes(): number
+
+ hours(): number
+ asHours(): number
+
+ days(): number
+ asDays(): number
+
+ weeks(): number
+ asWeeks(): number
+
+ months(): number
+ asMonths(): number
+
+ years(): number
+ asYears(): number
+
+ as(unit: string): number
+
+ get(unit: string): number
+
+ add(input: DurationAddType, unit? : string): Duration
+
+ subtract(input: DurationAddType, unit? : string): Duration
+
+ toJSON(): string
+
+ toISOString(): string
+
+ locale(locale: string): Duration
+}
+
+declare module 'dayjs/esm' {
+ export function duration(input?: DurationInputType , unit?: string): Duration
+ export function isDuration(d: any): d is Duration
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/duration/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/duration/index.js
new file mode 100644
index 0000000..1cb5f25
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/duration/index.js
@@ -0,0 +1,262 @@
+import { MILLISECONDS_A_DAY, MILLISECONDS_A_HOUR, MILLISECONDS_A_MINUTE, MILLISECONDS_A_SECOND, MILLISECONDS_A_WEEK } from '../../constant';
+var MILLISECONDS_A_YEAR = MILLISECONDS_A_DAY * 365;
+var MILLISECONDS_A_MONTH = MILLISECONDS_A_DAY * 30;
+var durationRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
+var unitToMS = {
+ years: MILLISECONDS_A_YEAR,
+ months: MILLISECONDS_A_MONTH,
+ days: MILLISECONDS_A_DAY,
+ hours: MILLISECONDS_A_HOUR,
+ minutes: MILLISECONDS_A_MINUTE,
+ seconds: MILLISECONDS_A_SECOND,
+ milliseconds: 1,
+ weeks: MILLISECONDS_A_WEEK
+};
+
+var isDuration = function isDuration(d) {
+ return d instanceof Duration;
+}; // eslint-disable-line no-use-before-define
+
+
+var $d;
+var $u;
+
+var wrapper = function wrapper(input, instance, unit) {
+ return new Duration(input, unit, instance.$l);
+}; // eslint-disable-line no-use-before-define
+
+
+var prettyUnit = function prettyUnit(unit) {
+ return $u.p(unit) + "s";
+};
+
+var Duration = /*#__PURE__*/function () {
+ function Duration(input, unit, locale) {
+ var _this = this;
+
+ this.$d = {};
+ this.$l = locale;
+
+ if (unit) {
+ return wrapper(input * unitToMS[prettyUnit(unit)], this);
+ }
+
+ if (typeof input === 'number') {
+ this.$ms = input;
+ this.parseFromMilliseconds();
+ return this;
+ }
+
+ if (typeof input === 'object') {
+ Object.keys(input).forEach(function (k) {
+ _this.$d[prettyUnit(k)] = input[k];
+ });
+ this.calMilliseconds();
+ return this;
+ }
+
+ if (typeof input === 'string') {
+ var d = input.match(durationRegex);
+
+ if (d) {
+ this.$d.years = d[2];
+ this.$d.months = d[3];
+ this.$d.weeks = d[4];
+ this.$d.days = d[5];
+ this.$d.hours = d[6];
+ this.$d.minutes = d[7];
+ this.$d.seconds = d[8];
+ this.calMilliseconds();
+ return this;
+ }
+ }
+
+ return this;
+ }
+
+ var _proto = Duration.prototype;
+
+ _proto.calMilliseconds = function calMilliseconds() {
+ var _this2 = this;
+
+ this.$ms = Object.keys(this.$d).reduce(function (total, unit) {
+ return total + (_this2.$d[unit] || 0) * (unitToMS[unit] || 1);
+ }, 0);
+ };
+
+ _proto.parseFromMilliseconds = function parseFromMilliseconds() {
+ var $ms = this.$ms;
+ this.$d.years = Math.floor($ms / MILLISECONDS_A_YEAR);
+ $ms %= MILLISECONDS_A_YEAR;
+ this.$d.months = Math.floor($ms / MILLISECONDS_A_MONTH);
+ $ms %= MILLISECONDS_A_MONTH;
+ this.$d.days = Math.floor($ms / MILLISECONDS_A_DAY);
+ $ms %= MILLISECONDS_A_DAY;
+ this.$d.hours = Math.floor($ms / MILLISECONDS_A_HOUR);
+ $ms %= MILLISECONDS_A_HOUR;
+ this.$d.minutes = Math.floor($ms / MILLISECONDS_A_MINUTE);
+ $ms %= MILLISECONDS_A_MINUTE;
+ this.$d.seconds = Math.floor($ms / MILLISECONDS_A_SECOND);
+ $ms %= MILLISECONDS_A_SECOND;
+ this.$d.milliseconds = $ms;
+ };
+
+ _proto.toISOString = function toISOString() {
+ var Y = this.$d.years ? this.$d.years + "Y" : '';
+ var M = this.$d.months ? this.$d.months + "M" : '';
+ var days = +this.$d.days || 0;
+
+ if (this.$d.weeks) {
+ days += this.$d.weeks * 7;
+ }
+
+ var D = days ? days + "D" : '';
+ var H = this.$d.hours ? this.$d.hours + "H" : '';
+ var m = this.$d.minutes ? this.$d.minutes + "M" : '';
+ var seconds = this.$d.seconds || 0;
+
+ if (this.$d.milliseconds) {
+ seconds += this.$d.milliseconds / 1000;
+ }
+
+ var S = seconds ? seconds + "S" : '';
+ var T = H || m || S ? 'T' : '';
+ var result = "P" + Y + M + D + T + H + m + S;
+ return result === 'P' ? 'P0D' : result;
+ };
+
+ _proto.toJSON = function toJSON() {
+ return this.toISOString();
+ };
+
+ _proto.as = function as(unit) {
+ return this.$ms / (unitToMS[prettyUnit(unit)] || 1);
+ };
+
+ _proto.get = function get(unit) {
+ var base = this.$ms;
+ var pUnit = prettyUnit(unit);
+
+ if (pUnit === 'milliseconds') {
+ base %= 1000;
+ } else if (pUnit === 'weeks') {
+ base = Math.floor(base / unitToMS[pUnit]);
+ } else {
+ base = this.$d[pUnit];
+ }
+
+ return base;
+ };
+
+ _proto.add = function add(input, unit, isSubtract) {
+ var another;
+
+ if (unit) {
+ another = input * unitToMS[prettyUnit(unit)];
+ } else if (isDuration(input)) {
+ another = input.$ms;
+ } else {
+ another = wrapper(input, this).$ms;
+ }
+
+ return wrapper(this.$ms + another * (isSubtract ? -1 : 1), this);
+ };
+
+ _proto.subtract = function subtract(input, unit) {
+ return this.add(input, unit, true);
+ };
+
+ _proto.locale = function locale(l) {
+ var that = this.clone();
+ that.$l = l;
+ return that;
+ };
+
+ _proto.clone = function clone() {
+ return wrapper(this.$ms, this);
+ };
+
+ _proto.humanize = function humanize(withSuffix) {
+ return $d().add(this.$ms, 'ms').locale(this.$l).fromNow(!withSuffix);
+ };
+
+ _proto.milliseconds = function milliseconds() {
+ return this.get('milliseconds');
+ };
+
+ _proto.asMilliseconds = function asMilliseconds() {
+ return this.as('milliseconds');
+ };
+
+ _proto.seconds = function seconds() {
+ return this.get('seconds');
+ };
+
+ _proto.asSeconds = function asSeconds() {
+ return this.as('seconds');
+ };
+
+ _proto.minutes = function minutes() {
+ return this.get('minutes');
+ };
+
+ _proto.asMinutes = function asMinutes() {
+ return this.as('minutes');
+ };
+
+ _proto.hours = function hours() {
+ return this.get('hours');
+ };
+
+ _proto.asHours = function asHours() {
+ return this.as('hours');
+ };
+
+ _proto.days = function days() {
+ return this.get('days');
+ };
+
+ _proto.asDays = function asDays() {
+ return this.as('days');
+ };
+
+ _proto.weeks = function weeks() {
+ return this.get('weeks');
+ };
+
+ _proto.asWeeks = function asWeeks() {
+ return this.as('weeks');
+ };
+
+ _proto.months = function months() {
+ return this.get('months');
+ };
+
+ _proto.asMonths = function asMonths() {
+ return this.as('months');
+ };
+
+ _proto.years = function years() {
+ return this.get('years');
+ };
+
+ _proto.asYears = function asYears() {
+ return this.as('years');
+ };
+
+ return Duration;
+}();
+
+export default (function (option, Dayjs, dayjs) {
+ $d = dayjs;
+ $u = dayjs().$utils();
+
+ dayjs.duration = function (input, unit) {
+ var $l = dayjs.locale();
+ return wrapper(input, {
+ $l: $l
+ }, unit);
+ };
+
+ dayjs.isDuration = isDuration;
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isBetween/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isBetween/index.d.ts
new file mode 100644
index 0000000..f442d6c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isBetween/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ isBetween(a: ConfigType, b: ConfigType, c?: OpUnitType | null, d?: string): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isBetween/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isBetween/index.js
new file mode 100644
index 0000000..2182a89
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isBetween/index.js
@@ -0,0 +1,10 @@
+export default (function (o, c, d) {
+ c.prototype.isBetween = function (a, b, u, i) {
+ var dA = d(a);
+ var dB = d(b);
+ i = i || '()';
+ var dAi = i[0] === '(';
+ var dBi = i[1] === ')';
+ return (dAi ? this.isAfter(dA, u) : !this.isBefore(dA, u)) && (dBi ? this.isBefore(dB, u) : !this.isAfter(dB, u)) || (dAi ? this.isBefore(dA, u) : !this.isAfter(dA, u)) && (dBi ? this.isAfter(dB, u) : !this.isBefore(dB, u));
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isLeapYear/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isLeapYear/index.d.ts
new file mode 100644
index 0000000..627ec5a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isLeapYear/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ isLeapYear(): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isLeapYear/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isLeapYear/index.js
new file mode 100644
index 0000000..bf1309d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isLeapYear/index.js
@@ -0,0 +1,7 @@
+export default (function (o, c) {
+ var proto = c.prototype;
+
+ proto.isLeapYear = function () {
+ return this.$y % 4 === 0 && this.$y % 100 !== 0 || this.$y % 400 === 0;
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isMoment/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isMoment/index.d.ts
new file mode 100644
index 0000000..6e3a69f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isMoment/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+
+ export function isMoment(input: any): boolean
+
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isMoment/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isMoment/index.js
new file mode 100644
index 0000000..48c8a89
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isMoment/index.js
@@ -0,0 +1,5 @@
+export default (function (o, c, f) {
+ f.isMoment = function (input) {
+ return f.isDayjs(input);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrAfter/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrAfter/index.d.ts
new file mode 100644
index 0000000..b4bc270
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrAfter/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ isSameOrAfter(date: ConfigType, unit?: OpUnitType): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrAfter/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrAfter/index.js
new file mode 100644
index 0000000..6a5c56f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrAfter/index.js
@@ -0,0 +1,5 @@
+export default (function (o, c) {
+ c.prototype.isSameOrAfter = function (that, units) {
+ return this.isSame(that, units) || this.isAfter(that, units);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrBefore/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrBefore/index.d.ts
new file mode 100644
index 0000000..c0a6c94
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrBefore/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ isSameOrBefore(date: ConfigType, unit?: OpUnitType): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrBefore/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrBefore/index.js
new file mode 100644
index 0000000..18d526a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isSameOrBefore/index.js
@@ -0,0 +1,5 @@
+export default (function (o, c) {
+ c.prototype.isSameOrBefore = function (that, units) {
+ return this.isSame(that, units) || this.isBefore(that, units);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isToday/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isToday/index.d.ts
new file mode 100644
index 0000000..8d55da8
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isToday/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ isToday(): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isToday/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isToday/index.js
new file mode 100644
index 0000000..93b36c8
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isToday/index.js
@@ -0,0 +1,9 @@
+export default (function (o, c, d) {
+ var proto = c.prototype;
+
+ proto.isToday = function () {
+ var comparisonTemplate = 'YYYY-MM-DD';
+ var now = d();
+ return this.format(comparisonTemplate) === now.format(comparisonTemplate);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isTomorrow/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isTomorrow/index.d.ts
new file mode 100644
index 0000000..7652237
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isTomorrow/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ isTomorrow(): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isTomorrow/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isTomorrow/index.js
new file mode 100644
index 0000000..8cc7238
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isTomorrow/index.js
@@ -0,0 +1,9 @@
+export default (function (o, c, d) {
+ var proto = c.prototype;
+
+ proto.isTomorrow = function () {
+ var comparisonTemplate = 'YYYY-MM-DD';
+ var tomorrow = d().add(1, 'day');
+ return this.format(comparisonTemplate) === tomorrow.format(comparisonTemplate);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isYesterday/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isYesterday/index.d.ts
new file mode 100644
index 0000000..f4370dc
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isYesterday/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ isYesterday(): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isYesterday/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isYesterday/index.js
new file mode 100644
index 0000000..fa55373
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isYesterday/index.js
@@ -0,0 +1,9 @@
+export default (function (o, c, d) {
+ var proto = c.prototype;
+
+ proto.isYesterday = function () {
+ var comparisonTemplate = 'YYYY-MM-DD';
+ var yesterday = d().subtract(1, 'day');
+ return this.format(comparisonTemplate) === yesterday.format(comparisonTemplate);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeek/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeek/index.d.ts
new file mode 100644
index 0000000..263de2e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeek/index.d.ts
@@ -0,0 +1,27 @@
+import { PluginFunc, UnitType, ConfigType } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+type ISOUnitType = UnitType | 'isoWeek';
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ isoWeekYear(): number
+ isoWeek(): number
+ isoWeek(value: number): Dayjs
+
+ isoWeekday(): number
+ isoWeekday(value: number): Dayjs
+
+ startOf(unit: ISOUnitType): Dayjs
+
+ endOf(unit: ISOUnitType): Dayjs
+
+ isSame(date: ConfigType, unit?: ISOUnitType): boolean
+
+ isBefore(date: ConfigType, unit?: ISOUnitType): boolean
+
+ isAfter(date: ConfigType, unit?: ISOUnitType): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeek/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeek/index.js
new file mode 100644
index 0000000..289ea7c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeek/index.js
@@ -0,0 +1,57 @@
+import { D, W, Y } from '../../constant';
+var isoWeekPrettyUnit = 'isoweek';
+export default (function (o, c, d) {
+ var getYearFirstThursday = function getYearFirstThursday(year, isUtc) {
+ var yearFirstDay = (isUtc ? d.utc : d)().year(year).startOf(Y);
+ var addDiffDays = 4 - yearFirstDay.isoWeekday();
+
+ if (yearFirstDay.isoWeekday() > 4) {
+ addDiffDays += 7;
+ }
+
+ return yearFirstDay.add(addDiffDays, D);
+ };
+
+ var getCurrentWeekThursday = function getCurrentWeekThursday(ins) {
+ return ins.add(4 - ins.isoWeekday(), D);
+ };
+
+ var proto = c.prototype;
+
+ proto.isoWeekYear = function () {
+ var nowWeekThursday = getCurrentWeekThursday(this);
+ return nowWeekThursday.year();
+ };
+
+ proto.isoWeek = function (week) {
+ if (!this.$utils().u(week)) {
+ return this.add((week - this.isoWeek()) * 7, D);
+ }
+
+ var nowWeekThursday = getCurrentWeekThursday(this);
+ var diffWeekThursday = getYearFirstThursday(this.isoWeekYear(), this.$u);
+ return nowWeekThursday.diff(diffWeekThursday, W) + 1;
+ };
+
+ proto.isoWeekday = function (week) {
+ if (!this.$utils().u(week)) {
+ return this.day(this.day() % 7 ? week : week - 7);
+ }
+
+ return this.day() || 7;
+ };
+
+ var oldStartOf = proto.startOf;
+
+ proto.startOf = function (units, startOf) {
+ var utils = this.$utils();
+ var isStartOf = !utils.u(startOf) ? startOf : true;
+ var unit = utils.p(units);
+
+ if (unit === isoWeekPrettyUnit) {
+ return isStartOf ? this.date(this.date() - (this.isoWeekday() - 1)).startOf('day') : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf('day');
+ }
+
+ return oldStartOf.bind(this)(units, startOf);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.d.ts
new file mode 100644
index 0000000..986360f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ isoWeeksInYear(): number
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.js
new file mode 100644
index 0000000..7161894
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.js
@@ -0,0 +1,15 @@
+export default (function (o, c) {
+ var proto = c.prototype;
+
+ proto.isoWeeksInYear = function () {
+ var isLeapYear = this.isLeapYear();
+ var last = this.endOf('y');
+ var day = last.day();
+
+ if (day === 4 || isLeapYear && day === 5) {
+ return 53;
+ }
+
+ return 52;
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localeData/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localeData/index.d.ts
new file mode 100644
index 0000000..bd4e211
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localeData/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ localeData(): any
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localeData/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localeData/index.js
new file mode 100644
index 0000000..0452172
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localeData/index.js
@@ -0,0 +1,102 @@
+export default (function (o, c, dayjs) {
+ // locale needed later
+ var proto = c.prototype;
+
+ var getLocalePart = function getLocalePart(part) {
+ return part && (part.indexOf ? part : part.s);
+ };
+
+ var getShort = function getShort(ins, target, full, num, localeOrder) {
+ var locale = ins.name ? ins : ins.$locale();
+ var targetLocale = getLocalePart(locale[target]);
+ var fullLocale = getLocalePart(locale[full]);
+ var result = targetLocale || fullLocale.map(function (f) {
+ return f.substr(0, num);
+ });
+ if (!localeOrder) return result;
+ var weekStart = locale.weekStart;
+ return result.map(function (_, index) {
+ return result[(index + (weekStart || 0)) % 7];
+ });
+ };
+
+ var getDayjsLocaleObject = function getDayjsLocaleObject() {
+ return dayjs.Ls[dayjs.locale()];
+ };
+
+ var localeData = function localeData() {
+ var _this = this;
+
+ return {
+ months: function months(instance) {
+ return instance ? instance.format('MMMM') : getShort(_this, 'months');
+ },
+ monthsShort: function monthsShort(instance) {
+ return instance ? instance.format('MMM') : getShort(_this, 'monthsShort', 'months', 3);
+ },
+ firstDayOfWeek: function firstDayOfWeek() {
+ return _this.$locale().weekStart || 0;
+ },
+ weekdays: function weekdays(instance) {
+ return instance ? instance.format('dddd') : getShort(_this, 'weekdays');
+ },
+ weekdaysMin: function weekdaysMin(instance) {
+ return instance ? instance.format('dd') : getShort(_this, 'weekdaysMin', 'weekdays', 2);
+ },
+ weekdaysShort: function weekdaysShort(instance) {
+ return instance ? instance.format('ddd') : getShort(_this, 'weekdaysShort', 'weekdays', 3);
+ },
+ longDateFormat: function longDateFormat(format) {
+ return _this.$locale().formats[format];
+ }
+ };
+ };
+
+ proto.localeData = function () {
+ return localeData.bind(this)();
+ };
+
+ dayjs.localeData = function () {
+ var localeObject = getDayjsLocaleObject();
+ return {
+ firstDayOfWeek: function firstDayOfWeek() {
+ return localeObject.weekStart || 0;
+ },
+ weekdays: function weekdays() {
+ return dayjs.weekdays();
+ },
+ weekdaysShort: function weekdaysShort() {
+ return dayjs.weekdaysShort();
+ },
+ weekdaysMin: function weekdaysMin() {
+ return dayjs.weekdaysMin();
+ },
+ months: function months() {
+ return dayjs.months();
+ },
+ monthsShort: function monthsShort() {
+ return dayjs.monthsShort();
+ }
+ };
+ };
+
+ dayjs.months = function () {
+ return getShort(getDayjsLocaleObject(), 'months');
+ };
+
+ dayjs.monthsShort = function () {
+ return getShort(getDayjsLocaleObject(), 'monthsShort', 'months', 3);
+ };
+
+ dayjs.weekdays = function (localeOrder) {
+ return getShort(getDayjsLocaleObject(), 'weekdays', null, null, localeOrder);
+ };
+
+ dayjs.weekdaysShort = function (localeOrder) {
+ return getShort(getDayjsLocaleObject(), 'weekdaysShort', 'weekdays', 3, localeOrder);
+ };
+
+ dayjs.weekdaysMin = function (localeOrder) {
+ return getShort(getDayjsLocaleObject(), 'weekdaysMin', 'weekdays', 2, localeOrder);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localizedFormat/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localizedFormat/index.d.ts
new file mode 100644
index 0000000..a17c896
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localizedFormat/index.d.ts
@@ -0,0 +1,4 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localizedFormat/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localizedFormat/index.js
new file mode 100644
index 0000000..7a966ac
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/localizedFormat/index.js
@@ -0,0 +1,36 @@
+import { FORMAT_DEFAULT } from '../../constant';
+export default (function (o, c, d) {
+ var proto = c.prototype;
+ var oldFormat = proto.format;
+ var englishFormats = {
+ LTS: 'h:mm:ss A',
+ LT: 'h:mm A',
+ L: 'MM/DD/YYYY',
+ LL: 'MMMM D, YYYY',
+ LLL: 'MMMM D, YYYY h:mm A',
+ LLLL: 'dddd, MMMM D, YYYY h:mm A'
+ };
+ d.en.formats = englishFormats;
+
+ var t = function t(format) {
+ return format.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (_, a, b) {
+ return a || b.slice(1);
+ });
+ };
+
+ proto.format = function (formatStr) {
+ if (formatStr === void 0) {
+ formatStr = FORMAT_DEFAULT;
+ }
+
+ var _this$$locale = this.$locale(),
+ _this$$locale$formats = _this$$locale.formats,
+ formats = _this$$locale$formats === void 0 ? {} : _this$$locale$formats;
+
+ var result = formatStr.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (_, a, b) {
+ var B = b && b.toUpperCase();
+ return a || formats[b] || englishFormats[b] || t(formats[B]);
+ });
+ return oldFormat.call(this, result);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/minMax/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/minMax/index.d.ts
new file mode 100644
index 0000000..b2b2712
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/minMax/index.d.ts
@@ -0,0 +1,11 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ export function max(dayjs: Dayjs[]): Dayjs
+ export function max(...dayjs: Dayjs[]): Dayjs
+ export function min(dayjs: Dayjs[]): Dayjs
+ export function min(...dayjs: Dayjs[]): Dayjs
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/minMax/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/minMax/index.js
new file mode 100644
index 0000000..0fc6c08
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/minMax/index.js
@@ -0,0 +1,36 @@
+export default (function (o, c, d) {
+ var sortBy = function sortBy(method, dates) {
+ if (!dates.length) {
+ return d();
+ }
+
+ if (dates.length === 1 && dates[0].length > 0) {
+ var _dates = dates;
+ dates = _dates[0];
+ }
+
+ var result;
+ var _dates2 = dates;
+ result = _dates2[0];
+
+ for (var i = 1; i < dates.length; i += 1) {
+ if (!dates[i].isValid() || dates[i][method](result)) {
+ result = dates[i];
+ }
+ }
+
+ return result;
+ };
+
+ d.max = function () {
+ var args = [].slice.call(arguments, 0); // eslint-disable-line prefer-rest-params
+
+ return sortBy('isAfter', args);
+ };
+
+ d.min = function () {
+ var args = [].slice.call(arguments, 0); // eslint-disable-line prefer-rest-params
+
+ return sortBy('isBefore', args);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/objectSupport/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/objectSupport/index.d.ts
new file mode 100644
index 0000000..de0a4a6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/objectSupport/index.d.ts
@@ -0,0 +1,12 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ set(argument: object): Dayjs
+ add(argument: object): Dayjs
+ subtract(argument: object): Dayjs
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/objectSupport/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/objectSupport/index.js
new file mode 100644
index 0000000..61e6487
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/objectSupport/index.js
@@ -0,0 +1,81 @@
+export default (function (o, c) {
+ var proto = c.prototype;
+
+ var isObject = function isObject(obj) {
+ return !(obj instanceof Date) && !(obj instanceof Array) && obj instanceof Object;
+ };
+
+ var prettyUnit = function prettyUnit(u) {
+ var unit = proto.$utils().p(u);
+ return unit === 'date' ? 'day' : unit;
+ };
+
+ var parseDate = function parseDate(cfg) {
+ var date = cfg.date,
+ utc = cfg.utc;
+ var $d = {};
+
+ if (isObject(date)) {
+ Object.keys(date).forEach(function (k) {
+ $d[prettyUnit(k)] = date[k];
+ });
+ var y = $d.year || 1970;
+ var M = $d.month - 1 || 0;
+ var d = $d.day || 1;
+ var h = $d.hour || 0;
+ var m = $d.minute || 0;
+ var s = $d.second || 0;
+ var ms = $d.millisecond || 0;
+
+ if (utc) {
+ return new Date(Date.UTC(y, M, d, h, m, s, ms));
+ }
+
+ return new Date(y, M, d, h, m, s, ms);
+ }
+
+ return date;
+ };
+
+ var oldParse = proto.parse;
+
+ proto.parse = function (cfg) {
+ cfg.date = parseDate.bind(this)(cfg);
+ oldParse.bind(this)(cfg);
+ };
+
+ var oldSet = proto.set;
+ var oldAdd = proto.add;
+
+ var callObject = function callObject(call, argument, string, offset) {
+ if (offset === void 0) {
+ offset = 1;
+ }
+
+ if (argument instanceof Object) {
+ var keys = Object.keys(argument);
+ var chain = this;
+ keys.forEach(function (key) {
+ chain = call.bind(chain)(argument[key] * offset, key);
+ });
+ return chain;
+ }
+
+ return call.bind(this)(argument * offset, string);
+ };
+
+ proto.set = function (string, _int) {
+ _int = _int === undefined ? string : _int;
+ return callObject.bind(this)(function (i, s) {
+ return oldSet.bind(this)(s, i);
+ }, _int, string);
+ };
+
+ proto.add = function (number, string) {
+ return callObject.bind(this)(oldAdd, number, string);
+ };
+
+ proto.subtract = function (number, string) {
+ return callObject.bind(this)(oldAdd, number, string, -1);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/pluralGetSet/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/pluralGetSet/index.d.ts
new file mode 100644
index 0000000..7ef7167
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/pluralGetSet/index.d.ts
@@ -0,0 +1,44 @@
+import { PluginFunc, UnitType, ConfigType } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ years(): number
+
+ years(value: number): Dayjs
+
+ months(): number
+
+ months(value: number): Dayjs
+
+ dates(): number
+
+ dates(value: number): Dayjs
+
+ weeks(): number
+
+ weeks(value: number): Dayjs
+
+ days(): number
+
+ days(value: number): Dayjs
+
+ hours(): number
+
+ hours(value: number): Dayjs
+
+ minutes(): number
+
+ minutes(value: number): Dayjs
+
+ seconds(): number
+
+ seconds(value: number): Dayjs
+
+ milliseconds(): number
+
+ milliseconds(value: number): Dayjs
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/pluralGetSet/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/pluralGetSet/index.js
new file mode 100644
index 0000000..d8214d6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/pluralGetSet/index.js
@@ -0,0 +1,7 @@
+export default (function (o, c) {
+ var proto = c.prototype;
+ var pluralAliases = ['milliseconds', 'seconds', 'minutes', 'hours', 'days', 'weeks', 'isoWeeks', 'months', 'quarters', 'years', 'dates'];
+ pluralAliases.forEach(function (alias) {
+ proto[alias] = proto[alias.replace(/s$/, '')];
+ });
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/quarterOfYear/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/quarterOfYear/index.d.ts
new file mode 100644
index 0000000..2148471
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/quarterOfYear/index.d.ts
@@ -0,0 +1,26 @@
+import { PluginFunc, ConfigType, QUnitType } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ quarter(): number
+
+ quarter(quarter: number): Dayjs
+
+ add(value: number, unit: QUnitType): Dayjs
+
+ subtract(value: number, unit: QUnitType): Dayjs
+
+ startOf(unit: QUnitType): Dayjs
+
+ endOf(unit: QUnitType): Dayjs
+
+ isSame(date: ConfigType, unit?: QUnitType): boolean
+
+ isBefore(date: ConfigType, unit?: QUnitType): boolean
+
+ isAfter(date: ConfigType, unit?: QUnitType): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/quarterOfYear/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/quarterOfYear/index.js
new file mode 100644
index 0000000..e376889
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/quarterOfYear/index.js
@@ -0,0 +1,41 @@
+import { Q, M, D } from '../../constant';
+export default (function (o, c) {
+ var proto = c.prototype;
+
+ proto.quarter = function (quarter) {
+ if (!this.$utils().u(quarter)) {
+ return this.month(this.month() % 3 + (quarter - 1) * 3);
+ }
+
+ return Math.ceil((this.month() + 1) / 3);
+ };
+
+ var oldAdd = proto.add;
+
+ proto.add = function (number, units) {
+ number = Number(number); // eslint-disable-line no-param-reassign
+
+ var unit = this.$utils().p(units);
+
+ if (unit === Q) {
+ return this.add(number * 3, M);
+ }
+
+ return oldAdd.bind(this)(number, units);
+ };
+
+ var oldStartOf = proto.startOf;
+
+ proto.startOf = function (units, startOf) {
+ var utils = this.$utils();
+ var isStartOf = !utils.u(startOf) ? startOf : true;
+ var unit = utils.p(units);
+
+ if (unit === Q) {
+ var quarter = this.quarter() - 1;
+ return isStartOf ? this.month(quarter * 3).startOf(M).startOf(D) : this.month(quarter * 3 + 2).endOf(M).endOf(D);
+ }
+
+ return oldStartOf.bind(this)(units, startOf);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/relativeTime/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/relativeTime/index.d.ts
new file mode 100644
index 0000000..e1b17cf
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/relativeTime/index.d.ts
@@ -0,0 +1,24 @@
+import { PluginFunc, ConfigType } from 'dayjs/esm'
+
+declare interface RelativeTimeThreshold {
+ l: string
+ r?: number
+ d?: string
+}
+
+declare interface RelativeTimeOptions {
+ rounding?: (num: number) => number
+ thresholds?: RelativeTimeThreshold[]
+}
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ fromNow(withoutSuffix?: boolean): string
+ from(compared: ConfigType, withoutSuffix?: boolean): string
+ toNow(withoutSuffix?: boolean): string
+ to(compared: ConfigType, withoutSuffix?: boolean): string
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/relativeTime/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/relativeTime/index.js
new file mode 100644
index 0000000..68ed430
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/relativeTime/index.js
@@ -0,0 +1,116 @@
+import * as C from '../../constant';
+export default (function (o, c, d) {
+ o = o || {};
+ var proto = c.prototype;
+ var relObj = {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ };
+ d.en.relativeTime = relObj;
+
+ var fromTo = function fromTo(input, withoutSuffix, instance, isFrom) {
+ var loc = instance.$locale().relativeTime || relObj;
+ var T = o.thresholds || [{
+ l: 's',
+ r: 44,
+ d: C.S
+ }, {
+ l: 'm',
+ r: 89
+ }, {
+ l: 'mm',
+ r: 44,
+ d: C.MIN
+ }, {
+ l: 'h',
+ r: 89
+ }, {
+ l: 'hh',
+ r: 21,
+ d: C.H
+ }, {
+ l: 'd',
+ r: 35
+ }, {
+ l: 'dd',
+ r: 25,
+ d: C.D
+ }, {
+ l: 'M',
+ r: 45
+ }, {
+ l: 'MM',
+ r: 10,
+ d: C.M
+ }, {
+ l: 'y',
+ r: 17
+ }, {
+ l: 'yy',
+ d: C.Y
+ }];
+ var Tl = T.length;
+ var result;
+ var out;
+ var isFuture;
+
+ for (var i = 0; i < Tl; i += 1) {
+ var t = T[i];
+
+ if (t.d) {
+ result = isFrom ? d(input).diff(instance, t.d, true) : instance.diff(input, t.d, true);
+ }
+
+ var abs = (o.rounding || Math.round)(Math.abs(result));
+ isFuture = result > 0;
+
+ if (abs <= t.r || !t.r) {
+ if (abs <= 1 && i > 0) t = T[i - 1]; // 1 minutes -> a minute, 0 seconds -> 0 second
+
+ var format = loc[t.l];
+
+ if (typeof format === 'string') {
+ out = format.replace('%d', abs);
+ } else {
+ out = format(abs, withoutSuffix, t.l, isFuture);
+ }
+
+ break;
+ }
+ }
+
+ if (withoutSuffix) return out;
+ return (isFuture ? loc.future : loc.past).replace('%s', out);
+ };
+
+ proto.to = function (input, withoutSuffix) {
+ return fromTo(input, withoutSuffix, this, true);
+ };
+
+ proto.from = function (input, withoutSuffix) {
+ return fromTo(input, withoutSuffix, this);
+ };
+
+ var makeNow = function makeNow(thisDay) {
+ return thisDay.$u ? d.utc() : d();
+ };
+
+ proto.toNow = function (withoutSuffix) {
+ return this.to(makeNow(this), withoutSuffix);
+ };
+
+ proto.fromNow = function (withoutSuffix) {
+ return this.from(makeNow(this), withoutSuffix);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/timezone/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/timezone/index.d.ts
new file mode 100644
index 0000000..b2eb235
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/timezone/index.d.ts
@@ -0,0 +1,17 @@
+import { PluginFunc, ConfigType } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ tz(timezone: string): Dayjs
+ }
+
+ interface DayjsTimezone {
+ (date: ConfigType, timezone: string): Dayjs
+ guess(): string
+ }
+
+ const tz: DayjsTimezone
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/timezone/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/timezone/index.js
new file mode 100644
index 0000000..b5e6491
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/timezone/index.js
@@ -0,0 +1,123 @@
+var typeToPos = {
+ year: 0,
+ month: 1,
+ day: 2,
+ hour: 3,
+ minute: 4,
+ second: 5
+};
+var ms = 'ms';
+export default (function (o, c, d) {
+ var defaultTimezone;
+ var localUtcOffset = d().utcOffset();
+
+ var tzOffset = function tzOffset(timestamp, timezone) {
+ var date = new Date(timestamp);
+ var dtf = new Intl.DateTimeFormat('en-US', {
+ hour12: false,
+ timeZone: timezone,
+ year: 'numeric',
+ month: '2-digit',
+ day: '2-digit',
+ hour: '2-digit',
+ minute: '2-digit',
+ second: '2-digit'
+ });
+ var formatResult = dtf.formatToParts(date);
+ var filled = [];
+
+ for (var i = 0; i < formatResult.length; i += 1) {
+ var _formatResult$i = formatResult[i],
+ type = _formatResult$i.type,
+ value = _formatResult$i.value;
+ var pos = typeToPos[type];
+
+ if (pos >= 0) {
+ filled[pos] = parseInt(value, 10);
+ }
+ } // Workaround for the same behavior in different node version
+ // https://github.com/nodejs/node/issues/33027
+
+
+ var hour = filled[3];
+ var fixedHour = hour === 24 ? 0 : hour;
+ var utcString = filled[0] + "-" + filled[1] + "-" + filled[2] + " " + fixedHour + ":" + filled[4] + ":" + filled[5] + ":000";
+ var utcTs = d.utc(utcString).valueOf();
+ var asTS = +date;
+ var over = asTS % 1000;
+ asTS -= over;
+ return (utcTs - asTS) / (60 * 1000);
+ }; // find the right offset a given local time. The o input is our guess, which determines which
+ // offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)
+ // https://github.com/moment/luxon/blob/master/src/datetime.js#L76
+
+
+ var fixOffset = function fixOffset(localTS, o0, tz) {
+ // Our UTC time is just a guess because our offset is just a guess
+ var utcGuess = localTS - o0 * 60 * 1000; // Test whether the zone matches the offset for this ts
+
+ var o2 = tzOffset(utcGuess, tz); // If so, offset didn't change and we're done
+
+ if (o0 === o2) {
+ return [utcGuess, o0];
+ } // If not, change the ts by the difference in the offset
+
+
+ utcGuess -= (o2 - o0) * 60 * 1000; // If that gives us the local time we want, we're done
+
+ var o3 = tzOffset(utcGuess, tz);
+
+ if (o2 === o3) {
+ return [utcGuess, o2];
+ } // If it's different, we're in a hole time.
+ // The offset has changed, but the we don't adjust the time
+
+
+ return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];
+ };
+
+ var proto = c.prototype;
+
+ proto.tz = function (timezone) {
+ if (timezone === void 0) {
+ timezone = defaultTimezone;
+ }
+
+ var target = this.toDate().toLocaleString('en-US', {
+ timeZone: timezone
+ });
+ var diff = Math.round((this.toDate() - new Date(target)) / 1000 / 60);
+ return d(target).utcOffset(localUtcOffset - diff, true).$set(ms, this.$ms);
+ };
+
+ d.tz = function (input, timezone) {
+ if (timezone === void 0) {
+ timezone = defaultTimezone;
+ }
+
+ var previousOffset = tzOffset(+d(), timezone);
+ var localTs;
+
+ if (typeof input !== 'string') {
+ // timestamp number || js Date || Day.js
+ localTs = d(input) + previousOffset * 60 * 1000;
+ }
+
+ localTs = localTs || d.utc(input).valueOf();
+
+ var _fixOffset = fixOffset(localTs, previousOffset, timezone),
+ targetTs = _fixOffset[0],
+ targetOffset = _fixOffset[1];
+
+ var ins = d(targetTs).utcOffset(targetOffset);
+ return ins;
+ };
+
+ d.tz.guess = function () {
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
+ };
+
+ d.tz.setDefault = function (timezone) {
+ defaultTimezone = timezone;
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toArray/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toArray/index.d.ts
new file mode 100644
index 0000000..5033831
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toArray/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ toArray(): number[]
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toArray/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toArray/index.js
new file mode 100644
index 0000000..2b795f4
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toArray/index.js
@@ -0,0 +1,7 @@
+export default (function (o, c) {
+ var proto = c.prototype;
+
+ proto.toArray = function () {
+ return [this.$y, this.$M, this.$D, this.$H, this.$m, this.$s, this.$ms];
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toObject/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toObject/index.d.ts
new file mode 100644
index 0000000..ad21520
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toObject/index.d.ts
@@ -0,0 +1,20 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+interface DayjsObject {
+ years: number
+ months: number
+ date: number
+ hours: number
+ minutes: number
+ seconds: number
+ milliseconds: number
+}
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ toObject(): DayjsObject
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toObject/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toObject/index.js
new file mode 100644
index 0000000..e35d93f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/toObject/index.js
@@ -0,0 +1,15 @@
+export default (function (o, c) {
+ var proto = c.prototype;
+
+ proto.toObject = function () {
+ return {
+ years: this.$y,
+ months: this.$M,
+ date: this.$D,
+ hours: this.$H,
+ minutes: this.$m,
+ seconds: this.$s,
+ milliseconds: this.$ms
+ };
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/updateLocale/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/updateLocale/index.d.ts
new file mode 100644
index 0000000..a8578f4
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/updateLocale/index.d.ts
@@ -0,0 +1,8 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ export function updateLocale(localeName: String, customConfig: Object): any
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/updateLocale/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/updateLocale/index.js
new file mode 100644
index 0000000..1b9965c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/updateLocale/index.js
@@ -0,0 +1,12 @@
+export default (function (option, Dayjs, dayjs) {
+ dayjs.updateLocale = function (locale, customConfig) {
+ var localeList = dayjs.Ls;
+ var localeConfig = localeList[locale];
+ if (!localeConfig) return;
+ var customConfigKeys = customConfig ? Object.keys(customConfig) : [];
+ customConfigKeys.forEach(function (c) {
+ localeConfig[c] = customConfig[c];
+ });
+ return localeConfig; // eslint-disable-line consistent-return
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/utc/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/utc/index.d.ts
new file mode 100644
index 0000000..38f9870
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/utc/index.d.ts
@@ -0,0 +1,19 @@
+import { PluginFunc, ConfigType } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+
+ utc(): Dayjs
+
+ local(): Dayjs
+
+ isUTC(): boolean
+
+ utcOffset(offset: number, keepLocalTime?: boolean): Dayjs
+ }
+
+ export function utc(config?: ConfigType, format?: string): Dayjs
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/utc/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/utc/index.js
new file mode 100644
index 0000000..5122a9c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/utc/index.js
@@ -0,0 +1,141 @@
+import { MILLISECONDS_A_MINUTE, MIN } from '../../constant';
+export default (function (option, Dayjs, dayjs) {
+ var localOffset = new Date().getTimezoneOffset();
+ var proto = Dayjs.prototype;
+
+ dayjs.utc = function (date) {
+ var cfg = {
+ date: date,
+ utc: true,
+ args: arguments
+ }; // eslint-disable-line prefer-rest-params
+
+ return new Dayjs(cfg); // eslint-disable-line no-use-before-define
+ };
+
+ proto.utc = function () {
+ return dayjs(this.toDate(), {
+ locale: this.$L,
+ utc: true
+ });
+ };
+
+ proto.local = function () {
+ return dayjs(this.toDate(), {
+ locale: this.$L,
+ utc: false
+ });
+ };
+
+ var oldParse = proto.parse;
+
+ proto.parse = function (cfg) {
+ if (cfg.utc) {
+ this.$u = true;
+ }
+
+ if (!this.$utils().u(cfg.$offset)) {
+ this.$offset = cfg.$offset;
+ }
+
+ oldParse.call(this, cfg);
+ };
+
+ var oldInit = proto.init;
+
+ proto.init = function () {
+ if (this.$u) {
+ var $d = this.$d;
+ this.$y = $d.getUTCFullYear();
+ this.$M = $d.getUTCMonth();
+ this.$D = $d.getUTCDate();
+ this.$W = $d.getUTCDay();
+ this.$H = $d.getUTCHours();
+ this.$m = $d.getUTCMinutes();
+ this.$s = $d.getUTCSeconds();
+ this.$ms = $d.getUTCMilliseconds();
+ } else {
+ oldInit.call(this);
+ }
+ };
+
+ var oldUtcOffset = proto.utcOffset;
+
+ proto.utcOffset = function (input, keepLocalTime) {
+ var _this$$utils = this.$utils(),
+ u = _this$$utils.u;
+
+ if (u(input)) {
+ if (this.$u) {
+ return 0;
+ }
+
+ if (!u(this.$offset)) {
+ return this.$offset;
+ }
+
+ return oldUtcOffset.call(this);
+ }
+
+ var offset = Math.abs(input) <= 16 ? input * 60 : input;
+ var ins = this;
+
+ if (keepLocalTime) {
+ ins.$offset = offset;
+ ins.$u = input === 0;
+ return ins;
+ }
+
+ if (input !== 0) {
+ ins = this.local().add(offset + localOffset, MIN);
+ ins.$offset = offset;
+ } else {
+ ins = this.utc();
+ }
+
+ return ins;
+ };
+
+ var oldFormat = proto.format;
+ var UTC_FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ss[Z]';
+
+ proto.format = function (formatStr) {
+ var str = formatStr || (this.$u ? UTC_FORMAT_DEFAULT : '');
+ return oldFormat.call(this, str);
+ };
+
+ proto.valueOf = function () {
+ var addedOffset = !this.$utils().u(this.$offset) ? this.$offset + localOffset : 0;
+ return this.$d.valueOf() - addedOffset * MILLISECONDS_A_MINUTE;
+ };
+
+ proto.isUTC = function () {
+ return !!this.$u;
+ };
+
+ proto.toISOString = function () {
+ return this.toDate().toISOString();
+ };
+
+ proto.toString = function () {
+ return this.toDate().toUTCString();
+ };
+
+ var oldToDate = proto.toDate;
+
+ proto.toDate = function (type) {
+ if (type === 's' && this.$offset) {
+ return dayjs(this.format('YYYY-MM-DD HH:mm:ss:SSS')).toDate();
+ }
+
+ return oldToDate.call(this);
+ };
+
+ var oldDiff = proto.diff;
+
+ proto.diff = function (input, units, _float) {
+ var localThis = this.local();
+ var localInput = dayjs(input).local();
+ return oldDiff.call(localThis, localInput, units, _float);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekOfYear/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekOfYear/index.d.ts
new file mode 100644
index 0000000..340051b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekOfYear/index.d.ts
@@ -0,0 +1,12 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ week(): number
+
+ week(value : number): Dayjs
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekOfYear/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekOfYear/index.js
new file mode 100644
index 0000000..c92406e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekOfYear/index.js
@@ -0,0 +1,44 @@
+import { MS, Y, D, W } from '../../constant';
+export default (function (o, c, d) {
+ var proto = c.prototype;
+
+ proto.week = function (week) {
+ if (week === void 0) {
+ week = null;
+ }
+
+ if (week !== null) {
+ return this.add((week - this.week()) * 7, D);
+ }
+
+ var yearStart = this.$locale().yearStart || 1;
+
+ if (this.month() === 11 && this.date() > 25) {
+ // d(this) is for badMutable
+ var nextYearStartDay = d(this).startOf(Y).add(1, Y).date(yearStart);
+ var thisEndOfWeek = d(this).endOf(W);
+
+ if (nextYearStartDay.isBefore(thisEndOfWeek)) {
+ return 1;
+ }
+ }
+
+ var yearStartDay = d(this).startOf(Y).date(yearStart);
+ var yearStartWeek = yearStartDay.startOf(W).subtract(1, MS);
+ var diffInWeek = this.diff(yearStartWeek, W, true);
+
+ if (diffInWeek < 0) {
+ return d(this).startOf('week').week();
+ }
+
+ return Math.ceil(diffInWeek);
+ };
+
+ proto.weeks = function (week) {
+ if (week === void 0) {
+ week = null;
+ }
+
+ return this.week(week);
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekYear/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekYear/index.d.ts
new file mode 100644
index 0000000..5b713e5
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekYear/index.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ weekYear(): number
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekYear/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekYear/index.js
new file mode 100644
index 0000000..676f56f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekYear/index.js
@@ -0,0 +1,15 @@
+export default (function (o, c) {
+ var proto = c.prototype;
+
+ proto.weekYear = function () {
+ var month = this.month();
+ var weekOfYear = this.week();
+ var year = this.year();
+
+ if (weekOfYear === 1 && month === 11) {
+ return year + 1;
+ }
+
+ return year;
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekday/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekday/index.d.ts
new file mode 100644
index 0000000..41945e7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekday/index.d.ts
@@ -0,0 +1,12 @@
+import { PluginFunc } from 'dayjs/esm'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs/esm' {
+ interface Dayjs {
+ weekday(): number
+
+ weekday(value: number): Dayjs
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekday/index.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekday/index.js
new file mode 100644
index 0000000..18032b3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/plugin/weekday/index.js
@@ -0,0 +1,15 @@
+export default (function (o, c) {
+ var proto = c.prototype;
+
+ proto.weekday = function (input) {
+ var weekStart = this.$locale().weekStart || 0;
+ var $W = this.$W;
+ var weekday = ($W < weekStart ? $W + 7 : $W) - weekStart;
+
+ if (this.$utils().u(input)) {
+ return weekday;
+ }
+
+ return this.subtract(weekday, 'day').add(input, 'day');
+ };
+});
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/esm/utils.js b/node_modules/@pm2/agent/node_modules/dayjs/esm/utils.js
new file mode 100644
index 0000000..b5a8131
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/esm/utils.js
@@ -0,0 +1,58 @@
+import * as C from './constant';
+
+var padStart = function padStart(string, length, pad) {
+ var s = String(string);
+ if (!s || s.length >= length) return string;
+ return "" + Array(length + 1 - s.length).join(pad) + string;
+};
+
+var padZoneStr = function padZoneStr(instance) {
+ var negMinutes = -instance.utcOffset();
+ var minutes = Math.abs(negMinutes);
+ var hourOffset = Math.floor(minutes / 60);
+ var minuteOffset = minutes % 60;
+ return "" + (negMinutes <= 0 ? '+' : '-') + padStart(hourOffset, 2, '0') + ":" + padStart(minuteOffset, 2, '0');
+};
+
+var monthDiff = function monthDiff(a, b) {
+ // function from moment.js in order to keep the same result
+ if (a.date() < b.date()) return -monthDiff(b, a);
+ var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month());
+ var anchor = a.clone().add(wholeMonthDiff, C.M);
+ var c = b - anchor < 0;
+ var anchor2 = a.clone().add(wholeMonthDiff + (c ? -1 : 1), C.M);
+ return +(-(wholeMonthDiff + (b - anchor) / (c ? anchor - anchor2 : anchor2 - anchor)) || 0);
+};
+
+var absFloor = function absFloor(n) {
+ return n < 0 ? Math.ceil(n) || 0 : Math.floor(n);
+};
+
+var prettyUnit = function prettyUnit(u) {
+ var special = {
+ M: C.M,
+ y: C.Y,
+ w: C.W,
+ d: C.D,
+ D: C.DATE,
+ h: C.H,
+ m: C.MIN,
+ s: C.S,
+ ms: C.MS,
+ Q: C.Q
+ };
+ return special[u] || String(u || '').toLowerCase().replace(/s$/, '');
+};
+
+var isUndefined = function isUndefined(s) {
+ return s === undefined;
+};
+
+export default {
+ s: padStart,
+ z: padZoneStr,
+ m: monthDiff,
+ a: absFloor,
+ p: prettyUnit,
+ u: isUndefined
+};
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/index.d.ts
new file mode 100644
index 0000000..3d31810
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/index.d.ts
@@ -0,0 +1,115 @@
+///
+
+export = dayjs;
+
+declare function dayjs (date?: dayjs.ConfigType): dayjs.Dayjs
+
+declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs
+
+declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs
+
+declare namespace dayjs {
+ export type ConfigType = string | number | Date | Dayjs
+
+ export type OptionType = { locale?: string, format?: string, utc?: boolean } | string | string[]
+
+ type UnitTypeShort = 'd' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms'
+ export type UnitType = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date' | UnitTypeShort;
+
+ export type OpUnitType = UnitType | "week" | 'w';
+ export type QUnitType = UnitType | "quarter" | 'Q';
+
+ class Dayjs {
+ constructor (config?: ConfigType)
+
+ clone(): Dayjs
+
+ isValid(): boolean
+
+ year(): number
+
+ year(value: number): Dayjs
+
+ month(): number
+
+ month(value: number): Dayjs
+
+ date(): number
+
+ date(value: number): Dayjs
+
+ day(): number
+
+ day(value: number): Dayjs
+
+ hour(): number
+
+ hour(value: number): Dayjs
+
+ minute(): number
+
+ minute(value: number): Dayjs
+
+ second(): number
+
+ second(value: number): Dayjs
+
+ millisecond(): number
+
+ millisecond(value: number): Dayjs
+
+ set(unit: UnitType, value: number): Dayjs
+
+ get(unit: UnitType): number
+
+ add(value: number, unit: OpUnitType): Dayjs
+
+ subtract(value: number, unit: OpUnitType): Dayjs
+
+ startOf(unit: OpUnitType): Dayjs
+
+ endOf(unit: OpUnitType): Dayjs
+
+ format(template?: string): string
+
+ diff(date: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number
+
+ valueOf(): number
+
+ unix(): number
+
+ daysInMonth(): number
+
+ toDate(): Date
+
+ toJSON(): string
+
+ toISOString(): string
+
+ toString(): string
+
+ utcOffset(): number
+
+ isBefore(date: ConfigType, unit?: OpUnitType): boolean
+
+ isSame(date: ConfigType, unit?: OpUnitType): boolean
+
+ isAfter(date: ConfigType, unit?: OpUnitType): boolean
+
+ locale(): string
+
+ locale(preset: string | ILocale, object?: Partial): Dayjs
+ }
+
+ export type PluginFunc = (option: T, c: typeof Dayjs, d: typeof dayjs) => void
+
+ export function extend(plugin: PluginFunc, option?: T): Dayjs
+
+ export function locale(preset?: string | ILocale, object?: Partial, isLocal?: boolean): string
+
+ export function isDayjs(d: any): d is Dayjs
+
+ export function unix(t: number): Dayjs
+
+ const Ls : { [key: string] : ILocale }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale.json b/node_modules/@pm2/agent/node_modules/dayjs/locale.json
new file mode 100644
index 0000000..a425a56
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale.json
@@ -0,0 +1 @@
+[{"key":"af","name":"Afrikaans"},{"key":"am","name":"Amharic"},{"key":"ar-dz","name":"Arabic (Algeria)"},{"key":"ar-kw","name":"Arabic (Kuwait)"},{"key":"ar-ly","name":"Arabic (Lybia)"},{"key":"ar-ma","name":"Arabic (Morocco)"},{"key":"ar-sa","name":"Arabic (Saudi Arabia)"},{"key":"ar-tn","name":" Arabic (Tunisia)"},{"key":"ar","name":"Arabic"},{"key":"az","name":"Azerbaijani"},{"key":"be","name":"Belarusian"},{"key":"bg","name":"Bulgarian"},{"key":"bi","name":"Bislama"},{"key":"bm","name":"Bambara"},{"key":"bn","name":"Bengali"},{"key":"bo","name":"Tibetan"},{"key":"br","name":"Breton"},{"key":"bs","name":"Bosnian"},{"key":"ca","name":"Catalan"},{"key":"cs","name":"Czech"},{"key":"cv","name":"Chuvash"},{"key":"cy","name":"Welsh"},{"key":"da","name":"Danish"},{"key":"de-at","name":"German (Austria)"},{"key":"de-ch","name":"German (Switzerland)"},{"key":"de","name":"German"},{"key":"dv","name":"Maldivian"},{"key":"el","name":"Greek"},{"key":"en-SG","name":"English (Singapore)"},{"key":"en-au","name":"English (Australia)"},{"key":"en-ca","name":"English (Canada)"},{"key":"en-gb","name":"English (United Kingdom)"},{"key":"en-ie","name":"English (Ireland)"},{"key":"en-il","name":"English (Israel)"},{"key":"en-in","name":"English (India)"},{"key":"en-nz","name":"English (New Zealand)"},{"key":"en-tt","name":"English (Trinidad & Tobago)"},{"key":"en","name":"English"},{"key":"eo","name":"Esperanto"},{"key":"es-do","name":"Spanish (Dominican Republic)"},{"key":"es-pr","name":"Spanish (Puerto Rico)"},{"key":"es-us","name":"Spanish (United States)"},{"key":"es","name":"Spanish"},{"key":"et","name":"Estonian"},{"key":"eu","name":"Basque"},{"key":"fa","name":"Persian"},{"key":"fi","name":"Finnish"},{"key":"fo","name":"Faroese"},{"key":"fr-ca","name":"French (Canada)"},{"key":"fr-ch","name":"French (Switzerland)"},{"key":"fr","name":"French"},{"key":"fy","name":"Frisian"},{"key":"ga","name":"Irish or Irish Gaelic"},{"key":"gd","name":"Scottish Gaelic"},{"key":"gl","name":"Galician"},{"key":"gom-latn","name":"Konkani Latin script"},{"key":"gu","name":"Gujarati"},{"key":"he","name":"Hebrew"},{"key":"hi","name":"Hindi"},{"key":"hr","name":"Croatian"},{"key":"ht","name":"Haitian Creole (Haiti)"},{"key":"hu","name":"Hungarian"},{"key":"hy-am","name":"Armenian"},{"key":"id","name":"Indonesian"},{"key":"is","name":"Icelandic"},{"key":"it-ch","name":"Italian (Switzerland)"},{"key":"it","name":"Italian"},{"key":"ja","name":"Japanese"},{"key":"jv","name":"Javanese"},{"key":"ka","name":"Georgian"},{"key":"kk","name":"Kazakh"},{"key":"km","name":"Cambodian"},{"key":"kn","name":"Kannada"},{"key":"ko","name":"Korean"},{"key":"ku","name":"Kurdish"},{"key":"ky","name":"Kyrgyz"},{"key":"lb","name":"Luxembourgish"},{"key":"lo","name":"Lao"},{"key":"lt","name":"Lithuanian"},{"key":"lv","name":"Latvian"},{"key":"me","name":"Montenegrin"},{"key":"mi","name":"Maori"},{"key":"mk","name":"Macedonian"},{"key":"ml","name":"Malayalam"},{"key":"mn","name":"Mongolian"},{"key":"mr","name":"Marathi"},{"key":"ms-my","name":"Malay"},{"key":"ms","name":"Malay"},{"key":"mt","name":"Maltese (Malta)"},{"key":"my","name":"Burmese"},{"key":"nb","name":"Norwegian Bokmål"},{"key":"ne","name":"Nepalese"},{"key":"nl-be","name":"Dutch (Belgium)"},{"key":"nl","name":"Dutch"},{"key":"nn","name":"Nynorsk"},{"key":"oc-lnc","name":"Occitan, lengadocian dialecte"},{"key":"pa-in","name":"Punjabi (India)"},{"key":"pl","name":"Polish"},{"key":"pt-br","name":"Portuguese (Brazil)"},{"key":"pt","name":"Portuguese"},{"key":"ro","name":"Romanian"},{"key":"ru","name":"Russian"},{"key":"rw","name":"Kinyarwanda (Rwanda)"},{"key":"sd","name":"Sindhi"},{"key":"se","name":"Northern Sami"},{"key":"si","name":"Sinhalese"},{"key":"sk","name":"Slovak"},{"key":"sl","name":"Slovenian"},{"key":"sq","name":"Albanian"},{"key":"sr-cyrl","name":"Serbian Cyrillic"},{"key":"sr","name":"Serbian"},{"key":"ss","name":"siSwati"},{"key":"sv","name":"Swedish"},{"key":"sw","name":"Swahili"},{"key":"ta","name":"Tamil"},{"key":"te","name":"Telugu"},{"key":"tet","name":"Tetun Dili (East Timor)"},{"key":"tg","name":"Tajik"},{"key":"th","name":"Thai"},{"key":"tk","name":"Turkmen"},{"key":"tl-ph","name":"Tagalog (Philippines)"},{"key":"tlh","name":"Klingon"},{"key":"tr","name":"Turkish"},{"key":"tzl","name":"Talossan"},{"key":"tzm-latn","name":"Central Atlas Tamazight Latin"},{"key":"tzm","name":"Central Atlas Tamazight"},{"key":"ug-cn","name":"Uyghur (China)"},{"key":"uk","name":"Ukrainian"},{"key":"ur","name":"Urdu"},{"key":"uz-latn","name":"Uzbek Latin"},{"key":"uz","name":"Uzbek"},{"key":"vi","name":"Vietnamese"},{"key":"x-pseudo","name":"Pseudo"},{"key":"yo","name":"Yoruba Nigeria"},{"key":"zh-cn","name":"Chinese (China)"},{"key":"zh-hk","name":"Chinese (Hong Kong)"},{"key":"zh-tw","name":"Chinese (Taiwan)"},{"key":"zh","name":"Chinese"}]
\ No newline at end of file
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/af.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/af.js
new file mode 100644
index 0000000..6f3bb93
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/af.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_af=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"af",weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),weekStart:1,weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/am.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/am.js
new file mode 100644
index 0000000..0684da9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/am.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_am=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"am",weekdays:"እሑድ_ሰኞ_ማክሰኞ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ".split("_"),weekdaysShort:"እሑድ_ሰኞ_ማክሰ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ".split("_"),weekdaysMin:"እሑ_ሰኞ_ማክ_ረቡ_ሐሙ_አር_ቅዳ".split("_"),months:"ጃንዋሪ_ፌብሯሪ_ማርች_ኤፕሪል_ሜይ_ጁን_ጁላይ_ኦገስት_ሴፕቴምበር_ኦክቶበር_ኖቬምበር_ዲሴምበር".split("_"),monthsShort:"ጃንዋ_ፌብሯ_ማርች_ኤፕሪ_ሜይ_ጁን_ጁላይ_ኦገስ_ሴፕቴ_ኦክቶ_ኖቬም_ዲሴም".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"በ%s",past:"%s በፊት",s:"ጥቂት ሰከንዶች",m:"አንድ ደቂቃ",mm:"%d ደቂቃዎች",h:"አንድ ሰዓት",hh:"%d ሰዓታት",d:"አንድ ቀን",dd:"%d ቀናት",M:"አንድ ወር",MM:"%d ወራት",y:"አንድ ዓመት",yy:"%d ዓመታት"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM D ፣ YYYY",LLL:"MMMM D ፣ YYYY HH:mm",LLLL:"dddd ፣ MMMM D ፣ YYYY HH:mm"},ordinal:function(_){return _+"ኛ"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-dz.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-dz.js
new file mode 100644
index 0000000..82e6030
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-dz.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ar_dz=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ar-dz",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"أح_إث_ثلا_أر_خم_جم_سب".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-kw.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-kw.js
new file mode 100644
index 0000000..5a2f7e6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-kw.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ar_kw=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ar-kw",weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-ly.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-ly.js
new file mode 100644
index 0000000..5cfad5e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-ly.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ar_ly=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ar-ly",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:6,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-ma.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-ma.js
new file mode 100644
index 0000000..df4c75e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-ma.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ar_ma=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ar-ma",weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekStart:6,weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-sa.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-sa.js
new file mode 100644
index 0000000..4f4f82a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-sa.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ar_sa=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ar-sa",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-tn.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-tn.js
new file mode 100644
index 0000000..3a042a3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar-tn.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ar_tn=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ar-tn",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ar.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar.js
new file mode 100644
index 0000000..5b3e09d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ar.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_ar=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _="يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),t={name:"ar",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),months:_,monthsShort:_,weekStart:6,relativeTime:{future:"بعد %s",past:"منذ %s",s:"ثانية واحدة",m:"دقيقة واحدة",mm:"%d دقائق",h:"ساعة واحدة",hh:"%d ساعات",d:"يوم واحد",dd:"%d أيام",M:"شهر واحد",MM:"%d أشهر",y:"عام واحد",yy:"%d أعوام"},ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return e.locale(t,null,!0),t});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/az.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/az.js
new file mode 100644
index 0000000..0b62a51
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/az.js
@@ -0,0 +1 @@
+!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):a.dayjs_locale_az=e(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e={name:"az",weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},ordinal:function(a){return a}};return a.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/be.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/be.js
new file mode 100644
index 0000000..cb2f937
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/be.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_be=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"be",weekdays:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),months:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),weekStart:1,weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/bg.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/bg.js
new file mode 100644
index 0000000..41b6e1f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/bg.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_bg=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"bg",weekdays:"Неделя_Понеделник_Вторник_Сряда_Четвъртък_Петък_Събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:"Януари_Февруари_Март_Април_Май_Юни_Юли_Август_Септември_Октомври_Ноември_Декември".split("_"),monthsShort:"Янр_Фев_Мар_Апр_Май_Юни_Юли_Авг_Сеп_Окт_Ное_Дек".split("_"),weekStart:1,ordinal:function(_){return _+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/bi.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/bi.js
new file mode 100644
index 0000000..8f48637
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/bi.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_bi=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"bi",weekdays:"Sande_Mande_Tusde_Wenesde_Tosde_Fraede_Sarade".split("_"),months:"Januari_Februari_Maj_Eprel_Mei_Jun_Julae_Okis_Septemba_Oktoba_Novemba_Disemba".split("_"),weekStart:1,weekdaysShort:"San_Man_Tus_Wen_Tos_Frae_Sar".split("_"),monthsShort:"Jan_Feb_Maj_Epr_Mai_Jun_Jul_Oki_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"San_Ma_Tu_We_To_Fr_Sar".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"lo %s",past:"%s bifo",s:"sam seken",m:"wan minit",mm:"%d minit",h:"wan haoa",hh:"%d haoa",d:"wan dei",dd:"%d dei",M:"wan manis",MM:"%d manis",y:"wan yia",yy:"%d yia"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/bm.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/bm.js
new file mode 100644
index 0000000..8e986e9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/bm.js
@@ -0,0 +1 @@
+!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):a.dayjs_locale_bm=e(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e={name:"bm",weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),weekStart:1,weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"}};return a.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/bn.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/bn.js
new file mode 100644
index 0000000..cf92fbf
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/bn.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_bn=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"bn",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/bo.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/bo.js
new file mode 100644
index 0000000..caf55d3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/bo.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_bo=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"bo",weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/br.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/br.js
new file mode 100644
index 0000000..f068bd5
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/br.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_br=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"br",weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),weekStart:1,weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},meridiem:function(e){return e<12?"a.m.":"g.m."}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/bs.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/bs.js
new file mode 100644
index 0000000..4b758a3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/bs.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_bs=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"bs",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(e){return e},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ca.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ca.js
new file mode 100644
index 0000000..9e65af7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ca.js
@@ -0,0 +1 @@
+!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):e.dayjs_locale_ca=s(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var s={name:"ca",weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Març_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",ll:"D MMM YYYY",lll:"D MMM YYYY, H:mm",llll:"ddd D MMM YYYY, H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(e){return e+"º"}};return e.locale(s,null,!0),s});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/cs.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/cs.js
new file mode 100644
index 0000000..fcf85bd
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/cs.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):e.dayjs_locale_cs=n(e.dayjs)}(this,function(e){"use strict";function n(e){return e>1&&e<5&&1!=~~(e/10)}function t(e,t,r,s){var d=e+" ";switch(r){case"s":return t||s?"pár sekund":"pár sekundami";case"m":return t?"minuta":s?"minutu":"minutou";case"mm":return t||s?d+(n(e)?"minuty":"minut"):d+"minutami";case"h":return t?"hodina":s?"hodinu":"hodinou";case"hh":return t||s?d+(n(e)?"hodiny":"hodin"):d+"hodinami";case"d":return t||s?"den":"dnem";case"dd":return t||s?d+(n(e)?"dny":"dní"):d+"dny";case"M":return t||s?"měsíc":"měsícem";case"MM":return t||s?d+(n(e)?"měsíce":"měsíců"):d+"měsíci";case"y":return t||s?"rok":"rokem";case"yy":return t||s?d+(n(e)?"roky":"let"):d+"lety"}}e=e&&e.hasOwnProperty("default")?e.default:e;var r={name:"cs",weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),months:"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),monthsShort:"led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),weekStart:1,yearStart:4,ordinal:function(e){return e+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"před %s",s:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t}};return e.locale(r,null,!0),r});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/cv.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/cv.js
new file mode 100644
index 0000000..0f4b099
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/cv.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_cv=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"cv",weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),weekStart:1,weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/cy.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/cy.js
new file mode 100644
index 0000000..4af19a3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/cy.js
@@ -0,0 +1 @@
+!function(d,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):d.dayjs_locale_cy=e(d.dayjs)}(this,function(d){"use strict";d=d&&d.hasOwnProperty("default")?d.default:d;var e={name:"cy",weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),weekStart:1,weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),ordinal:function(d){return d},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"}};return d.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/da.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/da.js
new file mode 100644
index 0000000..954df79
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/da.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):e.dayjs_locale_da=t(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={name:"da",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn._man._tirs._ons._tors._fre._lør.".split("_"),weekdaysMin:"sø._ma._ti._on._to._fr._lø.".split("_"),months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj_juni_juli_aug._sept._okt._nov._dec.".split("_"),weekStart:1,ordinal:function(e){return e+"."},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"}};return e.locale(t,null,!0),t});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/de-at.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/de-at.js
new file mode 100644
index 0000000..da98717
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/de-at.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):e.dayjs_locale_de_at=n(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n={name:"de-at",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(e){return e+"."},weekStart:1,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"einer Minute",mm:"%d Minuten",h:"einer Stunde",hh:"%d Stunden",d:"einem Tag",dd:"%d Tagen",M:"einem Monat",MM:"%d Monaten",y:"einem Jahr",yy:"%d Jahren"}};return e.locale(n,null,!0),n});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/de-ch.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/de-ch.js
new file mode 100644
index 0000000..51f5d48
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/de-ch.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_de_ch=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"de-ch",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),weekStart:1,weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/de.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/de.js
new file mode 100644
index 0000000..79a32fe
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/de.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):e.dayjs_locale_de=n(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan_Feb_März_Apr_Mai_Juni_Juli_Aug_Sept_Okt_Nov_Dez".split("_"),ordinal:function(e){return e+"."},weekStart:1,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:"wenigen Sekunden",m:"einer Minute",mm:"%d Minuten",h:"einer Stunde",hh:"%d Stunden",d:"einem Tag",dd:"%d Tagen",M:"einem Monat",MM:"%d Monaten",y:"einem Jahr",yy:"%d Jahren"}};return e.locale(n,null,!0),n});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/dv.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/dv.js
new file mode 100644
index 0000000..d9f24d6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/dv.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_dv=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"dv",weekdays:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),months:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekStart:7,weekdaysShort:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),monthsShort:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/el.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/el.js
new file mode 100644
index 0000000..f98cf52
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/el.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_el=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"el",weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),months:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαι_Ιουν_Ιουλ_Αυγ_Σεπτ_Οκτ_Νοε_Δεκ".split("_"),ordinal:function(_){return _},weekStart:1,relativeTime:{future:"σε %s",past:"πριν %s",s:"μερικά δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένα μήνα",MM:"%d μήνες",y:"ένα χρόνο",yy:"%d χρόνια"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/en-SG.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-SG.js
new file mode 100644
index 0000000..4fa8c8b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-SG.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_en_SG=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"en-SG",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/en-au.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-au.js
new file mode 100644
index 0000000..804e902
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-au.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_en_au=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"en-au",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/en-ca.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-ca.js
new file mode 100644
index 0000000..e2c7715
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-ca.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_en_ca=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"en-ca",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/en-gb.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-gb.js
new file mode 100644
index 0000000..aa7d9d9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-gb.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_en_gb=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"en-gb",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(e){var a=["th","st","nd","rd"],_=e%100;return"["+e+(a[(_-20)%10]||a[_]||a[0])+"]"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/en-ie.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-ie.js
new file mode 100644
index 0000000..c3fb553
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-ie.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_en_ie=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"en-ie",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/en-il.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-il.js
new file mode 100644
index 0000000..a16a49b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-il.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_en_il=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"en-il",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/en-in.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-in.js
new file mode 100644
index 0000000..01e0e3f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-in.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_en_in=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"en-in",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(e){var a=["th","st","nd","rd"],_=e%100;return"["+e+(a[(_-20)%10]||a[_]||a[0])+"]"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/en-nz.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-nz.js
new file mode 100644
index 0000000..9cf778c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-nz.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_en_nz=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"en-nz",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/en-tt.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-tt.js
new file mode 100644
index 0000000..87b2444
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/en-tt.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_en_tt=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"en-tt",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(e){var a=["th","st","nd","rd"],t=e%100;return"["+e+(a[(t-20)%10]||a[t]||a[0])+"]"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/en.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/en.js
new file mode 100644
index 0000000..f33e352
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/en.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.dayjs_locale_en=n()}(this,function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/eo.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/eo.js
new file mode 100644
index 0000000..d130bf3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/eo.js
@@ -0,0 +1 @@
+!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):o.dayjs_locale_eo=e(o.dayjs)}(this,function(o){"use strict";o=o&&o.hasOwnProperty("default")?o.default:o;var e={name:"eo",weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),ordinal:function(o){return o},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-a de] MMMM, YYYY",LLL:"D[-a de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-a de] MMMM, YYYY HH:mm"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"}};return o.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/es-do.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/es-do.js
new file mode 100644
index 0000000..57ebf94
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/es-do.js
@@ -0,0 +1 @@
+!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):e.dayjs_locale_es_do=o(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var o={name:"es-do",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekStart:1,relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(e){return e+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return e.locale(o,null,!0),o});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/es-pr.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/es-pr.js
new file mode 100644
index 0000000..71d7784
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/es-pr.js
@@ -0,0 +1 @@
+!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):e.dayjs_locale_es_pr=s(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var s={name:"es-pr",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(e){return e+"º"}};return e.locale(s,null,!0),s});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/es-us.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/es-us.js
new file mode 100644
index 0000000..4cb1315
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/es-us.js
@@ -0,0 +1 @@
+!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):e.dayjs_locale_es_us=s(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var s={name:"es-us",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(e){return e+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return e.locale(s,null,!0),s});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/es.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/es.js
new file mode 100644
index 0000000..cbe36b0
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/es.js
@@ -0,0 +1 @@
+!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):e.dayjs_locale_es=s(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var s={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(e){return e+"º"}};return e.locale(s,null,!0),s});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/et.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/et.js
new file mode 100644
index 0000000..d3cc36f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/et.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_et=a(e.dayjs)}(this,function(e){"use strict";function a(e,a,t,u){var s={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:["%d minuti","%d minutit"],h:["ühe tunni","tund aega","üks tund"],hh:["%d tunni","%d tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:["%d kuu","%d kuud"],y:["ühe aasta","aasta","üks aasta"],yy:["%d aasta","%d aastat"]};return a?(s[t][2]?s[t][2]:s[t][1]).replace("%d",e):(u?s[t][0]:s[t][1]).replace("%d",e)}e=e&&e.hasOwnProperty("default")?e.default:e;var t={name:"et",weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),ordinal:function(e){return e+"."},weekStart:1,relativeTime:{future:"%s pärast",past:"%s tagasi",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:"%d päeva",M:a,MM:a,y:a,yy:a},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.locale(t,null,!0),t});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/eu.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/eu.js
new file mode 100644
index 0000000..04b9f5e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/eu.js
@@ -0,0 +1 @@
+!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):a.dayjs_locale_eu=e(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e={name:"eu",weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),weekStart:1,weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"}};return a.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/fa.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/fa.js
new file mode 100644
index 0000000..42575c1
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/fa.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_fa=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"fa",weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekStart:6,months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/fi.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/fi.js
new file mode 100644
index 0000000..a805d92
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/fi.js
@@ -0,0 +1 @@
+!function(u,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):u.dayjs_locale_fi=e(u.dayjs)}(this,function(u){"use strict";function e(u,e,t,n){var i={s:"muutama sekunti",m:"minuutti",mm:"%d minuuttia",h:"tunti",hh:"%d tuntia",d:"päivä",dd:"%d päivää",M:"kuukausi",MM:"%d kuukautta",y:"vuosi",yy:"%d vuotta",numbers:"nolla_yksi_kaksi_kolme_neljä_viisi_kuusi_seitsemän_kahdeksan_yhdeksän".split("_")},a={s:"muutaman sekunnin",m:"minuutin",mm:"%d minuutin",h:"tunnin",hh:"%d tunnin",d:"päivän",dd:"%d päivän",M:"kuukauden",MM:"%d kuukauden",y:"vuoden",yy:"%d vuoden",numbers:"nollan_yhden_kahden_kolmen_neljän_viiden_kuuden_seitsemän_kahdeksan_yhdeksän".split("_")},s=n&&!e?a:i,_=s[t];return u<10?_.replace("%d",s.numbers[u]):_.replace("%d",u)}u=u&&u.hasOwnProperty("default")?u.default:u;var t={name:"fi",weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),ordinal:function(u){return u+"."},weekStart:1,relativeTime:{future:"%s päästä",past:"%s sitten",s:e,m:e,mm:e,h:e,hh:e,d:e,dd:e,M:e,MM:e,y:e,yy:e},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM[ta] YYYY",LLL:"D. MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, D. MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [klo] HH.mm",llll:"ddd, D. MMM YYYY, [klo] HH.mm"}};return u.locale(t,null,!0),t});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/fo.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/fo.js
new file mode 100644
index 0000000..0f53e23
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/fo.js
@@ -0,0 +1 @@
+!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],r):e.dayjs_locale_fo=r(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var r={name:"fo",weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"}};return e.locale(r,null,!0),r});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/fr-ca.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/fr-ca.js
new file mode 100644
index 0000000..857b3b5
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/fr-ca.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_fr_ca=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"fr-ca",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/fr-ch.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/fr-ch.js
new file mode 100644
index 0000000..a5d2173
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/fr-ch.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_fr_ch=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"fr-ch",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekStart:1,weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/fr.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/fr.js
new file mode 100644
index 0000000..6d5c235
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/fr.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_fr=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(e){return""+e+(1===e?"er":"")}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/fy.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/fy.js
new file mode 100644
index 0000000..8b63b31
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/fy.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):e.dayjs_locale_fy=n(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n={name:"fy",weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),weekStart:1,weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"}};return e.locale(n,null,!0),n});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ga.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ga.js
new file mode 100644
index 0000000..1d28235
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ga.js
@@ -0,0 +1 @@
+!function(a,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],i):a.dayjs_locale_ga=i(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var i={name:"ga",weekdays:"Dé Domhnaigh_Dé Luain_Dé Máirt_Dé Céadaoin_Déardaoin_Dé hAoine_Dé Satharn".split("_"),months:"Eanáir_Feabhra_Márta_Aibreán_Bealtaine_Méitheamh_Iúil_Lúnasa_Meán Fómhair_Deaireadh Fómhair_Samhain_Nollaig".split("_"),weekStart:1,weekdaysShort:"Dom_Lua_Mái_Céa_Déa_hAo_Sat".split("_"),monthsShort:"Eaná_Feab_Márt_Aibr_Beal_Méit_Iúil_Lúna_Meán_Deai_Samh_Noll".split("_"),weekdaysMin:"Do_Lu_Má_Ce_Dé_hA_Sa".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d mí",y:"bliain",yy:"%d bliain"}};return a.locale(i,null,!0),i});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/gd.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/gd.js
new file mode 100644
index 0000000..c5d10bb
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/gd.js
@@ -0,0 +1 @@
+!function(a,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],i):a.dayjs_locale_gd=i(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var i={name:"gd",weekdays:"Didòmhnaich_Diluain_Dimàirt_Diciadain_Diardaoin_Dihaoine_Disathairne".split("_"),months:"Am Faoilleach_An Gearran_Am Màrt_An Giblean_An Cèitean_An t-Ògmhios_An t-Iuchar_An Lùnastal_An t-Sultain_An Dàmhair_An t-Samhain_An Dùbhlachd".split("_"),weekStart:1,weekdaysShort:"Did_Dil_Dim_Dic_Dia_Dih_Dis".split("_"),monthsShort:"Faoi_Gear_Màrt_Gibl_Cèit_Ògmh_Iuch_Lùn_Sult_Dàmh_Samh_Dùbh".split("_"),weekdaysMin:"Dò_Lu_Mà_Ci_Ar_Ha_Sa".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"}};return a.locale(i,null,!0),i});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/gl.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/gl.js
new file mode 100644
index 0000000..d247f46
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/gl.js
@@ -0,0 +1 @@
+!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):e.dayjs_locale_gl=o(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var o={name:"gl",weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),ordinal:function(e){return e},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"}};return e.locale(o,null,!0),o});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/gom-latn.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/gom-latn.js
new file mode 100644
index 0000000..b1a4b17
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/gom-latn.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_gom_latn=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"gom-latn",weekdays:"Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split("_"),months:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),weekStart:1,weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),ordinal:function(e){return e},formats:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/gu.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/gu.js
new file mode 100644
index 0000000..3640453
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/gu.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_gu=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"gu",weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},relativeTime:{future:"%s મા",past:"%s પેહલા",s:"અમુક પળો",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/he.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/he.js
new file mode 100644
index 0000000..4617227
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/he.js
@@ -0,0 +1 @@
+!function(Y,M){"object"==typeof exports&&"undefined"!=typeof module?module.exports=M(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],M):Y.dayjs_locale_he=M(Y.dayjs)}(this,function(Y){"use strict";Y=Y&&Y.hasOwnProperty("default")?Y.default:Y;var M={name:"he",weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א׳_ב׳_ג׳_ד׳_ה׳_ו_ש׳".split("_"),months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו_פבר_מרץ_אפר_מאי_יונ_יול_אוג_ספט_אוק_נוב_דצמ".split("_"),relativeTime:{future:"בעוד %s",past:"לפני %s",s:"כמה שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:"%d שעות",d:"יום",dd:"%d ימים",M:"חודש",MM:"%d חודשים",y:"שנה",yy:"%d שנים"},ordinal:function(Y){return Y},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"}};return Y.locale(M,null,!0),M});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/hi.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/hi.js
new file mode 100644
index 0000000..542afcc
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/hi.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_hi=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"hi",weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/hr.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/hr.js
new file mode 100644
index 0000000..19177dd
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/hr.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_hr=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a="siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),t="siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),s=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/,_=function(e,_){return s.test(_)?a[e.month()]:t[e.month()]};_.s=t,_.f=a;var n={name:"hr",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:_,monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},relativeTime:{future:"za %s",past:"prije %s",s:"sekunda",m:"minuta",mm:"%d minuta",h:"sat",hh:"%d sati",d:"dan",dd:"%d dana",M:"mjesec",MM:"%d mjeseci",y:"godina",yy:"%d godine"},ordinal:function(e){return e+"."}};return e.locale(n,null,!0),n});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ht.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ht.js
new file mode 100644
index 0000000..818f8bf
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ht.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):e.dayjs_locale_ht=n(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n={name:"ht",weekdays:"dimanch_lendi_madi_mèkredi_jedi_vandredi_samdi".split("_"),months:"janvye_fevriye_mas_avril_me_jen_jiyè_out_septanm_oktòb_novanm_desanm".split("_"),weekdaysShort:"dim._len._mad._mèk._jed._van._sam.".split("_"),monthsShort:"jan._fev._mas_avr._me_jen_jiyè._out_sept._okt._nov._des.".split("_"),weekdaysMin:"di_le_ma_mè_je_va_sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"nan %s",past:"sa gen %s",s:"kèk segond",m:"yon minit",mm:"%d minit",h:"inèdtan",hh:"%d zè",d:"yon jou",dd:"%d jou",M:"yon mwa",MM:"%d mwa",y:"yon ane",yy:"%d ane"}};return e.locale(n,null,!0),n});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/hu.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/hu.js
new file mode 100644
index 0000000..da5f5ab
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/hu.js
@@ -0,0 +1 @@
+!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):e.dayjs_locale_hu=s(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var s={name:"hu",weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),ordinal:function(e){return e+"."},weekStart:1,relativeTime:{future:"%s múlva",past:"%s",s:"néhány másodperc",m:"egy perc",mm:"%d perc",h:"egy óra",hh:"%d óra",d:"egy nap",dd:"%d nap",M:"egy hónap",MM:"%d hónap",y:"egy éve",yy:"%d év"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"}};return e.locale(s,null,!0),s});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/hy-am.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/hy-am.js
new file mode 100644
index 0000000..69b1257
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/hy-am.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_hy_am=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"hy-am",weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),months:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),weekStart:1,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/id.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/id.js
new file mode 100644
index 0000000..0801114
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/id.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_id=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"id",weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(e){return e+"."}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/index.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/locale/index.d.ts
new file mode 100644
index 0000000..bd2dca2
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/index.d.ts
@@ -0,0 +1,11 @@
+///
+
+declare module 'dayjs/locale/*' {
+ namespace locale {
+ interface Locale extends ILocale {}
+ }
+
+ const locale: locale.Locale
+
+ export = locale
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/is.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/is.js
new file mode 100644
index 0000000..334e5a1
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/is.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_is=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"is",weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),ordinal:function(e){return e},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/it-ch.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/it-ch.js
new file mode 100644
index 0000000..1f5e368
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/it-ch.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_it_ch=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"it-ch",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/it.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/it.js
new file mode 100644
index 0000000..8d4a8eb
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/it.js
@@ -0,0 +1 @@
+!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):e.dayjs_locale_it=o(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var o={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(e){return e+"º"}};return e.locale(o,null,!0),o});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ja.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ja.js
new file mode 100644
index 0000000..ca5b731
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ja.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ja=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(_){return _+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(_){return _<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/jv.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/jv.js
new file mode 100644
index 0000000..3d961dc
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/jv.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):e.dayjs_locale_jv=n(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n={name:"jv",weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),weekStart:1,weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),ordinal:function(e){return e},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"}};return e.locale(n,null,!0),n});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ka.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ka.js
new file mode 100644
index 0000000..93f7831
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ka.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ka=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ka",weekdays:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"%s შემდეგ",past:"%s წინ",s:"წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათის",d:"დღეს",dd:"%d დღის განმავლობაში",M:"თვის",MM:"%d თვის",y:"წელი",yy:"%d წლის"},ordinal:function(_){return _}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/kk.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/kk.js
new file mode 100644
index 0000000..0038cbe
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/kk.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_kk=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"kk",weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekStart:1,relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/km.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/km.js
new file mode 100644
index 0000000..0cedc82
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/km.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_km=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"km",weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekStart:1,weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/kn.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/kn.js
new file mode 100644
index 0000000..063f64d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/kn.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_kn=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"kn",weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ko.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ko.js
new file mode 100644
index 0000000..fb44532
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ko.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ko=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(_){return _<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ku.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ku.js
new file mode 100644
index 0000000..02d4f5e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ku.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ku=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ku",weekdays:"یهكشهممه_دووشهممه_سێشهممه_چوارشهممه_پێنجشهممه_ههینی_شهممه".split("_"),months:"کانونی دووەم_شوبات_ئازار_نیسان_ئایار_حوزەیران_تەمموز_ئاب_ئەیلوول_تشرینی یەكەم_تشرینی دووەم_كانونی یەکەم".split("_"),weekStart:6,weekdaysShort:"یهكشهم_دووشهم_سێشهم_چوارشهم_پێنجشهم_ههینی_شهممه".split("_"),monthsShort:"کانونی دووەم_شوبات_ئازار_نیسان_ئایار_حوزەیران_تەمموز_ئاب_ئەیلوول_تشرینی یەكەم_تشرینی دووەم_كانونی یەکەم".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"له %s",past:"%s",s:"چهند چركهیهك",m:"یهك خولهك",mm:"%d خولهك",h:"یهك كاتژمێر",hh:"%d كاتژمێر",d:"یهك ڕۆژ",dd:"%d ڕۆژ",M:"یهك مانگ",MM:"%d مانگ",y:"یهك ساڵ",yy:"%d ساڵ"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ky.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ky.js
new file mode 100644
index 0000000..eb1d2b3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ky.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ky=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ky",weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),weekStart:1,weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/lb.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/lb.js
new file mode 100644
index 0000000..02cf490
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/lb.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_lb=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"lb",weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),weekStart:1,weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/lo.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/lo.js
new file mode 100644
index 0000000..343d0e3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/lo.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_lo=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"lo",weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/lt.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/lt.js
new file mode 100644
index 0000000..7c7c89f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/lt.js
@@ -0,0 +1 @@
+!function(s,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):s.dayjs_locale_lt=e(s.dayjs)}(this,function(s){"use strict";s=s&&s.hasOwnProperty("default")?s.default:s;var e="sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),i="sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),d=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,a=function(s,a){return d.test(a)?e[s.month()]:i[s.month()]};a.s=i,a.f=e;var M={name:"lt",weekdays:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),weekdaysShort:"sek_pir_ant_tre_ket_pen_šeš".split("_"),weekdaysMin:"s_p_a_t_k_pn_š".split("_"),months:a,monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),ordinal:function(s){return s+"."},weekStart:1,relativeTime:{future:"už %s",past:"prieš %s",s:"kelias sekundes",m:"minutę",mm:"%d minutes",h:"valandą",hh:"%d valandas",d:"dieną",dd:"%d dienas",M:"menesį",MM:"%d mėnesius",y:"metus",yy:"%d metus"},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"}};return s.locale(M,null,!0),M});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/lv.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/lv.js
new file mode 100644
index 0000000..3b6c91c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/lv.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_lv=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"lv",weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),weekStart:1,weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/me.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/me.js
new file mode 100644
index 0000000..f966758
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/me.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_me=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"me",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(e){return e},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/mi.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/mi.js
new file mode 100644
index 0000000..ab49565
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/mi.js
@@ -0,0 +1 @@
+!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):a.dayjs_locale_mi=e(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e={name:"mi",weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),weekStart:1,weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"}};return a.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/mk.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/mk.js
new file mode 100644
index 0000000..9febccf
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/mk.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_mk=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"mk",weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),weekStart:1,weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),ordinal:function(_){return _},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ml.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ml.js
new file mode 100644
index 0000000..baf1abb
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ml.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ml=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ml",weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/mn.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/mn.js
new file mode 100644
index 0000000..3aa26a9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/mn.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_mn=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"mn",weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},relativeTime:{future:"%s",past:"%s",s:"саяхан",m:"м",mm:"%dм",h:"1ц",hh:"%dц",d:"1ө",dd:"%dө",M:"1с",MM:"%dс",y:"1ж",yy:"%dж"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/mr.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/mr.js
new file mode 100644
index 0000000..f09c655
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/mr.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_mr=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"mr",weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ms-my.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ms-my.js
new file mode 100644
index 0000000..5d6c1ab
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ms-my.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_ms_my=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"ms-my",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),weekStart:1,weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),ordinal:function(e){return e},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ms.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ms.js
new file mode 100644
index 0000000..1540e98
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ms.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_ms=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"ms",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH.mm",LLLL:"dddd, D MMMM YYYY HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(e){return e+"."}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/mt.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/mt.js
new file mode 100644
index 0000000..a2cc46a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/mt.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):e.dayjs_locale_mt=t(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={name:"mt",weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),weekStart:1,weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"}};return e.locale(t,null,!0),t});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/my.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/my.js
new file mode 100644
index 0000000..9189378
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/my.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_my=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"my",weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),weekStart:1,weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/nb.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/nb.js
new file mode 100644
index 0000000..6ba8911
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/nb.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):e.dayjs_locale_nb=t(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={name:"nb",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),ordinal:function(e){return e+"."},weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"}};return e.locale(t,null,!0),t});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ne.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ne.js
new file mode 100644
index 0000000..308ac42
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ne.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ne=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ne",weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मे_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),relativeTime:{future:"%s पछि",past:"%s अघि",s:"सेकेन्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"घन्टा",hh:"%d घन्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक वर्ष",yy:"%d वर्ष"},ordinal:function(_){return(""+_).replace(/\d/g,function(_){return"०१२३४५६७८९"[_]})},formats:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/nl-be.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/nl-be.js
new file mode 100644
index 0000000..821019d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/nl-be.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_nl_be=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"nl-be",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),weekStart:1,weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/nl.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/nl.js
new file mode 100644
index 0000000..c0842d0
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/nl.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_nl=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"nl",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),ordinal:function(e){return e+"."},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"een minuut",mm:"%d minuten",h:"een uur",hh:"%d uur",d:"een dag",dd:"%d dagen",M:"een maand",MM:"%d maanden",y:"een jaar",yy:"%d jaar"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/nn.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/nn.js
new file mode 100644
index 0000000..a765e1f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/nn.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):e.dayjs_locale_nn=t(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={name:"nn",weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ordinal:function(e){return e+"."},weekStart:1,relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eitt minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månadar",y:"eitt år",yy:"%d år"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"}};return e.locale(t,null,!0),t});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/oc-lnc.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/oc-lnc.js
new file mode 100644
index 0000000..96538e9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/oc-lnc.js
@@ -0,0 +1 @@
+!function(e,d){"object"==typeof exports&&"undefined"!=typeof module?module.exports=d(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],d):e.dayjs_locale_oc_lnc=d(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var d={name:"oc-lnc",weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"Dg_Dl_Dm_Dc_Dj_Dv_Ds".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),months:"genièr_febrièr_març_abrial_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),monthsShort:"gen_feb_març_abr_mai_junh_julh_ago_set_oct_nov_dec".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},ordinal:function(e){return e+"º"}};return e.locale(d,null,!0),d});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/pa-in.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/pa-in.js
new file mode 100644
index 0000000..0afedfd
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/pa-in.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_pa_in=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"pa-in",weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/pl.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/pl.js
new file mode 100644
index 0000000..7ead3ff
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/pl.js
@@ -0,0 +1 @@
+!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],i):e.dayjs_locale_pl=i(e.dayjs)}(this,function(e){"use strict";function i(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function t(e,t,a){var n=e+" ";switch(a){case"m":return t?"minuta":"minutę";case"mm":return n+(i(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return n+(i(e)?"godziny":"godzin");case"MM":return n+(i(e)?"miesiące":"miesięcy");case"yy":return n+(i(e)?"lata":"lat")}}e=e&&e.hasOwnProperty("default")?e.default:e;var a="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),n="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),_=/D MMMM/,r=function(e,i){return _.test(i)?a[e.month()]:n[e.month()]};r.s=n,r.f=a;var s={name:"pl",weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),months:r,monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),ordinal:function(e){return e+"."},weekStart:1,relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:t,mm:t,h:t,hh:t,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:t,y:"rok",yy:t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.locale(s,null,!0),s});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/pt-br.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/pt-br.js
new file mode 100644
index 0000000..85384fd
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/pt-br.js
@@ -0,0 +1 @@
+!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):e.dayjs_locale_pt_br=o(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var o={name:"pt-br",weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),ordinal:function(e){return e+"º"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return e.locale(o,null,!0),o});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/pt.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/pt.js
new file mode 100644
index 0000000..36be259
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/pt.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_pt=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"pt",weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),ordinal:function(e){return e+"º"},weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ro.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ro.js
new file mode 100644
index 0000000..45a9fa6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ro.js
@@ -0,0 +1 @@
+!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],i):e.dayjs_locale_ro=i(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var i={name:"ro",weekdays:"Duminică_Luni_Marți_Miercuri_Joi_Vineri_Sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),months:"Ianuarie_Februarie_Martie_Aprilie_Mai_Iunie_Iulie_August_Septembrie_Octombrie_Noiembrie_Decembrie".split("_"),monthsShort:"Ian._Febr._Mart._Apr._Mai_Iun._Iul._Aug._Sept._Oct._Nov._Dec.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"peste %s",past:"acum %s",s:"câteva secunde",m:"un minut",mm:"%d minute",h:"o oră",hh:"%d ore",d:"o zi",dd:"%d zile",M:"o lună",MM:"%d luni",y:"un an",yy:"%d ani"},ordinal:function(e){return e}};return e.locale(i,null,!0),i});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ru.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ru.js
new file mode 100644
index 0000000..a79c10f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ru.js
@@ -0,0 +1 @@
+!function(_,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):_.dayjs_locale_ru=t(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var t="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),e="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),n="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),s="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),r=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function o(_,t,e){var n,s;return"m"===e?t?"минута":"минуту":_+" "+(n=+_,s={mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[e].split("_"),n%10==1&&n%100!=11?s[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?s[1]:s[2])}var d=function(_,n){return r.test(n)?t[_.month()]:e[_.month()]};d.s=e,d.f=t;var i=function(_,t){return r.test(t)?n[_.month()]:s[_.month()]};i.s=s,i.f=n;var m={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:d,monthsShort:i,weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:o,mm:o,h:"час",hh:o,d:"день",dd:o,M:"месяц",MM:o,y:"год",yy:o},ordinal:function(_){return _}};return _.locale(m,null,!0),m});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/rw.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/rw.js
new file mode 100644
index 0000000..30b1260
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/rw.js
@@ -0,0 +1 @@
+!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):a.dayjs_locale_rw=e(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e={name:"rw",weekdays:"Ku Cyumweru_Kuwa Mbere_Kuwa Kabiri_Kuwa Gatatu_Kuwa Kane_Kuwa Gatanu_Kuwa Gatandatu".split("_"),months:"Mutarama_Gashyantare_Werurwe_Mata_Gicurasi_Kamena_Nyakanga_Kanama_Nzeri_Ukwakira_Ugushyingo_Ukuboza".split("_"),relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(a){return a}};return a.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/sd.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/sd.js
new file mode 100644
index 0000000..e464ed3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/sd.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_sd=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"sd",weekdays:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),months:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekStart:1,weekdaysShort:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),monthsShort:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekdaysMin:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/se.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/se.js
new file mode 100644
index 0000000..4185721
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/se.js
@@ -0,0 +1 @@
+!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):a.dayjs_locale_se=e(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e={name:"se",weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),weekStart:1,weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"}};return a.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/si.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/si.js
new file mode 100644
index 0000000..a3c6cc6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/si.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_si=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"si",weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්ර_සි_සෙ".split("_"),ordinal:function(_){return _},formats:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/sk.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/sk.js
new file mode 100644
index 0000000..9571f9f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/sk.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):e.dayjs_locale_sk=t(e.dayjs)}(this,function(e){"use strict";function t(e){return e>1&&e<5&&1!=~~(e/10)}function r(e,r,n,a){var s=e+" ";switch(n){case"s":return r||a?"pár sekúnd":"pár sekundami";case"m":return r?"minúta":a?"minútu":"minútou";case"mm":return r||a?s+(t(e)?"minúty":"minút"):s+"minútami";case"h":return r?"hodina":a?"hodinu":"hodinou";case"hh":return r||a?s+(t(e)?"hodiny":"hodín"):s+"hodinami";case"d":return r||a?"deň":"dňom";case"dd":return r||a?s+(t(e)?"dni":"dní"):s+"dňami";case"M":return r||a?"mesiac":"mesiacom";case"MM":return r||a?s+(t(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return r||a?"rok":"rokom";case"yy":return r||a?s+(t(e)?"roky":"rokov"):s+"rokmi"}}e=e&&e.hasOwnProperty("default")?e.default:e;var n={name:"sk",weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),months:"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),monthsShort:"jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(e){return e+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"pred %s",s:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r}};return e.locale(n,null,!0),n});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/sl.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/sl.js
new file mode 100644
index 0000000..d0023a6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/sl.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_sl=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"sl",weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),weekStart:1,weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),ordinal:function(e){return e},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/sq.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/sq.js
new file mode 100644
index 0000000..9b90dc2
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/sq.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):t.dayjs_locale_sq=e(t.dayjs)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={name:"sq",weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),weekStart:1,weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"}};return t.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/sr-cyrl.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/sr-cyrl.js
new file mode 100644
index 0000000..31b1200
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/sr-cyrl.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_sr_cyrl=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"sr-cyrl",weekdays:"Недеља_Понедељак_Уторак_Среда_Четвртак_Петак_Субота".split("_"),weekdaysShort:"Нед._Пон._Уто._Сре._Чет._Пет._Суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),months:"Јануар_Фебруар_Март_Април_Мај_Јун_Јул_Август_Септембар_Октобар_Новембар_Децембар".split("_"),monthsShort:"Јан._Феб._Мар._Апр._Мај_Јун_Јул_Авг._Сеп._Окт._Нов._Дец.".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"пре %s",s:"секунда",m:"минут",mm:"%d минута",h:"сат",hh:"%d сати",d:"дан",dd:"%d дана",M:"месец",MM:"%d месеци",y:"година",yy:"%d године"},ordinal:function(_){return _+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/sr.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/sr.js
new file mode 100644
index 0000000..3ccb61d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/sr.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):e.dayjs_locale_sr=t(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={name:"sr",weekdays:"Nedelja_Ponedeljak_Utorak_Sreda_Četvrtak_Petak_Subota".split("_"),weekdaysShort:"Ned._Pon._Uto._Sre._Čet._Pet._Sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:"Januar_Februar_Mart_April_Maj_Jun_Jul_Avgust_Septembar_Oktobar_Novembar_Decembar".split("_"),monthsShort:"Jan._Feb._Mar._Apr._Maj_Jun_Jul_Avg._Sep._Okt._Nov._Dec.".split("_"),weekStart:1,relativeTime:{future:"za %s",past:"pre %s",s:"sekunda",m:"minut",mm:"%d minuta",h:"sat",hh:"%d sati",d:"dan",dd:"%d dana",M:"mesec",MM:"%d meseci",y:"godina",yy:"%d godine"},ordinal:function(e){return e+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.locale(t,null,!0),t});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ss.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ss.js
new file mode 100644
index 0000000..dadbc98
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ss.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_ss=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"ss",weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),weekStart:1,weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/sv.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/sv.js
new file mode 100644
index 0000000..f2adf6c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/sv.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_sv=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"sv",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,ordinal:function(e){var a=e%10;return"["+e+(1===a||2===a?"a":"e")+"]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/sw.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/sw.js
new file mode 100644
index 0000000..2ba8c91
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/sw.js
@@ -0,0 +1 @@
+!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):a.dayjs_locale_sw=e(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e={name:"sw",weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekStart:1,ordinal:function(a){return a},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return a.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ta.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ta.js
new file mode 100644
index 0000000..21eb97f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ta.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ta=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ta",weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/te.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/te.js
new file mode 100644
index 0000000..06f3bcb
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/te.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_te=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"te",weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/tet.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/tet.js
new file mode 100644
index 0000000..496ab10
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/tet.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):e.dayjs_locale_tet=t(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={name:"tet",weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),weekStart:1,weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"}};return e.locale(t,null,!0),t});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/tg.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/tg.js
new file mode 100644
index 0000000..e4995e2
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/tg.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_tg=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"tg",weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/th.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/th.js
new file mode 100644
index 0000000..ac9ecd8
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/th.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_th=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"th",weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"},ordinal:function(_){return _+"."}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/tk.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/tk.js
new file mode 100644
index 0000000..59f7931
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/tk.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):e.dayjs_locale_tk=n(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n={name:"tk",weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e){return e+"."}};return e.locale(n,null,!0),n});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/tl-ph.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/tl-ph.js
new file mode 100644
index 0000000..2da6282
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/tl-ph.js
@@ -0,0 +1 @@
+!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):e.dayjs_locale_tl_ph=a(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var a={name:"tl-ph",weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),weekStart:1,weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"}};return e.locale(a,null,!0),a});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/tlh.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/tlh.js
new file mode 100644
index 0000000..5837031
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/tlh.js
@@ -0,0 +1 @@
+!function(a,j){"object"==typeof exports&&"undefined"!=typeof module?module.exports=j(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],j):a.dayjs_locale_tlh=j(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var j={name:"tlh",weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),weekStart:1,weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return a.locale(j,null,!0),j});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/tr.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/tr.js
new file mode 100644
index 0000000..380ced9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/tr.js
@@ -0,0 +1 @@
+!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):a.dayjs_locale_tr=e(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){return a+"."}};return a.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/types.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/locale/types.d.ts
new file mode 100644
index 0000000..2c24a64
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/types.d.ts
@@ -0,0 +1,33 @@
+declare interface ILocale {
+ name: string
+ weekdays?: string[]
+ months?: string[]
+ weekStart?: number
+ weekdaysShort?: string[]
+ monthsShort?: string[]
+ weekdaysMin?: string[]
+ ordinal?: (n: number) => number | string
+ formats: Partial<{
+ LT: string
+ LTS: string
+ L: string
+ LL: string
+ LLL: string
+ LLLL: string
+ }>
+ relativeTime: Partial<{
+ future: string
+ past: string
+ s: string
+ m: string
+ mm: string
+ h: string
+ hh: string
+ d: string
+ dd: string
+ M: string
+ MM: string
+ y: string
+ yy: string
+ }>
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/tzl.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/tzl.js
new file mode 100644
index 0000000..bd53bd7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/tzl.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_tzl=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"tzl",weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),weekStart:1,weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),ordinal:function(e){return e},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/tzm-latn.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/tzm-latn.js
new file mode 100644
index 0000000..a111c2b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/tzm-latn.js
@@ -0,0 +1 @@
+!function(a,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):a.dayjs_locale_tzm_latn=s(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var s={name:"tzm-latn",weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekStart:6,weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"}};return a.locale(s,null,!0),s});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/tzm.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/tzm.js
new file mode 100644
index 0000000..57d1a97
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/tzm.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_tzm=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"tzm",weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekStart:6,weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ug-cn.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ug-cn.js
new file mode 100644
index 0000000..7183d67
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ug-cn.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ug_cn=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ug-cn",weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekStart:1,weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/uk.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/uk.js
new file mode 100644
index 0000000..9eb3354
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/uk.js
@@ -0,0 +1 @@
+!function(_,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):_.dayjs_locale_uk=t(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var t="січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),e="січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),s=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function n(_,t,e){var s,n;return"m"===e?t?"хвилина":"хвилину":"h"===e?t?"година":"годину":_+" "+(s=+_,n={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[e].split("_"),s%10==1&&s%100!=11?n[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?n[1]:n[2])}var d=function(_,n){return s.test(n)?t[_.month()]:e[_.month()]};d.s=e,d.f=t;var i={name:"uk",weekdays:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),weekdaysShort:"ндл_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:d,monthsShort:"сiч_лют_бер_квiт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:n,mm:n,h:n,hh:n,d:"день",dd:n,M:"місяць",MM:n,y:"рік",yy:n},ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"}};return _.locale(i,null,!0),i});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/ur.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/ur.js
new file mode 100644
index 0000000..cadbeec
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/ur.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_ur=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"ur",weekdays:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),months:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekStart:1,weekdaysShort:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),monthsShort:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekdaysMin:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/uz-latn.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/uz-latn.js
new file mode 100644
index 0000000..ac9ad50
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/uz-latn.js
@@ -0,0 +1 @@
+!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):a.dayjs_locale_uz_latn=e(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e={name:"uz-latn",weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),weekStart:1,weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"}};return a.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/uz.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/uz.js
new file mode 100644
index 0000000..79a46b1
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/uz.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_uz=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"uz",weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/vi.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/vi.js
new file mode 100644
index 0000000..8afa331
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/vi.js
@@ -0,0 +1 @@
+!function(t,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):t.dayjs_locale_vi=_(t.dayjs)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var _={name:"vi",weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),weekStart:1,weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"}};return t.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/x-pseudo.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/x-pseudo.js
new file mode 100644
index 0000000..963dc33
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/x-pseudo.js
@@ -0,0 +1 @@
+!function(_,d){"object"==typeof exports&&"undefined"!=typeof module?module.exports=d(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],d):_.dayjs_locale_x_pseudo=d(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var d={name:"x-pseudo",weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),weekStart:1,weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"}};return _.locale(d,null,!0),d});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/yo.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/yo.js
new file mode 100644
index 0000000..4b443cc
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/yo.js
@@ -0,0 +1 @@
+!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):e.dayjs_locale_yo=_(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var _={name:"yo",weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),weekStart:1,weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"}};return e.locale(_,null,!0),_});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/zh-cn.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/zh-cn.js
new file mode 100644
index 0000000..b6634dc
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/zh-cn.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_zh_cn=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(_,e){switch(e){case"W":return _+"周";default:return _+"日"}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(_,e){var t=100*_+e;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/zh-hk.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/zh-hk.js
new file mode 100644
index 0000000..3caea40
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/zh-hk.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_zh_hk=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"zh-hk",months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),ordinal:function(_){return _+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d 分鐘",h:"一小時",hh:"%d 小時",d:"一天",dd:"%d 天",M:"一個月",MM:"%d 個月",y:"一年",yy:"%d 年"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/zh-tw.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/zh-tw.js
new file mode 100644
index 0000000..3b427d4
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/zh-tw.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_zh_tw=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"zh-tw",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(_){return _+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/locale/zh.js b/node_modules/@pm2/agent/node_modules/dayjs/locale/zh.js
new file mode 100644
index 0000000..b42d20a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/locale/zh.js
@@ -0,0 +1 @@
+!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_zh=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"zh",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(_,e){switch(e){case"W":return _+"周";default:return _+"日"}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(_,e){var t=100*_+e;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"}};return _.locale(e,null,!0),e});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/package.json b/node_modules/@pm2/agent/node_modules/dayjs/package.json
new file mode 100644
index 0000000..5920207
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/package.json
@@ -0,0 +1,101 @@
+{
+ "name": "dayjs",
+ "version": "1.8.36",
+ "description": "2KB immutable date time library alternative to Moment.js with the same modern API ",
+ "main": "dayjs.min.js",
+ "types": "index.d.ts",
+ "module": "dayjs.min.js",
+ "scripts": {
+ "test": "TZ=Pacific/Auckland npm run test-tz && TZ=Europe/London npm run test-tz && TZ=America/Whitehorse npm run test-tz && npm run test-tz && jest",
+ "test-tz": "date && jest test/timezone.test --coverage=false",
+ "lint": "./node_modules/.bin/eslint src/* test/* build/*",
+ "prettier": "prettier --write \"docs/**/*.md\"",
+ "babel": "cross-env BABEL_ENV=build babel src --out-dir esm --copy-files && node build/esm",
+ "build": "cross-env BABEL_ENV=build node build && npm run size",
+ "sauce": "npx karma start karma.sauce.conf.js",
+ "test:sauce": "npm run sauce -- 0 && npm run sauce -- 1 && npm run sauce -- 2 && npm run sauce -- 3",
+ "size": "size-limit && gzip-size dayjs.min.js"
+ },
+ "pre-commit": [
+ "lint"
+ ],
+ "size-limit": [
+ {
+ "limit": "2.99 KB",
+ "path": "dayjs.min.js"
+ }
+ ],
+ "jest": {
+ "roots": [
+ "test"
+ ],
+ "testRegex": "test/(.*?/)?.*test.js$",
+ "testURL": "http://localhost",
+ "coverageDirectory": "./coverage/",
+ "collectCoverage": true,
+ "collectCoverageFrom": [
+ "src/**/*"
+ ]
+ },
+ "release": {
+ "prepare": [
+ {
+ "path": "@semantic-release/changelog"
+ },
+ [
+ "@semantic-release/git",
+ {
+ "assets": [
+ "CHANGELOG.md"
+ ]
+ }
+ ]
+ ]
+ },
+ "keywords": [
+ "dayjs",
+ "date",
+ "time",
+ "immutable",
+ "moment"
+ ],
+ "author": "iamkun",
+ "license": "MIT",
+ "homepage": "https://day.js.org",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/iamkun/dayjs.git"
+ },
+ "devDependencies": {
+ "@babel/cli": "^7.0.0-beta.44",
+ "@babel/core": "^7.0.0-beta.44",
+ "@babel/node": "^7.0.0-beta.44",
+ "@babel/preset-env": "^7.0.0-beta.44",
+ "babel-core": "^7.0.0-bridge.0",
+ "babel-jest": "^22.4.3",
+ "babel-plugin-external-helpers": "^6.22.0",
+ "cross-env": "^5.1.6",
+ "eslint": "^4.19.1",
+ "eslint-config-airbnb-base": "^12.1.0",
+ "eslint-plugin-import": "^2.10.0",
+ "eslint-plugin-jest": "^21.15.0",
+ "gzip-size-cli": "^2.1.0",
+ "jasmine-core": "^2.99.1",
+ "jest": "^22.4.3",
+ "karma": "^2.0.2",
+ "karma-jasmine": "^1.1.2",
+ "karma-sauce-launcher": "^1.1.0",
+ "mockdate": "^2.0.2",
+ "moment": "2.27.0",
+ "moment-timezone": "0.5.31",
+ "ncp": "^2.0.0",
+ "pre-commit": "^1.2.2",
+ "prettier": "^1.16.1",
+ "rollup": "^0.57.1",
+ "rollup-plugin-babel": "^4.0.0-beta.4",
+ "rollup-plugin-uglify": "^3.0.0",
+ "size-limit": "^0.18.0",
+ "typescript": "^2.8.3"
+ },
+ "dependencies": {}
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/advancedFormat.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/advancedFormat.d.ts
new file mode 100644
index 0000000..30ec75e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/advancedFormat.d.ts
@@ -0,0 +1,4 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/advancedFormat.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/advancedFormat.js
new file mode 100644
index 0000000..7b4370e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/advancedFormat.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_advancedFormat=t()}(this,function(){"use strict";return function(e,t,r){var n=t.prototype,o=n.format;r.en.ordinal=function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"},n.format=function(e){var t=this,r=this.$locale(),n=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|gggg|Do|X|x|k{1,2}|S/g,function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return r.ordinal(t.$D);case"gggg":return t.weekYear();case"wo":return r.ordinal(t.week(),"W");case"w":case"ww":return n.s(t.week(),"w"===e?1:2,"0");case"k":case"kk":return n.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();default:return e}});return o.bind(this)(a)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/badMutable.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/badMutable.d.ts
new file mode 100644
index 0000000..30ec75e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/badMutable.d.ts
@@ -0,0 +1,4 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/badMutable.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/badMutable.js
new file mode 100644
index 0000000..3b35ad6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/badMutable.js
@@ -0,0 +1 @@
+!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.dayjs_plugin_badMutable=n()}(this,function(){"use strict";return function(t,n){var i=n.prototype;i.$g=function(t,n,i){return this.$utils().u(t)?this[n]:this.$set(i,t)},i.set=function(t,n){return this.$set(t,n)};var e=i.startOf;i.startOf=function(t,n){return this.$d=e.bind(this)(t,n).toDate(),this.init(),this};var s=i.add;i.add=function(t,n){return this.$d=s.bind(this)(t,n).toDate(),this.init(),this};var r=i.locale;i.locale=function(t,n){return t?(this.$L=r.bind(this)(t,n).$L,this):this.$L};var o=i.daysInMonth;i.daysInMonth=function(){return o.bind(this.clone())()};var u=i.isSame;i.isSame=function(t,n){return u.bind(this.clone())(t,n)};var f=i.isBefore;i.isBefore=function(t,n){return f.bind(this.clone())(t,n)};var d=i.isAfter;i.isAfter=function(t,n){return d.bind(this.clone())(t,n)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/buddhistEra.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/buddhistEra.d.ts
new file mode 100644
index 0000000..30ec75e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/buddhistEra.d.ts
@@ -0,0 +1,4 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/buddhistEra.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/buddhistEra.js
new file mode 100644
index 0000000..290ccbd
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/buddhistEra.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_buddhistEra=e()}(this,function(){"use strict";return function(t,e){var n=e.prototype,i=n.format;n.format=function(t){var e=this,n=(t||"YYYY-MM-DDTHH:mm:ssZ").replace(/(\[[^\]]+])|BBBB|BB/g,function(t,n){var i,o=String(e.$y+543),r="BB"===t?[o.slice(-2),2]:[o,4];return n||(i=e.$utils()).s.apply(i,r.concat(["0"]))});return i.bind(this)(n)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/calendar.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/calendar.d.ts
new file mode 100644
index 0000000..a8d064f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/calendar.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc, ConfigType } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ calendar(referenceTime?: ConfigType, formats?: object): string
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/calendar.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/calendar.js
new file mode 100644
index 0000000..2b6e1b4
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/calendar.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_calendar=t()}(this,function(){"use strict";return function(e,t,a){var n="h:mm A",d={lastDay:"[Yesterday at] "+n,sameDay:"[Today at] "+n,nextDay:"[Tomorrow at] "+n,nextWeek:"dddd [at] "+n,lastWeek:"[Last] dddd [at] "+n,sameElse:"MM/DD/YYYY"};t.prototype.calendar=function(e,t){var n=t||this.$locale().calendar||d,s=a(e||void 0).startOf("d"),o=this.diff(s,"d",!0),i=o<-6?"sameElse":o<-1?"lastWeek":o<0?"lastDay":o<1?"sameDay":o<2?"nextDay":o<7?"nextWeek":"sameElse",f=n[i]||d[i];return"function"==typeof f?f.call(this,a()):this.format(f)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/customParseFormat.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/customParseFormat.d.ts
new file mode 100644
index 0000000..30ec75e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/customParseFormat.d.ts
@@ -0,0 +1,4 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/customParseFormat.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/customParseFormat.js
new file mode 100644
index 0000000..3a9c734
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/customParseFormat.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_customParseFormat=e()}(this,function(){"use strict";var t,e=/(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,o=/\d*[^\s\d-:/()]+/;var i=function(t){return function(e){this[t]=+e}},s=[/[+-]\d\d:?\d\d/,function(t){var e,n;(this.zone||(this.zone={})).offset=(e=t.match(/([+-]|\d\d)/g),0===(n=60*e[1]+ +e[2])?0:"+"===e[0]?-n:n)}],a=function(e){var n=t[e];return n&&(n.indexOf?n:n.s.concat(n.f))},h={A:[/[AP]M/,function(t){this.afternoon="PM"===t}],a:[/[ap]m/,function(t){this.afternoon="pm"===t}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[r,i("seconds")],ss:[r,i("seconds")],m:[r,i("minutes")],mm:[r,i("minutes")],H:[r,i("hours")],h:[r,i("hours")],HH:[r,i("hours")],hh:[r,i("hours")],D:[r,i("day")],DD:[n,i("day")],Do:[o,function(e){var n=t.ordinal,r=e.match(/\d+/);if(this.day=r[0],n)for(var o=1;o<=31;o+=1)n(o).replace(/\[|\]/g,"")===e&&(this.day=o)}],M:[r,i("month")],MM:[n,i("month")],MMM:[o,function(t){var e=a("months"),n=(a("monthsShort")||e.map(function(t){return t.substr(0,3)})).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[o,function(t){var e=a("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,i("year")],YY:[n,function(t){t=+t,this.year=t+(t>68?1900:2e3)}],YYYY:[/\d{4}/,i("year")],Z:s,ZZ:s};var f=function(t,n,r){try{var o=function(t){for(var n=t.match(e),r=n.length,o=0;o0?s-1:m.getMonth());var D=f||0,M=u||0,g=d||0,Y=c||0;return l?new Date(Date.UTC(p,y,v,D,M,g,Y+60*l.offset*1e3)):r?new Date(Date.UTC(p,y,v,D,M,g,Y)):new Date(p,y,v,D,M,g,Y)}catch(t){return new Date("")}};return function(e,n,r){var o=n.prototype,i=o.parse;o.parse=function(e){var n=e.date,o=e.utc,s=e.args;this.$u=o;var a=s[1];if("string"==typeof a){var h=!0===s[2],u=!0===s[3],d=h||u,c=s[2];u&&(c=s[2]),h||(t=c?r.Ls[c]:this.$locale()),this.$d=f(n,a,o),this.init(),c&&!0!==c&&(this.$L=this.locale(c).$L),d&&n!==this.format(a)&&(this.$d=new Date(""))}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var v=r.apply(this,s);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}m===l&&(this.$d=new Date(""))}else i.call(this,e)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/dayOfYear.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/dayOfYear.d.ts
new file mode 100644
index 0000000..4fd6601
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/dayOfYear.d.ts
@@ -0,0 +1,11 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ dayOfYear(): number
+ dayOfYear(value: number): Dayjs
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/dayOfYear.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/dayOfYear.js
new file mode 100644
index 0000000..e09facd
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/dayOfYear.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_dayOfYear=e()}(this,function(){"use strict";return function(t,e){e.prototype.dayOfYear=function(t){var e=Math.round((this.startOf("day")-this.startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"day")}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/duration.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/duration.d.ts
new file mode 100644
index 0000000..edc51b6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/duration.d.ts
@@ -0,0 +1,58 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export default plugin
+
+type DurationInputType = string | number | object
+type DurationAddType = number | object | Duration
+
+export declare class Duration {
+ constructor (input: DurationInputType, unit?: string, locale?: string)
+
+ clone(): Duration
+
+ humanize(withSuffix: boolean): string
+
+ milliseconds(): number
+ asMilliseconds(): number
+
+ seconds(): number
+ asSeconds(): number
+
+ minutes(): number
+ asMinutes(): number
+
+ hours(): number
+ asHours(): number
+
+ days(): number
+ asDays(): number
+
+ weeks(): number
+ asWeeks(): number
+
+ months(): number
+ asMonths(): number
+
+ years(): number
+ asYears(): number
+
+ as(unit: string): number
+
+ get(unit: string): number
+
+ add(input: DurationAddType, unit? : string): Duration
+
+ subtract(input: DurationAddType, unit? : string): Duration
+
+ toJSON(): string
+
+ toISOString(): string
+
+ locale(locale: string): Duration
+}
+
+declare module 'dayjs' {
+ export function duration(input?: DurationInputType , unit?: string): Duration
+ export function isDuration(d: any): d is Duration
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/duration.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/duration.js
new file mode 100644
index 0000000..1004c39
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/duration.js
@@ -0,0 +1 @@
+!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):t.dayjs_plugin_duration=s()}(this,function(){"use strict";var t,s,n=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,i={years:31536e6,months:2592e6,days:864e5,hours:36e5,minutes:6e4,seconds:1e3,milliseconds:1,weeks:6048e5},e=function(t){return t instanceof u},r=function(t,s,n){return new u(t,n,s.$l)},o=function(t){return s.p(t)+"s"},u=function(){function s(t,s,e){var u=this;if(this.$d={},this.$l=e,s)return r(t*i[o(s)],this);if("number"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if("object"==typeof t)return Object.keys(t).forEach(function(s){u.$d[o(s)]=t[s]}),this.calMilliseconds(),this;if("string"==typeof t){var h=t.match(n);if(h)return this.$d.years=h[2],this.$d.months=h[3],this.$d.weeks=h[4],this.$d.days=h[5],this.$d.hours=h[6],this.$d.minutes=h[7],this.$d.seconds=h[8],this.calMilliseconds(),this}return this}var u=s.prototype;return u.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce(function(s,n){return s+(t.$d[n]||0)*(i[n]||1)},0)},u.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=Math.floor(t/31536e6),t%=31536e6,this.$d.months=Math.floor(t/2592e6),t%=2592e6,this.$d.days=Math.floor(t/864e5),t%=864e5,this.$d.hours=Math.floor(t/36e5),t%=36e5,this.$d.minutes=Math.floor(t/6e4),t%=6e4,this.$d.seconds=Math.floor(t/1e3),t%=1e3,this.$d.milliseconds=t},u.toISOString=function(){var t=this.$d.years?this.$d.years+"Y":"",s=this.$d.months?this.$d.months+"M":"",n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=n?n+"D":"",e=this.$d.hours?this.$d.hours+"H":"",r=this.$d.minutes?this.$d.minutes+"M":"",o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3);var u=o?o+"S":"",h="P"+t+s+i+(e||r||u?"T":"")+e+r+u;return"P"===h?"P0D":h},u.toJSON=function(){return this.toISOString()},u.as=function(t){return this.$ms/(i[o(t)]||1)},u.get=function(t){var s=this.$ms,n=o(t);return"milliseconds"===n?s%=1e3:s="weeks"===n?Math.floor(s/i[n]):this.$d[n],s},u.add=function(t,s,n){var u;return u=s?t*i[o(s)]:e(t)?t.$ms:r(t,this).$ms,r(this.$ms+u*(n?-1:1),this)},u.subtract=function(t,s){return this.add(t,s,!0)},u.locale=function(t){var s=this.clone();return s.$l=t,s},u.clone=function(){return r(this.$ms,this)},u.humanize=function(s){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!s)},u.milliseconds=function(){return this.get("milliseconds")},u.asMilliseconds=function(){return this.as("milliseconds")},u.seconds=function(){return this.get("seconds")},u.asSeconds=function(){return this.as("seconds")},u.minutes=function(){return this.get("minutes")},u.asMinutes=function(){return this.as("minutes")},u.hours=function(){return this.get("hours")},u.asHours=function(){return this.as("hours")},u.days=function(){return this.get("days")},u.asDays=function(){return this.as("days")},u.weeks=function(){return this.get("weeks")},u.asWeeks=function(){return this.as("weeks")},u.months=function(){return this.get("months")},u.asMonths=function(){return this.as("months")},u.years=function(){return this.get("years")},u.asYears=function(){return this.as("years")},s}();return function(n,i,o){t=o,s=o().$utils(),o.duration=function(t,s){var n=o.locale();return r(t,{$l:n},s)},o.isDuration=e}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isBetween.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isBetween.d.ts
new file mode 100644
index 0000000..e73a27e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isBetween.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc, ConfigType, OpUnitType } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ isBetween(a: ConfigType, b: ConfigType, c?: OpUnitType | null, d?: string): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isBetween.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isBetween.js
new file mode 100644
index 0000000..535921a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isBetween.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_isBetween=t()}(this,function(){"use strict";return function(e,t,i){t.prototype.isBetween=function(e,t,s,f){var n=i(e),o=i(t),r="("===(f=f||"()")[0],u=")"===f[1];return(r?this.isAfter(n,s):!this.isBefore(n,s))&&(u?this.isBefore(o,s):!this.isAfter(o,s))||(r?this.isBefore(n,s):!this.isAfter(n,s))&&(u?this.isAfter(o,s):!this.isBefore(o,s))}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isLeapYear.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isLeapYear.d.ts
new file mode 100644
index 0000000..5be7409
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isLeapYear.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ isLeapYear(): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isLeapYear.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isLeapYear.js
new file mode 100644
index 0000000..c2ba251
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isLeapYear.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_isLeapYear=t()}(this,function(){"use strict";return function(e,t){t.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isMoment.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isMoment.d.ts
new file mode 100644
index 0000000..dac24f6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isMoment.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+
+ export function isMoment(input: any): boolean
+
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isMoment.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isMoment.js
new file mode 100644
index 0000000..5dd46f4
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isMoment.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.dayjs_plugin_isMoment=n()}(this,function(){"use strict";return function(e,n,t){t.isMoment=function(e){return t.isDayjs(e)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrAfter.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrAfter.d.ts
new file mode 100644
index 0000000..1c8c264
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrAfter.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc, ConfigType, OpUnitType } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ isSameOrAfter(date: ConfigType, unit?: OpUnitType): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrAfter.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrAfter.js
new file mode 100644
index 0000000..f9f8123
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrAfter.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_isSameOrAfter=t()}(this,function(){"use strict";return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrBefore.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrBefore.d.ts
new file mode 100644
index 0000000..1df5492
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrBefore.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc, ConfigType, OpUnitType } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ isSameOrBefore(date: ConfigType, unit?: OpUnitType): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrBefore.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrBefore.js
new file mode 100644
index 0000000..c31e245
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isSameOrBefore.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_isSameOrBefore=t()}(this,function(){"use strict";return function(e,t){t.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isToday.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isToday.d.ts
new file mode 100644
index 0000000..04ac581
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isToday.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ isToday(): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isToday.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isToday.js
new file mode 100644
index 0000000..da9ea34
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isToday.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_isToday=e()}(this,function(){"use strict";return function(t,e,o){e.prototype.isToday=function(){var t=o();return this.format("YYYY-MM-DD")===t.format("YYYY-MM-DD")}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isTomorrow.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isTomorrow.d.ts
new file mode 100644
index 0000000..08110b6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isTomorrow.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ isTomorrow(): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isTomorrow.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isTomorrow.js
new file mode 100644
index 0000000..df0d47b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isTomorrow.js
@@ -0,0 +1 @@
+!function(o,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):o.dayjs_plugin_isTomorrow=t()}(this,function(){"use strict";return function(o,t,e){t.prototype.isTomorrow=function(){var o=e().add(1,"day");return this.format("YYYY-MM-DD")===o.format("YYYY-MM-DD")}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isYesterday.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isYesterday.d.ts
new file mode 100644
index 0000000..2d8ae9e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isYesterday.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ isYesterday(): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isYesterday.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isYesterday.js
new file mode 100644
index 0000000..ee37cb2
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isYesterday.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_isYesterday=e()}(this,function(){"use strict";return function(t,e,n){e.prototype.isYesterday=function(){var t=n().subtract(1,"day");return this.format("YYYY-MM-DD")===t.format("YYYY-MM-DD")}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeek.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeek.d.ts
new file mode 100644
index 0000000..f8d59b7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeek.d.ts
@@ -0,0 +1,27 @@
+import { PluginFunc, UnitType, ConfigType } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+type ISOUnitType = UnitType | 'isoWeek';
+
+declare module 'dayjs' {
+ interface Dayjs {
+ isoWeekYear(): number
+ isoWeek(): number
+ isoWeek(value: number): Dayjs
+
+ isoWeekday(): number
+ isoWeekday(value: number): Dayjs
+
+ startOf(unit: ISOUnitType): Dayjs
+
+ endOf(unit: ISOUnitType): Dayjs
+
+ isSame(date: ConfigType, unit?: ISOUnitType): boolean
+
+ isBefore(date: ConfigType, unit?: ISOUnitType): boolean
+
+ isAfter(date: ConfigType, unit?: ISOUnitType): boolean
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeek.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeek.js
new file mode 100644
index 0000000..3938918
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeek.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_isoWeek=e()}(this,function(){"use strict";var t="day";return function(e,i,s){var a=function(e){return e.add(4-e.isoWeekday(),t)},d=i.prototype;d.isoWeekYear=function(){return a(this).year()},d.isoWeek=function(e){if(!this.$utils().u(e))return this.add(7*(e-this.isoWeek()),t);var i,d,n,r,o=a(this),u=(i=this.isoWeekYear(),d=this.$u,n=(d?s.utc:s)().year(i).startOf("year"),r=4-n.isoWeekday(),n.isoWeekday()>4&&(r+=7),n.add(r,t));return o.diff(u,"week")+1},d.isoWeekday=function(t){return this.$utils().u(t)?this.day()||7:this.day(this.day()%7?t:t-7)};var n=d.startOf;d.startOf=function(t,e){var i=this.$utils(),s=!!i.u(e)||e;return"isoweek"===i.p(t)?s?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n.bind(this)(t,e)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeeksInYear.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeeksInYear.d.ts
new file mode 100644
index 0000000..2bc02cd
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeeksInYear.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ isoWeeksInYear(): number
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeeksInYear.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeeksInYear.js
new file mode 100644
index 0000000..f8b2a76
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/isoWeeksInYear.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.dayjs_plugin_isoWeeksInYear=n()}(this,function(){"use strict";return function(e,n){n.prototype.isoWeeksInYear=function(){var e=this.isLeapYear(),n=this.endOf("y").day();return 4===n||e&&5===n?53:52}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/localeData.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/localeData.d.ts
new file mode 100644
index 0000000..7d98176
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/localeData.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ localeData(): any
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/localeData.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/localeData.js
new file mode 100644
index 0000000..fb15eca
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/localeData.js
@@ -0,0 +1 @@
+!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.dayjs_plugin_localeData=t()}(this,function(){"use strict";return function(n,t,e){var r=function(n){return n&&(n.indexOf?n:n.s)},o=function(n,t,e,o,u){var a=n.name?n:n.$locale(),s=r(a[t]),i=r(a[e]),f=s||i.map(function(n){return n.substr(0,o)});if(!u)return f;var d=a.weekStart;return f.map(function(n,t){return f[(t+(d||0))%7]})},u=function(){return e.Ls[e.locale()]};t.prototype.localeData=function(){return function(){var n=this;return{months:function(t){return t?t.format("MMMM"):o(n,"months")},monthsShort:function(t){return t?t.format("MMM"):o(n,"monthsShort","months",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(t){return t?t.format("dddd"):o(n,"weekdays")},weekdaysMin:function(t){return t?t.format("dd"):o(n,"weekdaysMin","weekdays",2)},weekdaysShort:function(t){return t?t.format("ddd"):o(n,"weekdaysShort","weekdays",3)},longDateFormat:function(t){return n.$locale().formats[t]}}}.bind(this)()},e.localeData=function(){var n=u();return{firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return e.weekdays()},weekdaysShort:function(){return e.weekdaysShort()},weekdaysMin:function(){return e.weekdaysMin()},months:function(){return e.months()},monthsShort:function(){return e.monthsShort()}}},e.months=function(){return o(u(),"months")},e.monthsShort=function(){return o(u(),"monthsShort","months",3)},e.weekdays=function(n){return o(u(),"weekdays",null,null,n)},e.weekdaysShort=function(n){return o(u(),"weekdaysShort","weekdays",3,n)},e.weekdaysMin=function(n){return o(u(),"weekdaysMin","weekdays",2,n)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/localizedFormat.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/localizedFormat.d.ts
new file mode 100644
index 0000000..30ec75e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/localizedFormat.d.ts
@@ -0,0 +1,4 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/localizedFormat.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/localizedFormat.js
new file mode 100644
index 0000000..bee2b27
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/localizedFormat.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_localizedFormat=t()}(this,function(){"use strict";return function(e,t,o){var n=t.prototype,r=n.format,M={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};o.en.formats=M;n.format=function(e){void 0===e&&(e="YYYY-MM-DDTHH:mm:ssZ");var t=this.$locale().formats,o=void 0===t?{}:t,n=e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(e,t,n){var r=n&&n.toUpperCase();return t||o[n]||M[n]||o[r].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,o){return t||o.slice(1)})});return r.call(this,n)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/minMax.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/minMax.d.ts
new file mode 100644
index 0000000..f167350
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/minMax.d.ts
@@ -0,0 +1,11 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ export function max(dayjs: Dayjs[]): Dayjs
+ export function max(...dayjs: Dayjs[]): Dayjs
+ export function min(dayjs: Dayjs[]): Dayjs
+ export function min(...dayjs: Dayjs[]): Dayjs
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/minMax.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/minMax.js
new file mode 100644
index 0000000..1584549
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/minMax.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.dayjs_plugin_minMax=n()}(this,function(){"use strict";return function(e,n,t){var i=function(e,n){if(!n.length)return t();var i;1===n.length&&n[0].length>0&&(n=n[0]),i=n[0];for(var r=1;r number
+ thresholds?: RelativeTimeThreshold[]
+}
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ fromNow(withoutSuffix?: boolean): string
+ from(compared: ConfigType, withoutSuffix?: boolean): string
+ toNow(withoutSuffix?: boolean): string
+ to(compared: ConfigType, withoutSuffix?: boolean): string
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/relativeTime.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/relativeTime.js
new file mode 100644
index 0000000..5d1daaa
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/relativeTime.js
@@ -0,0 +1 @@
+!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):r.dayjs_plugin_relativeTime=t()}(this,function(){"use strict";return function(r,t,e){r=r||{};var n=t.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};e.en.relativeTime=o;var d=function(t,n,d,i){for(var u,a,s,f=d.$locale().relativeTime||o,l=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],h=l.length,m=0;m0,y<=c.r||!c.r){y<=1&&m>0&&(c=l[m-1]);var p=f[c.l];a="string"==typeof p?p.replace("%d",y):p(y,n,c.l,s);break}}return n?a:(s?f.future:f.past).replace("%s",a)};n.to=function(r,t){return d(r,t,this,!0)},n.from=function(r,t){return d(r,t,this)};var i=function(r){return r.$u?e.utc():e()};n.toNow=function(r){return this.to(i(this),r)},n.fromNow=function(r){return this.from(i(this),r)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/timezone.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/timezone.d.ts
new file mode 100644
index 0000000..dce3b8b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/timezone.d.ts
@@ -0,0 +1,17 @@
+import { PluginFunc, ConfigType } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ tz(timezone: string): Dayjs
+ }
+
+ interface DayjsTimezone {
+ (date: ConfigType, timezone: string): Dayjs
+ guess(): string
+ }
+
+ const tz: DayjsTimezone
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/timezone.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/timezone.js
new file mode 100644
index 0000000..7d94af9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/timezone.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_timezone=e()}(this,function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5};return function(e,n,i){var o,r=i().utcOffset(),u=function(e,n){for(var o=new Date(e),r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(o),u=[],a=0;a=0&&(u[c]=parseInt(d,10))}var m=u[3],v=24===m?0:m,h=u[0]+"-"+u[1]+"-"+u[2]+" "+v+":"+u[4]+":"+u[5]+":000",l=+o;return(i.utc(h).valueOf()-(l-=l%1e3))/6e4};n.prototype.tz=function(t){void 0===t&&(t=o);var e=this.toDate().toLocaleString("en-US",{timeZone:t}),n=Math.round((this.toDate()-new Date(e))/1e3/60);return i(e).utcOffset(r-n,!0).$set("ms",this.$ms)},i.tz=function(t,e){void 0===e&&(e=o);var n,r=u(+i(),e);"string"!=typeof t&&(n=i(t)+60*r*1e3);var a=function(t,e,n){var i=t-60*e*1e3,o=u(i,n);if(e===o)return[i,e];var r=u(i-=60*(o-e)*1e3,n);return o===r?[i,o]:[t-60*Math.min(o,r)*1e3,Math.max(o,r)]}(n=n||i.utc(t).valueOf(),r,e),f=a[0],s=a[1];return i(f).utcOffset(s)},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(t){o=t}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/toArray.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/toArray.d.ts
new file mode 100644
index 0000000..45f1f0c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/toArray.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ toArray(): number[]
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/toArray.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/toArray.js
new file mode 100644
index 0000000..fef0f68
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/toArray.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_toArray=e()}(this,function(){"use strict";return function(t,e){e.prototype.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/toObject.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/toObject.d.ts
new file mode 100644
index 0000000..ca12aaf
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/toObject.d.ts
@@ -0,0 +1,20 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+interface DayjsObject {
+ years: number
+ months: number
+ date: number
+ hours: number
+ minutes: number
+ seconds: number
+ milliseconds: number
+}
+
+declare module 'dayjs' {
+ interface Dayjs {
+ toObject(): DayjsObject
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/toObject.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/toObject.js
new file mode 100644
index 0000000..e03619d
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/toObject.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_toObject=e()}(this,function(){"use strict";return function(t,e){e.prototype.toObject=function(){return{years:this.$y,months:this.$M,date:this.$D,hours:this.$H,minutes:this.$m,seconds:this.$s,milliseconds:this.$ms}}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/updateLocale.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/updateLocale.d.ts
new file mode 100644
index 0000000..44bce47
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/updateLocale.d.ts
@@ -0,0 +1,8 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ export function updateLocale(localeName: String, customConfig: Object): any
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/updateLocale.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/updateLocale.js
new file mode 100644
index 0000000..e38fdc8
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/updateLocale.js
@@ -0,0 +1 @@
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.dayjs_plugin_updateLocale=n()}(this,function(){"use strict";return function(e,n,t){t.updateLocale=function(e,n){var o=t.Ls[e];if(o)return(n?Object.keys(n):[]).forEach(function(e){o[e]=n[e]}),o}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/utc.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/utc.d.ts
new file mode 100644
index 0000000..1802761
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/utc.d.ts
@@ -0,0 +1,19 @@
+import { PluginFunc, ConfigType } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+
+ utc(): Dayjs
+
+ local(): Dayjs
+
+ isUTC(): boolean
+
+ utcOffset(offset: number, keepLocalTime?: boolean): Dayjs
+ }
+
+ export function utc(config?: ConfigType, format?: string): Dayjs
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/utc.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/utc.js
new file mode 100644
index 0000000..cd3cc01
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/utc.js
@@ -0,0 +1 @@
+!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.dayjs_plugin_utc=i()}(this,function(){"use strict";return function(t,i,e){var s=(new Date).getTimezoneOffset(),n=i.prototype;e.utc=function(t){return new i({date:t,utc:!0,args:arguments})},n.utc=function(){return e(this.toDate(),{locale:this.$L,utc:!0})},n.local=function(){return e(this.toDate(),{locale:this.$L,utc:!1})};var u=n.parse;n.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),u.call(this,t)};var o=n.init;n.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else o.call(this)};var f=n.utcOffset;n.utcOffset=function(t,i){var e=this.$utils().u;if(e(t))return this.$u?0:e(this.$offset)?f.call(this):this.$offset;var n=Math.abs(t)<=16?60*t:t,u=this;return i?(u.$offset=n,u.$u=0===t,u):(0!==t?(u=this.local().add(n+s,"minute")).$offset=n:u=this.utc(),u)};var r=n.format;n.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return r.call(this,i)},n.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+s;return this.$d.valueOf()-6e4*t},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var a=n.toDate;n.toDate=function(t){return"s"===t&&this.$offset?e(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():a.call(this)};var c=n.diff;n.diff=function(t,i,s){var n=this.local(),u=e(t).local();return c.call(n,u,i,s)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekOfYear.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekOfYear.d.ts
new file mode 100644
index 0000000..d988014
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekOfYear.d.ts
@@ -0,0 +1,12 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ week(): number
+
+ week(value : number): Dayjs
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekOfYear.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekOfYear.js
new file mode 100644
index 0000000..a8d1d2f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekOfYear.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_weekOfYear=t()}(this,function(){"use strict";var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),d=this.diff(a,e,!0);return d<0?r(this).startOf("week").week():Math.ceil(d)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekYear.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekYear.d.ts
new file mode 100644
index 0000000..df25331
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekYear.d.ts
@@ -0,0 +1,10 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ weekYear(): number
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekYear.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekYear.js
new file mode 100644
index 0000000..c9d2fe7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekYear.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_weekYear=t()}(this,function(){"use strict";return function(e,t){t.prototype.weekYear=function(){var e=this.month(),t=this.week(),n=this.year();return 1===t&&11===e?n+1:n}}});
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekday.d.ts b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekday.d.ts
new file mode 100644
index 0000000..87a8025
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekday.d.ts
@@ -0,0 +1,12 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ weekday(): number
+
+ weekday(value: number): Dayjs
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekday.js b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekday.js
new file mode 100644
index 0000000..ad0aaef
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/dayjs/plugin/weekday.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.dayjs_plugin_weekday=t()}(this,function(){"use strict";return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,n=this.$W,i=(n value`
+
+ Both of these will update the "recently used"-ness of the key.
+ They do what you think. `maxAge` is optional and overrides the
+ cache `maxAge` option if provided.
+
+ If the key is not found, `get()` will return `undefined`.
+
+ The key and val can be any value.
+
+* `peek(key)`
+
+ Returns the key value (or `undefined` if not found) without
+ updating the "recently used"-ness of the key.
+
+ (If you find yourself using this a lot, you *might* be using the
+ wrong sort of data structure, but there are some use cases where
+ it's handy.)
+
+* `del(key)`
+
+ Deletes a key out of the cache.
+
+* `reset()`
+
+ Clear the cache entirely, throwing away all values.
+
+* `has(key)`
+
+ Check if a key is in the cache, without updating the recent-ness
+ or deleting it for being stale.
+
+* `forEach(function(value,key,cache), [thisp])`
+
+ Just like `Array.prototype.forEach`. Iterates over all the keys
+ in the cache, in order of recent-ness. (Ie, more recently used
+ items are iterated over first.)
+
+* `rforEach(function(value,key,cache), [thisp])`
+
+ The same as `cache.forEach(...)` but items are iterated over in
+ reverse order. (ie, less recently used items are iterated over
+ first.)
+
+* `keys()`
+
+ Return an array of the keys in the cache.
+
+* `values()`
+
+ Return an array of the values in the cache.
+
+* `length`
+
+ Return total length of objects in cache taking into account
+ `length` options function.
+
+* `itemCount`
+
+ Return total quantity of objects currently in cache. Note, that
+ `stale` (see options) items are returned as part of this item
+ count.
+
+* `dump()`
+
+ Return an array of the cache entries ready for serialization and usage
+ with 'destinationCache.load(arr)`.
+
+* `load(cacheEntriesArray)`
+
+ Loads another cache entries array, obtained with `sourceCache.dump()`,
+ into the cache. The destination cache is reset before loading new entries
+
+* `prune()`
+
+ Manually iterates over the entire cache proactively pruning old entries
diff --git a/node_modules/@pm2/agent/node_modules/lru-cache/index.js b/node_modules/@pm2/agent/node_modules/lru-cache/index.js
new file mode 100644
index 0000000..573b6b8
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/lru-cache/index.js
@@ -0,0 +1,334 @@
+'use strict'
+
+// A linked list to keep track of recently-used-ness
+const Yallist = require('yallist')
+
+const MAX = Symbol('max')
+const LENGTH = Symbol('length')
+const LENGTH_CALCULATOR = Symbol('lengthCalculator')
+const ALLOW_STALE = Symbol('allowStale')
+const MAX_AGE = Symbol('maxAge')
+const DISPOSE = Symbol('dispose')
+const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')
+const LRU_LIST = Symbol('lruList')
+const CACHE = Symbol('cache')
+const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')
+
+const naiveLength = () => 1
+
+// lruList is a yallist where the head is the youngest
+// item, and the tail is the oldest. the list contains the Hit
+// objects as the entries.
+// Each Hit object has a reference to its Yallist.Node. This
+// never changes.
+//
+// cache is a Map (or PseudoMap) that matches the keys to
+// the Yallist.Node object.
+class LRUCache {
+ constructor (options) {
+ if (typeof options === 'number')
+ options = { max: options }
+
+ if (!options)
+ options = {}
+
+ if (options.max && (typeof options.max !== 'number' || options.max < 0))
+ throw new TypeError('max must be a non-negative number')
+ // Kind of weird to have a default max of Infinity, but oh well.
+ const max = this[MAX] = options.max || Infinity
+
+ const lc = options.length || naiveLength
+ this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc
+ this[ALLOW_STALE] = options.stale || false
+ if (options.maxAge && typeof options.maxAge !== 'number')
+ throw new TypeError('maxAge must be a number')
+ this[MAX_AGE] = options.maxAge || 0
+ this[DISPOSE] = options.dispose
+ this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false
+ this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false
+ this.reset()
+ }
+
+ // resize the cache when the max changes.
+ set max (mL) {
+ if (typeof mL !== 'number' || mL < 0)
+ throw new TypeError('max must be a non-negative number')
+
+ this[MAX] = mL || Infinity
+ trim(this)
+ }
+ get max () {
+ return this[MAX]
+ }
+
+ set allowStale (allowStale) {
+ this[ALLOW_STALE] = !!allowStale
+ }
+ get allowStale () {
+ return this[ALLOW_STALE]
+ }
+
+ set maxAge (mA) {
+ if (typeof mA !== 'number')
+ throw new TypeError('maxAge must be a non-negative number')
+
+ this[MAX_AGE] = mA
+ trim(this)
+ }
+ get maxAge () {
+ return this[MAX_AGE]
+ }
+
+ // resize the cache when the lengthCalculator changes.
+ set lengthCalculator (lC) {
+ if (typeof lC !== 'function')
+ lC = naiveLength
+
+ if (lC !== this[LENGTH_CALCULATOR]) {
+ this[LENGTH_CALCULATOR] = lC
+ this[LENGTH] = 0
+ this[LRU_LIST].forEach(hit => {
+ hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)
+ this[LENGTH] += hit.length
+ })
+ }
+ trim(this)
+ }
+ get lengthCalculator () { return this[LENGTH_CALCULATOR] }
+
+ get length () { return this[LENGTH] }
+ get itemCount () { return this[LRU_LIST].length }
+
+ rforEach (fn, thisp) {
+ thisp = thisp || this
+ for (let walker = this[LRU_LIST].tail; walker !== null;) {
+ const prev = walker.prev
+ forEachStep(this, fn, walker, thisp)
+ walker = prev
+ }
+ }
+
+ forEach (fn, thisp) {
+ thisp = thisp || this
+ for (let walker = this[LRU_LIST].head; walker !== null;) {
+ const next = walker.next
+ forEachStep(this, fn, walker, thisp)
+ walker = next
+ }
+ }
+
+ keys () {
+ return this[LRU_LIST].toArray().map(k => k.key)
+ }
+
+ values () {
+ return this[LRU_LIST].toArray().map(k => k.value)
+ }
+
+ reset () {
+ if (this[DISPOSE] &&
+ this[LRU_LIST] &&
+ this[LRU_LIST].length) {
+ this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))
+ }
+
+ this[CACHE] = new Map() // hash of items by key
+ this[LRU_LIST] = new Yallist() // list of items in order of use recency
+ this[LENGTH] = 0 // length of items in the list
+ }
+
+ dump () {
+ return this[LRU_LIST].map(hit =>
+ isStale(this, hit) ? false : {
+ k: hit.key,
+ v: hit.value,
+ e: hit.now + (hit.maxAge || 0)
+ }).toArray().filter(h => h)
+ }
+
+ dumpLru () {
+ return this[LRU_LIST]
+ }
+
+ set (key, value, maxAge) {
+ maxAge = maxAge || this[MAX_AGE]
+
+ if (maxAge && typeof maxAge !== 'number')
+ throw new TypeError('maxAge must be a number')
+
+ const now = maxAge ? Date.now() : 0
+ const len = this[LENGTH_CALCULATOR](value, key)
+
+ if (this[CACHE].has(key)) {
+ if (len > this[MAX]) {
+ del(this, this[CACHE].get(key))
+ return false
+ }
+
+ const node = this[CACHE].get(key)
+ const item = node.value
+
+ // dispose of the old one before overwriting
+ // split out into 2 ifs for better coverage tracking
+ if (this[DISPOSE]) {
+ if (!this[NO_DISPOSE_ON_SET])
+ this[DISPOSE](key, item.value)
+ }
+
+ item.now = now
+ item.maxAge = maxAge
+ item.value = value
+ this[LENGTH] += len - item.length
+ item.length = len
+ this.get(key)
+ trim(this)
+ return true
+ }
+
+ const hit = new Entry(key, value, len, now, maxAge)
+
+ // oversized objects fall out of cache automatically.
+ if (hit.length > this[MAX]) {
+ if (this[DISPOSE])
+ this[DISPOSE](key, value)
+
+ return false
+ }
+
+ this[LENGTH] += hit.length
+ this[LRU_LIST].unshift(hit)
+ this[CACHE].set(key, this[LRU_LIST].head)
+ trim(this)
+ return true
+ }
+
+ has (key) {
+ if (!this[CACHE].has(key)) return false
+ const hit = this[CACHE].get(key).value
+ return !isStale(this, hit)
+ }
+
+ get (key) {
+ return get(this, key, true)
+ }
+
+ peek (key) {
+ return get(this, key, false)
+ }
+
+ pop () {
+ const node = this[LRU_LIST].tail
+ if (!node)
+ return null
+
+ del(this, node)
+ return node.value
+ }
+
+ del (key) {
+ del(this, this[CACHE].get(key))
+ }
+
+ load (arr) {
+ // reset the cache
+ this.reset()
+
+ const now = Date.now()
+ // A previous serialized cache has the most recent items first
+ for (let l = arr.length - 1; l >= 0; l--) {
+ const hit = arr[l]
+ const expiresAt = hit.e || 0
+ if (expiresAt === 0)
+ // the item was created without expiration in a non aged cache
+ this.set(hit.k, hit.v)
+ else {
+ const maxAge = expiresAt - now
+ // dont add already expired items
+ if (maxAge > 0) {
+ this.set(hit.k, hit.v, maxAge)
+ }
+ }
+ }
+ }
+
+ prune () {
+ this[CACHE].forEach((value, key) => get(this, key, false))
+ }
+}
+
+const get = (self, key, doUse) => {
+ const node = self[CACHE].get(key)
+ if (node) {
+ const hit = node.value
+ if (isStale(self, hit)) {
+ del(self, node)
+ if (!self[ALLOW_STALE])
+ return undefined
+ } else {
+ if (doUse) {
+ if (self[UPDATE_AGE_ON_GET])
+ node.value.now = Date.now()
+ self[LRU_LIST].unshiftNode(node)
+ }
+ }
+ return hit.value
+ }
+}
+
+const isStale = (self, hit) => {
+ if (!hit || (!hit.maxAge && !self[MAX_AGE]))
+ return false
+
+ const diff = Date.now() - hit.now
+ return hit.maxAge ? diff > hit.maxAge
+ : self[MAX_AGE] && (diff > self[MAX_AGE])
+}
+
+const trim = self => {
+ if (self[LENGTH] > self[MAX]) {
+ for (let walker = self[LRU_LIST].tail;
+ self[LENGTH] > self[MAX] && walker !== null;) {
+ // We know that we're about to delete this one, and also
+ // what the next least recently used key will be, so just
+ // go ahead and set it now.
+ const prev = walker.prev
+ del(self, walker)
+ walker = prev
+ }
+ }
+}
+
+const del = (self, node) => {
+ if (node) {
+ const hit = node.value
+ if (self[DISPOSE])
+ self[DISPOSE](hit.key, hit.value)
+
+ self[LENGTH] -= hit.length
+ self[CACHE].delete(hit.key)
+ self[LRU_LIST].removeNode(node)
+ }
+}
+
+class Entry {
+ constructor (key, value, length, now, maxAge) {
+ this.key = key
+ this.value = value
+ this.length = length
+ this.now = now
+ this.maxAge = maxAge || 0
+ }
+}
+
+const forEachStep = (self, fn, node, thisp) => {
+ let hit = node.value
+ if (isStale(self, hit)) {
+ del(self, node)
+ if (!self[ALLOW_STALE])
+ hit = undefined
+ }
+ if (hit)
+ fn.call(thisp, hit.value, hit.key, self)
+}
+
+module.exports = LRUCache
diff --git a/node_modules/@pm2/agent/node_modules/lru-cache/package.json b/node_modules/@pm2/agent/node_modules/lru-cache/package.json
new file mode 100644
index 0000000..43b7502
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/lru-cache/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "lru-cache",
+ "description": "A cache object that deletes the least-recently-used items.",
+ "version": "6.0.0",
+ "author": "Isaac Z. Schlueter ",
+ "keywords": [
+ "mru",
+ "lru",
+ "cache"
+ ],
+ "scripts": {
+ "test": "tap",
+ "snap": "tap",
+ "preversion": "npm test",
+ "postversion": "npm publish",
+ "prepublishOnly": "git push origin --follow-tags"
+ },
+ "main": "index.js",
+ "repository": "git://github.com/isaacs/node-lru-cache.git",
+ "devDependencies": {
+ "benchmark": "^2.1.4",
+ "tap": "^14.10.7"
+ },
+ "license": "ISC",
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "engines": {
+ "node": ">=10"
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/semver/LICENSE b/node_modules/@pm2/agent/node_modules/semver/LICENSE
new file mode 100644
index 0000000..19129e3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/@pm2/agent/node_modules/semver/README.md b/node_modules/@pm2/agent/node_modules/semver/README.md
new file mode 100644
index 0000000..53ea9b5
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/README.md
@@ -0,0 +1,637 @@
+semver(1) -- The semantic versioner for npm
+===========================================
+
+## Install
+
+```bash
+npm install semver
+````
+
+## Usage
+
+As a node module:
+
+```js
+const semver = require('semver')
+
+semver.valid('1.2.3') // '1.2.3'
+semver.valid('a.b.c') // null
+semver.clean(' =v1.2.3 ') // '1.2.3'
+semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
+semver.gt('1.2.3', '9.8.7') // false
+semver.lt('1.2.3', '9.8.7') // true
+semver.minVersion('>=1.0.0') // '1.0.0'
+semver.valid(semver.coerce('v2')) // '2.0.0'
+semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
+```
+
+You can also just load the module for the function that you care about, if
+you'd like to minimize your footprint.
+
+```js
+// load the whole API at once in a single object
+const semver = require('semver')
+
+// or just load the bits you need
+// all of them listed here, just pick and choose what you want
+
+// classes
+const SemVer = require('semver/classes/semver')
+const Comparator = require('semver/classes/comparator')
+const Range = require('semver/classes/range')
+
+// functions for working with versions
+const semverParse = require('semver/functions/parse')
+const semverValid = require('semver/functions/valid')
+const semverClean = require('semver/functions/clean')
+const semverInc = require('semver/functions/inc')
+const semverDiff = require('semver/functions/diff')
+const semverMajor = require('semver/functions/major')
+const semverMinor = require('semver/functions/minor')
+const semverPatch = require('semver/functions/patch')
+const semverPrerelease = require('semver/functions/prerelease')
+const semverCompare = require('semver/functions/compare')
+const semverRcompare = require('semver/functions/rcompare')
+const semverCompareLoose = require('semver/functions/compare-loose')
+const semverCompareBuild = require('semver/functions/compare-build')
+const semverSort = require('semver/functions/sort')
+const semverRsort = require('semver/functions/rsort')
+
+// low-level comparators between versions
+const semverGt = require('semver/functions/gt')
+const semverLt = require('semver/functions/lt')
+const semverEq = require('semver/functions/eq')
+const semverNeq = require('semver/functions/neq')
+const semverGte = require('semver/functions/gte')
+const semverLte = require('semver/functions/lte')
+const semverCmp = require('semver/functions/cmp')
+const semverCoerce = require('semver/functions/coerce')
+
+// working with ranges
+const semverSatisfies = require('semver/functions/satisfies')
+const semverMaxSatisfying = require('semver/ranges/max-satisfying')
+const semverMinSatisfying = require('semver/ranges/min-satisfying')
+const semverToComparators = require('semver/ranges/to-comparators')
+const semverMinVersion = require('semver/ranges/min-version')
+const semverValidRange = require('semver/ranges/valid')
+const semverOutside = require('semver/ranges/outside')
+const semverGtr = require('semver/ranges/gtr')
+const semverLtr = require('semver/ranges/ltr')
+const semverIntersects = require('semver/ranges/intersects')
+const simplifyRange = require('semver/ranges/simplify')
+const rangeSubset = require('semver/ranges/subset')
+```
+
+As a command-line utility:
+
+```
+$ semver -h
+
+A JavaScript implementation of the https://semver.org/ specification
+Copyright Isaac Z. Schlueter
+
+Usage: semver [options] [ [...]]
+Prints valid versions sorted by SemVer precedence
+
+Options:
+-r --range
+ Print versions that match the specified range.
+
+-i --increment []
+ Increment a version by the specified level. Level can
+ be one of: major, minor, patch, premajor, preminor,
+ prepatch, or prerelease. Default level is 'patch'.
+ Only one version may be specified.
+
+--preid
+ Identifier to be used to prefix premajor, preminor,
+ prepatch or prerelease version increments.
+
+-l --loose
+ Interpret versions and ranges loosely
+
+-n <0|1>
+ This is the base to be used for the prerelease identifier.
+
+-p --include-prerelease
+ Always include prerelease versions in range matching
+
+-c --coerce
+ Coerce a string into SemVer if possible
+ (does not imply --loose)
+
+--rtl
+ Coerce version strings right to left
+
+--ltr
+ Coerce version strings left to right (default)
+
+Program exits successfully if any valid version satisfies
+all supplied ranges, and prints all satisfying versions.
+
+If no satisfying versions are found, then exits failure.
+
+Versions are printed in ascending order, so supplying
+multiple versions to the utility will just sort them.
+```
+
+## Versions
+
+A "version" is described by the `v2.0.0` specification found at
+.
+
+A leading `"="` or `"v"` character is stripped off and ignored.
+
+## Ranges
+
+A `version range` is a set of `comparators` which specify versions
+that satisfy the range.
+
+A `comparator` is composed of an `operator` and a `version`. The set
+of primitive `operators` is:
+
+* `<` Less than
+* `<=` Less than or equal to
+* `>` Greater than
+* `>=` Greater than or equal to
+* `=` Equal. If no operator is specified, then equality is assumed,
+ so this operator is optional, but MAY be included.
+
+For example, the comparator `>=1.2.7` would match the versions
+`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
+or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and
+would match the versions `2.0.0` and `3.1.0`, but not the versions
+`1.0.1` or `1.1.0`.
+
+Comparators can be joined by whitespace to form a `comparator set`,
+which is satisfied by the **intersection** of all of the comparators
+it includes.
+
+A range is composed of one or more comparator sets, joined by `||`. A
+version matches a range if and only if every comparator in at least
+one of the `||`-separated comparator sets is satisfied by the version.
+
+For example, the range `>=1.2.7 <1.3.0` would match the versions
+`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
+or `1.1.0`.
+
+The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
+`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
+
+### Prerelease Tags
+
+If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
+it will only be allowed to satisfy comparator sets if at least one
+comparator with the same `[major, minor, patch]` tuple also has a
+prerelease tag.
+
+For example, the range `>1.2.3-alpha.3` would be allowed to match the
+version `1.2.3-alpha.7`, but it would *not* be satisfied by
+`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
+than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
+range only accepts prerelease tags on the `1.2.3` version. The
+version `3.4.5` *would* satisfy the range, because it does not have a
+prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
+
+The purpose for this behavior is twofold. First, prerelease versions
+frequently are updated very quickly, and contain many breaking changes
+that are (by the author's design) not yet fit for public consumption.
+Therefore, by default, they are excluded from range matching
+semantics.
+
+Second, a user who has opted into using a prerelease version has
+clearly indicated the intent to use *that specific* set of
+alpha/beta/rc versions. By including a prerelease tag in the range,
+the user is indicating that they are aware of the risk. However, it
+is still not appropriate to assume that they have opted into taking a
+similar risk on the *next* set of prerelease versions.
+
+Note that this behavior can be suppressed (treating all prerelease
+versions as if they were normal versions, for the purpose of range
+matching) by setting the `includePrerelease` flag on the options
+object to any
+[functions](https://github.com/npm/node-semver#functions) that do
+range matching.
+
+#### Prerelease Identifiers
+
+The method `.inc` takes an additional `identifier` string argument that
+will append the value of the string as a prerelease identifier:
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta')
+// '1.2.4-beta.0'
+```
+
+command-line example:
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta
+1.2.4-beta.0
+```
+
+Which then can be used to increment further:
+
+```bash
+$ semver 1.2.4-beta.0 -i prerelease
+1.2.4-beta.1
+```
+
+#### Prerelease Identifier Base
+
+The method `.inc` takes an optional parameter 'identifierBase' string
+that will let you let your prerelease number as zero-based or one-based.
+Set to `false` to omit the prerelease number altogether.
+If you do not specify this parameter, it will default to zero-based.
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta', '1')
+// '1.2.4-beta.1'
+```
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta', false)
+// '1.2.4-beta'
+```
+
+command-line example:
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta -n 1
+1.2.4-beta.1
+```
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta -n false
+1.2.4-beta
+```
+
+### Advanced Range Syntax
+
+Advanced range syntax desugars to primitive comparators in
+deterministic ways.
+
+Advanced ranges may be combined in the same way as primitive
+comparators using white space or `||`.
+
+#### Hyphen Ranges `X.Y.Z - A.B.C`
+
+Specifies an inclusive set.
+
+* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
+
+If a partial version is provided as the first version in the inclusive
+range, then the missing pieces are replaced with zeroes.
+
+* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
+
+If a partial version is provided as the second version in the
+inclusive range, then all versions that start with the supplied parts
+of the tuple are accepted, but nothing that would be greater than the
+provided tuple parts.
+
+* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
+* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
+
+#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
+
+Any of `X`, `x`, or `*` may be used to "stand in" for one of the
+numeric values in the `[major, minor, patch]` tuple.
+
+* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless
+ `includePrerelease` is specified, in which case any version at all
+ satisfies)
+* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
+* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
+
+A partial version range is treated as an X-Range, so the special
+character is in fact optional.
+
+* `""` (empty string) := `*` := `>=0.0.0`
+* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
+* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
+
+#### Tilde Ranges `~1.2.3` `~1.2` `~1`
+
+Allows patch-level changes if a minor version is specified on the
+comparator. Allows minor-level changes if not.
+
+* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
+* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
+* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
+* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
+* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
+* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
+* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+
+#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
+
+Allows changes that do not modify the left-most non-zero element in the
+`[major, minor, patch]` tuple. In other words, this allows patch and
+minor updates for versions `1.0.0` and above, patch updates for
+versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
+
+Many authors treat a `0.x` version as if the `x` were the major
+"breaking-change" indicator.
+
+Caret ranges are ideal when an author may make breaking changes
+between `0.2.4` and `0.3.0` releases, which is a common practice.
+However, it presumes that there will *not* be breaking changes between
+`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
+additive (but non-breaking), according to commonly observed practices.
+
+* `^1.2.3` := `>=1.2.3 <2.0.0-0`
+* `^0.2.3` := `>=0.2.3 <0.3.0-0`
+* `^0.0.3` := `>=0.0.3 <0.0.4-0`
+* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
+ `0.0.3` version *only* will be allowed, if they are greater than or
+ equal to `beta`. So, `0.0.3-pr.2` would be allowed.
+
+When parsing caret ranges, a missing `patch` value desugars to the
+number `0`, but will allow flexibility within that value, even if the
+major and minor versions are both `0`.
+
+* `^1.2.x` := `>=1.2.0 <2.0.0-0`
+* `^0.0.x` := `>=0.0.0 <0.1.0-0`
+* `^0.0` := `>=0.0.0 <0.1.0-0`
+
+A missing `minor` and `patch` values will desugar to zero, but also
+allow flexibility within those values, even if the major version is
+zero.
+
+* `^1.x` := `>=1.0.0 <2.0.0-0`
+* `^0.x` := `>=0.0.0 <1.0.0-0`
+
+### Range Grammar
+
+Putting all this together, here is a Backus-Naur grammar for ranges,
+for the benefit of parser authors:
+
+```bnf
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
+```
+
+## Functions
+
+All methods and classes take a final `options` object argument. All
+options in this object are `false` by default. The options supported
+are:
+
+- `loose` Be more forgiving about not-quite-valid semver strings.
+ (Any resulting output will always be 100% strict compliant, of
+ course.) For backwards compatibility reasons, if the `options`
+ argument is a boolean value instead of an object, it is interpreted
+ to be the `loose` param.
+- `includePrerelease` Set to suppress the [default
+ behavior](https://github.com/npm/node-semver#prerelease-tags) of
+ excluding prerelease tagged versions from ranges unless they are
+ explicitly opted into.
+
+Strict-mode Comparators and Ranges will be strict about the SemVer
+strings that they parse.
+
+* `valid(v)`: Return the parsed version, or null if it's not valid.
+* `inc(v, release)`: Return the version incremented by the release
+ type (`major`, `premajor`, `minor`, `preminor`, `patch`,
+ `prepatch`, or `prerelease`), or null if it's not valid
+ * `premajor` in one call will bump the version up to the next major
+ version and down to a prerelease of that major version.
+ `preminor`, and `prepatch` work the same way.
+ * If called from a non-prerelease version, the `prerelease` will work the
+ same as `prepatch`. It increments the patch version, then makes a
+ prerelease. If the input version is already a prerelease it simply
+ increments it.
+* `prerelease(v)`: Returns an array of prerelease components, or null
+ if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
+* `major(v)`: Return the major version number.
+* `minor(v)`: Return the minor version number.
+* `patch(v)`: Return the patch version number.
+* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
+ or comparators intersect.
+* `parse(v)`: Attempt to parse a string as a semantic version, returning either
+ a `SemVer` object or `null`.
+
+### Comparison
+
+* `gt(v1, v2)`: `v1 > v2`
+* `gte(v1, v2)`: `v1 >= v2`
+* `lt(v1, v2)`: `v1 < v2`
+* `lte(v1, v2)`: `v1 <= v2`
+* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
+ even if they're not the exact same string. You already know how to
+ compare strings.
+* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
+* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
+ the corresponding function above. `"==="` and `"!=="` do simple
+ string comparison, but are included for completeness. Throws if an
+ invalid comparison string is provided.
+* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
+ `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
+* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
+ in descending order when passed to `Array.sort()`.
+* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
+ are equal. Sorts in ascending order if passed to `Array.sort()`.
+ `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
+* `diff(v1, v2)`: Returns difference between two versions by the release type
+ (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
+ or null if the versions are the same.
+
+### Comparators
+
+* `intersects(comparator)`: Return true if the comparators intersect
+
+### Ranges
+
+* `validRange(range)`: Return the valid range or null if it's not valid
+* `satisfies(version, range)`: Return true if the version satisfies the
+ range.
+* `maxSatisfying(versions, range)`: Return the highest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `minSatisfying(versions, range)`: Return the lowest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `minVersion(range)`: Return the lowest version that can possibly match
+ the given range.
+* `gtr(version, range)`: Return `true` if version is greater than all the
+ versions possible in the range.
+* `ltr(version, range)`: Return `true` if version is less than all the
+ versions possible in the range.
+* `outside(version, range, hilo)`: Return true if the version is outside
+ the bounds of the range in either the high or low direction. The
+ `hilo` argument must be either the string `'>'` or `'<'`. (This is
+ the function called by `gtr` and `ltr`.)
+* `intersects(range)`: Return true if any of the ranges comparators intersect
+* `simplifyRange(versions, range)`: Return a "simplified" range that
+ matches the same items in `versions` list as the range specified. Note
+ that it does *not* guarantee that it would match the same versions in all
+ cases, only for the set of versions provided. This is useful when
+ generating ranges by joining together multiple versions with `||`
+ programmatically, to provide the user with something a bit more
+ ergonomic. If the provided range is shorter in string-length than the
+ generated range, then that is returned.
+* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
+ entirely contained by the `superRange` range.
+
+Note that, since ranges may be non-contiguous, a version might not be
+greater than a range, less than a range, *or* satisfy a range! For
+example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
+until `2.0.0`, so the version `1.2.10` would not be greater than the
+range (because `2.0.1` satisfies, which is higher), nor less than the
+range (since `1.2.8` satisfies, which is lower), and it also does not
+satisfy the range.
+
+If you want to know if a version satisfies or does not satisfy a
+range, use the `satisfies(version, range)` function.
+
+### Coercion
+
+* `coerce(version, options)`: Coerces a string to semver if possible
+
+This aims to provide a very forgiving translation of a non-semver string to
+semver. It looks for the first digit in a string, and consumes all
+remaining characters which satisfy at least a partial semver (e.g., `1`,
+`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
+versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
+surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
+`3.4.0`). Only text which lacks digits will fail coercion (`version one`
+is not valid). The maximum length for any semver component considered for
+coercion is 16 characters; longer components will be ignored
+(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
+semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
+components are invalid (`9999999999999999.4.7.4` is likely invalid).
+
+If the `options.rtl` flag is set, then `coerce` will return the right-most
+coercible tuple that does not share an ending index with a longer coercible
+tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
+`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
+any other overlapping SemVer tuple.
+
+### Clean
+
+* `clean(version)`: Clean a string to be a valid semver if possible
+
+This will return a cleaned and trimmed semver version. If the provided
+version is not valid a null will be returned. This does not work for
+ranges.
+
+ex.
+* `s.clean(' = v 2.1.5foo')`: `null`
+* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
+* `s.clean(' = v 2.1.5-foo')`: `null`
+* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
+* `s.clean('=v2.1.5')`: `'2.1.5'`
+* `s.clean(' =v2.1.5')`: `2.1.5`
+* `s.clean(' 2.1.5 ')`: `'2.1.5'`
+* `s.clean('~1.0.0')`: `null`
+
+## Constants
+
+As a convenience, helper constants are exported to provide information about what `node-semver` supports:
+
+### `RELEASE_TYPES`
+
+- major
+- premajor
+- minor
+- preminor
+- patch
+- prepatch
+- prerelease
+
+```
+const semver = require('semver');
+
+if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
+ console.log('This is a valid release type!');
+} else {
+ console.warn('This is NOT a valid release type!');
+}
+```
+
+### `SEMVER_SPEC_VERSION`
+
+2.0.0
+
+```
+const semver = require('semver');
+
+console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION);
+```
+
+## Exported Modules
+
+
+
+You may pull in just the part of this semver utility that you need, if you
+are sensitive to packing and tree-shaking concerns. The main
+`require('semver')` export uses getter functions to lazily load the parts
+of the API that are used.
+
+The following modules are available:
+
+* `require('semver')`
+* `require('semver/classes')`
+* `require('semver/classes/comparator')`
+* `require('semver/classes/range')`
+* `require('semver/classes/semver')`
+* `require('semver/functions/clean')`
+* `require('semver/functions/cmp')`
+* `require('semver/functions/coerce')`
+* `require('semver/functions/compare')`
+* `require('semver/functions/compare-build')`
+* `require('semver/functions/compare-loose')`
+* `require('semver/functions/diff')`
+* `require('semver/functions/eq')`
+* `require('semver/functions/gt')`
+* `require('semver/functions/gte')`
+* `require('semver/functions/inc')`
+* `require('semver/functions/lt')`
+* `require('semver/functions/lte')`
+* `require('semver/functions/major')`
+* `require('semver/functions/minor')`
+* `require('semver/functions/neq')`
+* `require('semver/functions/parse')`
+* `require('semver/functions/patch')`
+* `require('semver/functions/prerelease')`
+* `require('semver/functions/rcompare')`
+* `require('semver/functions/rsort')`
+* `require('semver/functions/satisfies')`
+* `require('semver/functions/sort')`
+* `require('semver/functions/valid')`
+* `require('semver/ranges/gtr')`
+* `require('semver/ranges/intersects')`
+* `require('semver/ranges/ltr')`
+* `require('semver/ranges/max-satisfying')`
+* `require('semver/ranges/min-satisfying')`
+* `require('semver/ranges/min-version')`
+* `require('semver/ranges/outside')`
+* `require('semver/ranges/to-comparators')`
+* `require('semver/ranges/valid')`
+
diff --git a/node_modules/@pm2/agent/node_modules/semver/bin/semver.js b/node_modules/@pm2/agent/node_modules/semver/bin/semver.js
new file mode 100755
index 0000000..242b7ad
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/bin/semver.js
@@ -0,0 +1,197 @@
+#!/usr/bin/env node
+// Standalone semver comparison program.
+// Exits successfully and prints matching version(s) if
+// any supplied version is valid and passes all tests.
+
+const argv = process.argv.slice(2)
+
+let versions = []
+
+const range = []
+
+let inc = null
+
+const version = require('../package.json').version
+
+let loose = false
+
+let includePrerelease = false
+
+let coerce = false
+
+let rtl = false
+
+let identifier
+
+let identifierBase
+
+const semver = require('../')
+const parseOptions = require('../internal/parse-options')
+
+let reverse = false
+
+let options = {}
+
+const main = () => {
+ if (!argv.length) {
+ return help()
+ }
+ while (argv.length) {
+ let a = argv.shift()
+ const indexOfEqualSign = a.indexOf('=')
+ if (indexOfEqualSign !== -1) {
+ const value = a.slice(indexOfEqualSign + 1)
+ a = a.slice(0, indexOfEqualSign)
+ argv.unshift(value)
+ }
+ switch (a) {
+ case '-rv': case '-rev': case '--rev': case '--reverse':
+ reverse = true
+ break
+ case '-l': case '--loose':
+ loose = true
+ break
+ case '-p': case '--include-prerelease':
+ includePrerelease = true
+ break
+ case '-v': case '--version':
+ versions.push(argv.shift())
+ break
+ case '-i': case '--inc': case '--increment':
+ switch (argv[0]) {
+ case 'major': case 'minor': case 'patch': case 'prerelease':
+ case 'premajor': case 'preminor': case 'prepatch':
+ inc = argv.shift()
+ break
+ default:
+ inc = 'patch'
+ break
+ }
+ break
+ case '--preid':
+ identifier = argv.shift()
+ break
+ case '-r': case '--range':
+ range.push(argv.shift())
+ break
+ case '-n':
+ identifierBase = argv.shift()
+ if (identifierBase === 'false') {
+ identifierBase = false
+ }
+ break
+ case '-c': case '--coerce':
+ coerce = true
+ break
+ case '--rtl':
+ rtl = true
+ break
+ case '--ltr':
+ rtl = false
+ break
+ case '-h': case '--help': case '-?':
+ return help()
+ default:
+ versions.push(a)
+ break
+ }
+ }
+
+ options = parseOptions({ loose, includePrerelease, rtl })
+
+ versions = versions.map((v) => {
+ return coerce ? (semver.coerce(v, options) || { version: v }).version : v
+ }).filter((v) => {
+ return semver.valid(v)
+ })
+ if (!versions.length) {
+ return fail()
+ }
+ if (inc && (versions.length !== 1 || range.length)) {
+ return failInc()
+ }
+
+ for (let i = 0, l = range.length; i < l; i++) {
+ versions = versions.filter((v) => {
+ return semver.satisfies(v, range[i], options)
+ })
+ if (!versions.length) {
+ return fail()
+ }
+ }
+ return success(versions)
+}
+
+const failInc = () => {
+ console.error('--inc can only be used on a single version with no range')
+ fail()
+}
+
+const fail = () => process.exit(1)
+
+const success = () => {
+ const compare = reverse ? 'rcompare' : 'compare'
+ versions.sort((a, b) => {
+ return semver[compare](a, b, options)
+ }).map((v) => {
+ return semver.clean(v, options)
+ }).map((v) => {
+ return inc ? semver.inc(v, inc, options, identifier, identifierBase) : v
+ }).forEach((v, i, _) => {
+ console.log(v)
+ })
+}
+
+const help = () => console.log(
+`SemVer ${version}
+
+A JavaScript implementation of the https://semver.org/ specification
+Copyright Isaac Z. Schlueter
+
+Usage: semver [options] [ [...]]
+Prints valid versions sorted by SemVer precedence
+
+Options:
+-r --range
+ Print versions that match the specified range.
+
+-i --increment []
+ Increment a version by the specified level. Level can
+ be one of: major, minor, patch, premajor, preminor,
+ prepatch, or prerelease. Default level is 'patch'.
+ Only one version may be specified.
+
+--preid
+ Identifier to be used to prefix premajor, preminor,
+ prepatch or prerelease version increments.
+
+-l --loose
+ Interpret versions and ranges loosely
+
+-p --include-prerelease
+ Always include prerelease versions in range matching
+
+-c --coerce
+ Coerce a string into SemVer if possible
+ (does not imply --loose)
+
+--rtl
+ Coerce version strings right to left
+
+--ltr
+ Coerce version strings left to right (default)
+
+-n
+ Base number to be used for the prerelease identifier.
+ Can be either 0 or 1, or false to omit the number altogether.
+ Defaults to 0.
+
+Program exits successfully if any valid version satisfies
+all supplied ranges, and prints all satisfying versions.
+
+If no satisfying versions are found, then exits failure.
+
+Versions are printed in ascending order, so supplying
+multiple versions to the utility will just sort them.`)
+
+main()
diff --git a/node_modules/@pm2/agent/node_modules/semver/classes/comparator.js b/node_modules/@pm2/agent/node_modules/semver/classes/comparator.js
new file mode 100644
index 0000000..3d39c0e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/classes/comparator.js
@@ -0,0 +1,141 @@
+const ANY = Symbol('SemVer ANY')
+// hoisted class for cyclic dependency
+class Comparator {
+ static get ANY () {
+ return ANY
+ }
+
+ constructor (comp, options) {
+ options = parseOptions(options)
+
+ if (comp instanceof Comparator) {
+ if (comp.loose === !!options.loose) {
+ return comp
+ } else {
+ comp = comp.value
+ }
+ }
+
+ comp = comp.trim().split(/\s+/).join(' ')
+ debug('comparator', comp, options)
+ this.options = options
+ this.loose = !!options.loose
+ this.parse(comp)
+
+ if (this.semver === ANY) {
+ this.value = ''
+ } else {
+ this.value = this.operator + this.semver.version
+ }
+
+ debug('comp', this)
+ }
+
+ parse (comp) {
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
+ const m = comp.match(r)
+
+ if (!m) {
+ throw new TypeError(`Invalid comparator: ${comp}`)
+ }
+
+ this.operator = m[1] !== undefined ? m[1] : ''
+ if (this.operator === '=') {
+ this.operator = ''
+ }
+
+ // if it literally is just '>' or '' then allow anything.
+ if (!m[2]) {
+ this.semver = ANY
+ } else {
+ this.semver = new SemVer(m[2], this.options.loose)
+ }
+ }
+
+ toString () {
+ return this.value
+ }
+
+ test (version) {
+ debug('Comparator.test', version, this.options.loose)
+
+ if (this.semver === ANY || version === ANY) {
+ return true
+ }
+
+ if (typeof version === 'string') {
+ try {
+ version = new SemVer(version, this.options)
+ } catch (er) {
+ return false
+ }
+ }
+
+ return cmp(version, this.operator, this.semver, this.options)
+ }
+
+ intersects (comp, options) {
+ if (!(comp instanceof Comparator)) {
+ throw new TypeError('a Comparator is required')
+ }
+
+ if (this.operator === '') {
+ if (this.value === '') {
+ return true
+ }
+ return new Range(comp.value, options).test(this.value)
+ } else if (comp.operator === '') {
+ if (comp.value === '') {
+ return true
+ }
+ return new Range(this.value, options).test(comp.semver)
+ }
+
+ options = parseOptions(options)
+
+ // Special cases where nothing can possibly be lower
+ if (options.includePrerelease &&
+ (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
+ return false
+ }
+ if (!options.includePrerelease &&
+ (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
+ return false
+ }
+
+ // Same direction increasing (> or >=)
+ if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
+ return true
+ }
+ // Same direction decreasing (< or <=)
+ if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
+ return true
+ }
+ // same SemVer and both sides are inclusive (<= or >=)
+ if (
+ (this.semver.version === comp.semver.version) &&
+ this.operator.includes('=') && comp.operator.includes('=')) {
+ return true
+ }
+ // opposite directions less than
+ if (cmp(this.semver, '<', comp.semver, options) &&
+ this.operator.startsWith('>') && comp.operator.startsWith('<')) {
+ return true
+ }
+ // opposite directions greater than
+ if (cmp(this.semver, '>', comp.semver, options) &&
+ this.operator.startsWith('<') && comp.operator.startsWith('>')) {
+ return true
+ }
+ return false
+ }
+}
+
+module.exports = Comparator
+
+const parseOptions = require('../internal/parse-options')
+const { safeRe: re, t } = require('../internal/re')
+const cmp = require('../functions/cmp')
+const debug = require('../internal/debug')
+const SemVer = require('./semver')
+const Range = require('./range')
diff --git a/node_modules/@pm2/agent/node_modules/semver/classes/index.js b/node_modules/@pm2/agent/node_modules/semver/classes/index.js
new file mode 100644
index 0000000..5e3f5c9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/classes/index.js
@@ -0,0 +1,5 @@
+module.exports = {
+ SemVer: require('./semver.js'),
+ Range: require('./range.js'),
+ Comparator: require('./comparator.js'),
+}
diff --git a/node_modules/@pm2/agent/node_modules/semver/classes/range.js b/node_modules/@pm2/agent/node_modules/semver/classes/range.js
new file mode 100644
index 0000000..7e7c414
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/classes/range.js
@@ -0,0 +1,539 @@
+// hoisted class for cyclic dependency
+class Range {
+ constructor (range, options) {
+ options = parseOptions(options)
+
+ if (range instanceof Range) {
+ if (
+ range.loose === !!options.loose &&
+ range.includePrerelease === !!options.includePrerelease
+ ) {
+ return range
+ } else {
+ return new Range(range.raw, options)
+ }
+ }
+
+ if (range instanceof Comparator) {
+ // just put it in the set and return
+ this.raw = range.value
+ this.set = [[range]]
+ this.format()
+ return this
+ }
+
+ this.options = options
+ this.loose = !!options.loose
+ this.includePrerelease = !!options.includePrerelease
+
+ // First reduce all whitespace as much as possible so we do not have to rely
+ // on potentially slow regexes like \s*. This is then stored and used for
+ // future error messages as well.
+ this.raw = range
+ .trim()
+ .split(/\s+/)
+ .join(' ')
+
+ // First, split on ||
+ this.set = this.raw
+ .split('||')
+ // map the range to a 2d array of comparators
+ .map(r => this.parseRange(r.trim()))
+ // throw out any comparator lists that are empty
+ // this generally means that it was not a valid range, which is allowed
+ // in loose mode, but will still throw if the WHOLE range is invalid.
+ .filter(c => c.length)
+
+ if (!this.set.length) {
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
+ }
+
+ // if we have any that are not the null set, throw out null sets.
+ if (this.set.length > 1) {
+ // keep the first one, in case they're all null sets
+ const first = this.set[0]
+ this.set = this.set.filter(c => !isNullSet(c[0]))
+ if (this.set.length === 0) {
+ this.set = [first]
+ } else if (this.set.length > 1) {
+ // if we have any that are *, then the range is just *
+ for (const c of this.set) {
+ if (c.length === 1 && isAny(c[0])) {
+ this.set = [c]
+ break
+ }
+ }
+ }
+ }
+
+ this.format()
+ }
+
+ format () {
+ this.range = this.set
+ .map((comps) => comps.join(' ').trim())
+ .join('||')
+ .trim()
+ return this.range
+ }
+
+ toString () {
+ return this.range
+ }
+
+ parseRange (range) {
+ // memoize range parsing for performance.
+ // this is a very hot path, and fully deterministic.
+ const memoOpts =
+ (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
+ (this.options.loose && FLAG_LOOSE)
+ const memoKey = memoOpts + ':' + range
+ const cached = cache.get(memoKey)
+ if (cached) {
+ return cached
+ }
+
+ const loose = this.options.loose
+ // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
+ debug('hyphen replace', range)
+
+ // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
+ debug('comparator trim', range)
+
+ // `~ 1.2.3` => `~1.2.3`
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
+ debug('tilde trim', range)
+
+ // `^ 1.2.3` => `^1.2.3`
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace)
+ debug('caret trim', range)
+
+ // At this point, the range is completely trimmed and
+ // ready to be split into comparators.
+
+ let rangeList = range
+ .split(' ')
+ .map(comp => parseComparator(comp, this.options))
+ .join(' ')
+ .split(/\s+/)
+ // >=0.0.0 is equivalent to *
+ .map(comp => replaceGTE0(comp, this.options))
+
+ if (loose) {
+ // in loose mode, throw out any that are not valid comparators
+ rangeList = rangeList.filter(comp => {
+ debug('loose invalid filter', comp, this.options)
+ return !!comp.match(re[t.COMPARATORLOOSE])
+ })
+ }
+ debug('range list', rangeList)
+
+ // if any comparators are the null set, then replace with JUST null set
+ // if more than one comparator, remove any * comparators
+ // also, don't include the same comparator more than once
+ const rangeMap = new Map()
+ const comparators = rangeList.map(comp => new Comparator(comp, this.options))
+ for (const comp of comparators) {
+ if (isNullSet(comp)) {
+ return [comp]
+ }
+ rangeMap.set(comp.value, comp)
+ }
+ if (rangeMap.size > 1 && rangeMap.has('')) {
+ rangeMap.delete('')
+ }
+
+ const result = [...rangeMap.values()]
+ cache.set(memoKey, result)
+ return result
+ }
+
+ intersects (range, options) {
+ if (!(range instanceof Range)) {
+ throw new TypeError('a Range is required')
+ }
+
+ return this.set.some((thisComparators) => {
+ return (
+ isSatisfiable(thisComparators, options) &&
+ range.set.some((rangeComparators) => {
+ return (
+ isSatisfiable(rangeComparators, options) &&
+ thisComparators.every((thisComparator) => {
+ return rangeComparators.every((rangeComparator) => {
+ return thisComparator.intersects(rangeComparator, options)
+ })
+ })
+ )
+ })
+ )
+ })
+ }
+
+ // if ANY of the sets match ALL of its comparators, then pass
+ test (version) {
+ if (!version) {
+ return false
+ }
+
+ if (typeof version === 'string') {
+ try {
+ version = new SemVer(version, this.options)
+ } catch (er) {
+ return false
+ }
+ }
+
+ for (let i = 0; i < this.set.length; i++) {
+ if (testSet(this.set[i], version, this.options)) {
+ return true
+ }
+ }
+ return false
+ }
+}
+
+module.exports = Range
+
+const LRU = require('lru-cache')
+const cache = new LRU({ max: 1000 })
+
+const parseOptions = require('../internal/parse-options')
+const Comparator = require('./comparator')
+const debug = require('../internal/debug')
+const SemVer = require('./semver')
+const {
+ safeRe: re,
+ t,
+ comparatorTrimReplace,
+ tildeTrimReplace,
+ caretTrimReplace,
+} = require('../internal/re')
+const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')
+
+const isNullSet = c => c.value === '<0.0.0-0'
+const isAny = c => c.value === ''
+
+// take a set of comparators and determine whether there
+// exists a version which can satisfy it
+const isSatisfiable = (comparators, options) => {
+ let result = true
+ const remainingComparators = comparators.slice()
+ let testComparator = remainingComparators.pop()
+
+ while (result && remainingComparators.length) {
+ result = remainingComparators.every((otherComparator) => {
+ return testComparator.intersects(otherComparator, options)
+ })
+
+ testComparator = remainingComparators.pop()
+ }
+
+ return result
+}
+
+// comprised of xranges, tildes, stars, and gtlt's at this point.
+// already replaced the hyphen ranges
+// turn into a set of JUST comparators.
+const parseComparator = (comp, options) => {
+ debug('comp', comp, options)
+ comp = replaceCarets(comp, options)
+ debug('caret', comp)
+ comp = replaceTildes(comp, options)
+ debug('tildes', comp)
+ comp = replaceXRanges(comp, options)
+ debug('xrange', comp)
+ comp = replaceStars(comp, options)
+ debug('stars', comp)
+ return comp
+}
+
+const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
+
+// ~, ~> --> * (any, kinda silly)
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
+// ~0.0.1 --> >=0.0.1 <0.1.0-0
+const replaceTildes = (comp, options) => {
+ return comp
+ .trim()
+ .split(/\s+/)
+ .map((c) => replaceTilde(c, options))
+ .join(' ')
+}
+
+const replaceTilde = (comp, options) => {
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
+ return comp.replace(r, (_, M, m, p, pr) => {
+ debug('tilde', comp, _, M, m, p, pr)
+ let ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = `>=${M}.0.0 <${+M + 1}.0.0-0`
+ } else if (isX(p)) {
+ // ~1.2 == >=1.2.0 <1.3.0-0
+ ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`
+ } else if (pr) {
+ debug('replaceTilde pr', pr)
+ ret = `>=${M}.${m}.${p}-${pr
+ } <${M}.${+m + 1}.0-0`
+ } else {
+ // ~1.2.3 == >=1.2.3 <1.3.0-0
+ ret = `>=${M}.${m}.${p
+ } <${M}.${+m + 1}.0-0`
+ }
+
+ debug('tilde return', ret)
+ return ret
+ })
+}
+
+// ^ --> * (any, kinda silly)
+// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
+// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
+// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
+// ^1.2.3 --> >=1.2.3 <2.0.0-0
+// ^1.2.0 --> >=1.2.0 <2.0.0-0
+// ^0.0.1 --> >=0.0.1 <0.0.2-0
+// ^0.1.0 --> >=0.1.0 <0.2.0-0
+const replaceCarets = (comp, options) => {
+ return comp
+ .trim()
+ .split(/\s+/)
+ .map((c) => replaceCaret(c, options))
+ .join(' ')
+}
+
+const replaceCaret = (comp, options) => {
+ debug('caret', comp, options)
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
+ const z = options.includePrerelease ? '-0' : ''
+ return comp.replace(r, (_, M, m, p, pr) => {
+ debug('caret', comp, _, M, m, p, pr)
+ let ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
+ } else if (isX(p)) {
+ if (M === '0') {
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
+ } else {
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
+ }
+ } else if (pr) {
+ debug('replaceCaret pr', pr)
+ if (M === '0') {
+ if (m === '0') {
+ ret = `>=${M}.${m}.${p}-${pr
+ } <${M}.${m}.${+p + 1}-0`
+ } else {
+ ret = `>=${M}.${m}.${p}-${pr
+ } <${M}.${+m + 1}.0-0`
+ }
+ } else {
+ ret = `>=${M}.${m}.${p}-${pr
+ } <${+M + 1}.0.0-0`
+ }
+ } else {
+ debug('no pr')
+ if (M === '0') {
+ if (m === '0') {
+ ret = `>=${M}.${m}.${p
+ }${z} <${M}.${m}.${+p + 1}-0`
+ } else {
+ ret = `>=${M}.${m}.${p
+ }${z} <${M}.${+m + 1}.0-0`
+ }
+ } else {
+ ret = `>=${M}.${m}.${p
+ } <${+M + 1}.0.0-0`
+ }
+ }
+
+ debug('caret return', ret)
+ return ret
+ })
+}
+
+const replaceXRanges = (comp, options) => {
+ debug('replaceXRanges', comp, options)
+ return comp
+ .split(/\s+/)
+ .map((c) => replaceXRange(c, options))
+ .join(' ')
+}
+
+const replaceXRange = (comp, options) => {
+ comp = comp.trim()
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
+ debug('xRange', comp, ret, gtlt, M, m, p, pr)
+ const xM = isX(M)
+ const xm = xM || isX(m)
+ const xp = xm || isX(p)
+ const anyX = xp
+
+ if (gtlt === '=' && anyX) {
+ gtlt = ''
+ }
+
+ // if we're including prereleases in the match, then we need
+ // to fix this to -0, the lowest possible prerelease value
+ pr = options.includePrerelease ? '-0' : ''
+
+ if (xM) {
+ if (gtlt === '>' || gtlt === '<') {
+ // nothing is allowed
+ ret = '<0.0.0-0'
+ } else {
+ // nothing is forbidden
+ ret = '*'
+ }
+ } else if (gtlt && anyX) {
+ // we know patch is an x, because we have any x at all.
+ // replace X with 0
+ if (xm) {
+ m = 0
+ }
+ p = 0
+
+ if (gtlt === '>') {
+ // >1 => >=2.0.0
+ // >1.2 => >=1.3.0
+ gtlt = '>='
+ if (xm) {
+ M = +M + 1
+ m = 0
+ p = 0
+ } else {
+ m = +m + 1
+ p = 0
+ }
+ } else if (gtlt === '<=') {
+ // <=0.7.x is actually <0.8.0, since any 0.7.x should
+ // pass. Similarly, <=7.x is actually <8.0.0, etc.
+ gtlt = '<'
+ if (xm) {
+ M = +M + 1
+ } else {
+ m = +m + 1
+ }
+ }
+
+ if (gtlt === '<') {
+ pr = '-0'
+ }
+
+ ret = `${gtlt + M}.${m}.${p}${pr}`
+ } else if (xm) {
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
+ } else if (xp) {
+ ret = `>=${M}.${m}.0${pr
+ } <${M}.${+m + 1}.0-0`
+ }
+
+ debug('xRange return', ret)
+
+ return ret
+ })
+}
+
+// Because * is AND-ed with everything else in the comparator,
+// and '' means "any version", just remove the *s entirely.
+const replaceStars = (comp, options) => {
+ debug('replaceStars', comp, options)
+ // Looseness is ignored here. star is always as loose as it gets!
+ return comp
+ .trim()
+ .replace(re[t.STAR], '')
+}
+
+const replaceGTE0 = (comp, options) => {
+ debug('replaceGTE0', comp, options)
+ return comp
+ .trim()
+ .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
+}
+
+// This function is passed to string.replace(re[t.HYPHENRANGE])
+// M, m, patch, prerelease, build
+// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
+// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
+// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
+const hyphenReplace = incPr => ($0,
+ from, fM, fm, fp, fpr, fb,
+ to, tM, tm, tp, tpr, tb) => {
+ if (isX(fM)) {
+ from = ''
+ } else if (isX(fm)) {
+ from = `>=${fM}.0.0${incPr ? '-0' : ''}`
+ } else if (isX(fp)) {
+ from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
+ } else if (fpr) {
+ from = `>=${from}`
+ } else {
+ from = `>=${from}${incPr ? '-0' : ''}`
+ }
+
+ if (isX(tM)) {
+ to = ''
+ } else if (isX(tm)) {
+ to = `<${+tM + 1}.0.0-0`
+ } else if (isX(tp)) {
+ to = `<${tM}.${+tm + 1}.0-0`
+ } else if (tpr) {
+ to = `<=${tM}.${tm}.${tp}-${tpr}`
+ } else if (incPr) {
+ to = `<${tM}.${tm}.${+tp + 1}-0`
+ } else {
+ to = `<=${to}`
+ }
+
+ return `${from} ${to}`.trim()
+}
+
+const testSet = (set, version, options) => {
+ for (let i = 0; i < set.length; i++) {
+ if (!set[i].test(version)) {
+ return false
+ }
+ }
+
+ if (version.prerelease.length && !options.includePrerelease) {
+ // Find the set of versions that are allowed to have prereleases
+ // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
+ // That should allow `1.2.3-pr.2` to pass.
+ // However, `1.2.4-alpha.notready` should NOT be allowed,
+ // even though it's within the range set by the comparators.
+ for (let i = 0; i < set.length; i++) {
+ debug(set[i].semver)
+ if (set[i].semver === Comparator.ANY) {
+ continue
+ }
+
+ if (set[i].semver.prerelease.length > 0) {
+ const allowed = set[i].semver
+ if (allowed.major === version.major &&
+ allowed.minor === version.minor &&
+ allowed.patch === version.patch) {
+ return true
+ }
+ }
+ }
+
+ // Version has a -pre, but it's not one of the ones we like.
+ return false
+ }
+
+ return true
+}
diff --git a/node_modules/@pm2/agent/node_modules/semver/classes/semver.js b/node_modules/@pm2/agent/node_modules/semver/classes/semver.js
new file mode 100644
index 0000000..84e8459
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/classes/semver.js
@@ -0,0 +1,302 @@
+const debug = require('../internal/debug')
+const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
+const { safeRe: re, t } = require('../internal/re')
+
+const parseOptions = require('../internal/parse-options')
+const { compareIdentifiers } = require('../internal/identifiers')
+class SemVer {
+ constructor (version, options) {
+ options = parseOptions(options)
+
+ if (version instanceof SemVer) {
+ if (version.loose === !!options.loose &&
+ version.includePrerelease === !!options.includePrerelease) {
+ return version
+ } else {
+ version = version.version
+ }
+ } else if (typeof version !== 'string') {
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
+ }
+
+ if (version.length > MAX_LENGTH) {
+ throw new TypeError(
+ `version is longer than ${MAX_LENGTH} characters`
+ )
+ }
+
+ debug('SemVer', version, options)
+ this.options = options
+ this.loose = !!options.loose
+ // this isn't actually relevant for versions, but keep it so that we
+ // don't run into trouble passing this.options around.
+ this.includePrerelease = !!options.includePrerelease
+
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
+
+ if (!m) {
+ throw new TypeError(`Invalid Version: ${version}`)
+ }
+
+ this.raw = version
+
+ // these are actually numbers
+ this.major = +m[1]
+ this.minor = +m[2]
+ this.patch = +m[3]
+
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
+ throw new TypeError('Invalid major version')
+ }
+
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
+ throw new TypeError('Invalid minor version')
+ }
+
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
+ throw new TypeError('Invalid patch version')
+ }
+
+ // numberify any prerelease numeric ids
+ if (!m[4]) {
+ this.prerelease = []
+ } else {
+ this.prerelease = m[4].split('.').map((id) => {
+ if (/^[0-9]+$/.test(id)) {
+ const num = +id
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
+ return num
+ }
+ }
+ return id
+ })
+ }
+
+ this.build = m[5] ? m[5].split('.') : []
+ this.format()
+ }
+
+ format () {
+ this.version = `${this.major}.${this.minor}.${this.patch}`
+ if (this.prerelease.length) {
+ this.version += `-${this.prerelease.join('.')}`
+ }
+ return this.version
+ }
+
+ toString () {
+ return this.version
+ }
+
+ compare (other) {
+ debug('SemVer.compare', this.version, this.options, other)
+ if (!(other instanceof SemVer)) {
+ if (typeof other === 'string' && other === this.version) {
+ return 0
+ }
+ other = new SemVer(other, this.options)
+ }
+
+ if (other.version === this.version) {
+ return 0
+ }
+
+ return this.compareMain(other) || this.comparePre(other)
+ }
+
+ compareMain (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ return (
+ compareIdentifiers(this.major, other.major) ||
+ compareIdentifiers(this.minor, other.minor) ||
+ compareIdentifiers(this.patch, other.patch)
+ )
+ }
+
+ comparePre (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ // NOT having a prerelease is > having one
+ if (this.prerelease.length && !other.prerelease.length) {
+ return -1
+ } else if (!this.prerelease.length && other.prerelease.length) {
+ return 1
+ } else if (!this.prerelease.length && !other.prerelease.length) {
+ return 0
+ }
+
+ let i = 0
+ do {
+ const a = this.prerelease[i]
+ const b = other.prerelease[i]
+ debug('prerelease compare', i, a, b)
+ if (a === undefined && b === undefined) {
+ return 0
+ } else if (b === undefined) {
+ return 1
+ } else if (a === undefined) {
+ return -1
+ } else if (a === b) {
+ continue
+ } else {
+ return compareIdentifiers(a, b)
+ }
+ } while (++i)
+ }
+
+ compareBuild (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ let i = 0
+ do {
+ const a = this.build[i]
+ const b = other.build[i]
+ debug('prerelease compare', i, a, b)
+ if (a === undefined && b === undefined) {
+ return 0
+ } else if (b === undefined) {
+ return 1
+ } else if (a === undefined) {
+ return -1
+ } else if (a === b) {
+ continue
+ } else {
+ return compareIdentifiers(a, b)
+ }
+ } while (++i)
+ }
+
+ // preminor will bump the version up to the next minor release, and immediately
+ // down to pre-release. premajor and prepatch work the same way.
+ inc (release, identifier, identifierBase) {
+ switch (release) {
+ case 'premajor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor = 0
+ this.major++
+ this.inc('pre', identifier, identifierBase)
+ break
+ case 'preminor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor++
+ this.inc('pre', identifier, identifierBase)
+ break
+ case 'prepatch':
+ // If this is already a prerelease, it will bump to the next version
+ // drop any prereleases that might already exist, since they are not
+ // relevant at this point.
+ this.prerelease.length = 0
+ this.inc('patch', identifier, identifierBase)
+ this.inc('pre', identifier, identifierBase)
+ break
+ // If the input is a non-prerelease version, this acts the same as
+ // prepatch.
+ case 'prerelease':
+ if (this.prerelease.length === 0) {
+ this.inc('patch', identifier, identifierBase)
+ }
+ this.inc('pre', identifier, identifierBase)
+ break
+
+ case 'major':
+ // If this is a pre-major version, bump up to the same major version.
+ // Otherwise increment major.
+ // 1.0.0-5 bumps to 1.0.0
+ // 1.1.0 bumps to 2.0.0
+ if (
+ this.minor !== 0 ||
+ this.patch !== 0 ||
+ this.prerelease.length === 0
+ ) {
+ this.major++
+ }
+ this.minor = 0
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'minor':
+ // If this is a pre-minor version, bump up to the same minor version.
+ // Otherwise increment minor.
+ // 1.2.0-5 bumps to 1.2.0
+ // 1.2.1 bumps to 1.3.0
+ if (this.patch !== 0 || this.prerelease.length === 0) {
+ this.minor++
+ }
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'patch':
+ // If this is not a pre-release version, it will increment the patch.
+ // If it is a pre-release it will bump up to the same patch version.
+ // 1.2.0-5 patches to 1.2.0
+ // 1.2.0 patches to 1.2.1
+ if (this.prerelease.length === 0) {
+ this.patch++
+ }
+ this.prerelease = []
+ break
+ // This probably shouldn't be used publicly.
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
+ case 'pre': {
+ const base = Number(identifierBase) ? 1 : 0
+
+ if (!identifier && identifierBase === false) {
+ throw new Error('invalid increment argument: identifier is empty')
+ }
+
+ if (this.prerelease.length === 0) {
+ this.prerelease = [base]
+ } else {
+ let i = this.prerelease.length
+ while (--i >= 0) {
+ if (typeof this.prerelease[i] === 'number') {
+ this.prerelease[i]++
+ i = -2
+ }
+ }
+ if (i === -1) {
+ // didn't increment anything
+ if (identifier === this.prerelease.join('.') && identifierBase === false) {
+ throw new Error('invalid increment argument: identifier already exists')
+ }
+ this.prerelease.push(base)
+ }
+ }
+ if (identifier) {
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
+ let prerelease = [identifier, base]
+ if (identifierBase === false) {
+ prerelease = [identifier]
+ }
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
+ if (isNaN(this.prerelease[1])) {
+ this.prerelease = prerelease
+ }
+ } else {
+ this.prerelease = prerelease
+ }
+ }
+ break
+ }
+ default:
+ throw new Error(`invalid increment argument: ${release}`)
+ }
+ this.raw = this.format()
+ if (this.build.length) {
+ this.raw += `+${this.build.join('.')}`
+ }
+ return this
+ }
+}
+
+module.exports = SemVer
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/clean.js b/node_modules/@pm2/agent/node_modules/semver/functions/clean.js
new file mode 100644
index 0000000..811fe6b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/clean.js
@@ -0,0 +1,6 @@
+const parse = require('./parse')
+const clean = (version, options) => {
+ const s = parse(version.trim().replace(/^[=v]+/, ''), options)
+ return s ? s.version : null
+}
+module.exports = clean
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/cmp.js b/node_modules/@pm2/agent/node_modules/semver/functions/cmp.js
new file mode 100644
index 0000000..4011909
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/cmp.js
@@ -0,0 +1,52 @@
+const eq = require('./eq')
+const neq = require('./neq')
+const gt = require('./gt')
+const gte = require('./gte')
+const lt = require('./lt')
+const lte = require('./lte')
+
+const cmp = (a, op, b, loose) => {
+ switch (op) {
+ case '===':
+ if (typeof a === 'object') {
+ a = a.version
+ }
+ if (typeof b === 'object') {
+ b = b.version
+ }
+ return a === b
+
+ case '!==':
+ if (typeof a === 'object') {
+ a = a.version
+ }
+ if (typeof b === 'object') {
+ b = b.version
+ }
+ return a !== b
+
+ case '':
+ case '=':
+ case '==':
+ return eq(a, b, loose)
+
+ case '!=':
+ return neq(a, b, loose)
+
+ case '>':
+ return gt(a, b, loose)
+
+ case '>=':
+ return gte(a, b, loose)
+
+ case '<':
+ return lt(a, b, loose)
+
+ case '<=':
+ return lte(a, b, loose)
+
+ default:
+ throw new TypeError(`Invalid operator: ${op}`)
+ }
+}
+module.exports = cmp
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/coerce.js b/node_modules/@pm2/agent/node_modules/semver/functions/coerce.js
new file mode 100644
index 0000000..febbff9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/coerce.js
@@ -0,0 +1,52 @@
+const SemVer = require('../classes/semver')
+const parse = require('./parse')
+const { safeRe: re, t } = require('../internal/re')
+
+const coerce = (version, options) => {
+ if (version instanceof SemVer) {
+ return version
+ }
+
+ if (typeof version === 'number') {
+ version = String(version)
+ }
+
+ if (typeof version !== 'string') {
+ return null
+ }
+
+ options = options || {}
+
+ let match = null
+ if (!options.rtl) {
+ match = version.match(re[t.COERCE])
+ } else {
+ // Find the right-most coercible string that does not share
+ // a terminus with a more left-ward coercible string.
+ // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
+ //
+ // Walk through the string checking with a /g regexp
+ // Manually set the index so as to pick up overlapping matches.
+ // Stop when we get a match that ends at the string end, since no
+ // coercible string can be more right-ward without the same terminus.
+ let next
+ while ((next = re[t.COERCERTL].exec(version)) &&
+ (!match || match.index + match[0].length !== version.length)
+ ) {
+ if (!match ||
+ next.index + next[0].length !== match.index + match[0].length) {
+ match = next
+ }
+ re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
+ }
+ // leave it in a clean state
+ re[t.COERCERTL].lastIndex = -1
+ }
+
+ if (match === null) {
+ return null
+ }
+
+ return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
+}
+module.exports = coerce
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/compare-build.js b/node_modules/@pm2/agent/node_modules/semver/functions/compare-build.js
new file mode 100644
index 0000000..9eb881b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/compare-build.js
@@ -0,0 +1,7 @@
+const SemVer = require('../classes/semver')
+const compareBuild = (a, b, loose) => {
+ const versionA = new SemVer(a, loose)
+ const versionB = new SemVer(b, loose)
+ return versionA.compare(versionB) || versionA.compareBuild(versionB)
+}
+module.exports = compareBuild
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/compare-loose.js b/node_modules/@pm2/agent/node_modules/semver/functions/compare-loose.js
new file mode 100644
index 0000000..4881fbe
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/compare-loose.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const compareLoose = (a, b) => compare(a, b, true)
+module.exports = compareLoose
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/compare.js b/node_modules/@pm2/agent/node_modules/semver/functions/compare.js
new file mode 100644
index 0000000..748b7af
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/compare.js
@@ -0,0 +1,5 @@
+const SemVer = require('../classes/semver')
+const compare = (a, b, loose) =>
+ new SemVer(a, loose).compare(new SemVer(b, loose))
+
+module.exports = compare
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/diff.js b/node_modules/@pm2/agent/node_modules/semver/functions/diff.js
new file mode 100644
index 0000000..fc224e3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/diff.js
@@ -0,0 +1,65 @@
+const parse = require('./parse.js')
+
+const diff = (version1, version2) => {
+ const v1 = parse(version1, null, true)
+ const v2 = parse(version2, null, true)
+ const comparison = v1.compare(v2)
+
+ if (comparison === 0) {
+ return null
+ }
+
+ const v1Higher = comparison > 0
+ const highVersion = v1Higher ? v1 : v2
+ const lowVersion = v1Higher ? v2 : v1
+ const highHasPre = !!highVersion.prerelease.length
+ const lowHasPre = !!lowVersion.prerelease.length
+
+ if (lowHasPre && !highHasPre) {
+ // Going from prerelease -> no prerelease requires some special casing
+
+ // If the low version has only a major, then it will always be a major
+ // Some examples:
+ // 1.0.0-1 -> 1.0.0
+ // 1.0.0-1 -> 1.1.1
+ // 1.0.0-1 -> 2.0.0
+ if (!lowVersion.patch && !lowVersion.minor) {
+ return 'major'
+ }
+
+ // Otherwise it can be determined by checking the high version
+
+ if (highVersion.patch) {
+ // anything higher than a patch bump would result in the wrong version
+ return 'patch'
+ }
+
+ if (highVersion.minor) {
+ // anything higher than a minor bump would result in the wrong version
+ return 'minor'
+ }
+
+ // bumping major/minor/patch all have same result
+ return 'major'
+ }
+
+ // add the `pre` prefix if we are going to a prerelease version
+ const prefix = highHasPre ? 'pre' : ''
+
+ if (v1.major !== v2.major) {
+ return prefix + 'major'
+ }
+
+ if (v1.minor !== v2.minor) {
+ return prefix + 'minor'
+ }
+
+ if (v1.patch !== v2.patch) {
+ return prefix + 'patch'
+ }
+
+ // high and low are preleases
+ return 'prerelease'
+}
+
+module.exports = diff
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/eq.js b/node_modules/@pm2/agent/node_modules/semver/functions/eq.js
new file mode 100644
index 0000000..271fed9
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/eq.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const eq = (a, b, loose) => compare(a, b, loose) === 0
+module.exports = eq
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/gt.js b/node_modules/@pm2/agent/node_modules/semver/functions/gt.js
new file mode 100644
index 0000000..d9b2156
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/gt.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const gt = (a, b, loose) => compare(a, b, loose) > 0
+module.exports = gt
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/gte.js b/node_modules/@pm2/agent/node_modules/semver/functions/gte.js
new file mode 100644
index 0000000..5aeaa63
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/gte.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const gte = (a, b, loose) => compare(a, b, loose) >= 0
+module.exports = gte
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/inc.js b/node_modules/@pm2/agent/node_modules/semver/functions/inc.js
new file mode 100644
index 0000000..7670b1b
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/inc.js
@@ -0,0 +1,19 @@
+const SemVer = require('../classes/semver')
+
+const inc = (version, release, options, identifier, identifierBase) => {
+ if (typeof (options) === 'string') {
+ identifierBase = identifier
+ identifier = options
+ options = undefined
+ }
+
+ try {
+ return new SemVer(
+ version instanceof SemVer ? version.version : version,
+ options
+ ).inc(release, identifier, identifierBase).version
+ } catch (er) {
+ return null
+ }
+}
+module.exports = inc
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/lt.js b/node_modules/@pm2/agent/node_modules/semver/functions/lt.js
new file mode 100644
index 0000000..b440ab7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/lt.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const lt = (a, b, loose) => compare(a, b, loose) < 0
+module.exports = lt
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/lte.js b/node_modules/@pm2/agent/node_modules/semver/functions/lte.js
new file mode 100644
index 0000000..6dcc956
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/lte.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const lte = (a, b, loose) => compare(a, b, loose) <= 0
+module.exports = lte
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/major.js b/node_modules/@pm2/agent/node_modules/semver/functions/major.js
new file mode 100644
index 0000000..4283165
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/major.js
@@ -0,0 +1,3 @@
+const SemVer = require('../classes/semver')
+const major = (a, loose) => new SemVer(a, loose).major
+module.exports = major
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/minor.js b/node_modules/@pm2/agent/node_modules/semver/functions/minor.js
new file mode 100644
index 0000000..57b3455
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/minor.js
@@ -0,0 +1,3 @@
+const SemVer = require('../classes/semver')
+const minor = (a, loose) => new SemVer(a, loose).minor
+module.exports = minor
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/neq.js b/node_modules/@pm2/agent/node_modules/semver/functions/neq.js
new file mode 100644
index 0000000..f944c01
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/neq.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const neq = (a, b, loose) => compare(a, b, loose) !== 0
+module.exports = neq
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/parse.js b/node_modules/@pm2/agent/node_modules/semver/functions/parse.js
new file mode 100644
index 0000000..459b3b1
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/parse.js
@@ -0,0 +1,16 @@
+const SemVer = require('../classes/semver')
+const parse = (version, options, throwErrors = false) => {
+ if (version instanceof SemVer) {
+ return version
+ }
+ try {
+ return new SemVer(version, options)
+ } catch (er) {
+ if (!throwErrors) {
+ return null
+ }
+ throw er
+ }
+}
+
+module.exports = parse
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/patch.js b/node_modules/@pm2/agent/node_modules/semver/functions/patch.js
new file mode 100644
index 0000000..63afca2
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/patch.js
@@ -0,0 +1,3 @@
+const SemVer = require('../classes/semver')
+const patch = (a, loose) => new SemVer(a, loose).patch
+module.exports = patch
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/prerelease.js b/node_modules/@pm2/agent/node_modules/semver/functions/prerelease.js
new file mode 100644
index 0000000..06aa132
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/prerelease.js
@@ -0,0 +1,6 @@
+const parse = require('./parse')
+const prerelease = (version, options) => {
+ const parsed = parse(version, options)
+ return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
+}
+module.exports = prerelease
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/rcompare.js b/node_modules/@pm2/agent/node_modules/semver/functions/rcompare.js
new file mode 100644
index 0000000..0ac509e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/rcompare.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const rcompare = (a, b, loose) => compare(b, a, loose)
+module.exports = rcompare
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/rsort.js b/node_modules/@pm2/agent/node_modules/semver/functions/rsort.js
new file mode 100644
index 0000000..82404c5
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/rsort.js
@@ -0,0 +1,3 @@
+const compareBuild = require('./compare-build')
+const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
+module.exports = rsort
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/satisfies.js b/node_modules/@pm2/agent/node_modules/semver/functions/satisfies.js
new file mode 100644
index 0000000..50af1c1
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/satisfies.js
@@ -0,0 +1,10 @@
+const Range = require('../classes/range')
+const satisfies = (version, range, options) => {
+ try {
+ range = new Range(range, options)
+ } catch (er) {
+ return false
+ }
+ return range.test(version)
+}
+module.exports = satisfies
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/sort.js b/node_modules/@pm2/agent/node_modules/semver/functions/sort.js
new file mode 100644
index 0000000..4d10917
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/sort.js
@@ -0,0 +1,3 @@
+const compareBuild = require('./compare-build')
+const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
+module.exports = sort
diff --git a/node_modules/@pm2/agent/node_modules/semver/functions/valid.js b/node_modules/@pm2/agent/node_modules/semver/functions/valid.js
new file mode 100644
index 0000000..f27bae1
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/functions/valid.js
@@ -0,0 +1,6 @@
+const parse = require('./parse')
+const valid = (version, options) => {
+ const v = parse(version, options)
+ return v ? v.version : null
+}
+module.exports = valid
diff --git a/node_modules/@pm2/agent/node_modules/semver/index.js b/node_modules/@pm2/agent/node_modules/semver/index.js
new file mode 100644
index 0000000..86d42ac
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/index.js
@@ -0,0 +1,89 @@
+// just pre-load all the stuff that index.js lazily exports
+const internalRe = require('./internal/re')
+const constants = require('./internal/constants')
+const SemVer = require('./classes/semver')
+const identifiers = require('./internal/identifiers')
+const parse = require('./functions/parse')
+const valid = require('./functions/valid')
+const clean = require('./functions/clean')
+const inc = require('./functions/inc')
+const diff = require('./functions/diff')
+const major = require('./functions/major')
+const minor = require('./functions/minor')
+const patch = require('./functions/patch')
+const prerelease = require('./functions/prerelease')
+const compare = require('./functions/compare')
+const rcompare = require('./functions/rcompare')
+const compareLoose = require('./functions/compare-loose')
+const compareBuild = require('./functions/compare-build')
+const sort = require('./functions/sort')
+const rsort = require('./functions/rsort')
+const gt = require('./functions/gt')
+const lt = require('./functions/lt')
+const eq = require('./functions/eq')
+const neq = require('./functions/neq')
+const gte = require('./functions/gte')
+const lte = require('./functions/lte')
+const cmp = require('./functions/cmp')
+const coerce = require('./functions/coerce')
+const Comparator = require('./classes/comparator')
+const Range = require('./classes/range')
+const satisfies = require('./functions/satisfies')
+const toComparators = require('./ranges/to-comparators')
+const maxSatisfying = require('./ranges/max-satisfying')
+const minSatisfying = require('./ranges/min-satisfying')
+const minVersion = require('./ranges/min-version')
+const validRange = require('./ranges/valid')
+const outside = require('./ranges/outside')
+const gtr = require('./ranges/gtr')
+const ltr = require('./ranges/ltr')
+const intersects = require('./ranges/intersects')
+const simplifyRange = require('./ranges/simplify')
+const subset = require('./ranges/subset')
+module.exports = {
+ parse,
+ valid,
+ clean,
+ inc,
+ diff,
+ major,
+ minor,
+ patch,
+ prerelease,
+ compare,
+ rcompare,
+ compareLoose,
+ compareBuild,
+ sort,
+ rsort,
+ gt,
+ lt,
+ eq,
+ neq,
+ gte,
+ lte,
+ cmp,
+ coerce,
+ Comparator,
+ Range,
+ satisfies,
+ toComparators,
+ maxSatisfying,
+ minSatisfying,
+ minVersion,
+ validRange,
+ outside,
+ gtr,
+ ltr,
+ intersects,
+ simplifyRange,
+ subset,
+ SemVer,
+ re: internalRe.re,
+ src: internalRe.src,
+ tokens: internalRe.t,
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
+ RELEASE_TYPES: constants.RELEASE_TYPES,
+ compareIdentifiers: identifiers.compareIdentifiers,
+ rcompareIdentifiers: identifiers.rcompareIdentifiers,
+}
diff --git a/node_modules/@pm2/agent/node_modules/semver/internal/constants.js b/node_modules/@pm2/agent/node_modules/semver/internal/constants.js
new file mode 100644
index 0000000..94be1c5
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/internal/constants.js
@@ -0,0 +1,35 @@
+// Note: this is the semver.org version of the spec that it implements
+// Not necessarily the package version of this code.
+const SEMVER_SPEC_VERSION = '2.0.0'
+
+const MAX_LENGTH = 256
+const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
+/* istanbul ignore next */ 9007199254740991
+
+// Max safe segment length for coercion.
+const MAX_SAFE_COMPONENT_LENGTH = 16
+
+// Max safe length for a build identifier. The max length minus 6 characters for
+// the shortest version with a build 0.0.0+BUILD.
+const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
+
+const RELEASE_TYPES = [
+ 'major',
+ 'premajor',
+ 'minor',
+ 'preminor',
+ 'patch',
+ 'prepatch',
+ 'prerelease',
+]
+
+module.exports = {
+ MAX_LENGTH,
+ MAX_SAFE_COMPONENT_LENGTH,
+ MAX_SAFE_BUILD_LENGTH,
+ MAX_SAFE_INTEGER,
+ RELEASE_TYPES,
+ SEMVER_SPEC_VERSION,
+ FLAG_INCLUDE_PRERELEASE: 0b001,
+ FLAG_LOOSE: 0b010,
+}
diff --git a/node_modules/@pm2/agent/node_modules/semver/internal/debug.js b/node_modules/@pm2/agent/node_modules/semver/internal/debug.js
new file mode 100644
index 0000000..1c00e13
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/internal/debug.js
@@ -0,0 +1,9 @@
+const debug = (
+ typeof process === 'object' &&
+ process.env &&
+ process.env.NODE_DEBUG &&
+ /\bsemver\b/i.test(process.env.NODE_DEBUG)
+) ? (...args) => console.error('SEMVER', ...args)
+ : () => {}
+
+module.exports = debug
diff --git a/node_modules/@pm2/agent/node_modules/semver/internal/identifiers.js b/node_modules/@pm2/agent/node_modules/semver/internal/identifiers.js
new file mode 100644
index 0000000..e612d0a
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/internal/identifiers.js
@@ -0,0 +1,23 @@
+const numeric = /^[0-9]+$/
+const compareIdentifiers = (a, b) => {
+ const anum = numeric.test(a)
+ const bnum = numeric.test(b)
+
+ if (anum && bnum) {
+ a = +a
+ b = +b
+ }
+
+ return a === b ? 0
+ : (anum && !bnum) ? -1
+ : (bnum && !anum) ? 1
+ : a < b ? -1
+ : 1
+}
+
+const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
+
+module.exports = {
+ compareIdentifiers,
+ rcompareIdentifiers,
+}
diff --git a/node_modules/@pm2/agent/node_modules/semver/internal/parse-options.js b/node_modules/@pm2/agent/node_modules/semver/internal/parse-options.js
new file mode 100644
index 0000000..10d64ce
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/internal/parse-options.js
@@ -0,0 +1,15 @@
+// parse out just the options we care about
+const looseOption = Object.freeze({ loose: true })
+const emptyOpts = Object.freeze({ })
+const parseOptions = options => {
+ if (!options) {
+ return emptyOpts
+ }
+
+ if (typeof options !== 'object') {
+ return looseOption
+ }
+
+ return options
+}
+module.exports = parseOptions
diff --git a/node_modules/@pm2/agent/node_modules/semver/internal/re.js b/node_modules/@pm2/agent/node_modules/semver/internal/re.js
new file mode 100644
index 0000000..21150b3
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/internal/re.js
@@ -0,0 +1,212 @@
+const {
+ MAX_SAFE_COMPONENT_LENGTH,
+ MAX_SAFE_BUILD_LENGTH,
+ MAX_LENGTH,
+} = require('./constants')
+const debug = require('./debug')
+exports = module.exports = {}
+
+// The actual regexps go on exports.re
+const re = exports.re = []
+const safeRe = exports.safeRe = []
+const src = exports.src = []
+const t = exports.t = {}
+let R = 0
+
+const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
+
+// Replace some greedy regex tokens to prevent regex dos issues. These regex are
+// used internally via the safeRe object since all inputs in this library get
+// normalized first to trim and collapse all extra whitespace. The original
+// regexes are exported for userland consumption and lower level usage. A
+// future breaking change could export the safer regex only with a note that
+// all input should have extra whitespace removed.
+const safeRegexReplacements = [
+ ['\\s', 1],
+ ['\\d', MAX_LENGTH],
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
+]
+
+const makeSafeRegex = (value) => {
+ for (const [token, max] of safeRegexReplacements) {
+ value = value
+ .split(`${token}*`).join(`${token}{0,${max}}`)
+ .split(`${token}+`).join(`${token}{1,${max}}`)
+ }
+ return value
+}
+
+const createToken = (name, value, isGlobal) => {
+ const safe = makeSafeRegex(value)
+ const index = R++
+ debug(name, index, value)
+ t[name] = index
+ src[index] = value
+ re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
+}
+
+// The following Regular Expressions can be used for tokenizing,
+// validating, and parsing SemVer version strings.
+
+// ## Numeric Identifier
+// A single `0`, or a non-zero digit followed by zero or more digits.
+
+createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
+createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
+
+// ## Non-numeric Identifier
+// Zero or more digits, followed by a letter or hyphen, and then zero or
+// more letters, digits, or hyphens.
+
+createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
+
+// ## Main Version
+// Three dot-separated numeric identifiers.
+
+createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
+ `(${src[t.NUMERICIDENTIFIER]})\\.` +
+ `(${src[t.NUMERICIDENTIFIER]})`)
+
+createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
+ `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
+ `(${src[t.NUMERICIDENTIFIERLOOSE]})`)
+
+// ## Pre-release Version Identifier
+// A numeric identifier, or a non-numeric identifier.
+
+createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
+}|${src[t.NONNUMERICIDENTIFIER]})`)
+
+createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
+}|${src[t.NONNUMERICIDENTIFIER]})`)
+
+// ## Pre-release Version
+// Hyphen, followed by one or more dot-separated pre-release version
+// identifiers.
+
+createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
+}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)
+
+createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
+}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)
+
+// ## Build Metadata Identifier
+// Any combination of digits, letters, or hyphens.
+
+createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
+
+// ## Build Metadata
+// Plus sign, followed by one or more period-separated build metadata
+// identifiers.
+
+createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
+}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)
+
+// ## Full Version String
+// A main version, followed optionally by a pre-release version and
+// build metadata.
+
+// Note that the only major, minor, patch, and pre-release sections of
+// the version string are capturing groups. The build metadata is not a
+// capturing group, because it should not ever be used in version
+// comparison.
+
+createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
+}${src[t.PRERELEASE]}?${
+ src[t.BUILD]}?`)
+
+createToken('FULL', `^${src[t.FULLPLAIN]}$`)
+
+// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
+// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
+// common in the npm registry.
+createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
+}${src[t.PRERELEASELOOSE]}?${
+ src[t.BUILD]}?`)
+
+createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
+
+createToken('GTLT', '((?:<|>)?=?)')
+
+// Something like "2.*" or "1.2.x".
+// Note that "x.x" is a valid xRange identifer, meaning "any version"
+// Only the first item is strictly required.
+createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
+createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
+
+createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
+ `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
+ `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
+ `(?:${src[t.PRERELEASE]})?${
+ src[t.BUILD]}?` +
+ `)?)?`)
+
+createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
+ `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
+ `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
+ `(?:${src[t.PRERELEASELOOSE]})?${
+ src[t.BUILD]}?` +
+ `)?)?`)
+
+createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
+createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
+
+// Coercion.
+// Extract anything that could conceivably be a part of a valid semver
+createToken('COERCE', `${'(^|[^\\d])' +
+ '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
+ `(?:$|[^\\d])`)
+createToken('COERCERTL', src[t.COERCE], true)
+
+// Tilde ranges.
+// Meaning is "reasonably at or greater than"
+createToken('LONETILDE', '(?:~>?)')
+
+createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
+exports.tildeTrimReplace = '$1~'
+
+createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
+createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)
+
+// Caret ranges.
+// Meaning is "at least and backwards compatible with"
+createToken('LONECARET', '(?:\\^)')
+
+createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
+exports.caretTrimReplace = '$1^'
+
+createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
+createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)
+
+// A simple gt/lt/eq thing, or just "" to indicate "any version"
+createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
+createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)
+
+// An expression to strip any whitespace between the gtlt and the thing
+// it modifies, so that `> 1.2.3` ==> `>1.2.3`
+createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
+}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
+exports.comparatorTrimReplace = '$1$2$3'
+
+// Something like `1.2.3 - 1.2.4`
+// Note that these all use the loose form, because they'll be
+// checked against either the strict or loose comparator form
+// later.
+createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
+ `\\s+-\\s+` +
+ `(${src[t.XRANGEPLAIN]})` +
+ `\\s*$`)
+
+createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
+ `\\s+-\\s+` +
+ `(${src[t.XRANGEPLAINLOOSE]})` +
+ `\\s*$`)
+
+// Star ranges basically just allow anything at all.
+createToken('STAR', '(<|>)?=?\\s*\\*')
+// >=0.0.0 is like a star
+createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
+createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
diff --git a/node_modules/@pm2/agent/node_modules/semver/package.json b/node_modules/@pm2/agent/node_modules/semver/package.json
new file mode 100644
index 0000000..c145eca
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/package.json
@@ -0,0 +1,87 @@
+{
+ "name": "semver",
+ "version": "7.5.4",
+ "description": "The semantic version parser used by npm.",
+ "main": "index.js",
+ "scripts": {
+ "test": "tap",
+ "snap": "tap",
+ "lint": "eslint \"**/*.js\"",
+ "postlint": "template-oss-check",
+ "lintfix": "npm run lint -- --fix",
+ "posttest": "npm run lint",
+ "template-oss-apply": "template-oss-apply --force"
+ },
+ "devDependencies": {
+ "@npmcli/eslint-config": "^4.0.0",
+ "@npmcli/template-oss": "4.17.0",
+ "tap": "^16.0.0"
+ },
+ "license": "ISC",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/npm/node-semver.git"
+ },
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "files": [
+ "bin/",
+ "lib/",
+ "classes/",
+ "functions/",
+ "internal/",
+ "ranges/",
+ "index.js",
+ "preload.js",
+ "range.bnf"
+ ],
+ "tap": {
+ "timeout": 30,
+ "coverage-map": "map.js",
+ "nyc-arg": [
+ "--exclude",
+ "tap-snapshots/**"
+ ]
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "dependencies": {
+ "lru-cache": "^6.0.0"
+ },
+ "author": "GitHub Inc.",
+ "templateOSS": {
+ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
+ "version": "4.17.0",
+ "engines": ">=10",
+ "ciVersions": [
+ "10.0.0",
+ "10.x",
+ "12.x",
+ "14.x",
+ "16.x",
+ "18.x"
+ ],
+ "npmSpec": "8",
+ "distPaths": [
+ "classes/",
+ "functions/",
+ "internal/",
+ "ranges/",
+ "index.js",
+ "preload.js",
+ "range.bnf"
+ ],
+ "allowPaths": [
+ "/classes/",
+ "/functions/",
+ "/internal/",
+ "/ranges/",
+ "/index.js",
+ "/preload.js",
+ "/range.bnf"
+ ],
+ "publish": "true"
+ }
+}
diff --git a/node_modules/@pm2/agent/node_modules/semver/preload.js b/node_modules/@pm2/agent/node_modules/semver/preload.js
new file mode 100644
index 0000000..947cd4f
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/preload.js
@@ -0,0 +1,2 @@
+// XXX remove in v8 or beyond
+module.exports = require('./index.js')
diff --git a/node_modules/@pm2/agent/node_modules/semver/range.bnf b/node_modules/@pm2/agent/node_modules/semver/range.bnf
new file mode 100644
index 0000000..d4c6ae0
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/range.bnf
@@ -0,0 +1,16 @@
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | [1-9] ( [0-9] ) *
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/gtr.js b/node_modules/@pm2/agent/node_modules/semver/ranges/gtr.js
new file mode 100644
index 0000000..db7e355
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/gtr.js
@@ -0,0 +1,4 @@
+// Determine if version is greater than all the versions possible in the range.
+const outside = require('./outside')
+const gtr = (version, range, options) => outside(version, range, '>', options)
+module.exports = gtr
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/intersects.js b/node_modules/@pm2/agent/node_modules/semver/ranges/intersects.js
new file mode 100644
index 0000000..e0e9b7c
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/intersects.js
@@ -0,0 +1,7 @@
+const Range = require('../classes/range')
+const intersects = (r1, r2, options) => {
+ r1 = new Range(r1, options)
+ r2 = new Range(r2, options)
+ return r1.intersects(r2, options)
+}
+module.exports = intersects
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/ltr.js b/node_modules/@pm2/agent/node_modules/semver/ranges/ltr.js
new file mode 100644
index 0000000..528a885
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/ltr.js
@@ -0,0 +1,4 @@
+const outside = require('./outside')
+// Determine if version is less than all the versions possible in the range
+const ltr = (version, range, options) => outside(version, range, '<', options)
+module.exports = ltr
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/max-satisfying.js b/node_modules/@pm2/agent/node_modules/semver/ranges/max-satisfying.js
new file mode 100644
index 0000000..6e3d993
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/max-satisfying.js
@@ -0,0 +1,25 @@
+const SemVer = require('../classes/semver')
+const Range = require('../classes/range')
+
+const maxSatisfying = (versions, range, options) => {
+ let max = null
+ let maxSV = null
+ let rangeObj = null
+ try {
+ rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach((v) => {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!max || maxSV.compare(v) === -1) {
+ // compare(max, v, true)
+ max = v
+ maxSV = new SemVer(max, options)
+ }
+ }
+ })
+ return max
+}
+module.exports = maxSatisfying
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/min-satisfying.js b/node_modules/@pm2/agent/node_modules/semver/ranges/min-satisfying.js
new file mode 100644
index 0000000..9b60974
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/min-satisfying.js
@@ -0,0 +1,24 @@
+const SemVer = require('../classes/semver')
+const Range = require('../classes/range')
+const minSatisfying = (versions, range, options) => {
+ let min = null
+ let minSV = null
+ let rangeObj = null
+ try {
+ rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach((v) => {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!min || minSV.compare(v) === 1) {
+ // compare(min, v, true)
+ min = v
+ minSV = new SemVer(min, options)
+ }
+ }
+ })
+ return min
+}
+module.exports = minSatisfying
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/min-version.js b/node_modules/@pm2/agent/node_modules/semver/ranges/min-version.js
new file mode 100644
index 0000000..350e1f7
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/min-version.js
@@ -0,0 +1,61 @@
+const SemVer = require('../classes/semver')
+const Range = require('../classes/range')
+const gt = require('../functions/gt')
+
+const minVersion = (range, loose) => {
+ range = new Range(range, loose)
+
+ let minver = new SemVer('0.0.0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = new SemVer('0.0.0-0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = null
+ for (let i = 0; i < range.set.length; ++i) {
+ const comparators = range.set[i]
+
+ let setMin = null
+ comparators.forEach((comparator) => {
+ // Clone to avoid manipulating the comparator's semver object.
+ const compver = new SemVer(comparator.semver.version)
+ switch (comparator.operator) {
+ case '>':
+ if (compver.prerelease.length === 0) {
+ compver.patch++
+ } else {
+ compver.prerelease.push(0)
+ }
+ compver.raw = compver.format()
+ /* fallthrough */
+ case '':
+ case '>=':
+ if (!setMin || gt(compver, setMin)) {
+ setMin = compver
+ }
+ break
+ case '<':
+ case '<=':
+ /* Ignore maximum versions */
+ break
+ /* istanbul ignore next */
+ default:
+ throw new Error(`Unexpected operation: ${comparator.operator}`)
+ }
+ })
+ if (setMin && (!minver || gt(minver, setMin))) {
+ minver = setMin
+ }
+ }
+
+ if (minver && range.test(minver)) {
+ return minver
+ }
+
+ return null
+}
+module.exports = minVersion
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/outside.js b/node_modules/@pm2/agent/node_modules/semver/ranges/outside.js
new file mode 100644
index 0000000..ae99b10
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/outside.js
@@ -0,0 +1,80 @@
+const SemVer = require('../classes/semver')
+const Comparator = require('../classes/comparator')
+const { ANY } = Comparator
+const Range = require('../classes/range')
+const satisfies = require('../functions/satisfies')
+const gt = require('../functions/gt')
+const lt = require('../functions/lt')
+const lte = require('../functions/lte')
+const gte = require('../functions/gte')
+
+const outside = (version, range, hilo, options) => {
+ version = new SemVer(version, options)
+ range = new Range(range, options)
+
+ let gtfn, ltefn, ltfn, comp, ecomp
+ switch (hilo) {
+ case '>':
+ gtfn = gt
+ ltefn = lte
+ ltfn = lt
+ comp = '>'
+ ecomp = '>='
+ break
+ case '<':
+ gtfn = lt
+ ltefn = gte
+ ltfn = gt
+ comp = '<'
+ ecomp = '<='
+ break
+ default:
+ throw new TypeError('Must provide a hilo val of "<" or ">"')
+ }
+
+ // If it satisfies the range it is not outside
+ if (satisfies(version, range, options)) {
+ return false
+ }
+
+ // From now on, variable terms are as if we're in "gtr" mode.
+ // but note that everything is flipped for the "ltr" function.
+
+ for (let i = 0; i < range.set.length; ++i) {
+ const comparators = range.set[i]
+
+ let high = null
+ let low = null
+
+ comparators.forEach((comparator) => {
+ if (comparator.semver === ANY) {
+ comparator = new Comparator('>=0.0.0')
+ }
+ high = high || comparator
+ low = low || comparator
+ if (gtfn(comparator.semver, high.semver, options)) {
+ high = comparator
+ } else if (ltfn(comparator.semver, low.semver, options)) {
+ low = comparator
+ }
+ })
+
+ // If the edge version comparator has a operator then our version
+ // isn't outside it
+ if (high.operator === comp || high.operator === ecomp) {
+ return false
+ }
+
+ // If the lowest version comparator has an operator and our version
+ // is less than it then it isn't higher than the range
+ if ((!low.operator || low.operator === comp) &&
+ ltefn(version, low.semver)) {
+ return false
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
+ return false
+ }
+ }
+ return true
+}
+
+module.exports = outside
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/simplify.js b/node_modules/@pm2/agent/node_modules/semver/ranges/simplify.js
new file mode 100644
index 0000000..618d5b6
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/simplify.js
@@ -0,0 +1,47 @@
+// given a set of versions and a range, create a "simplified" range
+// that includes the same versions that the original range does
+// If the original range is shorter than the simplified one, return that.
+const satisfies = require('../functions/satisfies.js')
+const compare = require('../functions/compare.js')
+module.exports = (versions, range, options) => {
+ const set = []
+ let first = null
+ let prev = null
+ const v = versions.sort((a, b) => compare(a, b, options))
+ for (const version of v) {
+ const included = satisfies(version, range, options)
+ if (included) {
+ prev = version
+ if (!first) {
+ first = version
+ }
+ } else {
+ if (prev) {
+ set.push([first, prev])
+ }
+ prev = null
+ first = null
+ }
+ }
+ if (first) {
+ set.push([first, null])
+ }
+
+ const ranges = []
+ for (const [min, max] of set) {
+ if (min === max) {
+ ranges.push(min)
+ } else if (!max && min === v[0]) {
+ ranges.push('*')
+ } else if (!max) {
+ ranges.push(`>=${min}`)
+ } else if (min === v[0]) {
+ ranges.push(`<=${max}`)
+ } else {
+ ranges.push(`${min} - ${max}`)
+ }
+ }
+ const simplified = ranges.join(' || ')
+ const original = typeof range.raw === 'string' ? range.raw : String(range)
+ return simplified.length < original.length ? simplified : range
+}
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/subset.js b/node_modules/@pm2/agent/node_modules/semver/ranges/subset.js
new file mode 100644
index 0000000..1e5c268
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/subset.js
@@ -0,0 +1,247 @@
+const Range = require('../classes/range.js')
+const Comparator = require('../classes/comparator.js')
+const { ANY } = Comparator
+const satisfies = require('../functions/satisfies.js')
+const compare = require('../functions/compare.js')
+
+// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
+// - Every simple range `r1, r2, ...` is a null set, OR
+// - Every simple range `r1, r2, ...` which is not a null set is a subset of
+// some `R1, R2, ...`
+//
+// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
+// - If c is only the ANY comparator
+// - If C is only the ANY comparator, return true
+// - Else if in prerelease mode, return false
+// - else replace c with `[>=0.0.0]`
+// - If C is only the ANY comparator
+// - if in prerelease mode, return true
+// - else replace C with `[>=0.0.0]`
+// - Let EQ be the set of = comparators in c
+// - If EQ is more than one, return true (null set)
+// - Let GT be the highest > or >= comparator in c
+// - Let LT be the lowest < or <= comparator in c
+// - If GT and LT, and GT.semver > LT.semver, return true (null set)
+// - If any C is a = range, and GT or LT are set, return false
+// - If EQ
+// - If GT, and EQ does not satisfy GT, return true (null set)
+// - If LT, and EQ does not satisfy LT, return true (null set)
+// - If EQ satisfies every C, return true
+// - Else return false
+// - If GT
+// - If GT.semver is lower than any > or >= comp in C, return false
+// - If GT is >=, and GT.semver does not satisfy every C, return false
+// - If GT.semver has a prerelease, and not in prerelease mode
+// - If no C has a prerelease and the GT.semver tuple, return false
+// - If LT
+// - If LT.semver is greater than any < or <= comp in C, return false
+// - If LT is <=, and LT.semver does not satisfy every C, return false
+// - If GT.semver has a prerelease, and not in prerelease mode
+// - If no C has a prerelease and the LT.semver tuple, return false
+// - Else return true
+
+const subset = (sub, dom, options = {}) => {
+ if (sub === dom) {
+ return true
+ }
+
+ sub = new Range(sub, options)
+ dom = new Range(dom, options)
+ let sawNonNull = false
+
+ OUTER: for (const simpleSub of sub.set) {
+ for (const simpleDom of dom.set) {
+ const isSub = simpleSubset(simpleSub, simpleDom, options)
+ sawNonNull = sawNonNull || isSub !== null
+ if (isSub) {
+ continue OUTER
+ }
+ }
+ // the null set is a subset of everything, but null simple ranges in
+ // a complex range should be ignored. so if we saw a non-null range,
+ // then we know this isn't a subset, but if EVERY simple range was null,
+ // then it is a subset.
+ if (sawNonNull) {
+ return false
+ }
+ }
+ return true
+}
+
+const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
+const minimumVersion = [new Comparator('>=0.0.0')]
+
+const simpleSubset = (sub, dom, options) => {
+ if (sub === dom) {
+ return true
+ }
+
+ if (sub.length === 1 && sub[0].semver === ANY) {
+ if (dom.length === 1 && dom[0].semver === ANY) {
+ return true
+ } else if (options.includePrerelease) {
+ sub = minimumVersionWithPreRelease
+ } else {
+ sub = minimumVersion
+ }
+ }
+
+ if (dom.length === 1 && dom[0].semver === ANY) {
+ if (options.includePrerelease) {
+ return true
+ } else {
+ dom = minimumVersion
+ }
+ }
+
+ const eqSet = new Set()
+ let gt, lt
+ for (const c of sub) {
+ if (c.operator === '>' || c.operator === '>=') {
+ gt = higherGT(gt, c, options)
+ } else if (c.operator === '<' || c.operator === '<=') {
+ lt = lowerLT(lt, c, options)
+ } else {
+ eqSet.add(c.semver)
+ }
+ }
+
+ if (eqSet.size > 1) {
+ return null
+ }
+
+ let gtltComp
+ if (gt && lt) {
+ gtltComp = compare(gt.semver, lt.semver, options)
+ if (gtltComp > 0) {
+ return null
+ } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
+ return null
+ }
+ }
+
+ // will iterate one or zero times
+ for (const eq of eqSet) {
+ if (gt && !satisfies(eq, String(gt), options)) {
+ return null
+ }
+
+ if (lt && !satisfies(eq, String(lt), options)) {
+ return null
+ }
+
+ for (const c of dom) {
+ if (!satisfies(eq, String(c), options)) {
+ return false
+ }
+ }
+
+ return true
+ }
+
+ let higher, lower
+ let hasDomLT, hasDomGT
+ // if the subset has a prerelease, we need a comparator in the superset
+ // with the same tuple and a prerelease, or it's not a subset
+ let needDomLTPre = lt &&
+ !options.includePrerelease &&
+ lt.semver.prerelease.length ? lt.semver : false
+ let needDomGTPre = gt &&
+ !options.includePrerelease &&
+ gt.semver.prerelease.length ? gt.semver : false
+ // exception: <1.2.3-0 is the same as <1.2.3
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
+ lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
+ needDomLTPre = false
+ }
+
+ for (const c of dom) {
+ hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
+ hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
+ if (gt) {
+ if (needDomGTPre) {
+ if (c.semver.prerelease && c.semver.prerelease.length &&
+ c.semver.major === needDomGTPre.major &&
+ c.semver.minor === needDomGTPre.minor &&
+ c.semver.patch === needDomGTPre.patch) {
+ needDomGTPre = false
+ }
+ }
+ if (c.operator === '>' || c.operator === '>=') {
+ higher = higherGT(gt, c, options)
+ if (higher === c && higher !== gt) {
+ return false
+ }
+ } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
+ return false
+ }
+ }
+ if (lt) {
+ if (needDomLTPre) {
+ if (c.semver.prerelease && c.semver.prerelease.length &&
+ c.semver.major === needDomLTPre.major &&
+ c.semver.minor === needDomLTPre.minor &&
+ c.semver.patch === needDomLTPre.patch) {
+ needDomLTPre = false
+ }
+ }
+ if (c.operator === '<' || c.operator === '<=') {
+ lower = lowerLT(lt, c, options)
+ if (lower === c && lower !== lt) {
+ return false
+ }
+ } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
+ return false
+ }
+ }
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
+ return false
+ }
+ }
+
+ // if there was a < or >, and nothing in the dom, then must be false
+ // UNLESS it was limited by another range in the other direction.
+ // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
+ return false
+ }
+
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
+ return false
+ }
+
+ // we needed a prerelease range in a specific tuple, but didn't get one
+ // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
+ // because it includes prereleases in the 1.2.3 tuple
+ if (needDomGTPre || needDomLTPre) {
+ return false
+ }
+
+ return true
+}
+
+// >=1.2.3 is lower than >1.2.3
+const higherGT = (a, b, options) => {
+ if (!a) {
+ return b
+ }
+ const comp = compare(a.semver, b.semver, options)
+ return comp > 0 ? a
+ : comp < 0 ? b
+ : b.operator === '>' && a.operator === '>=' ? b
+ : a
+}
+
+// <=1.2.3 is higher than <1.2.3
+const lowerLT = (a, b, options) => {
+ if (!a) {
+ return b
+ }
+ const comp = compare(a.semver, b.semver, options)
+ return comp < 0 ? a
+ : comp > 0 ? b
+ : b.operator === '<' && a.operator === '<=' ? b
+ : a
+}
+
+module.exports = subset
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/to-comparators.js b/node_modules/@pm2/agent/node_modules/semver/ranges/to-comparators.js
new file mode 100644
index 0000000..6c8bc7e
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/to-comparators.js
@@ -0,0 +1,8 @@
+const Range = require('../classes/range')
+
+// Mostly just for testing and legacy API reasons
+const toComparators = (range, options) =>
+ new Range(range, options).set
+ .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))
+
+module.exports = toComparators
diff --git a/node_modules/@pm2/agent/node_modules/semver/ranges/valid.js b/node_modules/@pm2/agent/node_modules/semver/ranges/valid.js
new file mode 100644
index 0000000..365f356
--- /dev/null
+++ b/node_modules/@pm2/agent/node_modules/semver/ranges/valid.js
@@ -0,0 +1,11 @@
+const Range = require('../classes/range')
+const validRange = (range, options) => {
+ try {
+ // Return '*' instead of '' so that truthiness works.
+ // This will throw if it's invalid anyway
+ return new Range(range, options).range || '*'
+ } catch (er) {
+ return null
+ }
+}
+module.exports = validRange
diff --git a/node_modules/@pm2/agent/package.json b/node_modules/@pm2/agent/package.json
new file mode 100644
index 0000000..0060571
--- /dev/null
+++ b/node_modules/@pm2/agent/package.json
@@ -0,0 +1,41 @@
+{
+ "name": "@pm2/agent",
+ "version": "2.0.4",
+ "description": "PM2.io Agent Daemon",
+ "main": "index.js",
+ "directories": {
+ "test": "test"
+ },
+ "scripts": {
+ "test": "mocha test/units/*.mocha.js"
+ },
+ "keywords": [
+ "keymetrics",
+ "agent",
+ "daemon",
+ "pm2"
+ ],
+ "dependencies": {
+ "async": "~3.2.0",
+ "chalk": "~3.0.0",
+ "dayjs": "~1.8.24",
+ "debug": "~4.3.1",
+ "eventemitter2": "~5.0.1",
+ "fast-json-patch": "^3.0.0-1",
+ "fclone": "~1.0.11",
+ "nssocket": "0.6.0",
+ "pm2-axon": "~4.0.1",
+ "pm2-axon-rpc": "~0.7.0",
+ "proxy-agent": "~6.3.0",
+ "semver": "~7.5.0",
+ "ws": "~7.5.10"
+ },
+ "devDependencies": {
+ "clone": "^2.1.1",
+ "mocha": "^7.1",
+ "nock": "^13.0.11",
+ "simple-socks": "^2.0.2"
+ },
+ "author": "Keymetrics Team",
+ "license": "AGPL-3.0"
+}
diff --git a/node_modules/@pm2/agent/src/InteractorClient.js b/node_modules/@pm2/agent/src/InteractorClient.js
new file mode 100644
index 0000000..84c252b
--- /dev/null
+++ b/node_modules/@pm2/agent/src/InteractorClient.js
@@ -0,0 +1,502 @@
+'use strict'
+
+const log = require('debug')('interactor:client')
+const fs = require('fs')
+const path = require('path')
+const rpc = require('pm2-axon-rpc')
+const axon = require('pm2-axon')
+const chalk = require('chalk')
+const os = require('os')
+const constants = require('../constants')
+const childProcess = require('child_process')
+
+const printError = function (msg) {
+ if (process.env.PM2_SILENT || process.env.PM2_PROGRAMMATIC) return false
+ if (msg instanceof Error) return console.error(msg.message)
+ return console.error.apply(console, arguments)
+}
+const printOut = function (msg) {
+ if (process.env.PM2_SILENT || process.env.PM2_PROGRAMMATIC) return false
+ return console.log.apply(console, arguments)
+}
+
+module.exports = class InteractorDaemonizer {
+ /**
+ * Ping the Interactor to see if its online
+ * @param {Object} opts global constants
+ * @param {String} opts.INTERACTOR_RPC_PORT path used to connect to the interactor
+ * @param {Function} cb invoked with
+ */
+ static ping (opts, cb) {
+ if (typeof cb !== 'function') {
+ throw new Error('Missing parameters')
+ } else if (typeof opts !== 'object' || !opts || !opts.INTERACTOR_RPC_PORT) {
+ return cb(new Error('Missing parameters'))
+ }
+ const req = axon.socket('req')
+ const client = new rpc.Client(req)
+
+ log('[PING INTERACTOR] Trying to connect to Interactor daemon')
+
+ client.sock.once('reconnect attempt', _ => {
+ client.sock.close()
+ log('Interactor Daemon not launched')
+ return cb(null, false)
+ })
+
+ client.sock.once('connect', _ => {
+ client.sock.once('close', _ => {
+ return cb(null, true)
+ })
+ client.sock.close()
+ log('Interactor Daemon alive')
+ })
+
+ client.sock.once('error', (e) => {
+ if (e.code === 'EACCES') {
+ fs.stat(opts.INTERACTOR_RPC_PORT, (e, stats) => {
+ if (stats.uid === 0) {
+ console.error('Permission denied, activate current user')
+ return process.exit(1)
+ }
+ })
+ } else {
+ console.error('unexpected error')
+ console.error(e)
+ }
+ })
+
+ req.connect(opts.INTERACTOR_RPC_PORT)
+ }
+
+ /**
+ * Try to kill the interactor daemon via RPC
+ * @param {Object} conf global constants
+ * @param {String} conf.INTERACTOR_RPC_PORT path used to connect to the interactor
+ * @param {Function} cb invoked with
+ */
+ static killInteractorDaemon (conf, cb) {
+ process.env.PM2_INTERACTOR_PROCESSING = true
+
+ log('Killing interactor #1 ping')
+ this.ping(conf, (err, online) => {
+ log(`Interactor is ${!online || err ? 'offline' : 'online'}`)
+
+ if (!online || err) {
+ return cb ? err ? cb(err) : cb(new Error('Interactor not launched')) : printError('Interactor not launched')
+ }
+
+ this.launchRPC(conf, (err, data) => {
+ if (err) {
+ setTimeout(_ => {
+ this.disconnectRPC(cb)
+ }, 100)
+ return false
+ }
+ this.rpc.kill((err) => {
+ if (err) printError(err)
+ setTimeout(_ => {
+ this.disconnectRPC(cb)
+ }, 100)
+ })
+ return false
+ })
+ return false
+ })
+ }
+
+ /**
+ * Start a RPC client that connect to the InteractorDaemon
+ * @param {Object} conf global constants
+ * @param {Function} cb invoked with
+ */
+ static launchRPC (conf, cb) {
+ const req = axon.socket('req')
+ this.rpc = {}
+ this.client = new rpc.Client(req)
+
+ log('Generating Interactor methods of RPC client')
+
+ // attach known methods to RPC client
+ const generateMethods = (cb) => {
+ this.client.methods((err, methods) => {
+ if (err) return cb(err)
+ Object.keys(methods).forEach((key) => {
+ let method = methods[key]
+ log('+ Adding %s method to interactor RPC client', method.name);
+ ((name) => {
+ let self = this
+ this.rpc[name] = function () {
+ let args = Array.prototype.slice.call(arguments)
+ args.unshift(name)
+ self.client.call.apply(self.client, args)
+ }
+ })(method.name)
+ })
+ return cb()
+ })
+ }
+
+ this.client.sock.once('reconnect attempt', (err) => {
+ this.client.sock.removeAllListeners()
+ return cb(err, { success: false, msg: 'reconnect attempt' })
+ })
+
+ this.client.sock.once('error', (err) => {
+ log('-- Error in error catch all on Interactor --', err)
+ return cb(err, { success: false, msg: 'reconnect attempt' })
+ })
+
+ this.client.sock.once('connect', () => {
+ this.client.sock.removeAllListeners()
+ generateMethods(_ => {
+ log('Methods of RPC client for Interaction ready.')
+ return cb(null, { success: true })
+ })
+ })
+
+ this.client_sock = req.connect(conf.INTERACTOR_RPC_PORT)
+ }
+
+ /**
+ * Start or Restart the Interaction Daemon depending if its online or not
+ * @private
+ * @param {Object} conf global constants
+ * @param {Object} infos data used to start the interactor [can be recovered from FS]
+ * @param {String} infos.secret_key the secret key used to cipher data
+ * @param {String} infos.public_key the public key used identify the user
+ * @param {String} infos.machine_name [optional] override name of the machine
+ * @param {Function} cb invoked with
+ */
+ static daemonize (cst, conf, cb) {
+ const InteractorJS = path.resolve(path.dirname(module.filename), 'InteractorDaemon.js')
+ const PM2Path = require.main.filename
+
+ // Redirect PM2 internal err and out
+ // to STDERR STDOUT when running with Travis
+ const testEnv = process.env.TRAVIS || (process.env.NODE_ENV && process.env.NODE_ENV.match(/test/))
+ const out = testEnv ? 1 : fs.openSync(constants.INTERACTOR_LOG_FILE_PATH, 'a')
+ const err = testEnv ? 2 : fs.openSync(constants.INTERACTOR_LOG_FILE_PATH, 'a')
+
+ let binary = process.execPath
+ if (binary.indexOf('node') === -1) {
+ binary = 'node'
+ }
+ if (process.env.NODEJS_EXECUTABLE) {
+ binary = process.env.NODEJS_EXECUTABLE
+ }
+
+ const child = childProcess.spawn(binary, [InteractorJS], {
+ silent: false,
+ detached: true,
+ cwd: process.cwd(),
+ env: Object.assign({
+ PM2_HOME: cst.PM2_HOME,
+ PM2_MACHINE_NAME: conf.machine_name,
+ PM2_SECRET_KEY: conf.secret_key,
+ PM2_PUBLIC_KEY: conf.public_key,
+ PM2_REVERSE_INTERACT: conf.reverse_interact,
+ PM2_BINARY_PATH: PM2Path,
+ KEYMETRICS_NODE: conf.info_node,
+ PM2_VERSION: conf.pm2_version,
+ DEBUG: process.env.DEBUG || 'interactor:*,-interactor:axon,-interactor:websocket,-interactor:pm2:client,-interactor:push'
+ }, process.env),
+ stdio: ['ipc', out, err]
+ })
+
+ try {
+ let prevPid = fs.readFileSync(constants.INTERACTOR_PID_PATH)
+ prevPid = parseInt(prevPid)
+ process.kill(prevPid)
+ } catch (e) {
+ }
+
+ let pid = ''
+
+ if (child.pid)
+ pid = child.pid.toString()
+
+ fs.writeFileSync(cst.INTERACTOR_PID_PATH, pid)
+
+ child.on('close', (status) => {
+ if (status === constants.ERROR_EXIT) {
+ return cb(new Error('Agent has shutdown for unknown reason'))
+ }
+ return cb()
+ })
+
+ child.once('error', (err) => {
+ log('Error when launching Interactor, please check the agent logs')
+ return cb(err)
+ })
+
+ child.unref()
+
+ const timeout = setTimeout(_ => {
+ printOut(`${chalk.yellow('[PM2.IO][WARNING]')} Not managed to connect to PM2 Plus, retrying in background.`)
+ child.removeAllListeners()
+ child.disconnect()
+ return cb(null, {}, child)
+ }, 7000)
+
+ child.once('message', (msg) => {
+ clearTimeout(timeout)
+ log('Interactor daemon launched :', msg)
+
+ if (msg.log) {
+ return cb(null, msg, child)
+ }
+
+ child.removeAllListeners('error')
+ child.disconnect()
+
+ // Handle and show to user the different error message that can happen
+ if (msg.km_data && msg.km_data.error === true) {
+ if (!process.env.PM2_SILENT) {
+ console.log(chalk.red('[PM2.IO][ERROR]'), msg.km_data.msg)
+ console.log(chalk.cyan('[PM2.IO]') + ' Contact support contact@keymetrics.io and send us the error message')
+ }
+ return cb(msg)
+ } else if (msg.km_data && msg.km_data.disabled === true) {
+ if (!process.env.PM2_SILENT) {
+ console.log(chalk.cyan('[PM2.IO]') + ' Server DISABLED BY ADMINISTRATION contact support contact@keymetrics.io with reference to your public and secret keys)')
+ }
+ return cb(msg)
+ } else if (msg.km_data && msg.km_data.error === true) {
+ if (!process.env.PM2_SILENT) {
+ console.log('%s %s (Public: %s) (Secret: %s) (Machine name: %s)', chalk.red('[PM2.IO][ERROR]'),
+ msg.km_data.msg, msg.public_key, msg.secret_key, msg.machine_name)
+ }
+ return cb(msg)
+ } else if (msg.km_data && msg.km_data.active === false && msg.km_data.pending === true) {
+ if (!process.env.PM2_SILENT) {
+ console.log('%s You must upgrade your bucket in order to monitor more servers.', chalk.red('[PM2.IO]'))
+ }
+ return cb(msg)
+ }
+
+ return cb(null, msg, child)
+ })
+ }
+
+ /**
+ * Start or Restart the Interaction Daemon depending if its online or not
+ * @private
+ * @param {Object} conf global constants
+ * @param {Object} infos data used to start the interactor [can be recovered from FS]
+ * @param {String} infos.secret_key the secret key used to cipher data
+ * @param {String} infos.public_key the public key used identify the user
+ * @param {String} infos.machine_name [optional] override name of the machine
+ * @param {Function} cb invoked with
+ */
+ static launchOrAttach (conf, infos, cb) {
+ this.ping(conf, (err, online) => {
+ if (!err && online) {
+ log('Interactor online, restarting it...')
+ this.launchRPC(conf, _ => {
+ this.rpc.kill((ignoredErr) => {
+ this.daemonize(conf, infos, cb)
+ })
+ })
+ } else {
+ log('Interactor offline, launching it...')
+ this.daemonize(conf, infos, cb)
+ }
+ })
+ }
+
+ /**
+ * Restart the Interactor Daemon
+ * @param {Object} conf global constants
+ * @param {Function} cb invoked with
+ */
+ static update (conf, cb) {
+ this.ping(conf, (err, online) => {
+ if (err || !online) {
+ return cb ? cb(new Error('Interactor not launched')) : printError('Interactor not launched')
+ }
+ this.launchRPC(conf, _ => {
+ this.rpc.kill((err) => {
+ if (err) {
+ return cb ? cb(err) : printError(err)
+ }
+ printOut('Interactor successfully killed')
+ setTimeout(_ => {
+ this.launchAndInteract(conf, {}, _ => {
+ return cb(null, { msg: 'Daemon launched' })
+ })
+ }, 500)
+ })
+ })
+ })
+ }
+
+ /**
+ * Retrieve Interactor configuration from env, params and filesystem.
+ * @param {Object} cst global constants
+ * @param {Object} infos data used to start the interactor [optional]
+ * @param {String} infos.secret_key the secret key used to cipher data [optional]
+ * @param {String} infos.public_key the public key used identify the user [optional]
+ * @param {String} infos.machine_name override name of the machine [optional]
+ * @param {Function} cb invoked with
+ */
+ static getOrSetConf (cst, infos, cb) {
+ infos = infos || {}
+ let configuration = {
+ version_management: {
+ active: true
+ }
+ }
+ let confFS = {}
+
+ // Try loading configuration file on FS
+ try {
+ let fileContent = fs.readFileSync(cst.INTERACTION_CONF).toString()
+ // Handle old configuration with json5
+ fileContent = fileContent.replace(/\s(\w+):/g, '"$1":')
+ // parse
+ confFS = JSON.parse(fileContent)
+
+ if (confFS.version_management) {
+ configuration.version_management.active = confFS.version_management.active
+ }
+ } catch (e) {
+ log('Interaction file does not exists')
+ }
+
+ // load the configration (first have priority)
+ // -> from env variable
+ // -> from params (eg. CLI)
+ // -> from configuration on FS
+ configuration.public_key = process.env.PM2_PUBLIC_KEY || process.env.KEYMETRICS_PUBLIC || infos.public_key || confFS.public_key
+ configuration.secret_key = process.env.PM2_SECRET_KEY || process.env.KEYMETRICS_SECRET || infos.secret_key || confFS.secret_key
+ configuration.machine_name = process.env.PM2_MACHINE_NAME || process.env.INSTANCE_NAME || infos.machine_name || confFS.machine_name || `${os.hostname()}-${require('crypto').randomBytes(2).toString('hex')}`
+ configuration.pm2_version = process.env.PM2_VERSION || infos.pm2_version || confFS.pm2_version
+ configuration.reverse_interact = confFS.reverse_interact || true
+ // is setup empty ? use the one provided in env OR root OTHERWISE get the one on FS conf OR fallback on root
+ configuration.info_node = process.env.KEYMETRICS_NODE || infos.info_node || confFS.info_node || cst.KEYMETRICS_ROOT_URL
+
+
+ if (!configuration.secret_key) {
+ log('Secret key is not defined in configuration', configuration)
+ return cb(new Error('secret key is not defined'))
+ }
+ if (!configuration.public_key) {
+ log('Public key is not defined in configuration', configuration)
+ return cb(new Error('public key is not defined'))
+ }
+
+ // write configuration on FS
+ try {
+ fs.writeFileSync(cst.INTERACTION_CONF, JSON.stringify(configuration, null, 4))
+ } catch (e) {
+ console.error('Error when writting configuration file %s', cst.INTERACTION_CONF)
+ return cb(e)
+ }
+ if (configuration.info_node.indexOf('http') === -1) { // handle old file
+ configuration.info_node = `https://${configuration.info_node}`
+ }
+ return cb(null, configuration)
+ }
+
+ /**
+ * Disconnect the RPC client from Interactor Daemon
+ * @param {Function} cb invoked with
+ */
+ static disconnectRPC (cb) {
+ log('Disconnect RPC')
+ if (!this.client_sock || !this.client_sock.close) {
+ log('RPC not launched')
+ return cb(null, {
+ success: false,
+ msg: 'RPC connection to Interactor Daemon is not launched'
+ })
+ }
+
+ if (this.client_sock.closing === true) {
+ log('RPC already closed')
+ return cb(null, {
+ success: false,
+ msg: 'RPC closed'
+ })
+ }
+
+ try {
+ let timer
+
+ log('Closing RPC INTERACTOR')
+
+ this.client_sock.once('close', _ => {
+ log('RPC INTERACTOR cleanly closed')
+ clearTimeout(timer)
+ return cb ? cb(null, { success: true }) : false
+ })
+
+ timer = setTimeout(_ => {
+ if (this.client_sock.destroy) {
+ this.client_sock.destroy()
+ }
+ return cb ? cb(null, { success: true }) : false
+ }, 200)
+
+ this.client_sock.close()
+ } catch (err) {
+ log('Error while closing RPC INTERACTOR : %s', err.message || err)
+ return cb ? cb(err) : false
+ }
+ }
+
+ /**
+ * Start the Interactor Daemon
+ * @param {Object} cst global constants
+ * @param {Object} infos data used to start the interactor [can be recovered from FS]
+ * @param {String} infos.secret_key the secret key used to cipher data
+ * @param {String} infos.public_key the public key used identify the user
+ * @param {String} infos.machine_name [optional] override name of the machine
+ * @param {Function} cb invoked with
+ */
+ static launchAndInteract (cst, opts, cb) {
+ // For Watchdog
+ if (process.env.PM2_AGENT_ONLINE) {
+ return cb()
+ }
+
+ process.env.PM2_INTERACTOR_PROCESSING = true
+
+ this.getOrSetConf(Object.assign(cst, constants), opts, (err, conf) => {
+ if (err || !conf) return cb(err || new Error('Cant retrieve configuration'))
+
+ if (!process.env.PM2_SILENT) {
+ console.log(chalk.cyan('[PM2 I/O]') + ' Using: Public key: %s | Private key: %s | Machine name: %s', conf.public_key, conf.secret_key, conf.machine_name)
+ }
+ return this.launchOrAttach(cst, conf, cb)
+ })
+ }
+
+ /**
+ * Retrieve configuration used by the Interaction Daemon
+ * @param {Object} cst global constants
+ * @param {Function} cb invoked with
+ */
+ static getInteractInfo (cst, cb) {
+ log('Getting interaction info')
+ if (process.env.PM2_NO_INTERACTION) return cb(new Error('PM2_NO_INTERACTION set'))
+
+ this.ping(cst, (err, online) => {
+ if (err || !online) return cb(new Error('Interactor is offline'))
+
+ this.launchRPC(cst, _ => {
+ this.rpc.getInfos((err, infos) => {
+ if (err) return cb(err)
+
+ // Avoid general CLI to interfere with Keymetrics CLI commands
+ if (process.env.PM2_INTERACTOR_PROCESSING) return cb(null, infos)
+
+ this.disconnectRPC(() => {
+ return cb(null, infos)
+ })
+ })
+ })
+ })
+ }
+}
diff --git a/node_modules/@pm2/agent/src/InteractorDaemon.js b/node_modules/@pm2/agent/src/InteractorDaemon.js
new file mode 100644
index 0000000..8c93c61
--- /dev/null
+++ b/node_modules/@pm2/agent/src/InteractorDaemon.js
@@ -0,0 +1,452 @@
+'use strict'
+
+const fs = require('fs')
+const rpc = require('pm2-axon-rpc')
+const axon = require('pm2-axon')
+const log = require('debug')('interactor:daemon')
+const os = require('os')
+const cst = require('../constants.js')
+const ReverseInteractor = require('./reverse/ReverseInteractor.js')
+const PushInteractor = require('./push/PushInteractor.js')
+const Utility = require('./Utility.js')
+const PM2Client = require('./PM2Client.js')
+const TransporterInterface = require('./TransporterInterface.js')
+const domain = require('domain') // eslint-disable-line
+const WatchDog = require('./WatchDog')
+const InteractorClient = require('./InteractorClient')
+const semver = require('semver')
+const path = require('path')
+const pkg = require('../package.json')
+
+global._logs = false
+
+const InteractorDaemon = module.exports = class InteractorDaemon {
+ constructor () {
+ this.opts = this.retrieveConf()
+
+ log(`MACHINE_NAME=${this.opts.MACHINE_NAME}`)
+ log(`PUBLIC_KEY=${this.opts.PUBLIC_KEY}`)
+ log(`ROOT_URL=${cst.KEYMETRICS_ROOT_URL}`)
+
+ this.DAEMON_ACTIVE = false
+ this.transport = new TransporterInterface(this.opts, this)
+ .bind('websocket')
+ this.transport.on('error', (err) => {
+ return console.error('[NETWORK] Error : ' + err.message || err)
+ })
+ this.httpClient = new Utility.HTTPClient()
+ this._online = true
+
+ this._internalDebugger()
+ }
+
+ /**
+ * Use process.send() if connected
+ * @param {Object} data
+ */
+ sendToParent (data) {
+ if (!process.connected || !process.send) return console.log('Could not send data to parent')
+
+ try {
+ process.send(data)
+ } catch (e) {
+ console.trace('Parent process disconnected')
+ }
+ }
+
+ /**
+ * Get an interface for communicating with PM2 daemon
+ * @private
+ * @return {PM2Client}
+ */
+ getPM2Client () {
+ if (!this._ipm2) {
+ this._ipm2 = new PM2Client()
+ }
+ return this._ipm2
+ }
+
+ /**
+ * Terminate aconnections and exit
+ * @param {cb} callback called at the end
+ */
+ exit (err, cb) {
+ log('Exiting Interactor')
+ // clear workers
+ if (this._workerEndpoint) clearInterval(this._workerEndpoint)
+
+ // stop interactors
+ if (this.reverse) this.reverse.stop()
+ if (this.push) this.push.stop()
+
+ if (this._ipm2) this._ipm2.disconnect()
+ if (this.watchDog) this.watchDog.stop()
+ // stop transport
+ if (this.transport) this.transport.disconnect()
+
+ if (!err) {
+ try {
+ fs.unlinkSync(cst.INTERACTOR_RPC_PORT)
+ fs.unlinkSync(cst.INTERACTOR_PID_PATH)
+ } catch (err) {}
+ }
+
+ if (!this._rpc || !this._rpc.sock) {
+ return process.exit(cst.ERROR_EXIT)
+ }
+
+ if (typeof cb === 'function') {
+ cb()
+ }
+
+ setTimeout(() => {
+ this._rpc.sock.close(() => {
+ log('RPC server closed')
+ process.exit(err ? cst.ERROR_EXIT : cst.SUCCESS_EXIT)
+ })
+ }, 10)
+ }
+
+ /**
+ * Start a RPC server and expose it throught a socket file
+ */
+ startRPC (opts) {
+ log('Launching Interactor RPC server (bind to %s)', cst.INTERACTOR_RPC_PORT)
+ const rep = axon.socket('rep')
+ const rpcServer = new rpc.Server(rep)
+ const self = this
+ rep.bind(cst.INTERACTOR_RPC_PORT)
+
+ rpcServer.expose({
+ kill: function (cb) {
+ log('Shutdown request received via RPC')
+ return self.exit(null, cb)
+ },
+ getInfos: function (cb) {
+ if (self.opts && self.DAEMON_ACTIVE === true) {
+ return cb(null, {
+ machine_name: self.opts.MACHINE_NAME,
+ public_key: self.opts.PUBLIC_KEY,
+ secret_key: self.opts.SECRET_KEY,
+ remote_host: self.km_data.endpoints.web,
+ connected: self.transport.isConnected(),
+ transporters: self.transport.getActiveTransporters(),
+ socket_path: cst.INTERACTOR_RPC_PORT,
+ pm2_home_monitored: cst.PM2_HOME
+ })
+ } else {
+ return cb(null)
+ }
+ }
+ })
+ return rpcServer
+ }
+
+ /**
+ * Handle specific signals to launch memory / cpu profiling
+ * if available in node
+ */
+ _internalDebugger () {
+ // inspector isn't available under node 8
+ if (semver.satisfies(process.version, '<8')) return
+
+ const inspector = require('inspector')
+ const state = {
+ heap: false,
+ cpu: false,
+ session: null
+ }
+ const commands = {
+ heap: {
+ start: 'HeapProfiler.startSampling',
+ stop: 'HeapProfiler.stopSampling'
+ },
+ cpu: {
+ start: 'Profiler.start',
+ stop: 'Profiler.stop'
+ }
+ }
+
+ const handleSignal = type => {
+ return _ => {
+ if (state.session === null) {
+ state.session = new inspector.Session()
+ state.session.connect()
+ }
+
+ const isAlreadyEnabled = state[type]
+ const debuggerCommands = commands[type]
+ const profilerDomain = type === 'cpu' ? 'Profiler' : 'HeapProfiler'
+ const fileExt = type === 'heap' ? '.heapprofile' : '.cpuprofile'
+
+ if (isAlreadyEnabled) {
+ // stopping the profiling and writting it to disk if its running
+ console.log(`[DEBUG] Stopping ${type.toUpperCase()} Profiling`)
+ state.session.post(debuggerCommands.stop, (err, data) => {
+ const profile = data.profile
+ if (err) return console.error(err)
+ const randomId = Math.random().toString(36)
+ const profilePath = path.resolve(os.tmpdir(), `${type}-${randomId}${fileExt}`)
+
+ fs.writeFileSync(profilePath, JSON.stringify(profile))
+ console.log(`[DEBUG] Writing file in ${profilePath}`)
+ state[type] = false
+ state.session.post(`${profilerDomain}.disable`)
+ })
+ } else {
+ // start the profiling otherwise
+ console.log(`[DEBUG] Starting ${type.toUpperCase()} Profiling`)
+ state.session.post(`${profilerDomain}.enable`, _ => {
+ state.session.post(debuggerCommands.start)
+ state[type] = true
+ })
+ }
+ }
+ }
+
+ // use hook
+ process.on('SIGUSR1', handleSignal('cpu'))
+ process.on('SIGUSR2', handleSignal('heap'))
+ }
+
+ /**
+ * Retrieve metadata about the system
+ */
+ getSystemMetadata () {
+ return {
+ MACHINE_NAME: this.opts.MACHINE_NAME,
+ PUBLIC_KEY: this.opts.PUBLIC_KEY,
+ RECYCLE: this.opts.RECYCLE || false,
+ PM2_VERSION: process.env.PM2_VERSION,
+ MEMORY: os.totalmem() / 1000 / 1000,
+ HOSTNAME: os.hostname(),
+ CPUS: os.cpus()
+ }
+ }
+
+ /**
+ * Ping root url to retrieve node info
+ * @private
+ * @param {Function} cb invoked with where Object is the response sended by the server
+ */
+ _pingRoot (cb) {
+ const data = this.getSystemMetadata()
+
+ this.httpClient.open({
+ url: this.opts.ROOT_URL + '/api/node/verifyPM2',
+ method: 'POST',
+ data: {
+ public_id: this.opts.PUBLIC_KEY,
+ private_id: this.opts.SECRET_KEY,
+ data: data
+ },
+ headers: {
+ 'User-Agent': `PM2 Agent v${pkg.version}`
+ }
+ }, cb)
+ }
+
+ /**
+ * Ping root to verify retrieve and connect to the km endpoint
+ * @private
+ * @param {Function} cb invoked with
+ */
+ _verifyEndpoint (cb) {
+ if (typeof cb !== 'function') cb = function () {}
+
+ this._pingRoot((err, data) => {
+ if (err) {
+ log('Got an a error on ping root', err)
+ return cb(err)
+ }
+
+ this.km_data = data
+
+ // Verify data integrity
+ if (data.disabled === true || data.pending === true) {
+ log('Interactor is disabled by admins')
+ return cb(new Error('Connection refused, you might have hit the limit of agents you can connect (send email at contact@keymetrics.io for more infos)'))
+ }
+ if (data.active === false) {
+ log('Interactor not active: %s', data.msg || 'no message')
+ return cb(null, data)
+ }
+ if (!data.endpoints) {
+ return cb(new Error(`Endpoints field not present (${JSON.stringify(data)})`))
+ }
+
+ this.DAEMON_ACTIVE = true
+ this.transport.connect(data.endpoints, cb)
+ })
+ }
+
+ /**
+ * Retrieve configuration from environnement
+ */
+ retrieveConf () {
+ let opts = {}
+
+ opts.MACHINE_NAME = process.env.PM2_MACHINE_NAME
+ opts.PUBLIC_KEY = process.env.PM2_PUBLIC_KEY
+ opts.PM2_BINARY_PATH = process.env.PM2_BINARY_PATH
+ opts.SECRET_KEY = process.env.PM2_SECRET_KEY
+ opts.RECYCLE = process.env.KM_RECYCLE ? JSON.parse(process.env.KM_RECYCLE) : false
+ opts.PM2_VERSION = process.env.PM2_VERSION || '0.0.0'
+ opts.AGENT_TRANSPORT_WEBSOCKET = process.env.AGENT_TRANSPORT_WEBSOCKET
+ opts.internal_ip = Utility.network.v4
+
+ opts.PM2_REMOTE_METHOD_ALLOWED = [
+ 'restart',
+ 'reload',
+ 'reset',
+ 'scale',
+ 'startLogging',
+ 'stopLogging',
+ 'ping',
+ 'launchSysMonitoring',
+ 'deepUpdate'
+ ]
+
+ if (!opts.MACHINE_NAME) {
+ console.error('You must provide a PM2_MACHINE_NAME environment variable')
+ process.exit(cst.ERROR_EXIT)
+ } else if (!opts.PUBLIC_KEY) {
+ console.error('You must provide a PM2_PUBLIC_KEY environment variable')
+ process.exit(cst.ERROR_EXIT)
+ } else if (!opts.SECRET_KEY) {
+ console.error('You must provide a PM2_SECRET_KEY environment variable')
+ process.exit(cst.ERROR_EXIT)
+ }
+ return opts
+ }
+
+ /**
+ * Ping root url to retrieve node info
+ * @private
+ * @param {Function} cb invoked with [optional]
+ */
+ start (cb) {
+ let retries = 0
+ this._rpc = this.startRPC()
+ this.opts.ROOT_URL = cst.KEYMETRICS_ROOT_URL
+
+ const verifyEndpointCallback = (err, result) => {
+ if (err) {
+ log('Error while trying to retrieve endpoints : ' + (err.message || err))
+ if (retries++ < 30 && process.env.NODE_ENV !== 'test') {
+ log('Retrying to retrieve endpoints...')
+ return setTimeout(_ => {
+ return this._verifyEndpoint(verifyEndpointCallback)
+ }, 200 * retries)
+ }
+ this.sendToParent({ error: true, msg: err.message || err })
+ return this.exit(new Error('Error retrieving endpoints'))
+ }
+ if (result === false) {
+ log('False returned while trying to retrieve endpoints')
+ return this.exit(new Error('Error retrieving endpoints'))
+ }
+
+ // send data over IPC for CLI feedback
+ this.sendToParent({
+ error: false,
+ km_data: this.km_data,
+ online: true,
+ pid: process.pid,
+ machine_name: this.opts.MACHINE_NAME,
+ public_key: this.opts.PUBLIC_KEY,
+ secret_key: this.opts.SECRET_KEY,
+ reverse_interaction: this.opts.REVERSE_INTERACT
+ })
+
+ if (result && typeof result === 'object' &&
+ result.error === true && result.active === false) {
+ log(`Error when connecting: ${result.msg}`)
+ return this.exit(new Error(`Error when connecting: ${result.msg}`))
+ }
+
+ // start workers
+ this._workerEndpoint = setInterval(this._verifyEndpoint.bind(this, (err, result) => {
+ if (err) return
+ // We need to exit agent if bucket is disabled (trialing)
+ if (result && typeof result === 'object' && result.error === true && result.active === false) {
+ log(`Error when connecting: ${result.msg}, disconnecting transporters`)
+ return this.transport.disconnect()
+ }
+ }), 60000)
+ // start interactors
+ this.watchDog = WatchDog
+
+ setTimeout(() => {
+ log('>> PM2 Watchdog started')
+ this.watchDog.start({
+ pm2_binary_path: this.opts.PM2_BINARY_PATH,
+ conf: {
+ ipm2: this.getPM2Client()
+ }
+ })
+ }, 30 * 1000)
+
+ this.push = new PushInteractor(this.opts, this.getPM2Client(), this.transport)
+ this.reverse = new ReverseInteractor(this.opts, this.getPM2Client(), this.transport)
+ this.push.start()
+ this.reverse.start()
+ log('Interactor daemon started')
+ if (cb) {
+ setTimeout(cb, 20)
+ }
+ }
+ return this._verifyEndpoint(verifyEndpointCallback)
+ }
+}
+
+// If its the entry file launch the daemon
+// otherwise we just required it to use a function
+if (require.main === module) {
+ const d = domain.create()
+ let daemon = null
+
+ d.on('error', function (err) {
+ console.error('-- FATAL EXCEPTION happened --')
+ console.error(new Date())
+ console.error(err.stack)
+ console.log('Re-initiating Agent')
+
+ InteractorClient.getOrSetConf(cst, null, (err, infos) => {
+ if (err || !infos) {
+ if (err) {
+ console.error('[PM2 Agent] Failed to rescue agent :')
+ console.error(err || new Error(`Cannot find configuration to connect to backend`))
+ return process.exit(1)
+ }
+ }
+ console.log(`[PM2 Agent] Using (Public key: ${infos.public_key}) (Private key: ${infos.secret_key}) (Info node: ${infos.info_node})`)
+
+ // Exit anyway the errored agent
+ var timeout = setTimeout(_ => {
+ console.error('Daemonization of failsafe agent did not worked')
+ daemon.exit(err)
+ }, 2000)
+
+ InteractorClient.daemonize(cst, infos, (err) => {
+ if (err) {
+ log('[PM2 Agent] Failed to rescue agent :')
+ log(err)
+ } else {
+ log(`Succesfully launched new agent`)
+ }
+ clearTimeout(timeout)
+ daemon.exit(err)
+ })
+ })
+ })
+
+ d.run(_ => {
+ daemon = new InteractorDaemon()
+
+ process.title = `PM2 Agent v${pkg.version}: (${cst.PM2_HOME})`
+
+ log('[PM2 Agent] Launching agent')
+ daemon.start()
+ })
+}
diff --git a/node_modules/@pm2/agent/src/PM2Client.js b/node_modules/@pm2/agent/src/PM2Client.js
new file mode 100644
index 0000000..52f2f8c
--- /dev/null
+++ b/node_modules/@pm2/agent/src/PM2Client.js
@@ -0,0 +1,112 @@
+'use strict'
+
+const axon = require('pm2-axon')
+const cst = require('../constants.js')
+const rpc = require('pm2-axon-rpc')
+const log = require('debug')('interactor:pm2:client')
+const EventEmitter = require('events').EventEmitter
+const PM2Interface = require('./PM2Interface')
+
+/**
+ * PM2 API Wrapper used to setup connection with the daemon
+ * @param {Object} opts options
+ * @param {String} opts.sub_port socket file of the PM2 bus [optionnal]
+ * @param {String} opts.rpc_port socket file of the PM2 RPC server [optionnal]
+ */
+module.exports = class PM2Client extends EventEmitter {
+ constructor (opts) {
+ super()
+ const subSocket = (opts && opts.sub_port) || cst.DAEMON_PUB_PORT
+ const rpcSocket = (opts && opts.rpc_port) || cst.DAEMON_RPC_PORT
+
+ const sub = axon.socket('sub-emitter')
+ this.sub_sock = sub.connect(subSocket)
+ this.bus = sub
+
+ const req = axon.socket('req')
+ this.rpc_sock = req.connect(rpcSocket)
+ this.rpc_client = new rpc.Client(req)
+
+ this.rpc = {}
+
+ this.rpc_sock.on('connect', _ => {
+ log('PM2 API Wrapper connected to PM2 Daemon via RPC')
+ this.generateMethods(_ => {
+ this.pm2Interface = new PM2Interface(this.rpc)
+ this.emit('ready')
+ })
+ })
+
+ this.rpc_sock.on('close', _ => {
+ log('pm2 rpc closed')
+ this.emit('closed')
+ })
+
+ this.rpc_sock.on('reconnect attempt', _ => {
+ log('pm2 rpc reconnecting')
+ this.emit('reconnecting')
+ })
+
+ this.sub_sock.on('connect', _ => {
+ log('bus ready')
+ this.emit('bus:ready')
+ })
+
+ this.sub_sock.on('close', _ => {
+ log('bus closed')
+ this.emit('bus:closed')
+ })
+
+ this.sub_sock.on('reconnect attempt', _ => {
+ log('bus reconnecting')
+ this.emit('bus:reconnecting')
+ })
+ }
+
+ /**
+ * Disconnect socket connections. This will allow Node to exit automatically.
+ * Further calls to PM2 from this object will throw an error.
+ */
+ disconnect () {
+ this.sub_sock.close()
+ this.rpc_sock.close()
+ }
+
+ /**
+ * Generate method by requesting exposed methods by PM2
+ * You can now control/interact with PM2
+ */
+ generateMethods (cb) {
+ log('Requesting and generating RPC methods')
+ this.rpc_client.methods((err, methods) => {
+ if (err) return cb(err)
+ Object.keys(methods).forEach((key) => {
+ let method = methods[key]
+
+ log('+-- Creating %s method', method.name);
+
+ ((name) => {
+ const self = this
+ this.rpc[name] = function () {
+ let args = Array.prototype.slice.call(arguments)
+ args.unshift(name)
+ self.rpc_client.call.apply(self.rpc_client, args)
+ }
+ })(method.name)
+ })
+ return cb()
+ })
+ }
+
+ remote (method, parameters, cb) {
+ log('remote send %s', method, parameters)
+ if (typeof this.pm2Interface[method] === 'undefined') {
+ return cb(new Error('Deprecated or invalid method'))
+ }
+ this.pm2Interface[method](parameters, cb)
+ }
+
+ msgProcess (data, cb) {
+ this.rpc.msgProcess(data, cb)
+ }
+}
diff --git a/node_modules/@pm2/agent/src/PM2Interface.js b/node_modules/@pm2/agent/src/PM2Interface.js
new file mode 100644
index 0000000..f78e8de
--- /dev/null
+++ b/node_modules/@pm2/agent/src/PM2Interface.js
@@ -0,0 +1,180 @@
+'use strict'
+
+const log = require('debug')('interactor:pm2:interface')
+const path = require('path')
+const async = require('async')
+const fs = require('fs')
+const cst = require('../constants')
+
+module.exports = class PM2Interface {
+ constructor (rpc) {
+ log('PM2Interface instantiate')
+ this.rpc = rpc
+ }
+
+ getProcessByName (name, cb) {
+ var foundProc = []
+
+ this.rpc.getMonitorData({}, (err, list) => {
+ if (err) {
+ log('Error retrieving process list: ' + err)
+ return cb(err)
+ }
+
+ list.forEach((proc) => {
+ if (proc.pm2_env.name === name || proc.pm2_env.pm_exec_path === path.resolve(name.toString())) {
+ foundProc.push(proc)
+ }
+ })
+
+ return cb(null, foundProc)
+ })
+ }
+
+ /**
+ * Scale up/down a process
+ * @method scale
+ */
+ scale (opts, cb) {
+ const self = this
+ const appName = opts.name
+ let number = opts.number
+
+ function addProcs (proc, value, cb) {
+ (function ex (proc, number) {
+ if (number-- === 0) return cb()
+ log('Scaling up application')
+ self.rpc.duplicateProcessId(proc.pm2_env.pm_id, ex.bind(this, proc, number))
+ })(proc, number)
+ }
+
+ function rmProcs (procs, value, cb) {
+ let i = 0;
+
+ (function ex (procs, number) {
+ if (number++ === 0) return cb()
+ self.rpc.deleteProcessId(procs[i++].pm2_env.pm_id, ex.bind(this, procs, number))
+ })(procs, number)
+ }
+
+ let end = () => {
+ return cb ? cb(null, {success: true}) : log('Successfuly scale')
+ }
+
+ this.getProcessByName(appName, (err, procs) => {
+ if (err) {
+ return cb ? cb(err) : log(err)
+ }
+
+ if (!procs || procs.length === 0) {
+ log('Application %s not found', appName)
+ return cb ? cb(new Error('App not found')) : log('App not found')
+ }
+
+ let procNumber = procs.length
+
+ if (typeof (number) === 'string' && number.indexOf('+') >= 0) {
+ number = parseInt(number, 10)
+ return addProcs(procs[0], number, end)
+ } else if (typeof (number) === 'string' && number.indexOf('-') >= 0) {
+ number = parseInt(number, 10)
+ return rmProcs(procs, number, end)
+ } else {
+ number = parseInt(number, 10)
+ number = number - procNumber
+
+ if (number < 0) {
+ return rmProcs(procs, number, end)
+ } else if (number > 0) {
+ return addProcs(procs[0], number, end)
+ } else {
+ log('Nothing to do')
+ return cb ? cb(new Error('Same process number')) : log('Same process number')
+ }
+ }
+ })
+ }
+
+ /**
+ * Dump current processes managed by pm2 into DUMP_FILE_PATH file
+ * @method dump
+ * @param {} cb
+ * @return
+ */
+ dump (cb) {
+ var envArr = []
+
+ this.rpc.getMonitorData({}, (err, list) => {
+ if (err) {
+ return typeof cb === 'function' ? cb(err) : false
+ }
+
+ /**
+ * Description
+ * @method end
+ * @param {} err
+ * @return
+ */
+ const end = () => {
+ // Overwrite dump file, delete if broken and exit
+ try {
+ fs.writeFileSync(cst.DUMP_FILE_PATH, JSON.stringify(envArr, '', 2))
+ } catch (e) {
+ log('Dump error', e.stack || e)
+ return cb(e)
+ }
+ return (cb) ? cb(null, {success: true}) : true
+ }
+
+ async.each(list, (app, done) => {
+ delete app.pm2_env.instances
+ delete app.pm2_env.pm_id
+ if (!app.pm2_env.pmx_module) {
+ envArr.push(app.pm2_env)
+ }
+ done()
+ }, end)
+ })
+ }
+
+ _callWithProcessId (fn, params, cb) {
+ if (params.id === undefined) {
+ this.getProcessByName(params.name, (err, processes) => {
+ if (err) return cb(err)
+
+ // in case we don't find the process ourselves
+ // we believe pm2 will find it
+ if (processes.length === 0) {
+ return fn(Object.assign({ id: params.name }, params), cb)
+ }
+
+ async.eachOf(processes, (process, _key, localCb) => {
+ params.id = process.pm_id
+ fn(params, localCb)
+ }, cb)
+ })
+ } else {
+ fn(params, cb)
+ }
+ }
+
+ restart (params, cb) {
+ this._callWithProcessId(this.rpc.restartProcessId, params, cb)
+ }
+
+ reload (params, cb) {
+ this._callWithProcessId(this.rpc.reloadProcessId, params, cb)
+ }
+
+ reset (params, cb) {
+ this._callWithProcessId(
+ (newParams, cb) => this.rpc.resetMetaProcessId(newParams.id, cb),
+ params,
+ cb
+ )
+ }
+
+ ping (params, cb) {
+ this._callWithProcessId(this.rpc.ping, params, cb)
+ }
+}
diff --git a/node_modules/@pm2/agent/src/TransporterInterface.js b/node_modules/@pm2/agent/src/TransporterInterface.js
new file mode 100644
index 0000000..04e73c7
--- /dev/null
+++ b/node_modules/@pm2/agent/src/TransporterInterface.js
@@ -0,0 +1,173 @@
+'use strict'
+
+const EventEmitter2 = require('eventemitter2').EventEmitter2
+const async = require('async')
+const log = require('debug')('interactor:interface')
+const path = require('path')
+const config = require(path.join(__dirname, '../config')).transporters
+
+module.exports = class TransporterInterface extends EventEmitter2 {
+ /**
+ * Construct new transporter interface with default options and daemon
+ * @param {Object} opts [optionnal] Default options
+ * @param {InteractorDaemon} Daemon needed by transports
+ */
+ constructor (opts, daemon) {
+ log('New transporter interface')
+
+ super({
+ delimiter: ':',
+ wildcard: true
+ })
+ this.opts = opts || {}
+ this.daemon = daemon
+ this.transporters = new Map()
+ this.transportersEndpoints = new Map()
+ this.endpoints = new Map()
+ this.config = config
+ return this
+ }
+
+ /**
+ * Add transporter
+ * @param {String} name of the transporter (in ./transporters/)
+ * @param {Object} opts [optionnal] custom options
+ */
+ bind (name, opts) {
+ if (!opts) opts = {}
+ if (!this.config[name] || !this.config[name].enabled) return this
+ log('Bind [%s] transport to transporter interface', name)
+ let Transport = this._loadTransporter(name)
+ this.transporters.set(name, new Transport(Object.assign(opts, this.opts), this.daemon))
+ this.transportersEndpoints.set(name, this.config[name].endpoints || {})
+ this._bindEvents(name)
+ return this
+ }
+
+ /**
+ * Disconnect each transporters
+ */
+ disconnect () {
+ log('Disconnect all transporters')
+ this.transporters.forEach(transporter => {
+ transporter.disconnect()
+ })
+ }
+
+ /**
+ * Connect each transporters with new endpoints
+ * @param {Object} endpoints
+ * @param {Function} callback
+ */
+ connect (endpoints, cb) {
+ async.each(this.transporters, (data, next) => {
+ let name = data[0]
+ let transport = data[1]
+ // Isn't connected, connect it
+ if (!transport.isConnected()) {
+ log(`Connecting to: ${JSON.stringify(endpoints)}`)
+ transport.connect(this._buildConnectParamsFromEndpoints(name, endpoints), next)
+ // Endpoints have changed, reconnect
+ } else if (JSON.stringify(endpoints) !== JSON.stringify(this.endpoints)) {
+ log(`Received new endpoints to connect transporters: ${JSON.stringify(endpoints)}`)
+ transport.reconnect(this._buildConnectParamsFromEndpoints(name, endpoints), next)
+ // No changes
+ } else {
+ return next(null)
+ }
+ }, (err) => {
+ // Save endpoints
+ this.endpoints = endpoints
+ cb(err)
+ })
+ }
+
+ /**
+ * Send to each transporters
+ */
+ send (channel, data) {
+ if (process.env.VERBOSE)
+ console.log(`channel=${channel}: data=${JSON.stringify(data, '', 2)}`)
+ this.transporters.forEach(transporter => {
+ transporter.send(channel, data)
+ })
+ }
+
+ /**
+ * Require transporter
+ * @param {String} name of the transporter (in ./transporters/)
+ * @private
+ */
+ _loadTransporter (name) {
+ return require('./transporters/' + this._getTransportName(name))
+ }
+
+ /**
+ * Resolve transporter name
+ * @param {String} name of the transporter (in ./transporters/)
+ * @private
+ */
+ _getTransportName (name) {
+ name = name.toLowerCase()
+ name = name.charAt(0).toUpperCase() + name.slice(1)
+ return name + 'Transport'
+ }
+
+ /**
+ * Emit event on transporter event
+ * @param {String} name of the transporter
+ * @private
+ */
+ _bindEvents (name) {
+ const self = this
+ this.transporters.get(name).on('**', function (data) {
+ log('Received event from %s transporter', name)
+ self.emit(this.event, data)
+ })
+ }
+
+ /**
+ * Return an object used to connect() transport
+ * based on transporter endpoints options
+ * @param {String} transporter's name
+ * @param {Object} endpoints
+ * @private
+ */
+ _buildConnectParamsFromEndpoints (name, endpoints) {
+ if (!endpoints) endpoints = {}
+ const opts = this.transportersEndpoints.get(name)
+ if (typeof opts === 'string') {
+ return endpoints[opts] || opts
+ }
+ let params = {}
+ for (let key in opts) {
+ params[key] = endpoints[opts[key]] || opts[key]
+ }
+ return params
+ }
+
+ /**
+ * Is at least one transporter connected
+ * @return {Boolean}
+ */
+ isConnected () {
+ for (let transporter of this.transporters.values()) {
+ if (transporter.isConnected()) return true
+ }
+ return false
+ }
+
+ /**
+ * Get active transporters that are pushing data
+ * @return {String[]}
+ */
+ getActiveTransporters () {
+ let connected = []
+ for (let entry of this.transporters.values()) {
+ if (entry.isConnected()) {
+ connected.push(entry.constructor.name)
+ }
+ }
+ return connected
+ }
+}
diff --git a/node_modules/@pm2/agent/src/Utility.js b/node_modules/@pm2/agent/src/Utility.js
new file mode 100644
index 0000000..f6f617b
--- /dev/null
+++ b/node_modules/@pm2/agent/src/Utility.js
@@ -0,0 +1,395 @@
+'use strict'
+
+const os = require('os')
+const crypto = require('crypto')
+const dayjs = require('dayjs')
+const url = require('url')
+const ProxyAgent = require('proxy-agent')
+const cst = require('../constants.js')
+
+const interfaceType = {
+ v4: {
+ default: '127.0.0.1',
+ family: 'IPv4'
+ },
+ v6: {
+ default: '::1',
+ family: 'IPv6'
+ }
+}
+
+/**
+ * Search for public network adress
+ * @param {String} type the type of network interface, can be either 'v4' or 'v6'
+ */
+const retrieveAddress = (type) => {
+ let interfce = interfaceType[type]
+ let ret = interfce.default
+ let interfaces = os.networkInterfaces()
+
+ Object.keys(interfaces).forEach(function (el) {
+ interfaces[el].forEach(function (el2) {
+ if (!el2.internal && el2.family === interfce.family) {
+ ret = el2.address
+ }
+ })
+ })
+ return ret
+}
+
+/**
+ * Simple cache implementation
+ *
+ * @param {Object} opts cache options
+ * @param {Function} opts.miss function called when a key isn't found in the cache
+ */
+class Cache {
+ constructor (opts) {
+ this._cache = {}
+ this._miss = opts.miss
+ this._ttl_time = opts.ttl
+ this._ttl = {}
+
+ if (opts.ttl) {
+ this._worker = setInterval(this.worker.bind(this), 1000)
+ }
+ }
+
+ worker () {
+ let keys = Object.keys(this._ttl)
+ for (let i = 0; i < keys.length; i++) {
+ let key = keys[i]
+ let value = this._ttl[key]
+ if (dayjs().isAfter(value)) {
+ delete this._cache[key]
+ delete this._ttl[key]
+ }
+ }
+ }
+
+ /**
+ * Get a value from the cache
+ *
+ * @param {String} key
+ */
+ get (key) {
+ if (!key) return null
+ let value = this._cache[key]
+ if (value) return value
+
+ value = this._miss(key)
+
+ if (value) {
+ this.set(key, value)
+ }
+ return value
+ }
+
+ /**
+ * Set a value in the cache
+ *
+ * @param {String} key
+ * @param {Mixed} value
+ */
+ set (key, value) {
+ if (!key || !value) return false
+ this._cache[key] = value
+ if (this._ttl_time) {
+ this._ttl[key] = dayjs().add(this._ttl_time, 'seconds')
+ }
+ return true
+ }
+
+ reset () {
+ this._cache = null
+ this._cache = {}
+ this._ttl = null
+ this._ttl = {}
+ }
+}
+
+/**
+ * StackTraceParser is used to parse callsite from stacktrace
+ * and get from FS the context of the error (if available)
+ *
+ * @param {Cache} cache cache implementation used to query file from FS and get context
+ */
+class StackTraceParser {
+ constructor (opts) {
+ this._cache = opts.cache
+ this._context_size = opts.context
+ }
+
+ isAbsolute (path) {
+ if (process.platform === 'win32') {
+ // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+ let splitDeviceRe = /^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/
+ let result = splitDeviceRe.exec(path)
+ let device = result[1] || ''
+ let isUnc = Boolean(device && device.charAt(1) !== ':')
+ // UNC paths are always absolute
+ return Boolean(result[2] || isUnc)
+ } else {
+ return path.charAt(0) === '/'
+ }
+ }
+
+ parse (stack) {
+ if (!stack || stack.length === 0) return false
+
+ for (var i = 0, len = stack.length; i < len; i++) {
+ var callsite = stack[i]
+
+ // avoid null values
+ if (typeof callsite !== 'object') continue
+ if (!callsite.file_name || !callsite.line_number) continue
+
+ var type = this.isAbsolute(callsite.file_name) || callsite.file_name[0] === '.' ? 'user' : 'core'
+
+ // only use the callsite if its inside user space
+ if (!callsite || type === 'core' || callsite.file_name.indexOf('node_modules') > -1 ||
+ callsite.file_name.indexOf('vxx') > -1) {
+ continue
+ }
+
+ // get the whole context (all lines) and cache them if necessary
+ var context = this._cache.get(callsite.file_name)
+ var source = []
+ if (context && context.length > 0) {
+ // get line before the call
+ var preLine = callsite.line_number - this._context_size - 1
+ var pre = context.slice(preLine > 0 ? preLine : 0, callsite.line_number - 1)
+ if (pre && pre.length > 0) {
+ pre.forEach(function (line) {
+ source.push(line.replace(/\t/g, ' '))
+ })
+ }
+ // get the line where the call has been made
+ if (context[callsite.line_number - 1]) {
+ source.push(context[callsite.line_number - 1].replace(/\t/g, ' ').replace(' ', '>>'))
+ }
+ // and get the line after the call
+ var postLine = callsite.line_number + this._context_size
+ var post = context.slice(callsite.line_number, postLine)
+ if (post && post.length > 0) {
+ post.forEach(function (line) {
+ source.push(line.replace(/\t/g, ' '))
+ })
+ }
+ }
+ return {
+ context: source.length > 0 ? source.join('\n') : 'cannot retrieve source context',
+ callsite: [ callsite.file_name, callsite.line_number ].join(':')
+ }
+ }
+ return false
+ }
+
+ attachContext (error) {
+ if (!error) return error
+
+ // if pmx attached callsites we can parse them to retrieve the context
+ if (typeof (error.stackframes) === 'object') {
+ let result = this.parse(error.stackframes)
+ // no need to send it since there is already the stacktrace
+ delete error.stackframes
+ delete error.__error_callsites
+
+ if (result) {
+ error.callsite = result.callsite
+ error.context = result.context
+ }
+ }
+ // if the stack is here we can parse it directly from the stack string
+ // only if the context has been retrieved from elsewhere
+ if (typeof error.stack === 'string' && !error.callsite) {
+ let siteRegex = /(\/[^\\\n]*)/g
+ let tmp
+ let stack = []
+
+ // find matching groups
+ while ((tmp = siteRegex.exec(error.stack))) {
+ stack.push(tmp[1])
+ }
+
+ // parse each callsite to match the format used by the stackParser
+ stack = stack.map((callsite) => {
+ // remove the trailing ) if present
+ if (callsite[callsite.length - 1] === ')') {
+ callsite = callsite.substr(0, callsite.length - 1)
+ }
+ let location = callsite.split(':')
+
+ return location.length < 3 ? callsite : {
+ file_name: location[0],
+ line_number: parseInt(location[1])
+ }
+ })
+
+ let finalCallsite = this.parse(stack)
+ if (finalCallsite) {
+ error.callsite = finalCallsite.callsite
+ error.context = finalCallsite.context
+ }
+ }
+ return error
+ }
+}
+
+// EWMA = ExponentiallyWeightedMovingAverage from
+// https://github.com/felixge/node-measured/blob/master/lib/util/ExponentiallyMovingWeightedAverage.js
+// Copyright Felix Geisendörfer under MIT license
+class EWMA {
+ constructor () {
+ this._timePeriod = 60000
+ this._tickInterval = 5000
+ this._alpha = 1 - Math.exp(-this._tickInterval / this._timePeriod)
+ this._count = 0
+ this._rate = 0
+ this._interval = setInterval(_ => {
+ this.tick()
+ }, this._tickInterval)
+ this._interval.unref()
+ }
+
+ update (n) {
+ this._count += n || 1
+ }
+
+ tick () {
+ let instantRate = this._count / this._tickInterval
+ this._count = 0
+ this._rate += (this._alpha * (instantRate - this._rate))
+ }
+
+ rate (timeUnit) {
+ return (this._rate || 0) * timeUnit
+ }
+}
+
+class Cipher {
+ static get CIPHER_ALGORITHM () {
+ return 'aes256'
+ }
+
+ /**
+ * Decipher data using 256 bits key (AES)
+ * @param {Hex} data input data
+ * @param {String} key 256 bits key
+ * @return {Object} deciphered data parsed as json object
+ */
+ static decipherMessage (msg, key) {
+ try {
+ let decipher = crypto.createDecipher(Cipher.CIPHER_ALGORITHM, key)
+ let decipheredMessage = decipher.update(msg, 'hex', 'utf8')
+ decipheredMessage += decipher.final('utf8')
+ return JSON.parse(decipheredMessage)
+ } catch (err) {
+ console.error(err)
+ return null
+ }
+ }
+
+ /**
+ * Cipher data using 256 bits key (AES)
+ * @param {String} data input data
+ * @param {String} key 256 bits key
+ * @return {Hex} ciphered data
+ */
+ static cipherMessage (data, key) {
+ try {
+ // stringify if not already done (fail safe)
+ if (typeof data !== 'string') {
+ data = JSON.stringify(data)
+ }
+
+ let cipher = crypto.createCipher(Cipher.CIPHER_ALGORITHM, key)
+ let cipheredData = cipher.update(data, 'utf8', 'hex')
+ cipheredData += cipher.final('hex')
+ return cipheredData
+ } catch (err) {
+ console.error(err)
+ }
+ }
+}
+
+/**
+ * HTTP wrapper
+ */
+class HTTPClient {
+ /**
+ * Return native module (HTTP/HTTPS)
+ * @param {String} url
+ */
+ getModule (url) {
+ return url.match(/https:\/\//) ? require('https') : require('http')
+ }
+ /**
+ * Send an HTTP request and return data or error if status > 200
+ * @param {Object} opts
+ * @param {String} opts.url
+ * @param {String} opts.method
+ * @param {Object} [opts.data]
+ * @param {Object} [opts.headers]
+ * @param {Function} cb invoked with
+ */
+ open (opts, cb) {
+ const http = this.getModule(opts.url)
+ const parsedUrl = url.parse(opts.url)
+ let data = null
+ const options = {
+ hostname: parsedUrl.hostname,
+ path: parsedUrl.path,
+ port: parsedUrl.port,
+ method: opts.method,
+ headers: opts.headers,
+ agent: cst.PROXY ? new ProxyAgent(cst.PROXY) : undefined
+ }
+
+ if (opts.data) {
+ data = JSON.stringify(opts.data)
+ options.headers = Object.assign({
+ 'Content-Type': 'application/json',
+ 'Content-Length': data.length
+ }, opts.headers)
+ }
+
+ const req = http.request(options, (res) => {
+ let body = ''
+
+ res.setEncoding('utf8')
+ res.on('data', (chunk) => {
+ body += chunk.toString()
+ })
+ res.on('end', () => {
+ try {
+ let jsonData = JSON.parse(body)
+ return cb(null, jsonData)
+ } catch (err) {
+ return cb(err)
+ }
+ })
+ })
+ req.on('error', cb)
+
+ if (data) {
+ req.write(data)
+ }
+ req.end()
+ }
+}
+
+module.exports = {
+ EWMA: EWMA,
+ Cache: Cache,
+ StackTraceParser: StackTraceParser,
+ serialize: require('fclone'),
+ network: {
+ getIP: retrieveAddress,
+ v4: retrieveAddress('v4'),
+ v6: retrieveAddress('v6')
+ },
+ HTTPClient: HTTPClient,
+ Cipher: Cipher,
+ clone: require('fclone')
+}
diff --git a/node_modules/@pm2/agent/src/WatchDog.js b/node_modules/@pm2/agent/src/WatchDog.js
new file mode 100644
index 0000000..0a62d87
--- /dev/null
+++ b/node_modules/@pm2/agent/src/WatchDog.js
@@ -0,0 +1,70 @@
+'use strict'
+
+const debug = require('debug')('interactor:watchdog')
+const child = require('child_process')
+const path = require('path')
+const RECONNECT_TENTATIVES_BEFORE_RESURRECT = 6
+
+process.env.PM2_AGENT_ONLINE = true
+
+module.exports = class WatchDog {
+ static start (p) {
+ this.pm2_binary_path = p.pm2_binary_path
+ this.ipm2 = p.conf.ipm2
+ this.relaunching = false
+ this.autoDumpTime = 5 * 60 * 1000
+
+ /**
+ * Handle PM2 connection state changes
+ */
+ this.ipm2.on('ready', _ => {
+ debug('Connected to PM2')
+ this.relaunching = false
+ this.autoDump()
+ })
+
+ debug('Launching')
+
+ this.reconnect_tentatives = 0
+
+ this.ipm2.on('reconnecting', _ => {
+ debug('PM2 is disconnected - Relaunching PM2')
+
+ if (this.dump_interval) {
+ clearInterval(this.dump_interval)
+ }
+
+ if (this.reconnect_tentatives++ >= RECONNECT_TENTATIVES_BEFORE_RESURRECT &&
+ this.relaunching === false) {
+ this.relaunching = true
+ this.resurrect()
+ }
+ })
+ }
+
+ static stop() {
+ clearInterval(this.dump_interval)
+ }
+
+ static resurrect () {
+ debug(`Trying to launch PM2: ${path.resolve(__dirname, '../../../../bin/pm2')}`)
+ child.exec(`node ${this.pm2_binary_path} resurrect`, (err, sto, ste) => {
+ if (err) console.error(err)
+ console.log(sto, ste)
+ this.reconnect_tentatives = 0
+ setTimeout(_ => {
+ this.relaunching = false
+ }, 10 * 1000)
+ })
+ }
+
+ static autoDump () {
+ this.dump_interval = setInterval(_ => {
+ if (this.relaunching === true) return
+
+ this.ipm2.pm2Interface.dump(function (err) {
+ return err ? debug('Error when dumping', err) : debug('PM2 process list dumped')
+ })
+ }, this.autoDumpTime)
+ }
+}
diff --git a/node_modules/@pm2/agent/src/push/DataRetriever.js b/node_modules/@pm2/agent/src/push/DataRetriever.js
new file mode 100644
index 0000000..85e9f59
--- /dev/null
+++ b/node_modules/@pm2/agent/src/push/DataRetriever.js
@@ -0,0 +1,77 @@
+'use strict'
+
+const os = require('os')
+const pkg = require('../../package.json')
+const constants = require('../../constants')
+const path = require('path')
+const hostname = os.hostname()
+const platform = os.platform()
+const username = process.env.SUDO_USER || process.env.C9_USER || process.env.LOGNAME ||
+ process.env.USER || process.env.LNAME || process.env.USERNAME
+
+module.exports = class DataRetriever {
+ /**
+ * Normalize each process metdata
+ * @param {Object} processes process list extracted from pm2 daemon
+ * @param {Object} conf interactor configuration
+ */
+ static status (processes, conf) {
+ processes = processes || []
+ const formattedProcs = processes
+ .filter(proc => !proc.pm2_env.name.match(/_old_/))
+ .map((proc) => {
+
+ // proc.pm2_env.axm_actions = proc.pm2_env.axm_actions.concat(conf.PM2_REMOTE_METHOD_ALLOWED.map(method => {
+ // return {action_name: method, action_type: 'internal'}
+ // }))
+
+ return {
+ pid: proc.pid,
+ name: proc.pm2_env.name,
+ interpreter: proc.pm2_env.exec_interpreter,
+ args: proc.pm2_env.node_args,
+ path: proc.pm2_env.pm_exec_path,
+ restart_time: proc.pm2_env.restart_time,
+ created_at: proc.pm2_env.created_at,
+ exec_mode: proc.pm2_env.exec_mode,
+ pm_uptime: proc.pm2_env.pm_uptime,
+ status: proc.pm2_env.status,
+ pm_id: proc.pm2_env.pm_id,
+ unique_id: proc.pm2_env.unique_id,
+
+ cpu: Math.floor(proc.monit.cpu) || 0,
+ memory: Math.floor(proc.monit.memory) || 0,
+
+ versioning: proc.pm2_env.versioning || null,
+
+ node_env: proc.pm2_env.NODE_ENV || null,
+
+ axm_actions: proc.pm2_env.axm_actions || [],
+ axm_monitor: proc.pm2_env.axm_monitor || {},
+ //axm_options: proc.pm2_env.axm_options || {},
+ axm_options: {},
+ axm_dynamic: proc.pm2_env.dynamic || {}
+ }
+ })
+
+ return {
+ process: formattedProcs,
+ server: {
+ username: username,
+ hostname: hostname,
+ uptime: os.uptime(),
+ platform: platform,
+ pm2_version: conf.PM2_VERSION,
+ pm2_agent_version: pkg.version,
+ node_version: process.version,
+ unique_id: constants.UNIQUE_SERVER_ID,
+ //loadavg: os.loadavg(),
+ //total_mem: os.totalmem(),
+ //free_mem: os.freemem(),
+ //cpu: cpuMeta,
+ //type: os.type(),
+ //interaction: conf.REVERSE_INTERACT,
+ }
+ }
+ }
+}
diff --git a/node_modules/@pm2/agent/src/push/PushInteractor.js b/node_modules/@pm2/agent/src/push/PushInteractor.js
new file mode 100644
index 0000000..9f10aa0
--- /dev/null
+++ b/node_modules/@pm2/agent/src/push/PushInteractor.js
@@ -0,0 +1,206 @@
+
+'use strict'
+
+const debug = require('debug')('interactor:push')
+const fs = require('fs')
+const path = require('path')
+const cst = require('../../constants.js')
+const DataRetriever = require('./DataRetriever.js')
+const Utility = require('../Utility.js')
+const Aggregator = require('./TransactionAggregator.js')
+
+/**
+ * PushInteractor is the class that handle pushing data to KM
+ * @param {Object} opts interactor options
+ * @param {PM2Client} ipm2 pm2 daemon client used to listen on bus
+ * @param {WebsocketTransport} transport websocket transport used to send data to KM
+ */
+module.exports = class PushInteractor {
+ constructor (opts, ipm2, transport) {
+ this._ipm2 = ipm2
+ this.transport = transport
+ this.opts = opts
+ this.log_buffer = {}
+ this.processes = new Map() // Key is process name, value is pm2 env
+ this.broadcast_logs = new Map() // key is process name, value is true or false
+ this.ip_interval_counter = 60
+ debug('Push interactor constructed')
+ this._cacheFS = new Utility.Cache({
+ miss: function (key) {
+ try {
+ const content = fs.readFileSync(path.resolve(key))
+ return content.toString().split(/\r?\n/)
+ } catch (err) {
+ return debug('Error while trying to get file from FS : %s', err.message || err)
+ }
+ },
+ ttl: 60 * 30
+ })
+ this._stackParser = new Utility.StackTraceParser({ cache: this._cacheFS, context: cst.CONTEXT_ON_ERROR })
+ // // start transaction aggregator
+ this.aggregator = new Aggregator(this)
+ }
+
+ /**
+ * Start the interactor by starting all workers and listeners
+ */
+ start () {
+ // stop old running task
+ if (this._worker_executor !== undefined) {
+ this.stop()
+ }
+ debug('Push interactor started')
+ this._worker_executor = setInterval(this._worker.bind(this), cst.STATUS_INTERVAL)
+ this._ipm2.bus.on('*', this._onPM2Event.bind(this))
+ }
+
+ /**
+ * Stop the interactor by removing all running worker and listeners
+ */
+ stop () {
+ debug('Push interactor stopped')
+ if (this._worker_executor !== undefined) {
+ clearInterval(this._worker_executor)
+ this._worker_executor = null
+ }
+ if (this._cacheFS._worker !== undefined) {
+ clearInterval(this._cacheFS._worker)
+ this._cacheFS._worker = null
+ }
+ }
+
+ /**
+ * Listener of pm2 bus
+ * @param {String} event channel
+ * @param {Object} packet data
+ */
+ _onPM2Event (event, packet) {
+ debug('New PM2 event %s', event)
+ if (event === 'axm:action') return false
+ if (!packet.process) return debug('No process field [%s]', event)
+
+ // Drop transitional state processes (_old_*)
+ if (packet && packet.process && packet.process.pm_id && typeof packet.process.pm_id === 'string' &&
+ packet.process.pm_id.indexOf('_old') > -1) return false
+ if (this.processes.get(packet.process.name) && this.processes.get(packet.process.name)._km_monitored === false) return false
+
+ // bufferize logs
+ if (event.match(/^log:/)) {
+ if (!this.log_buffer[packet.process.name]) {
+ this.log_buffer[packet.process.name] = []
+ }
+ // delete the last one if too long
+ if (this.log_buffer[packet.process.name].length >= cst.LOGS_BUFFER) {
+ this.log_buffer[packet.process.name].shift()
+ }
+ // push the log data
+ this.log_buffer[packet.process.name].push(packet.data)
+
+ // don't send logs if not enabled
+ if (!global._logs && !this.broadcast_logs.get(packet.process.pm_id)) return false
+ // disabled logs anyway
+ if (!this.processes.has(packet.process.name) || this.processes.get(packet.process.name).send_logs === false) return false
+ }
+
+ // attach additional info for exception
+ if (event === 'process:exception' && cst.ENABLE_CONTEXT_ON_ERROR === true) {
+ packet.data.last_logs = this.log_buffer[packet.process.name]
+ packet.data = this._stackParser.attachContext(packet.data)
+ }
+
+ if (event === 'axm:reply' && packet.data && packet.data.return && (packet.data.return.heapdump || packet.data.return.cpuprofile || packet.data.return.heapprofile)) {
+ return this._sendFile(packet)
+ }
+
+ if (event === 'human:event') {
+ packet.name = packet.data.__name
+ delete packet.data.__name
+ }
+
+ // Normalize data
+ packet.process = {
+ pm_id: packet.process.pm_id,
+ name: packet.process.name,
+ rev: packet.process.rev || ((packet.process.versioning && packet.process.versioning.revision) ? packet.process.versioning.revision : null),
+ server: this.opts.MACHINE_NAME
+ }
+
+ // agregate transaction data before sending them
+ if (event.indexOf('axm:trace') > -1) return this.aggregator.aggregate(packet)
+
+ if (event.match(/^log:/)) {
+ packet.log_type = event.split(':')[1]
+ event = 'logs'
+ }
+
+ return this.transport.send(event, packet)
+ }
+
+ /**
+ * Worker function that will retrieve process metadata and send them to KM
+ */
+ _worker () {
+ if (!this._ipm2.rpc || !this._ipm2.rpc.getMonitorData)
+ return debug('Cant access to getMonitorData RPC PM2 method')
+
+ if (this.ip_interval_counter-- <= 0) {
+ this.opts.internal_ip = Utility.network.getIP('v4')
+ this.ip_interval_counter = 60
+ }
+
+ this._ipm2.rpc.getMonitorData({}, (err, processes) => {
+ if (err) {
+ return console.error(err || 'Cant access to getMonitorData RPC PM2 method')
+ }
+
+ // set broadcast logs
+ processes.forEach((process) => {
+ this.processes.set(process.name, process.pm2_env)
+ this.broadcast_logs.set(process.pm_id, process.pm2_env.broadcast_logs == 1 || process.pm2_env.broadcast_logs == 'true') // eslint-disable-line
+ })
+
+ processes = processes.filter(process => process.pm2_env._km_monitored !== false)
+
+ // send data
+ this.transport.send('status', {
+ data: DataRetriever.status(processes, this.opts),
+ server_name: this.opts.MACHINE_NAME,
+ internal_ip: this.opts.internal_ip
+ })
+ })
+ }
+
+ /**
+ * Handle packet containing file metadata to send to KM
+ */
+ _sendFile (packet) {
+ const filePath = JSON.parse(JSON.stringify(packet.data.return.dump_file))
+ let type = null
+ if (packet.data.return.heapdump) {
+ type = 'heapdump'
+ } else if (packet.data.return.heapprofile) {
+ type = 'heapprofile'
+ } else if (packet.data.return.cpuprofile) {
+ type = 'cpuprofile'
+ } else {
+ return debug(`Invalid profiling packet: ${JSON.stringify(packet)}`)
+ }
+ debug('Send file for %s', type)
+
+ packet = {
+ pm_id: packet.process.pm_id,
+ name: packet.process.name,
+ server_name: this.opts.MACHINE_NAME,
+ public_key: this.opts.PUBLIC_KEY,
+ type: type
+ }
+ packet[type] = true
+
+ fs.readFile(filePath, (err, data) => {
+ if (err) return debug(err)
+ fs.unlink(filePath, debug)
+ packet.data = data.toString('utf-8')
+ return this.transport.send('profiling', packet)
+ })
+ }
+}
diff --git a/node_modules/@pm2/agent/src/push/TransactionAggregator.js b/node_modules/@pm2/agent/src/push/TransactionAggregator.js
new file mode 100644
index 0000000..307a5b3
--- /dev/null
+++ b/node_modules/@pm2/agent/src/push/TransactionAggregator.js
@@ -0,0 +1,670 @@
+'use strict'
+
+const cst = require('../../constants.js')
+const log = require('debug')('interactor:aggregator')
+const Utility = require('../Utility.js')
+const fclone = require('fclone')
+const Histogram = require('../utils/probes/Histogram')
+
+/**
+ *
+ * # Data structure sent to interactor
+ *
+ * {
+ * 'process_name': {
+ * process : {}, // PM2 process meta data
+ * data : {
+ * routes : [ // array of all routes ordered by count
+ * {
+ * path: '/', // path of the route
+ * meta: {
+ * count: 50, // count of this route
+ * max: 300, // max latency of this route
+ * min: 50, // min latency of this route
+ * mean: 120 // mean latency of this route
+ * }
+ * variances: [{ // array of variance order by count
+ * spans : [
+ * ... // transactions
+ * ],
+ * count: 50, // count of this variance
+ * max: 300, // max latency of this variance
+ * min: 50, // min latency of this variance
+ * mean: 120 // mean latency of this variance
+ * }]
+ * }
+ * ],
+ * meta : {
+ * trace_count : 50, // trace number
+ * mean_latency : 40, // global app latency in ms
+ * http_meter : 30, // global app req per minutes
+ * db_meter : 20, // number of database transaction per min
+ * }
+ * }
+ * }
+ * }
+ */
+
+module.exports = class TransactionAggregator {
+ constructor (pushInteractor) {
+ this.processes = {}
+ this.stackParser = pushInteractor._stackParser
+ this.pushInteractor = pushInteractor
+
+ this.LABELS = {
+ 'HTTP_RESPONSE_CODE_LABEL_KEY': 'http/status_code',
+ 'HTTP_URL_LABEL_KEY': 'http/url',
+ 'HTTP_METHOD_LABEL_KEY': 'http/method',
+ 'HTTP_RESPONSE_SIZE_LABEL_KEY': 'http/response/size',
+ 'STACK_TRACE_DETAILS_KEY': 'stacktrace',
+ 'ERROR_DETAILS_NAME': 'error/name',
+ 'ERROR_DETAILS_MESSAGE': 'error/message',
+ 'HTTP_SOURCE_IP': 'http/source/ip',
+ 'HTTP_PATH_LABEL_KEY': 'http/path'
+ }
+ this.SPANS_DB = ['redis', 'mysql', 'pg', 'mongo', 'outbound_http']
+ this.REGEX_JSON_CLEANUP = /":(?!\[|{)\\"[^"]*\\"|":(["'])(?:(?=(\\?))\2.)*?\1|":(?!\[|{)[^,}\]]*|":\[[^{]*]/g
+
+ this.init()
+ }
+
+ /**
+ * First method to call in real environment
+ * - Listen to restart event for initialization period
+ * - Clear aggregation on process stop
+ * - Launch worker to attach data to be pushed to KM
+ */
+ init () {
+ // New Process Online, reset & wait a bit before processing
+ this.pushInteractor._ipm2.bus.on('process:event', (data) => {
+ if (data.event !== 'online' || !this.processes[data.process.name]) return false
+
+ let rev = (data.process.versioning && data.process.versioning.revision)
+ ? data.process.versioning.revision : null
+
+ this.resetAggregation(data.process.name, {
+ rev: rev,
+ server: this.pushInteractor.opts.MACHINE_NAME
+ })
+ })
+
+ // Process getting offline, delete aggregation
+ this.pushInteractor._ipm2.bus.on('process:event', (data) => {
+ if (data.event !== 'stop' || !this.processes[data.process.name]) return false
+ log('Deleting aggregation for %s', data.process.name)
+ delete this.processes[data.process.name]
+ })
+
+ this.launchWorker()
+ }
+
+ /**
+ * Reset aggregation for target app_name
+ */
+ resetAggregation (appName, meta) {
+ log('Reseting agg for app:%s meta:%j', appName, meta)
+
+ if (this.processes[appName].initialization_timeout) {
+ log('Reseting initialization timeout app:%s', appName)
+ clearTimeout(this.processes[appName].initialization_timeout)
+ clearInterval(this.processes[appName].notifier)
+ this.processes[appName].notifier = null
+ }
+
+ this.processes[appName] = this.initializeRouteMeta({
+ name: appName,
+ rev: meta.rev,
+ server: meta.server
+ })
+
+ let start = Date.now()
+ this.processes[appName].notifier = setInterval(_ => {
+ let elapsed = Date.now() - start
+ // failsafe
+ if (elapsed / 1000 > cst.AGGREGATION_DURATION) {
+ clearInterval(this.processes[appName].notifier)
+ this.processes[appName].notifier = null
+ }
+
+ let msg = {
+ data: {
+ learning_duration: cst.AGGREGATION_DURATION,
+ elapsed: elapsed
+ },
+ process: this.processes[appName].process
+ }
+ this.pushInteractor && this.pushInteractor.transport.send('axm:transaction:learning', msg)
+ }, 5000)
+
+ this.processes[appName].initialization_timeout = setTimeout(_ => {
+ log('Initialization timeout finished for app:%s', appName)
+ clearInterval(this.processes[appName].notifier)
+ this.processes[appName].notifier = null
+ this.processes[appName].initialization_timeout = null
+ }, cst.AGGREGATION_DURATION)
+ }
+
+ /**
+ * Clear aggregated data for all process
+ */
+ clearData () {
+ Object.keys(this.processes).forEach((process) => {
+ this.resetAggregation(process, this.processes[process].process)
+ })
+ }
+
+ /**
+ * Generate new entry for application
+ *
+ * @param {Object} process process meta
+ */
+ initializeRouteMeta (process) {
+ if (process.pm_id) delete process.pm_id
+
+ return {
+ routes: {},
+ meta: {
+ trace_count: 0,
+ http_meter: new Utility.EWMA(),
+ db_meter: new Utility.EWMA(),
+ histogram: new Histogram({ measurement: 'median' }),
+ db_histograms: {}
+ },
+ process: process
+ }
+ }
+
+ getAggregation () {
+ return this.processes
+ }
+
+ validateData (packet) {
+ if (!packet || !packet.data) {
+ log('Packet malformated', packet)
+ return false
+ }
+
+ if (!packet.process) {
+ log('Got packet without process: %j', packet)
+ return false
+ }
+
+ if (!packet.data.spans || !packet.data.spans[0]) {
+ log('Trace without spans: %s', Object.keys(packet.data))
+ return false
+ }
+
+ if (!packet.data.spans[0].labels) {
+ log('Trace spans without labels: %s', Object.keys(packet.data.spans))
+ return false
+ }
+
+ return true
+ }
+
+ /**
+ * Main method to aggregate and compute stats for traces
+ *
+ * @param {Object} packet
+ * @param {Object} packet.process process metadata
+ * @param {Object} packet.data trace
+ */
+ aggregate (packet) {
+ if (this.validateData(packet) === false) return false
+
+ const newTrace = packet.data
+ const appName = packet.process.name
+
+ if (!this.processes[appName]) {
+ this.processes[appName] = this.initializeRouteMeta(packet.process)
+ }
+
+ let process = this.processes[appName]
+
+ // Get http path of current span
+ let path = newTrace.spans[0].labels[this.LABELS.HTTP_PATH_LABEL_KEY]
+ if (!path) return false
+
+ // Cleanup spans
+ this.censorSpans(newTrace.spans)
+
+ // remove spans with startTime == endTime
+ newTrace.spans = newTrace.spans.filter((span) => {
+ return span.endTime !== span.startTime
+ })
+
+ // compute duration of child spans
+ newTrace.spans.forEach((span) => {
+ span.mean = Math.round(new Date(span.endTime) - new Date(span.startTime))
+ delete span.endTime
+ })
+
+ // Update app meta (mean_latency, http_meter, db_meter, trace_count)
+ newTrace.spans.forEach((span) => {
+ if (!span.name || !span.kind) return false
+
+ if (span.kind === 'RPC_SERVER') {
+ process.meta.histogram.update(span.mean)
+ return process.meta.http_meter.update()
+ }
+
+ // Override outbount http queries for processing
+ if (span.labels && span.labels['http/method'] && span.labels['http/status_code']) {
+ span.labels['service'] = span.name
+ span.name = 'outbound_http'
+ }
+
+ for (let i = 0, len = this.SPANS_DB.length; i < len; i++) {
+ if (span.name.indexOf(this.SPANS_DB[i]) > -1) {
+ process.meta.db_meter.update()
+ if (!process.meta.db_histograms[this.SPANS_DB[i]]) {
+ process.meta.db_histograms[this.SPANS_DB[i]] = new Histogram({ measurement: 'mean' })
+ }
+ process.meta.db_histograms[this.SPANS_DB[i]].update(span.mean)
+ break
+ }
+ }
+ })
+
+ process.meta.trace_count++
+
+ /**
+ * Handle traces aggregation
+ */
+ if (path[0] === '/' && path !== '/') {
+ path = path.substr(1, path.length - 1)
+ }
+
+ let matched = this.matchPath(path, process.routes)
+
+ if (!matched) {
+ process.routes[path] = []
+ this.mergeTrace(process.routes[path], newTrace, process)
+ } else {
+ this.mergeTrace(process.routes[matched], newTrace, process)
+ }
+
+ return this.processes
+ }
+
+ /**
+ * Merge new trace and compute mean, min, max, count
+ *
+ * @param {Object} aggregated previous aggregated route
+ * @param {Object} trace
+ */
+ mergeTrace (aggregated, trace, process) {
+ if (!aggregated || !trace) return
+
+ // if the trace doesn't any spans stop aggregation here
+ if (trace.spans.length === 0) return
+
+ // create data structure if needed
+ if (!aggregated.variances) aggregated.variances = []
+ if (!aggregated.meta) {
+ aggregated.meta = {
+ histogram: new Histogram({ measurement: 'median' }),
+ meter: new Utility.EWMA()
+ }
+ }
+
+ aggregated.meta.histogram.update(trace.spans[0].mean)
+ aggregated.meta.meter.update()
+
+ const merge = (variance) => {
+ // no variance found so its a new one
+ if (variance == null) {
+ delete trace.projectId
+ delete trace.traceId
+ trace.histogram = new Histogram({ measurement: 'median' })
+ trace.histogram.update(trace.spans[0].mean)
+
+ trace.spans.forEach((span) => {
+ span.histogram = new Histogram({ measurement: 'median' })
+ span.histogram.update(span.mean)
+ delete span.mean
+ })
+
+ // parse strackrace
+ this.parseStacktrace(trace.spans)
+ aggregated.variances.push(trace)
+ } else {
+ // check to see if request is anormally slow, if yes send it as inquisitor
+ if (trace.spans[0].mean > variance.histogram.percentiles([0.95])[0.95] &&
+ typeof pushInteractor !== 'undefined' && !process.initialization_timeout) {
+ // serialize and add metadata
+ this.parseStacktrace(trace.spans)
+ let data = {
+ trace: fclone(trace.spans),
+ variance: fclone(variance.spans.map((span) => {
+ return {
+ labels: span.labels,
+ kind: span.kind,
+ name: span.name,
+ startTime: span.startTime,
+ percentiles: {
+ p5: variance.histogram.percentiles([0.5])[0.5],
+ p95: variance.histogram.percentiles([0.95])[0.95]
+ }
+ }
+ })),
+ meta: {
+ value: trace.spans[0].mean,
+ percentiles: {
+ p5: variance.histogram.percentiles([0.5])[0.5],
+ p75: variance.histogram.percentiles([0.75])[0.75],
+ p95: variance.histogram.percentiles([0.95])[0.95],
+ p99: variance.histogram.percentiles([0.99])[0.99]
+ },
+ min: variance.histogram.getMin(),
+ max: variance.histogram.getMax(),
+ count: variance.histogram.getCount()
+ },
+ process: process.process
+ }
+ this.pushInteractor.transport.send('axm:transaction:outlier', data)
+ }
+
+ // variance found, merge spans
+ variance.histogram.update(trace.spans[0].mean)
+
+ // update duration of spans to be mean
+ this.updateSpanDuration(variance.spans, trace.spans, variance.count)
+
+ // delete stacktrace before merging
+ trace.spans.forEach((span) => {
+ delete span.labels.stacktrace
+ })
+ }
+ }
+
+ // for every variance, check spans same variance
+ for (let i = 0; i < aggregated.variances.length; i++) {
+ if (this.compareList(aggregated.variances[i].spans, trace.spans)) {
+ return merge(aggregated.variances[i])
+ }
+ }
+ // else its a new variance
+ return merge(null)
+ }
+
+ /**
+ * Parkour simultaneously both spans list to update value of the first one using value of the second one
+ * The first should be variance already aggregated for which we want to merge the second one
+ * The second one is a new trace, so we need to re-compute mean/min/max time for each spans
+ */
+ updateSpanDuration (spans, newSpans) {
+ for (let i = 0, len = spans.length; i < len; i++) {
+ if (!newSpans[i]) continue
+ spans[i].histogram.update(newSpans[i].mean)
+ }
+ }
+
+ /**
+ * Compare two spans list by going down on each span and comparing child and attribute
+ */
+ compareList (one, two) {
+ if (one.length !== two.length) return false
+
+ for (let i = 0, len = one; i < len; i++) {
+ if (one[i].name !== two[i].name) return false
+ if (one[i].kind !== two[i].kind) return false
+ if (!one[i].labels && two[i].labels) return false
+ if (one[i].labels && !two[i].labels) return false
+ if (one[i].labels.length !== two[i].labels.length) return false
+ }
+ return true
+ }
+
+ /**
+ * Will return the route if we found an already matched route
+ */
+ matchPath (path, routes) {
+ // empty route is / without the fist slash
+ if (!path || !routes) return false
+ if (path === '/') return routes[path] ? path : null
+
+ // remove the last slash if exist
+ if (path[path.length - 1] === '/') {
+ path = path.substr(0, path.length - 1)
+ }
+
+ // split to get array of segment
+ path = path.split('/')
+
+ // if the path has only one segment, we just need to compare the key
+ if (path.length === 1) return routes[path[0]] ? routes[path[0]] : null
+
+ // check in routes already stored for match
+ let keys = Object.keys(routes)
+ for (let i = 0, len = keys.length; i < len; i++) {
+ let route = keys[i]
+ let segments = route.split('/')
+
+ if (segments.length !== path.length) continue
+
+ for (let j = path.length - 1; j >= 0; j--) {
+ // different segment, try to find if new route or not
+ if (path[j] !== segments[j]) {
+ // if the aggregator already have matched that segment with a wildcard and the next segment is the same
+ if (this.isIdentifier(path[j]) && segments[j] === '*' && path[j - 1] === segments[j - 1]) {
+ return segments.join('/')
+ // case a let in url match, so we continue because they must be other let in url
+ } else if (path[j - 1] !== undefined && path[j - 1] === segments[j - 1] && this.isIdentifier(path[j]) && this.isIdentifier(segments[j])) {
+ segments[j] = '*'
+ // update routes in cache
+ routes[segments.join('/')] = routes[route]
+ delete routes[keys[i]]
+ return segments.join('/')
+ } else {
+ break
+ }
+ }
+
+ // if finish to iterate over segment of path, we must be on the same route
+ if (j === 0) return segments.join('/')
+ }
+ }
+ }
+
+ launchWorker () {
+ this._worker = setInterval(_ => {
+ let normalized = this.prepareAggregationforShipping()
+ Object.keys(normalized).forEach((key) => {
+ this.pushInteractor.transport.send('axm:transaction', normalized[key])
+ })
+ }, cst.TRACE_FLUSH_INTERVAL)
+ }
+
+ /**
+ * Normalize aggregation
+ */
+ prepareAggregationforShipping () {
+ let normalized = {}
+
+ // Iterate each applications
+ Object.keys(this.processes).forEach((appName) => {
+ let process = this.processes[appName]
+ let routes = process.routes
+
+ if (process.initialization_timeout) {
+ log('Waiting for app %s to be initialized', appName)
+ return null
+ }
+
+ normalized[appName] = {
+ data: {
+ routes: [],
+ meta: fclone({
+ trace_count: process.meta.trace_count,
+ http_meter: Math.round(process.meta.http_meter.rate(1000) * 100) / 100,
+ db_meter: Math.round(process.meta.db_meter.rate(1000) * 100) / 100,
+ http_percentiles: {
+ median: process.meta.histogram.percentiles([0.5])[0.5],
+ p95: process.meta.histogram.percentiles([0.95])[0.95],
+ p99: process.meta.histogram.percentiles([0.99])[0.99]
+ },
+ db_percentiles: {}
+ })
+ },
+ process: process.process
+ }
+
+ // compute percentiles for each db spans if they exist
+ this.SPANS_DB.forEach((name) => {
+ let histogram = process.meta.db_histograms[name]
+ if (!histogram) return
+ normalized[appName].data.meta.db_percentiles[name] = fclone(histogram.percentiles([0.5])[0.5])
+ })
+
+ Object.keys(routes).forEach((path) => {
+ let data = routes[path]
+
+ // hard check for invalid data
+ if (!data.variances || data.variances.length === 0) return
+
+ // get top 5 variances of the same route
+ const variances = data.variances.sort((a, b) => {
+ return b.count - a.count
+ }).slice(0, 5)
+
+ // create a copy without reference to stored one
+ let routeCopy = {
+ path: path === '/' ? '/' : '/' + path,
+ meta: fclone({
+ min: data.meta.histogram.getMin(),
+ max: data.meta.histogram.getMax(),
+ count: data.meta.histogram.getCount(),
+ meter: Math.round(data.meta.meter.rate(1000) * 100) / 100,
+ median: data.meta.histogram.percentiles([0.5])[0.5],
+ p95: data.meta.histogram.percentiles([0.95])[0.95]
+ }),
+ variances: []
+ }
+
+ variances.forEach((variance) => {
+ // hard check for invalid data
+ if (!variance.spans || variance.spans.length === 0) return
+
+ // deep copy of variances data
+ let tmp = fclone({
+ spans: [],
+ count: variance.histogram.getCount(),
+ min: variance.histogram.getMin(),
+ max: variance.histogram.getMax(),
+ median: variance.histogram.percentiles([0.5])[0.5],
+ p95: variance.histogram.percentiles([0.95])[0.95]
+ })
+
+ // get data for each span
+ variance.spans.forEach((span) => {
+ tmp.spans.push(fclone({
+ name: span.name,
+ labels: span.labels,
+ kind: span.kind,
+ startTime: span.startTime,
+ min: span.histogram.getMin(),
+ max: span.histogram.getMax(),
+ median: span.histogram.percentiles([0.5])[0.5]
+ }))
+ })
+ // push serialized into normalized data
+ routeCopy.variances.push(tmp)
+ })
+ // push the route into normalized data
+ normalized[appName].data.routes.push(routeCopy)
+ })
+ })
+
+ return normalized
+ }
+
+ /**
+ * Check if the string can be a id of some sort
+ *
+ * @param {String} id
+ */
+ isIdentifier (id) {
+ id = typeof (id) !== 'string' ? id + '' : id
+
+ // uuid v1/v4 with/without dash
+ if (id.match(/[0-9a-f]{8}-[0-9a-f]{4}-[14][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{12}[14][0-9a-f]{19}/i)) {
+ return true
+ // if number
+ } else if (id.match(/\d+/)) {
+ return true
+ // if suit of nbr/letters
+ } else if (id.match(/[0-9]+[a-z]+|[a-z]+[0-9]+/)) {
+ return true
+ // if match pattern with multiple char spaced by . - _ @
+ } else if (id.match(/((?:[0-9a-zA-Z]+[@\-_.][0-9a-zA-Z]+|[0-9a-zA-Z]+[@\-_.]|[@\-_.][0-9a-zA-Z]+)+)/)) {
+ return true
+ }
+ return false
+ }
+
+ /**
+ * Cleanup trace data
+ * - delete result(s)
+ * - replace labels value with a question mark
+ *
+ * @param {Object} spans list of span for a trace
+ */
+ censorSpans (spans) {
+ if (!spans) return log('spans is null')
+ if (cst.DEBUG) return
+
+ spans.forEach((span) => {
+ if (!span.labels) return
+
+ delete span.labels.results
+ delete span.labels.result
+ delete span.spanId
+ delete span.parentSpanId
+ delete span.labels.values
+
+ Object.keys(span.labels).forEach((key) => {
+ if (typeof (span.labels[key]) === 'string' && key !== 'stacktrace') {
+ span.labels[key] = span.labels[key].replace(this.REGEX_JSON_CLEANUP, '\": \"?\"') // eslint-disable-line
+ }
+ })
+ })
+ }
+
+ /**
+ * Parse stackrace of spans to extract and normalize data
+ *
+ * @param {Object} spans list of span for a trace
+ */
+ parseStacktrace (spans) {
+ if (!spans) return log('spans is null')
+
+ spans.forEach((span) => {
+ // if empty make sure that it doesnt exist
+ if (!span ||
+ !span.labels ||
+ !span.labels.stacktrace ||
+ typeof (span.labels.stacktrace) !== 'string') return
+
+ // you never know what come through that door
+ try {
+ span.labels.stacktrace = JSON.parse(span.labels.stacktrace)
+ } catch (e) {
+ return
+ }
+
+ if (!span.labels.stacktrace || !(span.labels.stacktrace.stack_frame instanceof Array)) return
+ // parse the stacktrace
+ let result = this.stackParser.parse(span.labels.stacktrace.stack_frame)
+ if (result) {
+ span.labels['source/file'] = result.callsite || undefined
+ span.labels['source/context'] = result.context || undefined
+ }
+ })
+
+ spans.forEach((span) => {
+ if (!span || !span.labels) return
+ delete span.labels.stacktrace
+ })
+ }
+}
diff --git a/node_modules/@pm2/agent/src/reverse/ReverseInteractor.js b/node_modules/@pm2/agent/src/reverse/ReverseInteractor.js
new file mode 100644
index 0000000..39659ac
--- /dev/null
+++ b/node_modules/@pm2/agent/src/reverse/ReverseInteractor.js
@@ -0,0 +1,128 @@
+
+'use strict'
+
+const debug = require('debug')('interactor:reverse')
+
+/**
+ * ReverseInteractor is the class that handle receiving event from KM
+ * @param {Object} opts interactor options
+ * @param {PM2} pm2 pm2 api
+ * @param {WebsocketTransport} transport websocket transport used to receive data to KM
+ */
+module.exports = class ReverseInteractor {
+ constructor (opts, ipm2, transport) {
+ this.ipm2 = ipm2
+ this.transport = transport
+ this.opts = opts
+ this.remoteMethodAlloweds = this.opts.PM2_REMOTE_METHOD_ALLOWED
+ }
+
+ start () {
+ debug('Reverse interactor is listening')
+ // action that trigger custom actions inside the code
+ this.transport.on('trigger:action', this._onCustomAction.bind(this))
+ this.transport.on('trigger:scoped_action', this._onCustomAction.bind(this))
+ // action that call pm2 api
+ this.transport.on('trigger:pm2:action', this._onPM2Action.bind(this))
+ }
+
+ stop () {
+ debug('Reverse interactor is no longer listening')
+ this.transport.removeAllListeners('trigger:action')
+ this.transport.removeAllListeners('trigger:scoped_action')
+ this.transport.removeAllListeners('trigger:pm2:action')
+ }
+
+ /**
+ * Listener for custom actions that can be triggered by KM, either scoped or normal
+ * @param {Object} data
+ * @param {Object} data.action_name name of the action triggered
+ * @param {Object} [data.app_name] name of the process where the action need to be run
+ * @param {Object} [data.process_id] id of the process where the action need to be run
+ * @param {Object} [data.opts] parameters used to call the method
+ * @param {Object} [data.uuid] uuid used to recognized the scoped action (scoped action only)
+ */
+ _onCustomAction (data) {
+ const type = data.uuid ? 'SCOPED' : 'REMOTE'
+
+ data.process_id = data.process_id !== undefined ? data.process_id : data.process.pm_id
+ debug('New %s action %s triggered for process %s', type, data.action_name, data.process_id)
+ // send the request to pmx via IPC
+ this.ipm2.msgProcess({
+ name: data.app_name,
+ id: data.process_id,
+ msg: data.action_name,
+ opts: data.opts || data.options || null,
+ action_name: data.action_name,
+ uuid: data.uuid
+ }, (err, res) => {
+ if (err) {
+ return this.transport.send('trigger:action:failure', {
+ success: false,
+ err: err.message || err,
+ id: data.process_id,
+ action_name: data.action_name
+ })
+ }
+ debug('Message received from AXM for proc_id : %s and action name %s', data.process_id, data.action_name)
+ return this.transport.send('trigger:action:success', {
+ success: true,
+ id: data.process_id,
+ action_name: data.action_name
+ })
+ })
+ }
+
+ /**
+ * Handle when KM call a pm2 action
+ * @param {Object} data
+ * @param {Object} data.method_name the name of the pm2 method
+ * @param {Object} data.parameters optional parameters used to call the method
+ */
+ _onPM2Action (data) {
+ // callback when the action has been executed
+ let callback = (err, res) => {
+ debug('PM2 action ended : pm2 %s (%s)', data.method_name, !err ? 'no error' : (err.message || err))
+ this.transport.send('trigger:pm2:result', {
+ ret: { err: err, data: res },
+ meta: {
+ method_name: data.method_name,
+ app_name: data.parameters.name,
+ machine_name: this.opts.MACHINE_NAME,
+ public_key: this.opts.PUBLIC_KEY
+ }
+ })
+ }
+ if (typeof data.method_name !== 'string') {
+ return debug('New PM2 action triggered with invalid method name: ', data.method_name)
+ }
+ if (this.remoteMethodAlloweds.indexOf(data.method_name) === -1) {
+ return callback(new Error('Method not allowed'))
+ }
+
+ debug('New PM2 action triggered : pm2 %s %j', data.method_name, data.parameters)
+
+ const method = data.method_name
+ let parameters = data.parameters
+ try {
+ parameters = JSON.parse(JSON.stringify(data.parameters))
+ } catch (err) {
+ console.error(err)
+ }
+
+ if (method === 'startLogging') {
+ global._logs = true
+ // Stop streaming logs automatically after timeout
+ clearTimeout(this._loggingTimeoutId)
+ this._loggingTimeoutId = setTimeout(function () {
+ global._logs = false
+ }, process.env.NODE_ENV === 'test' ? 10 : 120000)
+ return callback(null, 'Log streaming enabled')
+ } else if (method === 'stopLogging') {
+ global._logs = false
+ return callback(null, 'Log streaming disabled')
+ }
+
+ return this.ipm2.remote(method, parameters, callback)
+ }
+}
diff --git a/node_modules/@pm2/agent/src/transporters/Transporter.js b/node_modules/@pm2/agent/src/transporters/Transporter.js
new file mode 100644
index 0000000..cff951d
--- /dev/null
+++ b/node_modules/@pm2/agent/src/transporters/Transporter.js
@@ -0,0 +1,129 @@
+'use strict'
+
+const log = require('debug')('interactor:transporter')
+const EventEmitter2 = require('eventemitter2').EventEmitter2
+const dns = require('dns')
+const cst = require('../../constants.js')
+
+module.exports = class Transporter extends EventEmitter2 {
+ constructor () {
+ super({
+ delimiter: ':',
+ wildcard: true
+ })
+ }
+
+ /**
+ * Disconnect and connect to a url
+ * @param {String} url where the client will connect [optionnal]
+ * @param {Function} cb invoked with
+ */
+ reconnect (url, cb) {
+ log('Reconnect transporter')
+ this.disconnect()
+ this.connect(url, cb)
+ }
+
+ /**
+ * Broadcast the close event from websocket connection
+ * @private
+ * @param {Integer} code
+ * @param {String} reason
+ */
+ _onClose (code, reason) {
+ log('Closed transporter')
+ this.disconnect()
+ this._reconnect()
+ this.emit('close', code, reason)
+ }
+
+ /**
+ * Broadcast the error event from websocket connection
+ * and eventually close the connection if it isnt already
+ * @private
+ * @param {Error} err
+ */
+ _onError (err) {
+ log(`Error with transporter: ${err.message}`)
+ // close connection if needed
+ this.disconnect()
+ this._reconnect()
+ this.emit('error', err)
+ }
+
+ /**
+ * Worker that will empty the packet queue if the connection works.
+ * @private
+ */
+ _emptyQueue () {
+ // create the queue if it doesn't exist
+ if (!this.queue) {
+ this.queue = []
+ return
+ }
+ if (this.queue.length === 0) return
+ if (!this.isConnected()) return
+
+ log('Emptying queue (size : %d)', this.queue.length)
+
+ // re-send all of the data
+ while (this.queue.length > 0) {
+ if (!this.isConnected()) return
+ let packet = this.queue[0]
+ this.send(packet.channel, packet.data)
+ this.queue.shift()
+ }
+ }
+
+ /**
+ * Is internet reachable via DNS
+ * @private
+ * @param {Function} cb invoked with
+ */
+ _checkInternet (cb) {
+ dns.lookup('google.com', (err) => {
+ if (err && (err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN')) {
+ if (this._online) {
+ log('Internet is unreachable (DNS)')
+ }
+ this._online = false
+ } else {
+ if (!this._online) {
+ log('Internet is reachable again')
+ }
+ this._online = true
+ }
+ return cb(this._online)
+ })
+ }
+
+ /**
+ * Strategy to reconnect to remote endpoint as soon as possible
+ * -> test internet connection with dns request (if fail retry in 2 sec)
+ * -> try to connect to endpoint (if fail retry in 5 sec)
+ */
+ _reconnect () {
+ if (this._reconnecting === true) return
+ this._reconnecting = true
+
+ log('Trying to reconnect to remote endpoint')
+ this._checkInternet((online) => {
+ if (!online && !cst.PM2_DEBUG) {
+ log('Internet down, retry in 2 seconds ..')
+ this._reconnecting = false
+ return setTimeout(this._reconnect.bind(this), process.env.NODE_ENV === 'test' ? 1 : 2000)
+ }
+ this.connect((err) => {
+ if (err || !this.isConnected()) {
+ log('Endpoint down, retry in 5 seconds ...')
+ this._reconnecting = false
+ return setTimeout(this._reconnect.bind(this), process.env.NODE_ENV === 'test' ? 1 : 5000)
+ }
+
+ log('Connection etablished with remote endpoint')
+ this._reconnecting = false
+ this._emptyQueue()
+ })
+ })
+ }
+}
diff --git a/node_modules/@pm2/agent/src/transporters/WebsocketTransport.js b/node_modules/@pm2/agent/src/transporters/WebsocketTransport.js
new file mode 100644
index 0000000..66c4126
--- /dev/null
+++ b/node_modules/@pm2/agent/src/transporters/WebsocketTransport.js
@@ -0,0 +1,204 @@
+'use strict'
+
+const WebSocket = require('ws')
+const ProxyAgent = require('proxy-agent')
+const log = require('debug')('interactor:websocket')
+const cst = require('../../constants.js')
+const pkg = require('../../package.json')
+const Transporter = require('./Transporter')
+const jsonPatch = require('fast-json-patch')
+const fs = require('fs')
+/**
+ * Websocket Transport used to communicate with KM
+ * @param {Object} opts options
+ * @param {Daemon} daemon Interactor instance
+ */
+module.exports = class WebsocketTransport extends Transporter {
+ constructor (opts, daemon) {
+ super()
+ log('WebsocketTransporter constructed')
+ this.opts = opts
+ this._daemon = daemon
+ this._ws = null
+ this.queue = []
+ this._last_status = null
+ this._resend_status = false
+ this._worker = setInterval(this._emptyQueue.bind(this), process.env.NODE_ENV === 'test' ? 2 : 10000)
+ this._heartbeater = setInterval(this._heartbeat.bind(this), 5000)
+ }
+
+ /**
+ * Send heartbeat to websocket server (every 5 sec)
+ */
+ _heartbeat () {
+ if (!this.isConnected()) return false
+ return this._ws.ping()
+ }
+
+ /**
+ * Connect the websocket client to a url
+ * @param {String} url where the client will connect
+ * @param {Function} cb invoked with
+ */
+ connect (url, cb) {
+ if (typeof url === 'function') {
+ cb = url
+ url = this.endpoint
+ }
+ this.endpoint = url
+
+ if (!url) return cb(new Error('Websocket URL is not defined!'))
+
+ log('Connecting websocket transporter to %s...', url)
+ this._ws = new WebSocket(url, {
+ perMessageDeflate: process.env.WS_GZIP || false,
+ headers: {
+ 'X-KM-PUBLIC': this.opts.PUBLIC_KEY,
+ 'X-KM-SECRET': this.opts.SECRET_KEY,
+ 'X-KM-SERVER': this.opts.MACHINE_NAME,
+ 'X-PM2-VERSION': this.opts.PM2_VERSION || '0.0.0',
+ 'X-PROTOCOL-VERSION': cst.PROTOCOL_VERSION,
+ 'User-Agent': `PM2 Agent v${pkg.version}`
+ },
+ agent: cst.PROXY ? new ProxyAgent(cst.PROXY) : undefined
+ })
+
+ let onError = (err) => {
+ log('Error on websocket connect', err)
+ return cb(err)
+ }
+ this._ws.once('error', onError)
+ this._ws.once('open', () => {
+ this._resend_status = true
+ log(`Connected to ${url}`)
+ if (!this._ws) return false // an error occurred
+ this._ws.removeListener('error', onError)
+ this._ws.on('close', this._onClose.bind(this))
+ this._ws.on('error', this._onError.bind(this))
+ return cb()
+ })
+
+ this._ws.on('message', this._onMessage.bind(this))
+ this._ws.on('ping', (data) => {
+ this._ws.pong()
+ })
+ this._ws.on('pong', (data) => {})
+ }
+
+ /**
+ * Disconnect clients
+ */
+ disconnect () {
+ log('Disconnect websocket transporter')
+ if (this.isConnected()) {
+ this._ws.close(1000, 'Disconnecting')
+ }
+ this._ws = null
+ }
+
+ /**
+ * Are push and reverse connections ready
+ * @return {Boolean}
+ */
+ isConnected () {
+ return this._ws && this._ws.readyState === 1
+ }
+
+ /**
+ * Send data to endpoints
+ * @param {String} channel
+ * @param {Object} data
+ */
+ send (channel, data) {
+ if (!channel || !data) {
+ return log('Trying to send message without all necessary fields')
+ }
+ if (!this.isConnected()) {
+ if (!this._reconnecting) this._reconnect()
+
+ // do not buffer status/monitoring packet
+ if (channel === 'status' || channel === 'monitoring') return
+
+ log('Trying to send data while not connected, buffering ...')
+
+ // remove last element if the queue is full
+ if (this.queue.length >= cst.PACKET_QUEUE_SIZE) {
+ this.queue.shift()
+ }
+ return this.queue.push({ channel: channel, data: data })
+ }
+
+ if (channel === 'status' && process.env.WS_JSON_PATCH) {
+ if (this._last_status == null || this._resend_status == true) {
+ if (this._resend_status)
+ log('Sending fresh new status')
+ this._resend_status = false
+ this._last_status = data
+ }
+ else {
+ let patch = jsonPatch.compare(this._last_status, data)
+
+ let packet = {
+ payload: patch,
+ channel: 'status:patch'
+ }
+
+ this._last_status = data
+
+
+ if (process.env.WS_JSON_PATCH_BENCH) {
+ fs.writeFileSync('status', JSON.stringify(data))
+ fs.writeFileSync('patch', JSON.stringify(packet))
+ }
+
+ return this._ws.send(JSON.stringify(packet), (err) => {
+ packet = null
+ if (err) {
+ this.emit('error', err)
+ }
+ })
+ }
+ }
+
+ log('Sending packet over for channel %s', channel)
+ let packet = {
+ payload: data,
+ channel: channel
+ }
+ this._ws.send(JSON.stringify(packet), {
+ compress: cst.COMPRESS_PROTOCOL || false
+ }, (err) => {
+ packet = null
+ if (err) {
+ this.emit('error', err)
+ // buffer the packet to send it when the connection will be up again
+ this.queue.push({ channel: channel, data: data })
+ }
+ })
+ }
+
+ /**
+ * Message received from keymetrics
+ * @private
+ * @param {String} json packet
+ */
+ _onMessage (data) {
+ try {
+ data = JSON.parse(data)
+ } catch (err) {
+ return log('Bad packet received from remote : %s', err.message || err)
+ }
+
+ if (process.env.WS_JSON_PATCH && data.channel == 'status:resend') {
+ log(`Wrong patch sent to backend, resending fresh status`)
+ this._resend_status = true
+ }
+
+ // ensure that all required field are present
+ if (!data || !data.payload || !data.channel) {
+ return log('Received message without all necessary fields')
+ }
+ log('Recevied data on channel %s', data.channel)
+ this.emit(data.channel, data.payload)
+ }
+}
diff --git a/node_modules/@pm2/agent/src/utils/BinaryHeap.js b/node_modules/@pm2/agent/src/utils/BinaryHeap.js
new file mode 100644
index 0000000..7f14b0e
--- /dev/null
+++ b/node_modules/@pm2/agent/src/utils/BinaryHeap.js
@@ -0,0 +1,135 @@
+'use strict'
+
+// Hacked https://github.com/felixge/node-measured
+
+// Based on http://en.wikipedia.org/wiki/Binary_Heap
+// as well as http://eloquentjavascript.net/appendix2.html
+module.exports = BinaryHeap
+function BinaryHeap (options) {
+ options = options || {}
+
+ this._elements = options.elements || []
+ this._score = options.score || this._score
+}
+
+BinaryHeap.prototype.add = function (/* elements */) {
+ for (var i = 0; i < arguments.length; i++) {
+ var element = arguments[i]
+
+ this._elements.push(element)
+ this._bubble(this._elements.length - 1)
+ }
+}
+
+BinaryHeap.prototype.first = function () {
+ return this._elements[0]
+}
+
+BinaryHeap.prototype.removeFirst = function () {
+ var root = this._elements[0]
+ var last = this._elements.pop()
+
+ if (this._elements.length > 0) {
+ this._elements[0] = last
+ this._sink(0)
+ }
+
+ return root
+}
+
+BinaryHeap.prototype.clone = function () {
+ return new BinaryHeap({
+ elements: this.toArray(),
+ score: this._score
+ })
+}
+
+BinaryHeap.prototype.toSortedArray = function () {
+ var array = []
+ var clone = this.clone()
+
+ while (true) {
+ var element = clone.removeFirst()
+ if (element === undefined) break
+
+ array.push(element)
+ }
+
+ return array
+}
+
+BinaryHeap.prototype.toArray = function () {
+ return [].concat(this._elements)
+}
+
+BinaryHeap.prototype.size = function () {
+ return this._elements.length
+}
+
+BinaryHeap.prototype._bubble = function (bubbleIndex) {
+ var bubbleElement = this._elements[bubbleIndex]
+ var bubbleScore = this._score(bubbleElement)
+
+ while (bubbleIndex > 0) {
+ var parentIndex = this._parentIndex(bubbleIndex)
+ var parentElement = this._elements[parentIndex]
+ var parentScore = this._score(parentElement)
+
+ if (bubbleScore <= parentScore) break
+
+ this._elements[parentIndex] = bubbleElement
+ this._elements[bubbleIndex] = parentElement
+ bubbleIndex = parentIndex
+ }
+}
+
+BinaryHeap.prototype._sink = function (sinkIndex) {
+ var sinkElement = this._elements[sinkIndex]
+ var sinkScore = this._score(sinkElement)
+ var length = this._elements.length
+
+ while (true) {
+ var swapIndex = null
+ var swapScore = null
+ var swapElement = null
+ var childIndexes = this._childIndexes(sinkIndex)
+
+ for (var i = 0; i < childIndexes.length; i++) {
+ var childIndex = childIndexes[i]
+
+ if (childIndex >= length) break
+
+ var childElement = this._elements[childIndex]
+ var childScore = this._score(childElement)
+
+ if (childScore > sinkScore) {
+ if (swapScore === null || swapScore < childScore) {
+ swapIndex = childIndex
+ swapScore = childScore
+ swapElement = childElement
+ }
+ }
+ }
+
+ if (swapIndex === null) break
+
+ this._elements[swapIndex] = sinkElement
+ this._elements[sinkIndex] = swapElement
+ sinkIndex = swapIndex
+ }
+}
+
+BinaryHeap.prototype._parentIndex = function (index) {
+ return Math.floor((index - 1) / 2)
+}
+
+BinaryHeap.prototype._childIndexes = function (index) {
+ return [
+ 2 * index + 1,
+ 2 * index + 2
+ ]
+}
+
+BinaryHeap.prototype._score = function (element) {
+ return element.valueOf()
+}
diff --git a/node_modules/@pm2/agent/src/utils/EDS.js b/node_modules/@pm2/agent/src/utils/EDS.js
new file mode 100644
index 0000000..09cc7d2
--- /dev/null
+++ b/node_modules/@pm2/agent/src/utils/EDS.js
@@ -0,0 +1,111 @@
+'use strict'
+// Hacked https://github.com/felixge/node-measured
+
+var BinaryHeap = require('./BinaryHeap')
+var units = require('./units')
+
+module.exports = ExponentiallyDecayingSample
+function ExponentiallyDecayingSample (options) {
+ options = options || {}
+
+ this._elements = new BinaryHeap({
+ score: function (element) {
+ return -element.priority
+ }
+ })
+
+ this._rescaleInterval = options.rescaleInterval || ExponentiallyDecayingSample.RESCALE_INTERVAL
+ this._alpha = options.alpha || ExponentiallyDecayingSample.ALPHA
+ this._size = options.size || ExponentiallyDecayingSample.SIZE
+ this._random = options.random || this._random
+ this._landmark = null
+ this._nextRescale = null
+ this._mean = null
+}
+
+ExponentiallyDecayingSample.RESCALE_INTERVAL = 1 * units.HOURS
+ExponentiallyDecayingSample.ALPHA = 0.015
+ExponentiallyDecayingSample.SIZE = 1028
+
+ExponentiallyDecayingSample.prototype.update = function (value, timestamp) {
+ var now = Date.now()
+ if (!this._landmark) {
+ this._landmark = now
+ this._nextRescale = this._landmark + this._rescaleInterval
+ }
+
+ timestamp = timestamp || now
+
+ var newSize = this._elements.size() + 1
+
+ var element = {
+ priority: this._priority(timestamp - this._landmark),
+ value: value
+ }
+
+ if (newSize <= this._size) {
+ this._elements.add(element)
+ } else if (element.priority > this._elements.first().priority) {
+ this._elements.removeFirst()
+ this._elements.add(element)
+ }
+
+ if (now >= this._nextRescale) this._rescale(now)
+}
+
+ExponentiallyDecayingSample.prototype.toSortedArray = function () {
+ return this._elements
+ .toSortedArray()
+ .map(function (element) {
+ return element.value
+ })
+}
+
+ExponentiallyDecayingSample.prototype.toArray = function () {
+ return this._elements
+ .toArray()
+ .map(function (element) {
+ return element.value
+ })
+}
+
+ExponentiallyDecayingSample.prototype._weight = function (age) {
+ // We divide by 1000 to not run into huge numbers before reaching a
+ // rescale event.
+ return Math.exp(this._alpha * (age / 1000))
+}
+
+ExponentiallyDecayingSample.prototype._priority = function (age) {
+ return this._weight(age) / this._random()
+}
+
+ExponentiallyDecayingSample.prototype._random = function () {
+ return Math.random()
+}
+
+ExponentiallyDecayingSample.prototype._rescale = function (now) {
+ now = now || Date.now()
+
+ var self = this
+ var oldLandmark = this._landmark
+ this._landmark = now || Date.now()
+ this._nextRescale = now + this._rescaleInterval
+
+ var factor = self._priority(-(self._landmark - oldLandmark))
+
+ this._elements
+ .toArray()
+ .forEach(function (element) {
+ element.priority *= factor
+ })
+}
+
+ExponentiallyDecayingSample.prototype.avg = function (now) {
+ var sum = 0
+ this._elements
+ .toArray()
+ .forEach(function (element) {
+ sum += element.value
+ })
+ return (sum / this._elements.size())
+}
diff --git a/node_modules/@pm2/agent/src/utils/probes/Histogram.js b/node_modules/@pm2/agent/src/utils/probes/Histogram.js
new file mode 100644
index 0000000..fb19ffb
--- /dev/null
+++ b/node_modules/@pm2/agent/src/utils/probes/Histogram.js
@@ -0,0 +1,204 @@
+'use strict'
+
+// Hacked from https://github.com/felixge/node-measured
+
+var EDS = require('../EDS.js')
+
+function Histogram (opts) {
+ opts = opts || {}
+
+ this._measurement = opts.measurement
+ this._call_fn = null
+
+ var methods = {
+ min: this.getMin,
+ max: this.getMax,
+ sum: this.getSum,
+ count: this.getCount,
+ variance: this._calculateVariance,
+ mean: this._calculateMean,
+ stddev: this._calculateStddev,
+ ema: this.getEma()
+ }
+
+ if (methods[this._measurement]) {
+ this._call_fn = methods[this._measurement]
+ } else {
+ this._call_fn = function () {
+ var percentiles = this.percentiles([0.5, 0.75, 0.95, 0.99, 0.999])
+
+ var medians = {
+ median: percentiles[0.5],
+ p75: percentiles[0.75],
+ p95: percentiles[0.95],
+ p99: percentiles[0.99],
+ p999: percentiles[0.999]
+ }
+
+ return medians[this._measurement]
+ }
+ }
+ this._sample = new EDS()
+ this._min = null
+ this._max = null
+ this._count = 0
+ this._sum = 0
+
+ // These are for the Welford algorithm for calculating running variance
+ // without floating-point doom.
+ this._varianceM = 0
+ this._varianceS = 0
+ this._ema = 0
+}
+
+Histogram.prototype.update = function (value) {
+ this._count++
+ this._sum += value
+
+ this._sample.update(value)
+ this._updateMin(value)
+ this._updateMax(value)
+ this._updateVariance(value)
+ this._updateEma(value)
+}
+
+Histogram.prototype.percentiles = function (percentiles) {
+ var values = this._sample
+ .toArray()
+ .sort(function (a, b) {
+ return (a === b)
+ ? 0
+ : a - b
+ })
+
+ var results = {}
+
+ for (var i = 0; i < percentiles.length; i++) {
+ var percentile = percentiles[i]
+ if (!values.length) {
+ results[percentile] = null
+ continue
+ }
+
+ var pos = percentile * (values.length + 1)
+
+ if (pos < 1) {
+ results[percentile] = values[0]
+ } else if (pos >= values.length) {
+ results[percentile] = values[values.length - 1]
+ } else {
+ var lower = values[Math.floor(pos) - 1]
+ var upper = values[Math.ceil(pos) - 1]
+
+ results[percentile] = lower + (pos - Math.floor(pos)) * (upper - lower)
+ }
+ }
+
+ return results
+}
+
+Histogram.prototype.reset = function () {
+ this.constructor.call(this) // eslint-disable-line
+}
+
+Histogram.prototype.val = function () {
+ if (typeof (this._call_fn) === 'function') {
+ return this._call_fn()
+ } else {
+ return this._call_fn
+ }
+}
+
+Histogram.prototype.getMin = function () {
+ return this._min
+}
+
+Histogram.prototype.getMax = function () {
+ return this._max
+}
+
+Histogram.prototype.getSum = function () {
+ return this._sum
+}
+
+Histogram.prototype.getCount = function () {
+ return this._count
+}
+
+Histogram.prototype.getEma = function () {
+ return this._ema
+}
+
+Histogram.prototype.fullResults = function () {
+ var percentiles = this.percentiles([0.5, 0.75, 0.95, 0.99, 0.999])
+
+ return {
+ min: this._min,
+ max: this._max,
+ sum: this._sum,
+ variance: this._calculateVariance(),
+ mean: this._calculateMean(),
+ stddev: this._calculateStddev(),
+ count: this._count,
+ median: percentiles[0.5],
+ p75: percentiles[0.75],
+ p95: percentiles[0.95],
+ p99: percentiles[0.99],
+ p999: percentiles[0.999],
+ ema: this._ema
+ }
+}
+
+Histogram.prototype._updateMin = function (value) {
+ if (this._min === null || value < this._min) {
+ this._min = value
+ // console.log(value);
+ }
+}
+
+Histogram.prototype._updateMax = function (value) {
+ if (this._max === null || value > this._max) {
+ this._max = value
+ }
+}
+
+Histogram.prototype._updateVariance = function (value) {
+ if (this._count === 1) {
+ this._varianceM = value
+ return this._varianceM
+ }
+
+ var oldM = this._varianceM
+
+ this._varianceM += ((value - oldM) / this._count)
+ this._varianceS += ((value - oldM) * (value - this._varianceM))
+}
+
+Histogram.prototype._updateEma = function (value) {
+ if (this._count <= 1) {
+ this._ema = this._calculateMean()
+ return this._ema
+ }
+ var alpha = 2 / (1 + this._count)
+ this._ema = value * alpha + this._ema * (1 - alpha)
+}
+
+Histogram.prototype._calculateMean = function () {
+ return (this._count === 0)
+ ? 0
+ : this._sum / this._count
+}
+
+Histogram.prototype._calculateVariance = function () {
+ return (this._count <= 1)
+ ? null
+ : this._varianceS / (this._count - 1)
+}
+
+Histogram.prototype._calculateStddev = function () {
+ return (this._count < 1)
+ ? null
+ : Math.sqrt(this._calculateVariance())
+}
+
+module.exports = Histogram
diff --git a/node_modules/@pm2/agent/src/utils/units.js b/node_modules/@pm2/agent/src/utils/units.js
new file mode 100644
index 0000000..e329da2
--- /dev/null
+++ b/node_modules/@pm2/agent/src/utils/units.js
@@ -0,0 +1,10 @@
+'use strict'
+// Time units, as found in Java:
+// see: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html
+exports.NANOSECONDS = 1 / (1000 * 1000)
+exports.MICROSECONDS = 1 / 1000
+exports.MILLISECONDS = 1
+exports.SECONDS = 1000 * exports.MILLISECONDS
+exports.MINUTES = 60 * exports.SECONDS
+exports.HOURS = 60 * exports.MINUTES
+exports.DAYS = 24 * exports.HOURS
diff --git a/node_modules/@pm2/io/.drone.jsonnet b/node_modules/@pm2/io/.drone.jsonnet
new file mode 100644
index 0000000..10776d7
--- /dev/null
+++ b/node_modules/@pm2/io/.drone.jsonnet
@@ -0,0 +1,114 @@
+local pipeline(version) = {
+ kind: "pipeline",
+ name: "node-v" + version,
+ steps: [
+ {
+ name: "tests",
+ image: "node:" + version,
+ commands: [
+ "node -v",
+ "uname -r",
+ "npm install",
+ "npm test"
+ ]
+ },
+ ],
+ services: [
+ {
+ name: "mongodb",
+ image: "mongo:3.4",
+ environment: {
+ AUTH: "no"
+ },
+ },
+ {
+ name: "redis",
+ image: "redis:5",
+ },
+ {
+ name: "mysql",
+ image: "mysql:5",
+ environment: {
+ MYSQL_DATABASE: "test",
+ MYSQL_ROOT_PASSWORD: "password"
+ },
+ },
+ {
+ name: "postgres",
+ image: "postgres:11",
+ environment: {
+ POSTGRES_DB: "test",
+ POSTGRES_PASSWORD: "password"
+ },
+ },
+ ],
+ trigger: {
+ event: ["push", "pull_request"]
+ },
+};
+
+[
+ pipeline("8"),
+ pipeline("10"),
+ pipeline("12"),
+ pipeline("13"),
+ pipeline("14"),
+ {
+ kind: "pipeline",
+ name: "build & publish",
+ trigger: {
+ event: "tag"
+ },
+ steps: [
+ {
+ name: "build",
+ image: "node:8",
+ commands: [
+ "export PATH=$PATH:./node_modules/.bin/",
+ "yarn 2> /dev/null",
+ "mkdir build",
+ "yarn run build",
+ ],
+ },
+ {
+ name: "publish",
+ image: "plugins/npm",
+ settings: {
+ username: {
+ from_secret: "npm_username"
+ },
+ password: {
+ from_secret: "npm_password"
+ },
+ email: {
+ from_secret: "npm_email"
+ },
+ },
+ },
+ ],
+ },
+ {
+ kind: "secret",
+ name: "npm_username",
+ get: {
+ path: "secret/drone/npm",
+ name: "username",
+ },
+ },
+ {
+ kind: "secret",
+ name: "npm_email",
+ get: {
+ path: "secret/drone/npm",
+ name: "email",
+ },
+ },
+ {
+ kind: "secret",
+ name: "npm_password",
+ get: {
+ path: "secret/drone/npm",
+ name: "password",
+ },
+ }
+]
diff --git a/node_modules/@pm2/io/.mocharc.js b/node_modules/@pm2/io/.mocharc.js
new file mode 100644
index 0000000..53d4184
--- /dev/null
+++ b/node_modules/@pm2/io/.mocharc.js
@@ -0,0 +1,17 @@
+
+process.env.NODE_ENV = 'test';
+
+module.exports = {
+ 'allow-uncaught': false,
+ 'async-only': false,
+ bail: true,
+ color: true,
+ delay: false,
+ diff: true,
+ exit: true,
+ timeout: 10000,
+ 'trace-warnings': true,
+ ui: 'bdd',
+ retries: 2,
+ require: ['ts-node/register']
+}
diff --git a/node_modules/@pm2/io/.vscode/settings.json b/node_modules/@pm2/io/.vscode/settings.json
new file mode 100644
index 0000000..3662b37
--- /dev/null
+++ b/node_modules/@pm2/io/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "typescript.tsdk": "node_modules/typescript/lib"
+}
\ No newline at end of file
diff --git a/node_modules/@pm2/io/LICENSE.md b/node_modules/@pm2/io/LICENSE.md
new file mode 100644
index 0000000..e1cc1b6
--- /dev/null
+++ b/node_modules/@pm2/io/LICENSE.md
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2019 Keymetrics Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/node_modules/@pm2/io/NOTES.md b/node_modules/@pm2/io/NOTES.md
new file mode 100644
index 0000000..99458b5
--- /dev/null
+++ b/node_modules/@pm2/io/NOTES.md
@@ -0,0 +1,73 @@
+
+## API idea
+
+require('pm2-bundle-monitoring')
+
+// or
+
+require('pm2-io').connect({
+ secret: '',
+ public: ''
+})
+
+require('pm2-exception-catching')
+require('pm2-transaction-tracing').config({
+ ignore_route: '/ws'
+})
+
+require('pm2-frontend-monitoring')
+var pm2_metrics = require('pm2-metrics')
+
+pm2_metrics.variable('BLE pairing mode', permit_join)
+pm2_metrics.variable('In memory users', () => Object.keys(users).length)
+
+NOTES:
+- watch parameters is not reset on pm2 restart. only after pm2 delete
+
+
+----
+
+
+pm2-io-apm features are in src/features/:
+
+```
+src/features/
+├── dependencies.ts
+├── entrypoint.ts
+├── events.ts
+├── metrics.ts
+├── notify.ts
+├── profiling.ts
+└── tracing.ts
+```
+
+## Tracing
+
+- `./src/census` folder is essentially a dump of https://github.com/census-instrumentation/opencensus-node/tree/master/packages/opencensus-nodejs-base/src/trace with plugins added
+- Only traces higher than `MINIMUM_TRACE_DURATION: 1000 * 1000` are sent to transporter (sent in /src/census/exporter.ts:72)
+
+Trace sent looks like:
+
+```
+{
+ traceId: 'fac7052e9129416185a26d4935229620',
+ name: '/slow',
+ id: '66358f0a48be82c5',
+ parentId: '',
+ kind: 'SERVER',
+ timestamp: 1586380086251000,
+ duration: 2007559,
+ debug: false,
+ shared: false,
+ localEndpoint: { serviceName: 'tototransaction' },
+ tags: {
+ 'http.host': 'localhost',
+ 'http.method': 'GET',
+ 'http.path': '/slow',
+ 'http.route': '/slow',
+ 'http.user_agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36',
+ 'http.status_code': '304',
+ 'result.code': undefined
+ }
+}
+```
diff --git a/node_modules/@pm2/io/README.md b/node_modules/@pm2/io/README.md
new file mode 100644
index 0000000..dd693d4
--- /dev/null
+++ b/node_modules/@pm2/io/README.md
@@ -0,0 +1,574 @@
+
+
+
+
+
+
+
+
+
+
+
+The [@pm2/io](https://github.com/keymetrics/pm2-io-apm/tree/master/test) module comes along with PM2. It is the PM2 library responsible for gathering the metrics, reporting exceptions, exposing remote actions and every interaction with your application.
+
+You can also use it as a standalone agent, if you want to connect your nodejs process to PM2 Enterprise but without having to launch your application with PM2.
+
+# Table of Contents
+
+- [**Installation**](https://github.com/keymetrics/pm2-io-apm/tree/master#installation)
+- [**Expose Custom Metrics**](https://github.com/keymetrics/pm2-io-apm/tree/master#expose-custom-metrics)
+- [**Expose Remote Actions**](https://github.com/keymetrics/pm2-io-apm#expose-remote-actions-trigger-functions-remotely)
+- [**Report Custom Errors**](https://github.com/keymetrics/pm2-io-apm#report-user-error)
+- [**Distributed Tracing**](https://github.com/keymetrics/pm2-io-apm#distributed-tracing)
+- [**Configuration**](https://github.com/keymetrics/pm2-io-apm/tree/master#configuration)
+- [**Migration Guide**](https://github.com/keymetrics/pm2-io-apm#migration-guides)
+- [**Development**](https://github.com/keymetrics/pm2-io-apm/tree/master#development)
+- [**Notes**](https://github.com/keymetrics/pm2-io-apm/tree/master#notes)
+
+
+# Installation
+
+With npm:
+
+```bash
+npm install @pm2/io --save
+```
+
+With yarn:
+
+```bash
+yarn add @pm2/io
+```
+
+## V8 Runtime Metrics
+
+To retrieve by default V8 Runtime metrics like:
+- V8 Garbage Collector metrics
+- [CPU Context Switch](https://unix.stackexchange.com/questions/442969/what-exactly-are-voluntary-context-switches)
+- [Page Fault](https://en.wikipedia.org/wiki/Page_fault#Types)
+
+Install:
+
+```bash
+npm install @pm2/node-runtime-stats
+```
+
+And restart the application.
+
+## Custom Metrics
+
+@pm2/io allows you to gather metrics from your code to be reported in the PM2 Plus/Enterprise dashboard.
+
+### Create a custom metrics
+
+You can create a new custom metrics with the method `metric()` of `@pm2/io`.
+
+```javascript
+const io = require('@pm2/io');
+
+const users = io.metric({
+ name: 'Realtime user',
+});
+users.set(10)
+```
+
+This arguments are available:
+
+- **name**: The metric name (required; string)
+- **id**: The type of metric (default 'metric', string)
+- **unit**: unit of the measure (default ''; string)
+- **historic**: keep the history in PM2 Plus (default: true; boolean)
+
+There are 4 different types of metrics:
+
+- **gauge**: To expose a variable's value
+- **counter**: A discrete counter to be triggered manually to count a number of occurrence
+- **meter**: To measure a frequency, a number of occurrences of a repeating event per unit of time
+- **histogram**: To measure a statistic, a statistic on a metric over the last 5 minutes
+
+### Metric: Variable Exposition
+
+The first type of metric, called `metric`, allows to expose a variable's value. The variable can be exposed passively, with a function that gets called every second, or actively, with a method that you use to update the value.
+
+#### Active Mode
+
+In active mode, you need to create a probe and call the method `set()` to update the value.
+
+```javascript
+const myMetric = io.metric({
+ name: 'Realtime Value'
+});
+
+myMetric.set(23);
+```
+
+#### Passive Mode
+
+In passive mode you hust need to return the variable to be monitored:
+
+```javascript
+const myMetric = io.metric({
+ name: 'Realtime Value',
+ value: () => {
+ return variable_to_monitor
+ }
+});
+```
+
+### Counter: Discrete Counter
+
+The second type of metric, called `counter`, is a discrete counter that helps you count the number of occurrence of a particular event. The counter starts at 0 and can be incremented or decremented.
+
+```javascript
+const io = require('@pm2/io');
+
+const currentReq = io.counter({
+ name: 'Current req processed',
+ type: 'counter',
+});
+
+http.createServer((req, res) => {
+ // Increment the counter, counter will eq 1
+ currentReq.inc();
+ req.on('end', () => {
+ // Decrement the counter, counter will eq 0
+ currentReq.dec();
+ });
+});
+```
+
+### Meter: Frequency
+
+The third type of metric, called `meter`, compute the frequency of an event. Each time the event happens, you need to call the `mark()` method. By default, the frequency is the number of events per second over the last minute.
+
+```javascript
+const io = require('@pm2/io');
+
+const reqsec = io.meter({
+ name: 'req/sec',
+ type: 'meter',
+});
+
+http.createServer((req, res) => {
+ reqsec.mark();
+ res.end({ success: true });
+});
+```
+
+Additional options:
+- **samples**: (optional)(default: 1) Rate unit. Defaults to **1** sec.
+- **timeframe**: (optional)(default: 60) Timeframe over which the events will be analyzed. Defaults to **60** sec.
+
+### Histogram: Statistics
+
+Collect values and provide statistic tools to explore their distribution over the last 5 minutes.
+
+```javascript
+const io = require('@pm2/io');
+
+const latency = io.histogram({
+ name: 'latency',
+ measurement: 'mean'
+});
+
+var latencyValue = 0;
+
+setInterval(() => {
+ latencyValue = Math.round(Math.random() * 100);
+ latency.update(latencyValue);
+}, 100);
+```
+
+Options are:
+- **measurement** : default: mean; min, max, sum, count, variance, mean, stddev, median, p75, p95, p99, p99.
+
+## Expose Remote Actions: Trigger Functions remotely
+
+Remotely trigger functions from PM2 Plus or Enterprise.
+
+### Simple actions
+
+The function takes a function as a parameter (cb here) and need to be called once the job is finished.
+
+Example:
+
+```javascript
+const io = require('@pm2/io');
+
+io.action('db:clean', (cb) => {
+ clean.db(() => {
+ // cb must be called at the end of the action
+ return cb({ success: true });
+ });
+});
+```
+
+## Report user error
+
+By default, in the Issue tab, you are only alerted for uncaught exceptions. Any exception that you catch is not reported. You can manually report them with the `notifyError()` method.
+
+```javascript
+const io = require('@pm2/io');
+
+io.notifyError(new Error('This is an error'), {
+ // you can some http context that will be reported in the UI
+ http: {
+ url: req.url
+ },
+ // or anything that you can like an user id
+ custom: {
+ user: req.user.id
+ }
+});
+```
+
+#### Express error reporting
+
+If you want you can configure your express middleware to automatically send you an error with the error middleware of express :
+
+```javascript
+const io = require('@pm2/io')
+const express = require('express')
+const app = express()
+
+// add the routes that you want
+app.use('/toto', () => {
+ throw new Error('ajdoijerr')
+})
+
+// always add the middleware as the last one
+app.use(io.expressErrorHandler())
+```
+
+#### Koa error reporting
+
+We also expose a custom koa middleware to report error with a specific koa middleware :
+
+```javascript
+const io = require('@pm2/io')
+const Koa = require('koa')
+const app = new Koa()
+
+// the order isn't important with koa
+app.use(pmx.koaErrorHandler())
+
+// add the routes that you want
+app.use(async ctx => {
+ ctx.throw(new Error('toto'))
+})
+```
+
+## Distributed Tracing
+
+The Distributed Tracing allows to captures and propagates distributed traces through your system, allowing you to visualize how customer requests flow across services, rapidly perform deep root cause analysis, and better analyze latency across a highly distributed set of services.
+If you want to enable it, here the simple options to enable:
+
+
+```javascript
+const io = require('@pm2/io').init({
+ tracing: {
+ enabled: true,
+ // will add the actual queries made to database, false by default
+ detailedDatabasesCalls: true,
+ // if you want you can ignore some endpoint based on their path
+ ignoreIncomingPaths: [
+ // can be a regex
+ /misc/,
+ // or a exact string
+ '/api/bucket'
+ // or a function with the request
+ (url, request) => {
+ return true
+ }
+ ],
+ // same as above but used to match entire URLs
+ ignoreOutgoingUrls: [],
+ /**
+ * Determines the probability of a request to be traced. Ranges from 0.0 to 1.0
+ * default is 0.5
+ */
+ samplingRate: 0.5
+ }
+})
+```
+
+By default we ignore specific incoming requests (you can override this by setting `ignoreIncomingPaths: []`):
+- Request with the OPTIONS or HEAD method
+- Request fetching a static ressources (`*.js`, `*.css`, `*.ico`, `*.svg`, `.png` or `*webpack*`)
+
+### What's get traced
+
+When your application will receive a request from either `http`, `https` or `http2` it will start a trace. After that, we will trace the following modules:
+ - `http` outgoing requests
+ - `https` outgoing requests
+ - `http2` outgoing requests
+ - `mongodb-core` version 1 - 3
+ - `redis` versions > 2.6
+ - `ioredis` versions > 2.6
+ - `mysql` version 1 - 3
+ - `mysql2` version 1 - 3
+ - `pg` version > 6
+ - `vue-server-renderer` version 2
+
+### Custom Tracing API
+
+The custom tracing API can be used to create custom trace spans. A span is a particular unit of work within a trace, such as an RPC request. Spans may be nested; the outermost span is called a root span, even if there are no nested child spans. Root spans typically correspond to incoming requests, while child spans typically correspond to outgoing requests, or other work that is triggered in response to incoming requests. This means that root spans shouldn't be created in a context where a root span already exists; a child span is more suitable here. Instead, root spans should be created to track work that happens outside of the request lifecycle entirely, such as periodically scheduled work. To illustrate:
+
+```js
+const io = require('@pm2/io').init({ tracing: true })
+const tracer = io.getTracer()
+// ...
+
+app.get('/:token', function (req, res) {
+ const token = req.params.token
+ // the '2' correspond to the type of operation you want to trace
+ // can be 0 (UNKNOWN), 1 (SERVER) or 2 (CLIENT)
+ // 'verifyToken' here will be the name of the operation
+ const customSpan = tracer.startChildSpan('verifyToken', 2)
+ // note that customSpan can be null if you are not inside a request
+ req.Token.verifyToken(token, (err, result) => {
+ if (err) {
+ // you can add tags to the span to attach more details to the span
+ customSpan.addAttribute('error', err.message)
+ customSpan.end()
+ return res.status(500).send('error')
+ }
+ customSpan.addAttribute('result', result)
+ // be sure to always .end() the spans
+ customSpan.end()
+ // redirect the user if the token is valid
+ res.send('/user/me')
+ })
+})
+
+// For any significant work done _outside_ of the request lifecycle, use
+// startRootSpan.
+const traceOptions = {
+ name: 'my custom trace',
+ // the '1' correspond to the type of operation you want to trace
+ // can be 0 (UNKNOWN), 1 (SERVER) or 2 (CLIENT)
+ kind: '1'
+ }
+plugin.tracer.startRootSpan(traceOptions, rootSpan => {
+ // ...
+ // Be sure to call rootSpan.end().
+ rootSpan.end()
+});
+```
+
+## Configuration
+
+### Global configuration object
+
+```javascript
+export class IOConfig {
+ /**
+ * Automatically catch unhandled errors
+ */
+ catchExceptions?: boolean = true
+ /**
+ * Configure the metrics to add automatically to your process
+ */
+ metrics?: {
+ eventLoop: boolean = true,
+ network: boolean = false,
+ http: boolean = true,
+ gc: boolean = true,
+ v8: boolean = true
+ }
+ /**
+ * Configure the default actions that you can run
+ */
+ actions?: {
+ eventLoopDump?: boolean = true
+ }
+ /**
+ * Configure availables profilers that will be exposed
+ */
+ profiling?: {
+ /**
+ * Toggle the CPU profiling actions
+ */
+ cpuJS: boolean = true
+ /**
+ * Toggle the heap snapshot actions
+ */
+ heapSnapshot: boolean = true
+ /**
+ * Toggle the heap sampling actions
+ */
+ heapSampling: boolean = true
+ /**
+ * Force a specific implementation of profiler
+ *
+ * available:
+ * - 'addon' (using the v8-profiler-node8 addon)
+ * - 'inspector' (using the "inspector" api from node core)
+ * - 'none' (disable the profilers)
+ * - 'both' (will try to use inspector and fallback on addon if available)
+ */
+ implementation: string = 'both'
+ }
+ /**
+ * Configure the transaction tracing options
+ */
+ tracing?: {
+ /**
+ * Enabled the distributed tracing feature.
+ */
+ enabled: boolean
+ /**
+ * If you want to report a specific service name
+ * the default is the same as in apmOptions
+ */
+ serviceName?: string
+ /**
+ * Generate trace for outgoing request that aren't connected to a incoming one
+ * default is false
+ */
+ outbound?: boolean
+ /**
+ * Determines the probability of a request to be traced. Ranges from 0.0 to 1.0
+ * default is 0.5
+ */
+ samplingRate?: number,
+ /**
+ * Add details about databases calls (redis, mongodb etc)
+ */
+ detailedDatabasesCalls?: boolean,
+ /**
+ * Ignore specific incoming request depending on their path
+ */
+ ignoreIncomingPaths?: Array>
+ /**
+ * Ignore specific outgoing request depending on their url
+ */
+ ignoreOutgoingUrls?: Array>
+ /**
+ * Set to true when wanting to create span for raw TCP connection
+ * instead of new http request
+ */
+ createSpanWithNet: boolean
+ }
+ /**
+ * If you want to connect to PM2 Enterprise without using PM2, you should enable
+ * the standalone mode
+ *
+ * default is false
+ */
+ standalone?: boolean = false
+ /**
+ * Define custom options for the standalone mode
+ */
+ apmOptions?: {
+ /**
+ * public key of the bucket to which the agent need to connect
+ */
+ publicKey: string
+ /**
+ * Secret key of the bucket to which the agent need to connect
+ */
+ secretKey: string
+ /**
+ * The name of the application/service that will be reported to PM2 Enterprise
+ */
+ appName: string
+ /**
+ * The name of the server as reported in PM2 Enterprise
+ *
+ * default is os.hostname()
+ */
+ serverName?: string
+ /**
+ * Broadcast all the logs from your application to our backend
+ */
+ sendLogs?: Boolean
+ /**
+ * Avoid to broadcast any logs from your application to our backend
+ * Even if the sendLogs option set to false, you can still see some logs
+ * when going to the log interface (it automatically trigger broacasting log)
+ */
+ disableLogs?: Boolean
+ /**
+ * Since logs can be forwared to our backend you may want to ignore specific
+ * logs (containing sensitive data for example)
+ */
+ logFilter?: string | RegExp
+ /**
+ * Proxy URI to use when reaching internet
+ * Supporting socks5,http,https,pac,socks4
+ * see https://github.com/TooTallNate/node-proxy-agent
+ *
+ * example: socks5://username:password@some-socks-proxy.com:9050
+ */
+ proxy?: string
+ }
+}
+```
+
+You can pass whatever options you want to `io.init`, it will automatically update its configuration.
+
+## Migration Guides
+
+### 2.x to 3.x
+
+Here the list of breaking changes :
+
+- Removed `io.scopedAction` because of low user adoption
+- Removed `io.notify` in favor of `io.notifyError` (droppin replacement)
+- Removed support for `gc-stats` module
+- Removed Heap profiling support when using the profiler addon (which wasn't possible at all)
+- Removed deep-metrics support (the module that allowed to get metrics about websocket/mongo out of the box), we are working on a better solution.
+- Removed `io.transpose`
+- Removed `io.probe()` to init metrics
+- **Changed the configuration structure**
+
+High chance that if you used a custom configuration for `io.init`, you need to change it to reflect the new configuration.
+Apart from that and the `io.notify` removal, it shouldn't break the way you instanciated metrics.
+If you find something else that breaks please report it to us (tech@keymetrics.io).
+
+### 3.x to 4.x
+
+The only difference with the 4.x version is the new tracing system put in place, so the only changs are related to it:
+
+- **Dropped the support for node 4** (you can still use the 3.x if you use node 4 but you will not have access to the distributed tracing)
+- **Changed the tracing configuration** (see options above)
+
+## Development
+
+To auto rebuild on file change:
+
+```bash
+$ npm install
+$ npm run watch
+```
+
+To test only one file:
+
+```bash
+$ npm run unit
+```
+
+Run transpilation + test + coverage:
+
+```bash
+$ npm run test
+```
+
+Run transpilation + test only:
+
+```bash
+$ npm run unit
+```
+
+## Notes
+
+Curently this package isn't compatible with `amqp` if you use the `network` metrics. We recommend to disable the metrics with the following configuration in this case :
+
+```javascript
+io.init({
+ metrics: {
+ network: false
+ }
+})
+```
diff --git a/node_modules/@pm2/io/build/main/configuration.d.ts b/node_modules/@pm2/io/build/main/configuration.d.ts
new file mode 100644
index 0000000..1212428
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/configuration.d.ts
@@ -0,0 +1,6 @@
+export default class Configuration {
+ static configureModule(opts: any): void;
+ static findPackageJson(): string | null | undefined;
+ static init(conf: any, doNotTellPm2?: any): any;
+ static getMain(): any;
+}
diff --git a/node_modules/@pm2/io/build/main/configuration.js b/node_modules/@pm2/io/build/main/configuration.js
new file mode 100644
index 0000000..6fd9793
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/configuration.js
@@ -0,0 +1,124 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const debug_1 = require("debug");
+const debug = (0, debug_1.default)('axm:configuration');
+const serviceManager_1 = require("./serviceManager");
+const autocast_1 = require("./utils/autocast");
+const path = require("path");
+const fs = require("fs");
+class Configuration {
+ static configureModule(opts) {
+ if (serviceManager_1.ServiceManager.get('transport'))
+ serviceManager_1.ServiceManager.get('transport').setOptions(opts);
+ }
+ static findPackageJson() {
+ try {
+ require.main = Configuration.getMain();
+ }
+ catch (_e) {
+ }
+ if (!require.main) {
+ return;
+ }
+ if (!require.main.paths) {
+ return;
+ }
+ let pkgPath = path.resolve(path.dirname(require.main.filename), 'package.json');
+ try {
+ fs.statSync(pkgPath);
+ }
+ catch (e) {
+ try {
+ pkgPath = path.resolve(path.dirname(require.main.filename), '..', 'package.json');
+ fs.statSync(pkgPath);
+ }
+ catch (e) {
+ debug('Cannot find package.json');
+ try {
+ pkgPath = path.resolve(path.dirname(require.main.filename), '..', '..', 'package.json');
+ fs.statSync(pkgPath);
+ }
+ catch (e) {
+ debug('Cannot find package.json');
+ return null;
+ }
+ }
+ return pkgPath;
+ }
+ return pkgPath;
+ }
+ static init(conf, doNotTellPm2) {
+ const packageFilepath = Configuration.findPackageJson();
+ let packageJson;
+ if (!conf.module_conf) {
+ conf.module_conf = {};
+ }
+ conf.apm = {
+ type: 'node',
+ version: null
+ };
+ try {
+ const prefix = __dirname.replace(/\\/g, '/').indexOf('/build/') >= 0 ? '../../' : '../';
+ const pkg = require(prefix + 'package.json');
+ conf.apm.version = pkg.version || null;
+ }
+ catch (err) {
+ debug('Failed to fetch current apm version: ', err.message);
+ }
+ if (conf.isModule === true) {
+ try {
+ packageJson = require(packageFilepath || '');
+ conf.module_version = packageJson.version;
+ conf.module_name = packageJson.name;
+ conf.description = packageJson.description;
+ if (packageJson.config) {
+ conf = Object.assign(conf, packageJson.config);
+ conf.module_conf = packageJson.config;
+ }
+ }
+ catch (e) {
+ throw new Error(e);
+ }
+ }
+ else {
+ conf.module_name = process.env.name || 'outside-pm2';
+ try {
+ packageJson = require(packageFilepath || '');
+ conf.module_version = packageJson.version;
+ if (packageJson.config) {
+ conf = Object.assign(conf, packageJson.config);
+ conf.module_conf = packageJson.config;
+ }
+ }
+ catch (e) {
+ debug(e.message);
+ }
+ }
+ try {
+ if (process.env[conf.module_name]) {
+ const castedConf = new autocast_1.default().autocast(JSON.parse(process.env[conf.module_name] || ''));
+ conf = Object.assign(conf, castedConf);
+ delete castedConf.probes;
+ conf.module_conf = JSON.parse(JSON.stringify(Object.assign(conf.module_conf, castedConf)));
+ Object.keys(conf.module_conf).forEach(function (key) {
+ if ((key === 'password' || key === 'passwd') &&
+ conf.module_conf[key].length >= 1) {
+ conf.module_conf[key] = 'Password hidden';
+ }
+ });
+ }
+ }
+ catch (e) {
+ debug(e);
+ }
+ if (doNotTellPm2 === true)
+ return conf;
+ Configuration.configureModule(conf);
+ return conf;
+ }
+ static getMain() {
+ return require.main || { filename: './somefile.js' };
+ }
+}
+exports.default = Configuration;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2V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DQUFDLENBQUE7UUFDbkMsT0FBTyxJQUFJLENBQUE7SUFDYixDQUFDO0lBRUQsTUFBTSxDQUFDLE9BQU87UUFDWixPQUFPLE9BQU8sQ0FBQyxJQUFJLElBQUksRUFBRSxRQUFRLEVBQUUsZUFBZSxFQUFFLENBQUE7SUFDdEQsQ0FBQztDQUNGO0FBcElELGdDQW9JQyJ9
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/constants.d.ts b/node_modules/@pm2/io/build/main/constants.d.ts
new file mode 100644
index 0000000..6bca8b2
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/constants.d.ts
@@ -0,0 +1,5 @@
+declare const _default: {
+ METRIC_INTERVAL: number;
+};
+export default _default;
+export declare function canUseInspector(): any;
diff --git a/node_modules/@pm2/io/build/main/constants.js b/node_modules/@pm2/io/build/main/constants.js
new file mode 100644
index 0000000..cd4f023
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/constants.js
@@ -0,0 +1,16 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.canUseInspector = void 0;
+const semver = require("semver");
+exports.default = {
+ METRIC_INTERVAL: 990
+};
+function canUseInspector() {
+ const isAboveNode10 = semver.satisfies(process.version, '>= 10.1.0');
+ const isAboveNode8 = semver.satisfies(process.version, '>= 8.0.0');
+ const canUseInNode8 = process.env.FORCE_INSPECTOR === '1'
+ || process.env.FORCE_INSPECTOR === 'true' || process.env.NODE_ENV === 'production';
+ return isAboveNode10 || (isAboveNode8 && canUseInNode8);
+}
+exports.canUseInspector = canUseInspector;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnN0YW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxpQ0FBZ0M7QUFFaEMsa0JBQWU7SUFDYixlQUFlLEVBQUUsR0FBRztDQUNyQixDQUFBO0FBRUQsU0FBZ0IsZUFBZTtJQUM3QixNQUFNLGFBQWEsR0FBRyxNQUFNLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxPQUFPLEVBQUUsV0FBVyxDQUFDLENBQUE7SUFDcEUsTUFBTSxZQUFZLEdBQUcsTUFBTSxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMsT0FBTyxFQUFFLFVBQVUsQ0FBQyxDQUFBO0lBQ2xFLE1BQU0sYUFBYSxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsZUFBZSxLQUFLLEdBQUc7V0FDcEQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxlQUFlLEtBQUssTUFBTSxJQUFJLE9BQU8sQ0FBQyxHQUFHLENBQUMsUUFBUSxLQUFLLFlBQVksQ0FBQTtJQUNwRixPQUFPLGFBQWEsSUFBSSxDQUFDLFlBQVksSUFBSSxhQUFhLENBQUMsQ0FBQTtBQUN6RCxDQUFDO0FBTkQsMENBTUMifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/featureManager.d.ts b/node_modules/@pm2/io/build/main/featureManager.d.ts
new file mode 100644
index 0000000..212c739
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/featureManager.d.ts
@@ -0,0 +1,14 @@
+import { IOConfig } from './pmx';
+export declare function getObjectAtPath(context: Object, path: string): any;
+export declare class FeatureManager {
+ private logger;
+ init(options: IOConfig): void;
+ get(name: string): Feature;
+ destroy(): void;
+}
+export declare class FeatureConfig {
+}
+export interface Feature {
+ init(config?: any): void;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/featureManager.js b/node_modules/@pm2/io/build/main/featureManager.js
new file mode 100644
index 0000000..5d41237
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/featureManager.js
@@ -0,0 +1,100 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.FeatureConfig = exports.FeatureManager = exports.getObjectAtPath = void 0;
+const notify_1 = require("./features/notify");
+const profiling_1 = require("./features/profiling");
+const events_1 = require("./features/events");
+const metrics_1 = require("./features/metrics");
+const dependencies_1 = require("./features/dependencies");
+const Debug = require("debug");
+function getObjectAtPath(context, path) {
+ if (path.indexOf('.') === -1 && path.indexOf('[') === -1) {
+ return context[path];
+ }
+ let crumbs = path.split(/\.|\[|\]/g);
+ let i = -1;
+ let len = crumbs.length;
+ let result;
+ while (++i < len) {
+ if (i === 0)
+ result = context;
+ if (!crumbs[i])
+ continue;
+ if (result === undefined)
+ break;
+ result = result[crumbs[i]];
+ }
+ return result;
+}
+exports.getObjectAtPath = getObjectAtPath;
+class AvailableFeature {
+}
+const availablesFeatures = [
+ {
+ name: 'notify',
+ optionsPath: '.',
+ module: notify_1.NotifyFeature
+ },
+ {
+ name: 'profiler',
+ optionsPath: 'profiling',
+ module: profiling_1.ProfilingFeature
+ },
+ {
+ name: 'events',
+ module: events_1.EventsFeature
+ },
+ {
+ name: 'metrics',
+ optionsPath: 'metrics',
+ module: metrics_1.MetricsFeature
+ },
+ {
+ name: 'dependencies',
+ module: dependencies_1.DependenciesFeature
+ }
+];
+class FeatureManager {
+ constructor() {
+ this.logger = Debug('axm:features');
+ }
+ init(options) {
+ for (let availableFeature of availablesFeatures) {
+ this.logger(`Creating feature ${availableFeature.name}`);
+ const feature = new availableFeature.module();
+ let config = undefined;
+ if (typeof availableFeature.optionsPath !== 'string') {
+ config = {};
+ }
+ else if (availableFeature.optionsPath === '.') {
+ config = options;
+ }
+ else {
+ config = getObjectAtPath(options, availableFeature.optionsPath);
+ }
+ this.logger(`Init feature ${availableFeature.name}`);
+ feature.init(config);
+ availableFeature.instance = feature;
+ }
+ }
+ get(name) {
+ const feature = availablesFeatures.find(feature => feature.name === name);
+ if (feature === undefined || feature.instance === undefined) {
+ throw new Error(`Tried to call feature ${name} which doesn't exist or wasn't initiated`);
+ }
+ return feature.instance;
+ }
+ destroy() {
+ for (let availableFeature of availablesFeatures) {
+ if (availableFeature.instance === undefined)
+ continue;
+ this.logger(`Destroy feature ${availableFeature.name}`);
+ availableFeature.instance.destroy();
+ }
+ }
+}
+exports.FeatureManager = FeatureManager;
+class FeatureConfig {
+}
+exports.FeatureConfig = FeatureConfig;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVhdHVyZU1hbmFnZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZmVhdHVyZU1hbmFnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsOENBQWlEO0FBQ2pELG9EQUF1RDtBQUN2RCw4Q0FBaUQ7QUFFakQsZ0RBQW1EO0FBQ25ELDBEQUE2RDtBQUM3RCwrQkFBOEI7QUFFOUIsU0FBZ0IsZUFBZSxDQUFFLE9BQWUsRUFBRSxJQUFZO0lBQzVELElBQUksSUFBSSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUMsSUFBSSxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLENBQUM7UUFDekQsT0FBTyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUE7SUFDdEIsQ0FBQztJQUVELElBQUksTUFBTSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsV0FBVyxDQUFDLENBQUE7SUFDcEMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUE7SUFDVixJQUFJLEdBQUcsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFBO0lBQ3ZCLElBQUksTUFBTSxDQUFBO0lBRVYsT0FBTyxFQUFFLENBQUMsR0FBRyxHQUFHLEVBQUUsQ0FBQztRQUNqQixJQUFJLENBQUMsS0FBSyxDQUFDO1lBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQTtRQUM3QixJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQztZQUFFL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FLLElBQUksZ0JBQWdCLElBQUksa0JBQWtCLEVBQUUsQ0FBQztZQUNoRCxJQUFJLGdCQUFnQixDQUFDLFFBQVEsS0FBSyxTQUFTO2dCQUFFLFNBQVE7WUFDckQsSUFBSSxDQUFDLE1BQU0sQ0FBQyxtQkFBbUIsZ0JBQWdCLENBQUMsSUFBSSxFQUFFLENBQUMsQ0FBQTtZQUN2RCxnQkFBZ0IsQ0FBQyxRQUFRLENBQUMsT0FBTyxFQUFFLENBQUE7UUFDckMsQ0FBQztJQUNILENBQUM7Q0FDRjtBQS9DRCx3Q0ErQ0M7QUFHRCxNQUFhLGFBQWE7Q0FBSTtBQUE5QixzQ0FBOEIifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/features/dependencies.d.ts b/node_modules/@pm2/io/build/main/features/dependencies.d.ts
new file mode 100644
index 0000000..d9cd061
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/dependencies.d.ts
@@ -0,0 +1,7 @@
+import { Feature } from '../featureManager';
+export declare class DependenciesFeature implements Feature {
+ private transport;
+ private logger;
+ init(): void;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/features/dependencies.js b/node_modules/@pm2/io/build/main/features/dependencies.js
new file mode 100644
index 0000000..6642bc7
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/dependencies.js
@@ -0,0 +1,46 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.DependenciesFeature = void 0;
+const serviceManager_1 = require("../serviceManager");
+const Debug = require("debug");
+const configuration_1 = require("../configuration");
+const fs_1 = require("fs");
+class DependenciesFeature {
+ constructor() {
+ this.logger = Debug('axm:features:dependencies');
+ }
+ init() {
+ this.transport = serviceManager_1.ServiceManager.get('transport');
+ this.logger('init');
+ const pkgPath = configuration_1.default.findPackageJson();
+ if (typeof pkgPath !== 'string')
+ return this.logger('failed to found pkg.json path');
+ this.logger(`found pkg.json in ${pkgPath}`);
+ (0, fs_1.readFile)(pkgPath, (err, data) => {
+ if (err)
+ return this.logger(`failed to read pkg.json`, err);
+ try {
+ const pkg = JSON.parse(data.toString());
+ if (typeof pkg.dependencies !== 'object') {
+ return this.logger(`failed to find deps in pkg.json`);
+ }
+ const dependencies = Object.keys(pkg.dependencies)
+ .reduce((list, name) => {
+ list[name] = { version: pkg.dependencies[name] };
+ return list;
+ }, {});
+ this.logger(`collected ${Object.keys(dependencies).length} dependencies`);
+ this.transport.send('application:dependencies', dependencies);
+ this.logger('sent dependencies list');
+ }
+ catch (err) {
+ return this.logger(`failed to parse pkg.json`, err);
+ }
+ });
+ }
+ destroy() {
+ this.logger('destroy');
+ }
+}
+exports.DependenciesFeature = DependenciesFeature;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVwZW5kZW5jaWVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2ZlYXR1cmVzL2RlcGVuZGVuY2llcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxzREFBa0Q7QUFDbEQsK0JBQThCO0FBRzlCLG9EQUE0QztBQUM1QywyQkFBNkI7QUFLN0IsTUFBYSxtQkFBbUI7SUFBaEM7UUFHVSxXQUFNLEdBQWEsS0FBSyxDQUFDLDJCQUEyQixDQUFDLENBQUE7SUFrQy9ELENBQUM7SUFoQ0MsSUFBSTtRQUNGLElBQUksQ0FBQyxTQUFTLEdBQUcsK0JBQWMsQ0FBQyxHQUFHLENBQUMsV0FBVyxDQUFDLENBQUE7UUFDaEQsSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQTtRQUVuQixNQUFNLE9BQU8sR0FBRyx1QkFBYSxDQUFDLGVBQWUsRUFBRSxDQUFBO1FBQy9DLElBQUksT0FBTyxPQUFPLEtBQUssUUFBUTtZQUFFLE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQywrQkFBK0IsQ0FBQyxDQU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DN0QsSUFBSSxDQUFDLE1BQU0sQ0FBQyx3QkFBd0IsQ0FBQyxDQUFBO1lBQ3ZDLENBQUM7WUFBQyxPQUFPLEdBQUcsRUFBRSxDQUFDO2dCQUNiLE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQywwQkFBMEIsRUFBRSxHQUFHLENBQUMsQ0FBQTtZQUNyRCxDQUFDO1FBQ0gsQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0lBRUQsT0FBTztRQUNMLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLENBQUE7SUFDeEIsQ0FBQztDQUNGO0FBckNELGtEQXFDQyJ9
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/features/entrypoint.d.ts b/node_modules/@pm2/io/build/main/features/entrypoint.d.ts
new file mode 100644
index 0000000..47d03f4
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/entrypoint.d.ts
@@ -0,0 +1,11 @@
+import { IOConfig } from '../pmx';
+export declare class Entrypoint {
+ private io;
+ constructor();
+ events(): void;
+ sensors(): void;
+ actuators(): void;
+ onStart(cb: Function): void;
+ onStop(err: Error, cb: Function, code: number, signal: string): any;
+ conf(): IOConfig | undefined;
+}
diff --git a/node_modules/@pm2/io/build/main/features/entrypoint.js b/node_modules/@pm2/io/build/main/features/entrypoint.js
new file mode 100644
index 0000000..730ec57
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/entrypoint.js
@@ -0,0 +1,53 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Entrypoint = void 0;
+const IO_KEY = Symbol.for('@pm2/io');
+class Entrypoint {
+ constructor() {
+ try {
+ this.io = global[IO_KEY].init(this.conf());
+ this.onStart(err => {
+ if (err) {
+ console.error(err);
+ process.exit(1);
+ }
+ this.sensors();
+ this.events();
+ this.actuators();
+ this.io.onExit((code, signal) => {
+ this.onStop(err, () => {
+ this.io.destroy();
+ }, code, signal);
+ });
+ if (process && process.send)
+ process.send('ready');
+ });
+ }
+ catch (e) {
+ if (this.io) {
+ this.io.destroy();
+ }
+ throw (e);
+ }
+ }
+ events() {
+ return;
+ }
+ sensors() {
+ return;
+ }
+ actuators() {
+ return;
+ }
+ onStart(cb) {
+ throw new Error('Entrypoint onStart() not specified');
+ }
+ onStop(err, cb, code, signal) {
+ return cb();
+ }
+ conf() {
+ return undefined;
+ }
+}
+exports.Entrypoint = Entrypoint;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50cnlwb2ludC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9mZWF0dXJlcy9lbnRyeXBvaW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBLE1BQU0sTUFBTSxHQUFHLE1BQU0sQ0FBQyxHQUFHLENBQUMsU0FBUyxDQUFDLENBQUE7QUFFcEMsTUFBYSxVQUFVO0lBR3JCO1FBQ0UsSUFBSSxDQUFDO1lBQ0gsSUFBSSxDQUFDLEVBQUUsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFBO1lBRTFDLElBQUksQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUU7Z0JBQ2pCLElBQUksR0FBRyxFQUFFLENBQUM7b0JBQ1IsT0FBTyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQTtvQkFDbEIsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQTtnQkFDakIsQ0FBQztnQkFFRCxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUE7Z0JBQ2QsSUFBSSxDQUFDLE1BQU0sRUFBRSxDQUFBO2dCQUNiLElBQUksQ0FBQyxTQUFTLEVBQUUsQ0FBQTtnQkFFaEIsSUFBSSxDQUFDLEVBQUUsQ0FBQyxNQUFN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a/node_modules/@pm2/io/build/main/features/events.d.ts b/node_modules/@pm2/io/build/main/features/events.d.ts
new file mode 100644
index 0000000..70241b4
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/events.d.ts
@@ -0,0 +1,8 @@
+import { Feature } from '../featureManager';
+export declare class EventsFeature implements Feature {
+ private transport;
+ private logger;
+ init(): void;
+ emit(name?: string, data?: any): any;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/features/events.js b/node_modules/@pm2/io/build/main/features/events.js
new file mode 100644
index 0000000..a772085
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/events.js
@@ -0,0 +1,45 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.EventsFeature = void 0;
+const serviceManager_1 = require("../serviceManager");
+const Debug = require("debug");
+class EventsFeature {
+ constructor() {
+ this.logger = Debug('axm:features:events');
+ }
+ init() {
+ this.transport = serviceManager_1.ServiceManager.get('transport');
+ this.logger('init');
+ }
+ emit(name, data) {
+ if (typeof name !== 'string') {
+ console.error('event name must be a string');
+ return console.trace();
+ }
+ if (typeof data !== 'object') {
+ console.error('event data must be an object');
+ return console.trace();
+ }
+ if (data instanceof Array) {
+ console.error(`event data cannot be an array`);
+ return console.trace();
+ }
+ let inflightObj = {};
+ try {
+ inflightObj = JSON.parse(JSON.stringify(data));
+ }
+ catch (err) {
+ return console.log('Failed to serialize the event data', err.message);
+ }
+ inflightObj.__name = name;
+ if (this.transport === undefined) {
+ return this.logger('Failed to send event as transporter isnt available');
+ }
+ this.transport.send('human:event', inflightObj);
+ }
+ destroy() {
+ this.logger('destroy');
+ }
+}
+exports.EventsFeature = EventsFeature;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2ZlYXR1cmVzL2V2ZW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdz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csRUFBRSxDQUFDO1lBQ2IsT0FBTyxPQUFPLENBQUMsR0FBRyxDQUFDLG9DQUFvQyxFQUFFLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQTtRQUN2RSxDQUFDO1FBRUQsV0FBVyxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUE7UUFDekIsSUFBSSxJQUFJLENBQUMsU0FBUyxLQUFLLFNBQVMsRUFBRSxDQUFDO1lBQ2pDLE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxvREFBb0QsQ0FBQyxDQUFBO1FBQzFFLENBQUM7UUFDRCxJQUFJLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxhQUFhLEVBQUUsV0FBVyxDQUFDLENBQUE7SUFDakQsQ0FBQztJQUVELE9BQU87UUFDTCxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFBO0lBQ3hCLENBQUM7Q0FDRjtBQXpDRCxzQ0F5Q0MifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/features/metrics.d.ts b/node_modules/@pm2/io/build/main/features/metrics.d.ts
new file mode 100644
index 0000000..f72cbcb
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/metrics.d.ts
@@ -0,0 +1,24 @@
+import { Feature } from '../featureManager';
+import { EventLoopMetricOption } from '../metrics/eventLoopMetrics';
+import { NetworkTrafficConfig } from '../metrics/network';
+import { HttpMetricsConfig } from '../metrics/httpMetrics';
+import { V8MetricsConfig } from '../metrics/v8';
+import { RuntimeMetricsOptions } from '../metrics/runtime';
+export declare const defaultMetricConf: MetricConfig;
+export declare class MetricConfig {
+ v8?: V8MetricsConfig | boolean;
+ runtime?: RuntimeMetricsOptions | boolean;
+ http?: HttpMetricsConfig | boolean;
+ network?: NetworkTrafficConfig | boolean;
+ eventLoop?: EventLoopMetricOption | boolean;
+}
+export interface MetricInterface {
+ init(config?: Object | boolean): void;
+ destroy(): void;
+}
+export declare class MetricsFeature implements Feature {
+ private logger;
+ init(options?: Object): void;
+ get(name: string): MetricInterface | undefined;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/features/metrics.js b/node_modules/@pm2/io/build/main/features/metrics.js
new file mode 100644
index 0000000..b102ca0
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/metrics.js
@@ -0,0 +1,90 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.MetricsFeature = exports.MetricConfig = exports.defaultMetricConf = void 0;
+const debug_1 = require("debug");
+const featureManager_1 = require("../featureManager");
+const eventLoopMetrics_1 = require("../metrics/eventLoopMetrics");
+const network_1 = require("../metrics/network");
+const httpMetrics_1 = require("../metrics/httpMetrics");
+const v8_1 = require("../metrics/v8");
+const runtime_1 = require("../metrics/runtime");
+exports.defaultMetricConf = {
+ eventLoop: true,
+ network: false,
+ http: true,
+ runtime: true,
+ v8: true
+};
+class MetricConfig {
+}
+exports.MetricConfig = MetricConfig;
+class AvailableMetric {
+}
+const availableMetrics = [
+ {
+ name: 'eventloop',
+ module: eventLoopMetrics_1.default,
+ optionsPath: 'eventLoop'
+ },
+ {
+ name: 'http',
+ module: httpMetrics_1.default,
+ optionsPath: 'http'
+ },
+ {
+ name: 'network',
+ module: network_1.default,
+ optionsPath: 'network'
+ },
+ {
+ name: 'v8',
+ module: v8_1.default,
+ optionsPath: 'v8'
+ },
+ {
+ name: 'runtime',
+ module: runtime_1.default,
+ optionsPath: 'runtime'
+ }
+];
+class MetricsFeature {
+ constructor() {
+ this.logger = (0, debug_1.default)('axm:features:metrics');
+ }
+ init(options) {
+ if (typeof options !== 'object')
+ options = {};
+ this.logger('init');
+ for (let availableMetric of availableMetrics) {
+ const metric = new availableMetric.module();
+ let config = undefined;
+ if (typeof availableMetric.optionsPath !== 'string') {
+ config = {};
+ }
+ else if (availableMetric.optionsPath === '.') {
+ config = options;
+ }
+ else {
+ config = (0, featureManager_1.getObjectAtPath)(options, availableMetric.optionsPath);
+ }
+ metric.init(config);
+ availableMetric.instance = metric;
+ }
+ }
+ get(name) {
+ const metric = availableMetrics.find(metric => metric.name === name);
+ if (metric === undefined)
+ return undefined;
+ return metric.instance;
+ }
+ destroy() {
+ this.logger('destroy');
+ for (let availableMetric of availableMetrics) {
+ if (availableMetric.instance === undefined)
+ continue;
+ availableMetric.instance.destroy();
+ }
+ }
+}
+exports.MetricsFeature = MetricsFeature;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0cmljcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9mZWF0dXJlcy9tZXRyaWNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlDQUF5QjtBQUN6QixzREFBNEQ7QUFDNUQsa0VBQW1HO0FBQ25HLGdEQUF3RTtBQUN4RSx3REFBdUU7QUFDdkUsc0NBQXlEO0FBQ3pELGdEQUEwRTtBQUU3RCxRQUFBLGlCQUFpQixHQUFpQjtJQUM3QyxTQUFTLEVBQUUsSUFBSTtJQUNmLE9BQU8sRUFBRSxLQUFLO0lBQ2QsSUFBSSxFQUFFLElBQUk7SUFDVixPQUFPLEVBQUUsSUFBSTtJQUNiLEVBQUUsRUFBRSxJQUFJO0NBQ1QsQ0FBQTtBQUVELE1BQWEsWUFBWTtDQXVCeEI7QUF2QkQsb0NBdUJDO0FBRUQsTUFBTSxlQUFlO0NBcUJwQjtBQUVELE1BQU0sZ0JBQWdCLEdBQXNCO0lBQzFDO1FBQ0UsSUFBSSxFQUFFLFdBQVc7UUFDakIsTUFBTSxFQUFFLDBCQUE4QjtRQUN0QyxXQUFXLEVBQUUsV0FBVztLQUN6QjtJQUNEO1FBQ0UsSUFBSSxFQUFFLE1BQU07UUFDWixNQUFNLEVBQUUscUJBQVc7UUFDbkIsV0FBVyxFQUFFLE1BQU07S0FDcEI7SUFDRDtRQUNFLElBQUksRUFBRSxTQUFTO1FBQ2YsTUFBTSxFQUF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2hFLENBQUM7WUFJRCxNQUFNLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFBO1lBQ25CLGVBQWUsQ0FBQyxRQUFRLEdBQUcsTUFBTSxDQUFBO1FBQ25DLENBQUM7SUFDSCxDQUFDO0lBRUQsR0FBRyxDQUFFLElBQVk7UUFDZixNQUFNLE1BQU0sR0FBRyxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxNQUFNLENBQUMsSUFBSSxLQUFLLElBQUksQ0FBQyxDQUFBO1FBQ3BFLElBQUksTUFBTSxLQUFLLFNBQVM7WUFBRSxPQUFPLFNBQVMsQ0FBQTtRQUMxQyxPQUFPLE1BQU0sQ0FBQyxRQUFRLENBQUE7SUFDeEIsQ0FBQztJQUVELE9BQU87UUFDTCxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFBO1FBQ3RCLEtBQUssSUFBSSxlQUFlLElBQUksZ0JBQWdCLEVBQUUsQ0FBQztZQUM3QyxJQUFJLGVBQWUsQ0FBQyxRQUFRLEtBQUssU0FBUztnQkFBRSxTQUFRO1lBQ3BELGVBQWUsQ0FBQyxRQUFRLENBQUMsT0FBTyxFQUFFLENBQUE7UUFDcEMsQ0FBQztJQUNILENBQUM7Q0FDRjtBQXZDRCx3Q0F1Q0MifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/features/notify.d.ts b/node_modules/@pm2/io/build/main/features/notify.d.ts
new file mode 100644
index 0000000..79556a8
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/notify.d.ts
@@ -0,0 +1,23 @@
+import { Feature } from '../featureManager';
+export declare class NotifyOptions {
+ catchExceptions: boolean;
+}
+export declare class ErrorContext {
+ http?: Object;
+ custom?: Object;
+}
+export declare class NotifyFeature implements Feature {
+ private logger;
+ private transport;
+ private cache;
+ private stackParser;
+ init(options?: NotifyOptions): any;
+ destroy(): void;
+ getSafeError(err: any): Error;
+ notifyError(err: Error | string | {}, context?: ErrorContext): any;
+ private onUncaughtException;
+ private onUnhandledRejection;
+ private catchAll;
+ expressErrorHandler(): (err: any, req: any, res: any, next: any) => any;
+ koaErrorHandler(): (ctx: any, next: any) => Promise;
+}
diff --git a/node_modules/@pm2/io/build/main/features/notify.js b/node_modules/@pm2/io/build/main/features/notify.js
new file mode 100644
index 0000000..c80c2b7
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/notify.js
@@ -0,0 +1,225 @@
+'use strict';
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.NotifyFeature = exports.ErrorContext = exports.NotifyOptions = void 0;
+const tslib_1 = require("tslib");
+const configuration_1 = require("../configuration");
+const serviceManager_1 = require("../serviceManager");
+const debug_1 = require("debug");
+const semver = require("semver");
+const stackParser_1 = require("../utils/stackParser");
+const fs = require("fs");
+const path = require("path");
+class NotifyOptions {
+}
+exports.NotifyOptions = NotifyOptions;
+class ErrorContext {
+}
+exports.ErrorContext = ErrorContext;
+const optionsDefault = {
+ catchExceptions: true
+};
+class NotifyFeature {
+ constructor() {
+ this.logger = (0, debug_1.default)('axm:features:notify');
+ }
+ init(options) {
+ if (options === undefined) {
+ options = optionsDefault;
+ }
+ this.logger('init');
+ this.transport = serviceManager_1.ServiceManager.get('transport');
+ if (this.transport === undefined) {
+ return this.logger(`Failed to load transporter service`);
+ }
+ configuration_1.default.configureModule({
+ error: true
+ });
+ if (options.catchExceptions === false)
+ return;
+ this.logger('Registering hook to catch unhandled exception/rejection');
+ this.cache = new stackParser_1.Cache({
+ miss: (key) => {
+ try {
+ const content = fs.readFileSync(path.resolve(key));
+ return content.toString().split(/\r?\n/);
+ }
+ catch (err) {
+ this.logger('Error while trying to get file from FS : %s', err.message || err);
+ return null;
+ }
+ },
+ ttl: 30 * 60
+ });
+ this.stackParser = new stackParser_1.StackTraceParser({
+ cache: this.cache,
+ contextSize: 5
+ });
+ this.catchAll();
+ }
+ destroy() {
+ process.removeListener('uncaughtException', this.onUncaughtException);
+ process.removeListener('unhandledRejection', this.onUnhandledRejection);
+ this.logger('destroy');
+ }
+ getSafeError(err) {
+ if (err instanceof Error)
+ return err;
+ let message;
+ try {
+ message = `Non-error value: ${JSON.stringify(err)}`;
+ }
+ catch (e) {
+ try {
+ message = `Unserializable non-error value: ${String(e)}`;
+ }
+ catch (e2) {
+ message = `Unserializable non-error value that cannot be converted to a string`;
+ }
+ }
+ if (message.length > 1000)
+ message = message.substr(0, 1000) + '...';
+ return new Error(message);
+ }
+ notifyError(err, context) {
+ if (typeof context !== 'object') {
+ context = {};
+ }
+ if (this.transport === undefined) {
+ return this.logger(`Tried to send error without having transporter available`);
+ }
+ const safeError = this.getSafeError(err);
+ let stackContext = null;
+ if (err instanceof Error) {
+ stackContext = this.stackParser.retrieveContext(err);
+ }
+ const payload = Object.assign({
+ message: safeError.message,
+ stack: safeError.stack,
+ name: safeError.name,
+ metadata: context
+ }, stackContext === null ? {} : stackContext);
+ return this.transport.send('process:exception', payload);
+ }
+ onUncaughtException(error) {
+ if (semver.satisfies(process.version, '< 6')) {
+ console.error(error.stack);
+ }
+ else {
+ console.error(error);
+ }
+ const safeError = this.getSafeError(error);
+ let stackContext = null;
+ if (error instanceof Error) {
+ stackContext = this.stackParser.retrieveContext(error);
+ }
+ const payload = Object.assign({
+ message: safeError.message,
+ stack: safeError.stack,
+ name: safeError.name
+ }, stackContext === null ? {} : stackContext);
+ if (serviceManager_1.ServiceManager.get('transport')) {
+ serviceManager_1.ServiceManager.get('transport').send('process:exception', payload);
+ }
+ if (process.listeners('uncaughtException').length === 1) {
+ process.exit(1);
+ }
+ }
+ onUnhandledRejection(error) {
+ if (error === undefined)
+ return;
+ console.error(error);
+ const safeError = this.getSafeError(error);
+ let stackContext = null;
+ if (error instanceof Error) {
+ stackContext = this.stackParser.retrieveContext(error);
+ }
+ const payload = Object.assign({
+ message: safeError.message,
+ stack: safeError.stack,
+ name: safeError.name
+ }, stackContext === null ? {} : stackContext);
+ if (serviceManager_1.ServiceManager.get('transport')) {
+ serviceManager_1.ServiceManager.get('transport').send('process:exception', payload);
+ }
+ }
+ catchAll() {
+ if (process.env.exec_mode === 'cluster_mode') {
+ return false;
+ }
+ process.on('uncaughtException', this.onUncaughtException.bind(this));
+ process.on('unhandledRejection', this.onUnhandledRejection.bind(this));
+ }
+ expressErrorHandler() {
+ const self = this;
+ configuration_1.default.configureModule({
+ error: true
+ });
+ return function errorHandler(err, req, res, next) {
+ const safeError = self.getSafeError(err);
+ const payload = {
+ message: safeError.message,
+ stack: safeError.stack,
+ name: safeError.name,
+ metadata: {
+ http: {
+ url: req.url,
+ params: req.params,
+ method: req.method,
+ query: req.query,
+ body: req.body,
+ path: req.path,
+ route: req.route && req.route.path ? req.route.path : undefined
+ },
+ custom: {
+ user: typeof req.user === 'object' ? req.user.id : undefined
+ }
+ }
+ };
+ if (serviceManager_1.ServiceManager.get('transport')) {
+ serviceManager_1.ServiceManager.get('transport').send('process:exception', payload);
+ }
+ return next(err);
+ };
+ }
+ koaErrorHandler() {
+ const self = this;
+ configuration_1.default.configureModule({
+ error: true
+ });
+ return function (ctx, next) {
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
+ try {
+ yield next();
+ }
+ catch (err) {
+ const safeError = self.getSafeError(err);
+ const payload = {
+ message: safeError.message,
+ stack: safeError.stack,
+ name: safeError.name,
+ metadata: {
+ http: {
+ url: ctx.request.url,
+ params: ctx.params,
+ method: ctx.request.method,
+ query: ctx.request.query,
+ body: ctx.request.body,
+ path: ctx.request.path,
+ route: ctx._matchedRoute
+ },
+ custom: {
+ user: typeof ctx.user === 'object' ? ctx.user.id : undefined
+ }
+ }
+ };
+ if (serviceManager_1.ServiceManager.get('transport')) {
+ serviceManager_1.ServiceManager.get('transport').send('process:exception', payload);
+ }
+ throw err;
+ }
+ });
+ };
+ }
+}
+exports.NotifyFeature = NotifyFeature;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90aWZ5LmpzIiwic291c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R0FBRyxDQUFDLE9BQU8sQ0FBQyxLQUFLO2dDQUN4QixJQUFJLEVBQUUsR0FBRyxDQUFDLE9BQU8sQ0FBQyxJQUFJO2dDQUN0QixJQUFJLEVBQUUsR0FBRyxDQUFDLE9BQU8sQ0FBQyxJQUFJO2dDQUN0QixLQUFLLEVBQUUsR0FBRyxDQUFDLGFBQWE7NkJBQ3pCOzRCQUNELE1BQU0sRUFBRTtnQ0FDTixJQUFJLEVBQUUsT0FBTyxHQUFHLENBQUMsSUFBSSxLQUFLLFFBQVEsQ0FBQyxDQUFDLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFNBQVM7NkJBQzdEO3lCQUNGO3FCQUNGLENBQUE7b0JBQ0QsSUFBSSwrQkFBYyxDQUFDLEdBQUcsQ0FBQyxXQUFXLENBQUMsRUFBRSxDQUFDO3dCQUNwQywrQkFBYyxDQUFDLEdBQUcsQ0FBQyxXQUFXLENBQUMsQ0FBQyxJQUFJLENBQUMsbUJBQW1CLEVBQUUsT0FBTyxDQUFDLENBQUE7b0JBQ3BFLENBQUM7b0JBQ0QsTUFBTSxHQUFHLENBQUE7Z0JBQ1gsQ0FBQztZQUNILENBQUM7U0FBQSxDQUFBO0lBQ0gsQ0FBQztDQUNGO0FBdk9ELHNDQXVPQyJ9
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/features/profiling.d.ts b/node_modules/@pm2/io/build/main/features/profiling.d.ts
new file mode 100644
index 0000000..b591467
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/profiling.d.ts
@@ -0,0 +1,18 @@
+import { Feature } from '../featureManager';
+export interface ProfilerType {
+ init(): void;
+ register(): void;
+ destroy(): void;
+}
+export declare class ProfilingConfig {
+ cpuJS: boolean;
+ heapSnapshot: boolean;
+ heapSampling: boolean;
+ implementation?: string;
+}
+export declare class ProfilingFeature implements Feature {
+ private profiler;
+ private logger;
+ init(config?: ProfilingConfig | boolean): any;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/features/profiling.js b/node_modules/@pm2/io/build/main/features/profiling.js
new file mode 100644
index 0000000..5bfd475
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/features/profiling.js
@@ -0,0 +1,69 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ProfilingFeature = exports.ProfilingConfig = void 0;
+const addonProfiler_1 = require("../profilers/addonProfiler");
+const inspectorProfiler_1 = require("../profilers/inspectorProfiler");
+const constants_1 = require("../constants");
+const Debug = require("debug");
+class ProfilingConfig {
+}
+exports.ProfilingConfig = ProfilingConfig;
+const defaultProfilingConfig = {
+ cpuJS: true,
+ heapSnapshot: true,
+ heapSampling: true,
+ implementation: 'both'
+};
+const disabledProfilingConfig = {
+ cpuJS: false,
+ heapSnapshot: false,
+ heapSampling: false,
+ implementation: 'none'
+};
+class ProfilingFeature {
+ constructor() {
+ this.logger = Debug('axm:features:profiling');
+ }
+ init(config) {
+ if (config === true) {
+ config = defaultProfilingConfig;
+ }
+ else if (config === false) {
+ config = disabledProfilingConfig;
+ }
+ else if (config === undefined) {
+ config = defaultProfilingConfig;
+ }
+ if (process.env.PM2_PROFILING_FORCE_FALLBACK === 'true') {
+ config.implementation = 'addon';
+ }
+ if (config.implementation === undefined || config.implementation === 'both') {
+ config.implementation = (0, constants_1.canUseInspector)() === true ? 'inspector' : 'addon';
+ }
+ switch (config.implementation) {
+ case 'inspector': {
+ this.logger('using inspector implementation');
+ this.profiler = new inspectorProfiler_1.default();
+ break;
+ }
+ case 'addon': {
+ this.logger('using addon implementation');
+ this.profiler = new addonProfiler_1.default();
+ break;
+ }
+ default: {
+ return this.logger(`Invalid profiler implementation choosen: ${config.implementation}`);
+ }
+ }
+ this.logger('init');
+ this.profiler.init();
+ }
+ destroy() {
+ this.logger('destroy');
+ if (this.profiler === undefined)
+ return;
+ this.profiler.destroy();
+ }
+}
+exports.ProfilingFeature = ProfilingFeature;
+//# sourceMappingURL=data:application/json;base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sSUFBSSxFQUFFLENBQUE7SUFDdEIsQ0FBQztJQUVELE9BQU87UUFDTCxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFBO1FBQ3RCLElBQUksSUFBSSxDQUFDLFFBQVEsS0FBSyxTQUFTO1lBQUUsT0FBTTtRQUN2QyxJQUFJLENBQUMsUUFBUSxDQUFDLE9BQU8sRUFBRSxDQUFBO0lBQ3pCLENBQUM7Q0FDRjtBQS9DRCw0Q0ErQ0MifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/index.d.ts b/node_modules/@pm2/io/build/main/index.d.ts
new file mode 100644
index 0000000..0f1ea79
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/index.d.ts
@@ -0,0 +1,3 @@
+import PMX from './pmx';
+declare const io: PMX;
+export = io;
diff --git a/node_modules/@pm2/io/build/main/index.js b/node_modules/@pm2/io/build/main/index.js
new file mode 100644
index 0000000..9fe2071
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/index.js
@@ -0,0 +1,8 @@
+"use strict";
+const pmx_1 = require("./pmx");
+const IO_KEY = Symbol.for('@pm2/io');
+const isAlreadyHere = (Object.getOwnPropertySymbols(global).indexOf(IO_KEY) > -1);
+const io = isAlreadyHere ? global[IO_KEY] : new pmx_1.default().init();
+global[IO_KEY] = io;
+module.exports = io;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLCtCQUF1QjtBQUV2QixNQUFNLE1BQU0sR0FBRyxNQUFNLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxDQUFBO0FBQ3BDLE1BQU0sYUFBYSxHQUFHLENBQUMsTUFBTSxDQUFDLHFCQUFxQixDQUFDLE1BQU0sQ0FBQyxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFBO0FBRWpGLE1BQU0sRUFBRSxHQUFRLGFBQWEsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBUSxDQUFDLENBQUMsQ0FBQyxJQUFJLGFBQUcsRUFBRSxDQUFDLElBQUksRUFBRSxDQUFBO0FBQ3hFLE1BQU0sQ0FBQyxNQUFNLENBQUMsR0FBRyxFQUFFLENBQUE7QUFFbkIsaUJBQVMsRUFBRSxDQUFBIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/metrics/eventLoopMetrics.d.ts b/node_modules/@pm2/io/build/main/metrics/eventLoopMetrics.d.ts
new file mode 100644
index 0000000..665341e
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/metrics/eventLoopMetrics.d.ts
@@ -0,0 +1,17 @@
+import { MetricInterface } from '../features/metrics';
+export declare class EventLoopMetricOption {
+ eventLoopActive: boolean;
+ eventLoopDelay: boolean;
+}
+export default class EventLoopHandlesRequestsMetric implements MetricInterface {
+ private metricService;
+ private logger;
+ private requestTimer;
+ private handleTimer;
+ private delayTimer;
+ private delayLoopInterval;
+ private runtimeStatsService;
+ private handle;
+ init(config?: EventLoopMetricOption | boolean): any;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/metrics/eventLoopMetrics.js b/node_modules/@pm2/io/build/main/metrics/eventLoopMetrics.js
new file mode 100644
index 0000000..0c9a680
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/metrics/eventLoopMetrics.js
@@ -0,0 +1,129 @@
+'use strict';
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.EventLoopMetricOption = void 0;
+const metrics_1 = require("../services/metrics");
+const serviceManager_1 = require("../serviceManager");
+const Debug = require("debug");
+const histogram_1 = require("../utils/metrics/histogram");
+class EventLoopMetricOption {
+}
+exports.EventLoopMetricOption = EventLoopMetricOption;
+const defaultOptions = {
+ eventLoopActive: true,
+ eventLoopDelay: true
+};
+class EventLoopHandlesRequestsMetric {
+ constructor() {
+ this.logger = Debug('axm:features:metrics:eventloop');
+ this.delayLoopInterval = 1000;
+ }
+ init(config) {
+ if (config === false)
+ return;
+ if (config === undefined) {
+ config = defaultOptions;
+ }
+ if (config === true) {
+ config = defaultOptions;
+ }
+ this.metricService = serviceManager_1.ServiceManager.get('metrics');
+ if (this.metricService === undefined)
+ return this.logger('Failed to load metric service');
+ this.logger('init');
+ if (typeof process._getActiveRequests === 'function' && config.eventLoopActive === true) {
+ const requestMetric = this.metricService.metric({
+ name: 'Active requests',
+ id: 'internal/libuv/requests',
+ historic: true
+ });
+ this.requestTimer = setInterval(_ => {
+ requestMetric.set(process._getActiveRequests().length);
+ }, 1000);
+ this.requestTimer.unref();
+ }
+ if (typeof process._getActiveHandles === 'function' && config.eventLoopActive === true) {
+ const handleMetric = this.metricService.metric({
+ name: 'Active handles',
+ id: 'internal/libuv/handles',
+ historic: true
+ });
+ this.handleTimer = setInterval(_ => {
+ handleMetric.set(process._getActiveHandles().length);
+ }, 1000);
+ this.handleTimer.unref();
+ }
+ if (config.eventLoopDelay === false)
+ return;
+ const histogram = new histogram_1.default();
+ const uvLatencyp50 = {
+ name: 'Event Loop Latency',
+ id: 'internal/libuv/latency/p50',
+ type: metrics_1.MetricType.histogram,
+ historic: true,
+ implementation: histogram,
+ handler: function () {
+ const percentiles = this.implementation.percentiles([0.5]);
+ if (percentiles[0.5] === null)
+ return null;
+ return percentiles[0.5].toFixed(2);
+ },
+ unit: 'ms'
+ };
+ const uvLatencyp95 = {
+ name: 'Event Loop Latency p95',
+ id: 'internal/libuv/latency/p95',
+ type: metrics_1.MetricType.histogram,
+ historic: true,
+ implementation: histogram,
+ handler: function () {
+ const percentiles = this.implementation.percentiles([0.95]);
+ if (percentiles[0.95] === null)
+ return null;
+ return percentiles[0.95].toFixed(2);
+ },
+ unit: 'ms'
+ };
+ this.metricService.registerMetric(uvLatencyp50);
+ this.metricService.registerMetric(uvLatencyp95);
+ this.runtimeStatsService = serviceManager_1.ServiceManager.get('runtimeStats');
+ if (this.runtimeStatsService === undefined) {
+ this.logger('runtimeStats module not found, fallbacking into pure js method');
+ let oldTime = process.hrtime();
+ this.delayTimer = setInterval(() => {
+ const newTime = process.hrtime();
+ const delay = (newTime[0] - oldTime[0]) * 1e3 + (newTime[1] - oldTime[1]) / 1e6 - this.delayLoopInterval;
+ oldTime = newTime;
+ histogram.update(delay);
+ }, this.delayLoopInterval);
+ this.delayTimer.unref();
+ }
+ else {
+ this.logger('using runtimeStats module as data source for event loop latency');
+ this.handle = (stats) => {
+ if (typeof stats !== 'object' || !Array.isArray(stats.ticks))
+ return;
+ stats.ticks.forEach((tick) => {
+ histogram.update(tick);
+ });
+ };
+ this.runtimeStatsService.on('data', this.handle);
+ }
+ }
+ destroy() {
+ if (this.requestTimer !== undefined) {
+ clearInterval(this.requestTimer);
+ }
+ if (this.handleTimer !== undefined) {
+ clearInterval(this.handleTimer);
+ }
+ if (this.delayTimer !== undefined) {
+ clearInterval(this.delayTimer);
+ }
+ if (this.runtimeStatsService !== undefined) {
+ this.runtimeStatsService.removeListener('data', this.handle);
+ }
+ this.logger('destroy');
+ }
+}
+exports.default = EventLoopHandlesRequestsMetric;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRMb29wTWV0cmljcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tZXRyaWNzL2V2ZW50TG9vcE1ldHJpY3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFBWSxDQUFBOzs7QUFFWixpREFBK0U7QUFDL0Usc0RBQWtEO0FBQ2xELCtCQUE4QjtBQUU5QiwwREFBa0Q7QUFHbEQsTUFBYSxxQkFBcUI7Q0FXakM7QUFYRCxzREFXQztBQUVELE1BQU0sY0FBYyxHQUEwQjtJQUM1QyxlQUFlLEVBQUUsSUF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CxpREF3SEMifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/metrics/httpMetrics.d.ts b/node_modules/@pm2/io/build/main/metrics/httpMetrics.d.ts
new file mode 100644
index 0000000..eba1ff1
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/metrics/httpMetrics.d.ts
@@ -0,0 +1,18 @@
+import { MetricInterface } from '../features/metrics';
+export declare class HttpMetricsConfig {
+ http: boolean;
+}
+export default class HttpMetrics implements MetricInterface {
+ private defaultConf;
+ private metrics;
+ private logger;
+ private metricService;
+ private modules;
+ private hooks;
+ init(config?: HttpMetricsConfig | boolean): any;
+ private registerHttpMetric;
+ private registerHttpsMetric;
+ destroy(): void;
+ private hookHttp;
+ private hookRequire;
+}
diff --git a/node_modules/@pm2/io/build/main/metrics/httpMetrics.js b/node_modules/@pm2/io/build/main/metrics/httpMetrics.js
new file mode 100644
index 0000000..efc2372
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/metrics/httpMetrics.js
@@ -0,0 +1,179 @@
+'use strict';
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.HttpMetricsConfig = void 0;
+const shimmer = require("shimmer");
+const debug_1 = require("debug");
+const configuration_1 = require("../configuration");
+const serviceManager_1 = require("../serviceManager");
+const histogram_1 = require("../utils/metrics/histogram");
+const requireMiddle = require("require-in-the-middle");
+const metrics_1 = require("../services/metrics");
+class HttpMetricsConfig {
+}
+exports.HttpMetricsConfig = HttpMetricsConfig;
+class HttpMetrics {
+ constructor() {
+ this.defaultConf = {
+ http: true
+ };
+ this.metrics = new Map();
+ this.logger = (0, debug_1.default)('axm:features:metrics:http');
+ this.modules = {};
+ }
+ init(config) {
+ if (config === false)
+ return;
+ if (config === undefined) {
+ config = this.defaultConf;
+ }
+ if (typeof config !== 'object') {
+ config = this.defaultConf;
+ }
+ this.logger('init');
+ configuration_1.default.configureModule({
+ latency: true
+ });
+ this.metricService = serviceManager_1.ServiceManager.get('metrics');
+ if (this.metricService === undefined)
+ return this.logger(`Failed to load metric service`);
+ this.logger('hooking to require');
+ this.hookRequire();
+ }
+ registerHttpMetric() {
+ if (this.metricService === undefined)
+ return this.logger(`Failed to load metric service`);
+ const histogram = new histogram_1.default();
+ const p50 = {
+ name: `HTTP Mean Latency`,
+ id: 'internal/http/builtin/latency/p50',
+ type: metrics_1.MetricType.histogram,
+ historic: true,
+ implementation: histogram,
+ unit: 'ms',
+ handler: () => {
+ const percentiles = histogram.percentiles([0.5]);
+ return percentiles[0.5];
+ }
+ };
+ const p95 = {
+ name: `HTTP P95 Latency`,
+ id: 'internal/http/builtin/latency/p95',
+ type: metrics_1.MetricType.histogram,
+ historic: true,
+ implementation: histogram,
+ handler: () => {
+ const percentiles = histogram.percentiles([0.95]);
+ return percentiles[0.95];
+ },
+ unit: 'ms'
+ };
+ const meter = {
+ name: 'HTTP',
+ historic: true,
+ id: 'internal/http/builtin/reqs',
+ unit: 'req/min'
+ };
+ this.metricService.registerMetric(p50);
+ this.metricService.registerMetric(p95);
+ this.metrics.set('http.latency', histogram);
+ this.metrics.set('http.meter', this.metricService.meter(meter));
+ }
+ registerHttpsMetric() {
+ if (this.metricService === undefined)
+ return this.logger(`Failed to load metric service`);
+ const histogram = new histogram_1.default();
+ const p50 = {
+ name: `HTTPS Mean Latency`,
+ id: 'internal/https/builtin/latency/p50',
+ type: metrics_1.MetricType.histogram,
+ historic: true,
+ implementation: histogram,
+ unit: 'ms',
+ handler: () => {
+ const percentiles = histogram.percentiles([0.5]);
+ return percentiles[0.5];
+ }
+ };
+ const p95 = {
+ name: `HTTPS P95 Latency`,
+ id: 'internal/https/builtin/latency/p95',
+ type: metrics_1.MetricType.histogram,
+ historic: true,
+ implementation: histogram,
+ handler: () => {
+ const percentiles = histogram.percentiles([0.95]);
+ return percentiles[0.95];
+ },
+ unit: 'ms'
+ };
+ const meter = {
+ name: 'HTTPS',
+ historic: true,
+ id: 'internal/https/builtin/reqs',
+ unit: 'req/min'
+ };
+ this.metricService.registerMetric(p50);
+ this.metricService.registerMetric(p95);
+ this.metrics.set('https.latency', histogram);
+ this.metrics.set('https.meter', this.metricService.meter(meter));
+ }
+ destroy() {
+ if (this.modules.http !== undefined) {
+ this.logger('unwraping http module');
+ shimmer.unwrap(this.modules.http, 'emit');
+ this.modules.http = undefined;
+ }
+ if (this.modules.https !== undefined) {
+ this.logger('unwraping https module');
+ shimmer.unwrap(this.modules.https, 'emit');
+ this.modules.https = undefined;
+ }
+ if (this.hooks) {
+ this.hooks.unhook();
+ }
+ this.logger('destroy');
+ }
+ hookHttp(nodule, name) {
+ if (nodule.Server === undefined || nodule.Server.prototype === undefined)
+ return;
+ if (this.modules[name] !== undefined)
+ return this.logger(`Module ${name} already hooked`);
+ this.logger(`Hooking to ${name} module`);
+ this.modules[name] = nodule.Server.prototype;
+ if (name === 'http') {
+ this.registerHttpMetric();
+ }
+ else if (name === 'https') {
+ this.registerHttpsMetric();
+ }
+ const self = this;
+ shimmer.wrap(nodule.Server.prototype, 'emit', (original) => {
+ return function (event, req, res) {
+ if (event !== 'request')
+ return original.apply(this, arguments);
+ const meter = self.metrics.get(`${name}.meter`);
+ if (meter !== undefined) {
+ meter.mark();
+ }
+ const latency = self.metrics.get(`${name}.latency`);
+ if (latency === undefined)
+ return original.apply(this, arguments);
+ if (res === undefined || res === null)
+ return original.apply(this, arguments);
+ const startTime = Date.now();
+ res.once('finish', _ => {
+ latency.update(Date.now() - startTime);
+ });
+ return original.apply(this, arguments);
+ };
+ });
+ }
+ hookRequire() {
+ this.hooks = requireMiddle(['http', 'https'], (exports, name) => {
+ this.hookHttp(exports, name);
+ return exports;
+ });
+ }
+}
+exports.default = HttpMetrics;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cE1ldHJpY3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbWV0cmljcy9odHRwTWV0cmljcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF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 No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/metrics/network.d.ts b/node_modules/@pm2/io/build/main/metrics/network.d.ts
new file mode 100644
index 0000000..dd6089a
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/metrics/network.d.ts
@@ -0,0 +1,15 @@
+import { MetricInterface } from '../features/metrics';
+export declare class NetworkTrafficConfig {
+ upload: boolean;
+ download: boolean;
+}
+export default class NetworkMetric implements MetricInterface {
+ private metricService;
+ private timer;
+ private logger;
+ private socketProto;
+ init(config?: NetworkTrafficConfig | boolean): any;
+ destroy(): void;
+ private catchDownload;
+ private catchUpload;
+}
diff --git a/node_modules/@pm2/io/build/main/metrics/network.js b/node_modules/@pm2/io/build/main/metrics/network.js
new file mode 100644
index 0000000..9eea393
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/metrics/network.js
@@ -0,0 +1,122 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.NetworkTrafficConfig = void 0;
+const netModule = require("net");
+const metrics_1 = require("../services/metrics");
+const Debug = require("debug");
+const meter_1 = require("../utils/metrics/meter");
+const shimmer = require("shimmer");
+const serviceManager_1 = require("../serviceManager");
+class NetworkTrafficConfig {
+}
+exports.NetworkTrafficConfig = NetworkTrafficConfig;
+const defaultConfig = {
+ upload: false,
+ download: false
+};
+const allEnabled = {
+ upload: true,
+ download: true
+};
+class NetworkMetric {
+ constructor() {
+ this.logger = Debug('axm:features:metrics:network');
+ }
+ init(config) {
+ if (config === false)
+ return;
+ if (config === true) {
+ config = allEnabled;
+ }
+ if (config === undefined) {
+ config = defaultConfig;
+ }
+ this.metricService = serviceManager_1.ServiceManager.get('metrics');
+ if (this.metricService === undefined) {
+ return this.logger(`Failed to load metric service`);
+ }
+ if (config.download === true) {
+ this.catchDownload();
+ }
+ if (config.upload === true) {
+ this.catchUpload();
+ }
+ this.logger('init');
+ }
+ destroy() {
+ if (this.timer !== undefined) {
+ clearTimeout(this.timer);
+ }
+ if (this.socketProto !== undefined && this.socketProto !== null) {
+ shimmer.unwrap(this.socketProto, 'read');
+ shimmer.unwrap(this.socketProto, 'write');
+ }
+ this.logger('destroy');
+ }
+ catchDownload() {
+ if (this.metricService === undefined)
+ return this.logger(`Failed to load metric service`);
+ const downloadMeter = new meter_1.default({});
+ this.metricService.registerMetric({
+ name: 'Network In',
+ id: 'internal/network/in',
+ historic: true,
+ type: metrics_1.MetricType.meter,
+ implementation: downloadMeter,
+ unit: 'kb/s',
+ handler: function () {
+ return Math.floor(this.implementation.val() / 1024 * 1000) / 1000;
+ }
+ });
+ setTimeout(() => {
+ const property = netModule.Socket.prototype.read;
+ const isWrapped = property && property.__wrapped === true;
+ if (isWrapped) {
+ return this.logger(`Already patched socket read, canceling`);
+ }
+ shimmer.wrap(netModule.Socket.prototype, 'read', function (original) {
+ return function () {
+ this.on('data', (data) => {
+ if (typeof data.length === 'number') {
+ downloadMeter.mark(data.length);
+ }
+ });
+ return original.apply(this, arguments);
+ };
+ });
+ }, 500);
+ }
+ catchUpload() {
+ if (this.metricService === undefined)
+ return this.logger(`Failed to load metric service`);
+ const uploadMeter = new meter_1.default();
+ this.metricService.registerMetric({
+ name: 'Network Out',
+ id: 'internal/network/out',
+ type: metrics_1.MetricType.meter,
+ historic: true,
+ implementation: uploadMeter,
+ unit: 'kb/s',
+ handler: function () {
+ return Math.floor(this.implementation.val() / 1024 * 1000) / 1000;
+ }
+ });
+ setTimeout(() => {
+ const property = netModule.Socket.prototype.write;
+ const isWrapped = property && property.__wrapped === true;
+ if (isWrapped) {
+ return this.logger(`Already patched socket write, canceling`);
+ }
+ shimmer.wrap(netModule.Socket.prototype, 'write', function (original) {
+ return function (data) {
+ if (typeof data.length === 'number') {
+ uploadMeter.mark(data.length);
+ }
+ return original.apply(this, arguments);
+ };
+ });
+ }, 500);
+ }
+}
+exports.default = NetworkMetric;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmV0d29yay5qcyIsInNvdXJjZVJvb3QiOiIi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DLENBQUMsQ0FBQTtZQUMvRCxDQUFDO1lBQ0QsT0FBTyxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLFNBQVMsRUFBRSxPQUFPLEVBQUUsVUFBVSxRQUFRO2dCQUNsRSxPQUFPLFVBQVUsSUFBSTtvQkFDbkIsSUFBSSxPQUFPLElBQUksQ0FBQyxNQUFNLEtBQUssUUFBUSxFQUFFLENBQUM7d0JBQ3BDLFdBQVcsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFBO29CQUMvQixDQUFDO29CQUNELE9BQU8sUUFBUSxDQUFDLEtBQUssQ0FBQyxJQUFJLEVBQUUsU0FBUyxDQUFDLENBQUE7Z0JBQ3hDLENBQUMsQ0FBQTtZQUNILENBQUMsQ0FBQyxDQUFBO1FBQ0osQ0FBQyxFQUFFLEdBQUcsQ0FBQyxDQUFBO0lBQ1QsQ0FBQztDQUNGO0FBOUdELGdDQThHQyJ9
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/metrics/runtime.d.ts b/node_modules/@pm2/io/build/main/metrics/runtime.d.ts
new file mode 100644
index 0000000..91211c0
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/metrics/runtime.d.ts
@@ -0,0 +1,16 @@
+import { MetricInterface } from '../features/metrics';
+export declare class RuntimeMetricsOptions {
+ gcOldPause: boolean;
+ gcNewPause: boolean;
+ pageFaults: boolean;
+ contextSwitchs: boolean;
+}
+export default class RuntimeMetrics implements MetricInterface {
+ private metricService;
+ private logger;
+ private runtimeStatsService;
+ private handle;
+ private metrics;
+ init(config?: RuntimeMetricsOptions | boolean): any;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/metrics/runtime.js b/node_modules/@pm2/io/build/main/metrics/runtime.js
new file mode 100644
index 0000000..545c252
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/metrics/runtime.js
@@ -0,0 +1,154 @@
+'use strict';
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.RuntimeMetricsOptions = void 0;
+const metrics_1 = require("../services/metrics");
+const serviceManager_1 = require("../serviceManager");
+const Debug = require("debug");
+const histogram_1 = require("../utils/metrics/histogram");
+class RuntimeMetricsOptions {
+}
+exports.RuntimeMetricsOptions = RuntimeMetricsOptions;
+const defaultOptions = {
+ gcNewPause: true,
+ gcOldPause: true,
+ pageFaults: true,
+ contextSwitchs: true
+};
+class RuntimeMetrics {
+ constructor() {
+ this.logger = Debug('axm:features:metrics:runtime');
+ this.metrics = new Map();
+ }
+ init(config) {
+ if (config === false)
+ return;
+ if (config === undefined) {
+ config = defaultOptions;
+ }
+ if (config === true) {
+ config = defaultOptions;
+ }
+ this.metricService = serviceManager_1.ServiceManager.get('metrics');
+ if (this.metricService === undefined)
+ return this.logger('Failed to load metric service');
+ this.runtimeStatsService = serviceManager_1.ServiceManager.get('runtimeStats');
+ if (this.runtimeStatsService === undefined)
+ return this.logger('Failed to load runtime stats service');
+ this.logger('init');
+ const newHistogram = new histogram_1.default();
+ if (config.gcNewPause === true) {
+ this.metricService.registerMetric({
+ name: 'GC New Space Pause',
+ id: 'internal/v8/gc/new/pause/p50',
+ type: metrics_1.MetricType.histogram,
+ historic: true,
+ implementation: newHistogram,
+ unit: 'ms',
+ handler: function () {
+ const percentiles = this.implementation.percentiles([0.5]);
+ return percentiles[0.5];
+ }
+ });
+ this.metricService.registerMetric({
+ name: 'GC New Space Pause p95',
+ id: 'internal/v8/gc/new/pause/p95',
+ type: metrics_1.MetricType.histogram,
+ historic: true,
+ implementation: newHistogram,
+ unit: 'ms',
+ handler: function () {
+ const percentiles = this.implementation.percentiles([0.95]);
+ return percentiles[0.95];
+ }
+ });
+ }
+ const oldHistogram = new histogram_1.default();
+ if (config.gcOldPause === true) {
+ this.metricService.registerMetric({
+ name: 'GC Old Space Pause',
+ id: 'internal/v8/gc/old/pause/p50',
+ type: metrics_1.MetricType.histogram,
+ historic: true,
+ implementation: oldHistogram,
+ unit: 'ms',
+ handler: function () {
+ const percentiles = this.implementation.percentiles([0.5]);
+ return percentiles[0.5];
+ }
+ });
+ this.metricService.registerMetric({
+ name: 'GC Old Space Pause p95',
+ id: 'internal/v8/gc/old/pause/p95',
+ type: metrics_1.MetricType.histogram,
+ historic: true,
+ implementation: oldHistogram,
+ unit: 'ms',
+ handler: function () {
+ const percentiles = this.implementation.percentiles([0.95]);
+ return percentiles[0.95];
+ }
+ });
+ }
+ if (config.contextSwitchs === true) {
+ const volontarySwitchs = this.metricService.histogram({
+ name: 'Volontary CPU Context Switch',
+ id: 'internal/uv/cpu/contextswitch/volontary',
+ measurement: metrics_1.MetricMeasurements.mean
+ });
+ const inVolontarySwitchs = this.metricService.histogram({
+ name: 'Involuntary CPU Context Switch',
+ id: 'internal/uv/cpu/contextswitch/involontary',
+ measurement: metrics_1.MetricMeasurements.mean
+ });
+ this.metrics.set('inVolontarySwitchs', inVolontarySwitchs);
+ this.metrics.set('volontarySwitchs', volontarySwitchs);
+ }
+ if (config.pageFaults === true) {
+ const softPageFault = this.metricService.histogram({
+ name: 'Minor Page Fault',
+ id: 'internal/uv/memory/pagefault/minor',
+ measurement: metrics_1.MetricMeasurements.mean
+ });
+ const hardPageFault = this.metricService.histogram({
+ name: 'Major Page Fault',
+ id: 'internal/uv/memory/pagefault/major',
+ measurement: metrics_1.MetricMeasurements.mean
+ });
+ this.metrics.set('softPageFault', softPageFault);
+ this.metrics.set('hardPageFault', hardPageFault);
+ }
+ this.handle = (stats) => {
+ if (typeof stats !== 'object' || typeof stats.gc !== 'object')
+ return;
+ newHistogram.update(stats.gc.newPause);
+ oldHistogram.update(stats.gc.oldPause);
+ if (typeof stats.usage !== 'object')
+ return;
+ const volontarySwitchs = this.metrics.get('volontarySwitchs');
+ if (volontarySwitchs !== undefined) {
+ volontarySwitchs.update(stats.usage.ru_nvcsw);
+ }
+ const inVolontarySwitchs = this.metrics.get('inVolontarySwitchs');
+ if (inVolontarySwitchs !== undefined) {
+ inVolontarySwitchs.update(stats.usage.ru_nivcsw);
+ }
+ const softPageFault = this.metrics.get('softPageFault');
+ if (softPageFault !== undefined) {
+ softPageFault.update(stats.usage.ru_minflt);
+ }
+ const hardPageFault = this.metrics.get('hardPageFault');
+ if (hardPageFault !== undefined) {
+ hardPageFault.update(stats.usage.ru_majflt);
+ }
+ };
+ this.runtimeStatsService.on('data', this.handle);
+ }
+ destroy() {
+ if (this.runtimeStatsService !== undefined) {
+ this.runtimeStatsService.removeListener('data', this.handle);
+ }
+ this.logger('destroy');
+ }
+}
+exports.default = RuntimeMetrics;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnVudGltZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tZXRyaWNzL3J1bnRpbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFBWSxDQUFBOzs7QUFFWixpREFBbUY7QUFDbkYsc0RBQWtEO0FBQ2xELCtCQUE4QjtBQUU5QiwwREFBa0Q7QUFHbEQsTUFBYSxxQkFBcUI7Q0FhakM7QUFiRCxzREFhQztBQUVELE1BQU0sY0FBYyxHQUEwQjtJQUM1QyxVQUFVLEVBQUUsSUFBSTtJQUNoQixVQUFVLEVBQUUsSUFBSTtJQUNoQixVQUFVLEVBQUUsSUFBSTtJQUNoQixjQUFjLEVBQUUsSUFBSTtDQUNyQixDQUFBO0FBRUQsTUFBcUIsY0FBYztJQUFuQztRQUdVLFdBQU0sR0FBUSxLQUFLLENBQUMsOEJBQThCLENBQUMsQ0FBQTtRQUduRCxZQUFPLEdBQTJCLElBQUksR0FBRyxFQUFxQixDQUFBO0lBeUl4RSxDQUFDO0lBdklDLElBQUksQ0FBRSxNQUF3QztRQUM1QyxJQUFJLE1BQU0sS0FBSyxLQUFLO1lBQUUsT0FBTTtRQUM1QixJQUFJLE1BQU0sS0FBSyxTQUFTLEVBQUUsQ0FBQztZQUN6QixNQUFNLEdBQ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SxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUE7WUFDN0MsQ0FBQztRQUNILENBQUMsQ0FBQTtRQUVELElBQUksQ0FBQyxtQkFBbUIsQ0FBQyxFQUFFLENBQUMsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQTtJQUNsRCxDQUFDO0lBRUQsT0FBTztRQUNMLElBQUksSUFBSSxDQUFDLG1CQUFtQixLQUFLLFNBQVMsRUFBRSxDQUFDO1lBQzNDLElBQUksQ0FBQyxtQkFBbUIsQ0FBQyxjQUFjLENBQUMsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQTtRQUM5RCxDQUFDO1FBQ0QsSUFBSSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQTtJQUN4QixDQUFDO0NBQ0Y7QUEvSUQsaUNBK0lDIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/metrics/v8.d.ts b/node_modules/@pm2/io/build/main/metrics/v8.d.ts
new file mode 100644
index 0000000..de59609
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/metrics/v8.d.ts
@@ -0,0 +1,23 @@
+import { MetricInterface } from '../features/metrics';
+export declare class V8MetricsConfig {
+ new_space: boolean;
+ old_space: boolean;
+ map_space: boolean;
+ code_space: boolean;
+ large_object_space: boolean;
+ heap_total_size: boolean;
+ heap_used_size: boolean;
+ heap_used_percent: boolean;
+}
+export default class V8Metric implements MetricInterface {
+ private timer;
+ private TIME_INTERVAL;
+ private metricService;
+ private logger;
+ private metricStore;
+ private unitKB;
+ private metricsDefinitions;
+ init(config?: V8MetricsConfig | boolean): any;
+ destroy(): void;
+ private formatMiBytes;
+}
diff --git a/node_modules/@pm2/io/build/main/metrics/v8.js b/node_modules/@pm2/io/build/main/metrics/v8.js
new file mode 100644
index 0000000..755cfa5
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/metrics/v8.js
@@ -0,0 +1,101 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.V8MetricsConfig = void 0;
+const v8 = require("v8");
+const debug_1 = require("debug");
+const serviceManager_1 = require("../serviceManager");
+class V8MetricsConfig {
+}
+exports.V8MetricsConfig = V8MetricsConfig;
+const defaultOptions = {
+ new_space: false,
+ old_space: false,
+ map_space: false,
+ code_space: false,
+ large_object_space: false,
+ heap_total_size: true,
+ heap_used_size: true,
+ heap_used_percent: true
+};
+class V8Metric {
+ constructor() {
+ this.TIME_INTERVAL = 800;
+ this.logger = (0, debug_1.default)('axm:features:metrics:v8');
+ this.metricStore = new Map();
+ this.unitKB = 'MiB';
+ this.metricsDefinitions = {
+ total_heap_size: {
+ name: 'Heap Size',
+ id: 'internal/v8/heap/total',
+ unit: this.unitKB,
+ historic: true
+ },
+ heap_used_percent: {
+ name: 'Heap Usage',
+ id: 'internal/v8/heap/usage',
+ unit: '%',
+ historic: true
+ },
+ used_heap_size: {
+ name: 'Used Heap Size',
+ id: 'internal/v8/heap/used',
+ unit: this.unitKB,
+ historic: true
+ }
+ };
+ }
+ init(config) {
+ if (config === false)
+ return;
+ if (config === undefined) {
+ config = defaultOptions;
+ }
+ if (config === true) {
+ config = defaultOptions;
+ }
+ this.metricService = serviceManager_1.ServiceManager.get('metrics');
+ if (this.metricService === undefined)
+ return this.logger('Failed to load metric service');
+ this.logger('init');
+ if (!v8.hasOwnProperty('getHeapStatistics')) {
+ return this.logger(`V8.getHeapStatistics is not available, aborting`);
+ }
+ for (let metricName in this.metricsDefinitions) {
+ if (config[metricName] === false)
+ continue;
+ const isEnabled = config[metricName];
+ if (isEnabled === false)
+ continue;
+ let metric = this.metricsDefinitions[metricName];
+ this.metricStore.set(metricName, this.metricService.metric(metric));
+ }
+ this.timer = setInterval(() => {
+ const stats = v8.getHeapStatistics();
+ for (let metricName in this.metricsDefinitions) {
+ if (typeof stats[metricName] !== 'number')
+ continue;
+ const gauge = this.metricStore.get(metricName);
+ if (gauge === undefined)
+ continue;
+ gauge.set(this.formatMiBytes(stats[metricName]));
+ }
+ const usage = (stats.used_heap_size / stats.total_heap_size * 100).toFixed(2);
+ const usageMetric = this.metricStore.get('heap_used_percent');
+ if (usageMetric !== undefined) {
+ usageMetric.set(parseFloat(usage));
+ }
+ }, this.TIME_INTERVAL);
+ this.timer.unref();
+ }
+ destroy() {
+ if (this.timer !== undefined) {
+ clearInterval(this.timer);
+ }
+ this.logger('destroy');
+ }
+ formatMiBytes(val) {
+ return (val / 1024 / 1024).toFixed(2);
+ }
+}
+exports.default = V8Metric;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidjguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbWV0cmljcy92OC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5QkFBd0I7QUFHeEIsaUNBQXlCO0FBQ3pCLHNEQUFrRDtBQUlsRCxNQUFhLGVBQWU7Q0FTM0I7QUFURCwwQ0FTQztBQUdELE1BQU0sY0FBYyxHQUFvQjtJQUN0QyxTQUFTLEVBQUUsS0FBSztJQUNoQixTQUFTLEVBQUUsS0FBSztJQUNoQixTQUFTLEVBQUUsS0FBSztJQUNoQixVQUFVLEVBQUUsS0FBSztJQUNqQixrQkFBa0IsRUFBRSxLQUFLO0lBQ3pCLGVBQWUsRUFBRSxJQUFJO0lBQ3JCLGNBQWMsRUFBRSxJQUFJO0lBQ3BCLGlCQUFpQixFQUFFLElBQUk7Q0FDeEIsQ0FBQTtBQUVELE1BQXFCLFFBQVE7SUFBN0I7UUFHVSxrQkFBYSxHQUFXLEdBQUcsQ0FBQTtRQUUzQixXQUFNLEdBQWEsSUFBQSxlQUFLLEVBQUMseUJBQXlCLENBQUMsQ0FBQTtRQUNuRCxnQkFBVyxHQUF1QixJQUFJLEdBQUcsRUFBaUIsQ0FBQTtRQUUxRCxXQUFNLEdBQUcsS0FBSyxDQUFBO1FBR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index 0000000..9dbce05
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/pmx.d.ts
@@ -0,0 +1,50 @@
+import { TransportConfig } from './services/transport';
+import { ErrorContext } from './features/notify';
+import { Metric, HistogramOptions, MetricBulk } from './services/metrics';
+import Meter from './utils/metrics/meter';
+import Histogram from './utils/metrics/histogram';
+import Gauge from './utils/metrics/gauge';
+import Counter from './utils/metrics/counter';
+import { MetricConfig } from './features/metrics';
+import { ProfilingConfig } from './features/profiling';
+import { Entrypoint } from './features/entrypoint';
+export declare class IOConfig {
+ catchExceptions?: boolean;
+ metrics?: MetricConfig;
+ actions?: {
+ eventLoopDump?: boolean;
+ };
+ profiling?: ProfilingConfig | boolean;
+ standalone?: boolean;
+ apmOptions?: TransportConfig;
+}
+export declare const defaultConfig: IOConfig;
+export default class PMX {
+ private initialConfig;
+ private featureManager;
+ private transport;
+ private actionService;
+ private metricService;
+ private runtimeStatsService;
+ private logger;
+ private initialized;
+ Entrypoint: {
+ new (): Entrypoint;
+ };
+ init(config?: IOConfig): this;
+ destroy(): void;
+ getConfig(): IOConfig;
+ notifyError(error: Error | string | {}, context?: ErrorContext): any;
+ metrics(metric: MetricBulk | Array): any[];
+ histogram(config: HistogramOptions): Histogram;
+ metric(config: Metric): Gauge;
+ gauge(config: Metric): Gauge;
+ counter(config: Metric): Counter;
+ meter(config: Metric): Meter;
+ action(name: string, opts?: Object, fn?: Function): void;
+ onExit(callback: Function): any;
+ emit(name: string, data: Object): any;
+ initModule(opts: any, cb?: Function): any;
+ expressErrorHandler(): (err: any, req: any, res: any, next: any) => any;
+ koaErrorHandler(): (ctx: any, next: any) => Promise;
+}
diff --git a/node_modules/@pm2/io/build/main/pmx.js b/node_modules/@pm2/io/build/main/pmx.js
new file mode 100644
index 0000000..84f39ce
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/pmx.js
@@ -0,0 +1,275 @@
+'use strict';
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.defaultConfig = exports.IOConfig = void 0;
+const configuration_1 = require("./configuration");
+const debug_1 = require("debug");
+const serviceManager_1 = require("./serviceManager");
+const transport_1 = require("./services/transport");
+const featureManager_1 = require("./featureManager");
+const actions_1 = require("./services/actions");
+const metrics_1 = require("./services/metrics");
+const constants_1 = require("./constants");
+const runtimeStats_1 = require("./services/runtimeStats");
+const entrypoint_1 = require("./features/entrypoint");
+class IOConfig {
+ constructor() {
+ this.catchExceptions = true;
+ this.profiling = true;
+ this.standalone = false;
+ }
+}
+exports.IOConfig = IOConfig;
+exports.defaultConfig = {
+ catchExceptions: true,
+ profiling: true,
+ metrics: {
+ v8: true,
+ network: false,
+ eventLoop: true,
+ runtime: true,
+ http: true
+ },
+ standalone: false,
+ apmOptions: undefined,
+};
+class PMX {
+ constructor() {
+ this.featureManager = new featureManager_1.FeatureManager();
+ this.transport = null;
+ this.actionService = null;
+ this.metricService = null;
+ this.runtimeStatsService = null;
+ this.logger = (0, debug_1.default)('axm:main');
+ this.initialized = false;
+ this.Entrypoint = entrypoint_1.Entrypoint;
+ }
+ init(config) {
+ const callsite = (new Error().stack || '').split('\n')[2];
+ if (callsite && callsite.length > 0) {
+ this.logger(`init from ${callsite}`);
+ }
+ if (this.initialized === true) {
+ this.logger(`Calling init but was already the case, destroying and recreating`);
+ this.destroy();
+ }
+ if (config === undefined) {
+ config = exports.defaultConfig;
+ }
+ if (!config.standalone) {
+ const autoStandalone = process.env.PM2_SECRET_KEY && process.env.PM2_PUBLIC_KEY && process.env.PM2_APP_NAME;
+ config.standalone = !!autoStandalone;
+ config.apmOptions = autoStandalone ? {
+ secretKey: process.env.PM2_SECRET_KEY,
+ publicKey: process.env.PM2_PUBLIC_KEY,
+ appName: process.env.PM2_APP_NAME
+ } : undefined;
+ }
+ this.transport = (0, transport_1.createTransport)(config.standalone === true ? 'websocket' : 'ipc', config.apmOptions);
+ serviceManager_1.ServiceManager.set('transport', this.transport);
+ if ((0, constants_1.canUseInspector)()) {
+ const Inspector = require('./services/inspector');
+ const inspectorService = new Inspector();
+ inspectorService.init();
+ serviceManager_1.ServiceManager.set('inspector', inspectorService);
+ }
+ this.actionService = new actions_1.ActionService();
+ this.actionService.init();
+ serviceManager_1.ServiceManager.set('actions', this.actionService);
+ this.metricService = new metrics_1.MetricService();
+ this.metricService.init();
+ serviceManager_1.ServiceManager.set('metrics', this.metricService);
+ this.runtimeStatsService = new runtimeStats_1.RuntimeStatsService();
+ this.runtimeStatsService.init();
+ if (this.runtimeStatsService.isEnabled()) {
+ serviceManager_1.ServiceManager.set('runtimeStats', this.runtimeStatsService);
+ }
+ this.featureManager.init(config);
+ configuration_1.default.init(config);
+ this.initialConfig = config;
+ this.initialized = true;
+ return this;
+ }
+ destroy() {
+ this.logger('destroy');
+ this.featureManager.destroy();
+ if (this.actionService !== null) {
+ this.actionService.destroy();
+ }
+ if (this.transport !== null) {
+ this.transport.destroy();
+ }
+ if (this.metricService !== null) {
+ this.metricService.destroy();
+ }
+ if (this.runtimeStatsService !== null) {
+ this.runtimeStatsService.destroy();
+ }
+ const inspectorService = serviceManager_1.ServiceManager.get('inspector');
+ if (inspectorService !== undefined) {
+ inspectorService.destroy();
+ }
+ }
+ getConfig() {
+ return this.initialConfig;
+ }
+ notifyError(error, context) {
+ const notify = this.featureManager.get('notify');
+ return notify.notifyError(error, context);
+ }
+ metrics(metric) {
+ const res = [];
+ if (metric === undefined || metric === null) {
+ console.error(`Received empty metric to create`);
+ console.trace();
+ return [];
+ }
+ let metrics = !Array.isArray(metric) ? [metric] : metric;
+ for (let metric of metrics) {
+ if (typeof metric.name !== 'string') {
+ console.error(`Trying to create a metrics without a name`, metric);
+ console.trace();
+ res.push({});
+ continue;
+ }
+ if (metric.type === undefined) {
+ metric.type = metrics_1.MetricType.gauge;
+ }
+ switch (metric.type) {
+ case metrics_1.MetricType.counter: {
+ res.push(this.counter(metric));
+ continue;
+ }
+ case metrics_1.MetricType.gauge: {
+ res.push(this.gauge(metric));
+ continue;
+ }
+ case metrics_1.MetricType.histogram: {
+ res.push(this.histogram(metric));
+ continue;
+ }
+ case metrics_1.MetricType.meter: {
+ res.push(this.meter(metric));
+ continue;
+ }
+ case metrics_1.MetricType.metric: {
+ res.push(this.gauge(metric));
+ continue;
+ }
+ default: {
+ console.error(`Invalid metric type ${metric.type} for metric ${metric.name}`);
+ console.trace();
+ res.push({});
+ continue;
+ }
+ }
+ }
+ return res;
+ }
+ histogram(config) {
+ if (typeof config === 'string') {
+ config = {
+ name: config,
+ measurement: metrics_1.MetricMeasurements.mean
+ };
+ }
+ if (this.metricService === null) {
+ return console.trace(`Tried to register a metric without initializing @pm2/io`);
+ }
+ return this.metricService.histogram(config);
+ }
+ metric(config) {
+ if (typeof config === 'string') {
+ config = {
+ name: config
+ };
+ }
+ if (this.metricService === null) {
+ return console.trace(`Tried to register a metric without initializing @pm2/io`);
+ }
+ return this.metricService.metric(config);
+ }
+ gauge(config) {
+ if (typeof config === 'string') {
+ config = {
+ name: config
+ };
+ }
+ if (this.metricService === null) {
+ return console.trace(`Tried to register a metric without initializing @pm2/io`);
+ }
+ return this.metricService.metric(config);
+ }
+ counter(config) {
+ if (typeof config === 'string') {
+ config = {
+ name: config
+ };
+ }
+ if (this.metricService === null) {
+ return console.trace(`Tried to register a metric without initializing @pm2/io`);
+ }
+ return this.metricService.counter(config);
+ }
+ meter(config) {
+ if (typeof config === 'string') {
+ config = {
+ name: config
+ };
+ }
+ if (this.metricService === null) {
+ return console.trace(`Tried to register a metric without initializing @pm2/io`);
+ }
+ return this.metricService.meter(config);
+ }
+ action(name, opts, fn) {
+ if (typeof name === 'object') {
+ const tmp = name;
+ name = tmp.name;
+ opts = tmp.options;
+ fn = tmp.action;
+ }
+ if (this.actionService === null) {
+ return console.trace(`Tried to register a action without initializing @pm2/io`);
+ }
+ return this.actionService.registerAction(name, opts, fn);
+ }
+ onExit(callback) {
+ if (typeof callback === 'function') {
+ const onExit = require('signal-exit');
+ return onExit(callback);
+ }
+ }
+ emit(name, data) {
+ const events = this.featureManager.get('events');
+ return events.emit(name, data);
+ }
+ initModule(opts, cb) {
+ if (!opts)
+ opts = {};
+ if (opts.reference) {
+ opts.name = opts.reference;
+ delete opts.reference;
+ }
+ opts = Object.assign({
+ widget: {}
+ }, opts);
+ opts.widget = Object.assign({
+ type: 'generic',
+ logo: 'https://app.keymetrics.io/img/logo/keymetrics-300.png',
+ theme: ['#111111', '#1B2228', '#807C7C', '#807C7C']
+ }, opts.widget);
+ opts.isModule = true;
+ opts = configuration_1.default.init(opts);
+ return typeof cb === 'function' ? cb(null, opts) : opts;
+ }
+ expressErrorHandler() {
+ const notify = this.featureManager.get('notify');
+ return notify.expressErrorHandler();
+ }
+ koaErrorHandler() {
+ const notify = this.featureManager.get('notify');
+ return notify.koaErrorHandler();
+ }
+}
+exports.default = PMX;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG14LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3BteC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLENBQUE7OztBQUVaLG1EQUEyQztBQUMzQyxpQ0FBeUI7QUFDekIscURBQWlEO0FBQ2pELG9EQUFrRjtBQUNsRixxREFBaUQ7QUFDakQsZ0RBQWtEO0FBRWxELGdEQUF3SDtBQU94SCwyQ0FBNkM7QUFHN0MsMERBQTZEO0FBQzdELHNEQUFrRDtBQUVsRCxNQUFhLFFBQVE7SUFBckI7UUFJRSxvQkFBZSxHQUFhLElBQUksQ0FBQTtRQWNoQyxjQUFTLEdBQStCLElBQUksQ0FBQTtRQUs1QyxlQUFVLEdBQWEsS0FBSyxDQUFBO0lBSzlCLENBQUM7Q0FBQTtBQTVCRCw0QkE0QkM7QUFFWSxRQUFBLGFBQWEsR0FBYTtJQUNyQyxlQUFlLEVBQUUsSUFBSTtJQUNyQixTQUFTLEVBQUUsSUFBSTtJQUNmLE9BQU8sRUFBRTtRQUNQLEVBQUUsRUFBRSxJQUFJO1FB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EdBQUcsQ0FBQyxRQUFRLENBQWtCLENBQUE7UUFDakUsT0FBTyxNQUFNLENBQUMsbUJBQW1CLEVBQUUsQ0FBQTtJQUNyQyxDQUFDO0lBTUQsZUFBZTtRQUNiLE1BQU0sTUFBTSxHQUFHLElBQUksQ0FBQyxjQUFjLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBa0IsQ0FBQTtRQUNqRSxPQUFPLE1BQU0sQ0FBQyxlQUFlLEVBQUUsQ0FBQTtJQUNqQyxDQUFDO0NBQ0Y7QUEvVkQsc0JBK1ZDIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/profilers/addonProfiler.d.ts b/node_modules/@pm2/io/build/main/profilers/addonProfiler.d.ts
new file mode 100644
index 0000000..4a92e1f
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/profilers/addonProfiler.d.ts
@@ -0,0 +1,16 @@
+import { ProfilerType } from '../features/profiling';
+export default class AddonProfiler implements ProfilerType {
+ private profiler;
+ private modules;
+ private actionService;
+ private transport;
+ private currentProfile;
+ private logger;
+ init(): any;
+ register(): any;
+ destroy(): void;
+ private onCPUProfileStart;
+ private onCPUProfileStop;
+ private onHeapdump;
+ private takeSnapshot;
+}
diff --git a/node_modules/@pm2/io/build/main/profilers/addonProfiler.js b/node_modules/@pm2/io/build/main/profilers/addonProfiler.js
new file mode 100644
index 0000000..97934b5
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/profilers/addonProfiler.js
@@ -0,0 +1,172 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const module_1 = require("../utils/module");
+const configuration_1 = require("../configuration");
+const serviceManager_1 = require("../serviceManager");
+const miscellaneous_1 = require("../utils/miscellaneous");
+const Debug = require("debug");
+class CurrentProfile {
+}
+class AddonProfiler {
+ constructor() {
+ this.profiler = null;
+ this.modules = ['v8-profiler-node8', 'v8-profiler'];
+ this.currentProfile = null;
+ this.logger = Debug('axm:features:profiling:addon');
+ }
+ init() {
+ for (const moduleName of this.modules) {
+ let path = module_1.default.detectModule(moduleName);
+ if (path === null)
+ continue;
+ let profiler = module_1.default.loadModule(moduleName);
+ if (profiler instanceof Error)
+ continue;
+ this.profiler = profiler;
+ break;
+ }
+ if (this.profiler === null) {
+ configuration_1.default.configureModule({
+ heapdump: false,
+ 'feature.profiler.heap_snapshot': false,
+ 'feature.profiler.heap_sampling': false,
+ 'feature.profiler.cpu_js': false
+ });
+ return this.logger(`Failed to require the profiler via addon, disabling profiling ...`);
+ }
+ this.logger('init');
+ this.actionService = serviceManager_1.ServiceManager.get('actions');
+ if (this.actionService === undefined) {
+ return this.logger(`Fail to get action service`);
+ }
+ this.transport = serviceManager_1.ServiceManager.get('transport');
+ if (this.transport === undefined) {
+ return this.logger(`Fail to get transport service`);
+ }
+ configuration_1.default.configureModule({
+ heapdump: true,
+ 'feature.profiler.heapsnapshot': true,
+ 'feature.profiler.heapsampling': false,
+ 'feature.profiler.cpu_js': true
+ });
+ this.register();
+ }
+ register() {
+ if (this.actionService === undefined) {
+ return this.logger(`Fail to get action service`);
+ }
+ this.logger('register');
+ this.actionService.registerAction('km:heapdump', this.onHeapdump.bind(this));
+ this.actionService.registerAction('km:cpu:profiling:start', this.onCPUProfileStart.bind(this));
+ this.actionService.registerAction('km:cpu:profiling:stop', this.onCPUProfileStop.bind(this));
+ }
+ destroy() {
+ this.logger('Addon Profiler destroyed !');
+ if (this.profiler === null)
+ return;
+ this.profiler.deleteAllProfiles();
+ }
+ onCPUProfileStart(opts, cb) {
+ if (typeof cb !== 'function') {
+ cb = opts;
+ opts = {};
+ }
+ if (typeof opts !== 'object' || opts === null) {
+ opts = {};
+ }
+ if (this.currentProfile !== null) {
+ return cb({
+ err: 'A profiling is already running',
+ success: false
+ });
+ }
+ this.currentProfile = new CurrentProfile();
+ this.currentProfile.uuid = miscellaneous_1.default.generateUUID();
+ this.currentProfile.startTime = Date.now();
+ this.currentProfile.initiated = typeof opts.initiated === 'string'
+ ? opts.initiated : 'manual';
+ cb({ success: true, uuid: this.currentProfile.uuid });
+ this.profiler.startProfiling();
+ if (isNaN(parseInt(opts.timeout, 10)))
+ return;
+ const duration = parseInt(opts.timeout, 10);
+ setTimeout(_ => {
+ this.onCPUProfileStop(_ => {
+ return;
+ });
+ }, duration);
+ }
+ onCPUProfileStop(cb) {
+ if (this.currentProfile === null) {
+ return cb({
+ err: 'No profiling are already running',
+ success: false
+ });
+ }
+ if (this.transport === undefined) {
+ return cb({
+ err: 'No profiling are already running',
+ success: false
+ });
+ }
+ const profile = this.profiler.stopProfiling();
+ const data = JSON.stringify(profile);
+ cb({ success: true, uuid: this.currentProfile.uuid });
+ this.transport.send('profilings', {
+ uuid: this.currentProfile.uuid,
+ duration: Date.now() - this.currentProfile.startTime,
+ at: this.currentProfile.startTime,
+ data,
+ dump_file_size: data.length,
+ success: true,
+ initiated: this.currentProfile.initiated,
+ type: 'cpuprofile',
+ cpuprofile: true
+ });
+ this.currentProfile = null;
+ }
+ onHeapdump(opts, cb) {
+ if (typeof cb !== 'function') {
+ cb = opts;
+ opts = {};
+ }
+ if (typeof opts !== 'object' || opts === null) {
+ opts = {};
+ }
+ cb({ success: true });
+ setTimeout(() => {
+ const startTime = Date.now();
+ this.takeSnapshot()
+ .then((data) => {
+ return this.transport.send('profilings', {
+ data,
+ at: startTime,
+ initiated: typeof opts.initiated === 'string' ? opts.initiated : 'manual',
+ duration: Date.now() - startTime,
+ type: 'heapdump'
+ });
+ }).catch(err => {
+ return cb({
+ success: err.message,
+ err: err
+ });
+ });
+ }, 200);
+ }
+ takeSnapshot() {
+ return new Promise((resolve, reject) => {
+ const snapshot = this.profiler.takeSnapshot();
+ snapshot.export((err, data) => {
+ if (err) {
+ reject(err);
+ }
+ else {
+ resolve(data);
+ }
+ snapshot.delete();
+ });
+ });
+ }
+}
+exports.default = AddonProfiler;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkb25Qcm9maWxlci5qcyIsInNvdXJjZVJvb3QiO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BQUE7WUFDSixDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLEVBQUU7Z0JBQ2IsT0FBTyxFQUFFLENBQUM7b0JBQ1IsT0FBTyxFQUFFLEdBQUcsQ0FBQyxPQUFPO29CQUNwQixHQUFHLEVBQUUsR0FBRztpQkFDVCxDQUFDLENBQUE7WUFDSixDQUFDLENBQUMsQ0FBQTtRQUNOLENBQUMsRUFBRSxHQUFHLENBQUMsQ0FBQTtJQUNULENBQUM7SUFFTyxZQUFZO1FBQ2xCLE9BQU8sSUFBSSxPQUFPLENBQUMsQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQUU7WUFDckMsTUFBTSxRQUFRLEdBQUcsSUFBSSxDQUFDLFFBQVEsQ0FBQyxZQUFZLEVBQUUsQ0FBQTtZQUM3QyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxFQUFFLElBQUksRUFBRSxFQUFFO2dCQUM1QixJQUFJLEdBQUcsRUFBRSxDQUFDO29CQUNSLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQTtnQkFDYixDQUFDO3FCQUFNLENBQUM7b0JBQ04sT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFBO2dCQUNmLENBQUM7Z0JBRUQsUUFBUSxDQUFDLE1BQU0sRUFBRSxDQUFBO1lBQ25CLENBQUMsQ0FBQyxDQUFBO1FBQ0osQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ0Y7QUFoTUQsZ0NBZ01DIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/profilers/inspectorProfiler.d.ts b/node_modules/@pm2/io/build/main/profilers/inspectorProfiler.d.ts
new file mode 100644
index 0000000..a6d34f9
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/profilers/inspectorProfiler.d.ts
@@ -0,0 +1,18 @@
+import { ProfilerType } from '../features/profiling';
+export default class InspectorProfiler implements ProfilerType {
+ private profiler;
+ private actionService;
+ private transport;
+ private currentProfile;
+ private logger;
+ private isNode11;
+ init(): any;
+ register(): any;
+ destroy(): void;
+ private onHeapProfileStart;
+ private onHeapProfileStop;
+ private onCPUProfileStart;
+ private onCPUProfileStop;
+ private onHeapdump;
+ takeSnapshot(): Promise;
+}
diff --git a/node_modules/@pm2/io/build/main/profilers/inspectorProfiler.js b/node_modules/@pm2/io/build/main/profilers/inspectorProfiler.js
new file mode 100644
index 0000000..488c21e
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/profilers/inspectorProfiler.js
@@ -0,0 +1,268 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const tslib_1 = require("tslib");
+const configuration_1 = require("../configuration");
+const serviceManager_1 = require("../serviceManager");
+const miscellaneous_1 = require("../utils/miscellaneous");
+const Debug = require("debug");
+const semver = require("semver");
+class CurrentProfile {
+}
+class InspectorProfiler {
+ constructor() {
+ this.profiler = undefined;
+ this.currentProfile = null;
+ this.logger = Debug('axm:features:profiling:inspector');
+ this.isNode11 = semver.satisfies(semver.clean(process.version), '>11.x');
+ }
+ init() {
+ this.profiler = serviceManager_1.ServiceManager.get('inspector');
+ if (this.profiler === undefined) {
+ configuration_1.default.configureModule({
+ heapdump: false,
+ 'feature.profiler.heap_snapshot': false,
+ 'feature.profiler.heap_sampling': false,
+ 'feature.profiler.cpu_js': false
+ });
+ return console.error(`Failed to require the profiler via inspector, disabling profiling ...`);
+ }
+ this.profiler.getSession().post('Profiler.enable');
+ this.profiler.getSession().post('HeapProfiler.enable');
+ this.logger('init');
+ this.actionService = serviceManager_1.ServiceManager.get('actions');
+ if (this.actionService === undefined) {
+ return this.logger(`Fail to get action service`);
+ }
+ this.transport = serviceManager_1.ServiceManager.get('transport');
+ if (this.transport === undefined) {
+ return this.logger(`Fail to get transport service`);
+ }
+ configuration_1.default.configureModule({
+ heapdump: true,
+ 'feature.profiler.heapsnapshot': !this.isNode11,
+ 'feature.profiler.heapsampling': true,
+ 'feature.profiler.cpu_js': true
+ });
+ this.register();
+ }
+ register() {
+ if (this.actionService === undefined) {
+ return this.logger(`Fail to get action service`);
+ }
+ this.logger('register');
+ this.actionService.registerAction('km:heapdump', this.onHeapdump.bind(this));
+ this.actionService.registerAction('km:cpu:profiling:start', this.onCPUProfileStart.bind(this));
+ this.actionService.registerAction('km:cpu:profiling:stop', this.onCPUProfileStop.bind(this));
+ this.actionService.registerAction('km:heap:sampling:start', this.onHeapProfileStart.bind(this));
+ this.actionService.registerAction('km:heap:sampling:stop', this.onHeapProfileStop.bind(this));
+ }
+ destroy() {
+ this.logger('Inspector Profiler destroyed !');
+ if (this.profiler === undefined)
+ return;
+ this.profiler.getSession().post('Profiler.disable');
+ this.profiler.getSession().post('HeapProfiler.disable');
+ }
+ onHeapProfileStart(opts, cb) {
+ if (typeof cb !== 'function') {
+ cb = opts;
+ opts = {};
+ }
+ if (typeof opts !== 'object' || opts === null) {
+ opts = {};
+ }
+ if (this.profiler === undefined) {
+ return cb({
+ err: 'Profiler not available',
+ success: false
+ });
+ }
+ if (this.currentProfile !== null) {
+ return cb({
+ err: 'A profiling is already running',
+ success: false
+ });
+ }
+ this.currentProfile = new CurrentProfile();
+ this.currentProfile.uuid = miscellaneous_1.default.generateUUID();
+ this.currentProfile.startTime = Date.now();
+ this.currentProfile.initiated = typeof opts.initiated === 'string'
+ ? opts.initiated : 'manual';
+ cb({ success: true, uuid: this.currentProfile.uuid });
+ const defaultSamplingInterval = 16384;
+ this.profiler.getSession().post('HeapProfiler.startSampling', {
+ samplingInterval: typeof opts.samplingInterval === 'number'
+ ? opts.samplingInterval : defaultSamplingInterval
+ });
+ if (isNaN(parseInt(opts.timeout, 10)))
+ return;
+ const duration = parseInt(opts.timeout, 10);
+ setTimeout(_ => {
+ this.onHeapProfileStop(_ => {
+ return;
+ });
+ }, duration);
+ }
+ onHeapProfileStop(cb) {
+ if (this.currentProfile === null) {
+ return cb({
+ err: 'No profiling are already running',
+ success: false
+ });
+ }
+ if (this.profiler === undefined) {
+ return cb({
+ err: 'Profiler not available',
+ success: false
+ });
+ }
+ cb({ success: true, uuid: this.currentProfile.uuid });
+ this.profiler.getSession().post('HeapProfiler.stopSampling', (_, { profile }) => {
+ if (this.currentProfile === null)
+ return;
+ if (this.transport === undefined)
+ return;
+ const data = JSON.stringify(profile);
+ this.transport.send('profilings', {
+ uuid: this.currentProfile.uuid,
+ duration: Date.now() - this.currentProfile.startTime,
+ at: this.currentProfile.startTime,
+ data,
+ success: true,
+ initiated: this.currentProfile.initiated,
+ type: 'heapprofile',
+ heapprofile: true
+ });
+ this.currentProfile = null;
+ });
+ }
+ onCPUProfileStart(opts, cb) {
+ if (typeof cb !== 'function') {
+ cb = opts;
+ opts = {};
+ }
+ if (typeof opts !== 'object' || opts === null) {
+ opts = {};
+ }
+ if (this.profiler === undefined) {
+ return cb({
+ err: 'Profiler not available',
+ success: false
+ });
+ }
+ if (this.currentProfile !== null) {
+ return cb({
+ err: 'A profiling is already running',
+ success: false
+ });
+ }
+ this.currentProfile = new CurrentProfile();
+ this.currentProfile.uuid = miscellaneous_1.default.generateUUID();
+ this.currentProfile.startTime = Date.now();
+ this.currentProfile.initiated = typeof opts.initiated === 'string'
+ ? opts.initiated : 'manual';
+ cb({ success: true, uuid: this.currentProfile.uuid });
+ if (process.hasOwnProperty('_startProfilerIdleNotifier') === true) {
+ process._startProfilerIdleNotifier();
+ }
+ this.profiler.getSession().post('Profiler.start');
+ if (isNaN(parseInt(opts.timeout, 10)))
+ return;
+ const duration = parseInt(opts.timeout, 10);
+ setTimeout(_ => {
+ this.onCPUProfileStop(_ => {
+ return;
+ });
+ }, duration);
+ }
+ onCPUProfileStop(cb) {
+ if (this.currentProfile === null) {
+ return cb({
+ err: 'No profiling are already running',
+ success: false
+ });
+ }
+ if (this.profiler === undefined) {
+ return cb({
+ err: 'Profiler not available',
+ success: false
+ });
+ }
+ cb({ success: true, uuid: this.currentProfile.uuid });
+ if (process.hasOwnProperty('_stopProfilerIdleNotifier') === true) {
+ process._stopProfilerIdleNotifier();
+ }
+ this.profiler.getSession().post('Profiler.stop', (_, res) => {
+ if (this.currentProfile === null)
+ return;
+ if (this.transport === undefined)
+ return;
+ const profile = res.profile;
+ const data = JSON.stringify(profile);
+ this.transport.send('profilings', {
+ uuid: this.currentProfile.uuid,
+ duration: Date.now() - this.currentProfile.startTime,
+ at: this.currentProfile.startTime,
+ data,
+ success: true,
+ initiated: this.currentProfile.initiated,
+ type: 'cpuprofile',
+ cpuprofile: true
+ });
+ this.currentProfile = null;
+ });
+ }
+ onHeapdump(opts, cb) {
+ if (typeof cb !== 'function') {
+ cb = opts;
+ opts = {};
+ }
+ if (typeof opts !== 'object' || opts === null) {
+ opts = {};
+ }
+ if (this.profiler === undefined) {
+ return cb({
+ err: 'Profiler not available',
+ success: false
+ });
+ }
+ cb({ success: true });
+ setTimeout(() => {
+ const startTime = Date.now();
+ this.takeSnapshot()
+ .then(data => {
+ return this.transport.send('profilings', {
+ data,
+ at: startTime,
+ initiated: typeof opts.initiated === 'string' ? opts.initiated : 'manual',
+ duration: Date.now() - startTime,
+ type: 'heapdump'
+ });
+ }).catch(err => {
+ return cb({
+ success: err.message,
+ err: err
+ });
+ });
+ }, 200);
+ }
+ takeSnapshot() {
+ return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
+ if (this.profiler === undefined)
+ return reject(new Error(`Profiler not available`));
+ const chunks = [];
+ const chunkHandler = (raw) => {
+ const data = raw.params;
+ chunks.push(data.chunk);
+ };
+ this.profiler.getSession().on('HeapProfiler.addHeapSnapshotChunk', chunkHandler);
+ yield this.profiler.getSession().post('HeapProfiler.takeHeapSnapshot', {
+ reportProgress: false
+ });
+ this.profiler.getSession().removeListener('HeapProfiler.addHeapSnapshotChunk', chunkHandler);
+ return resolve(chunks.join(''));
+ }));
+ }
+}
+exports.default = InspectorProfiler;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5zcGVjdG9yUHJvZmlsZXIuanMiLCJzb3Vy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TtZQUNELElBQUksQ0FBQyxRQUFRLENBQUMsVUFBVSxFQUFFLENBQUMsRUFBRSxDQUFDLG1DQUFtQyxFQUFFLFlBQVksQ0FBQyxDQUFBO1lBRWhGLE1BQU0sSUFBSSxDQUFDLFFBQVEsQ0FBQyxVQUFVLEVBQUUsQ0FBQyxJQUFJLENBQUMsK0JBQStCLEVBQUU7Z0JBQ3JFLGNBQWMsRUFBRSxLQUFLO2FBQ3RCLENBQUMsQ0FBQTtZQUVGLElBQUksQ0FBQyxRQUFRLENBQUMsVUFBVSxFQUFFLENBQUMsY0FBYyxDQUFDLG1DQUFtQyxFQUFFLFlBQVksQ0FBQyxDQUFBO1lBQzVGLE9BQU8sT0FBTyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQTtRQUNqQyxDQUFDLENBQUEsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNGO0FBdlRELG9DQXVUQyJ9
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/serviceManager.d.ts b/node_modules/@pm2/io/build/main/serviceManager.d.ts
new file mode 100644
index 0000000..ca7e3ee
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/serviceManager.d.ts
@@ -0,0 +1,7 @@
+export declare class Service {
+}
+export declare class ServiceManager {
+ static get(serviceName: string): any | undefined;
+ static set(serviceName: string, service: Service): Map;
+ static reset(serviceName: string): boolean;
+}
diff --git a/node_modules/@pm2/io/build/main/serviceManager.js b/node_modules/@pm2/io/build/main/serviceManager.js
new file mode 100644
index 0000000..50fb870
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/serviceManager.js
@@ -0,0 +1,20 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ServiceManager = exports.Service = void 0;
+const services = new Map();
+class Service {
+}
+exports.Service = Service;
+class ServiceManager {
+ static get(serviceName) {
+ return services.get(serviceName);
+ }
+ static set(serviceName, service) {
+ return services.set(serviceName, service);
+ }
+ static reset(serviceName) {
+ return services.delete(serviceName);
+ }
+}
+exports.ServiceManager = ServiceManager;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZU1hbmFnZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VydmljZU1hbmFnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsTUFBTSxRQUFRLEdBQXFCLElBQUksR0FBRyxFQUFlLENBQUE7QUFFekQsTUFBYSxPQUFPO0NBQUc7QUFBdkIsMEJBQXVCO0FBRXZCLE1BQWEsY0FBYztJQUVsQixNQUFNLENBQUMsR0FBRyxDQUFFLFdBQW1CO1FBQ3BDLE9BQU8sUUFBUSxDQUFDLEdBQUcsQ0FBQyxXQUFXLENBQUMsQ0FBQTtJQUNsQyxDQUFDO0lBRU0sTUFBTSxDQUFDLEdBQUcsQ0FBRSxXQUFtQixFQUFFLE9BQWdCO1FBQ3RELE9BQU8sUUFBUSxDQUFDLEdBQUcsQ0FBQyxXQUFXLEVBQUUsT0FBTyxDQUFDLENBQUE7SUFDM0MsQ0FBQztJQUVNLE1BQU0sQ0FBQyxLQUFLLENBQUUsV0FBbUI7UUFDdEMsT0FBTyxRQUFRLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxDQUFBO0lBQ3JDLENBQUM7Q0FDRjtBQWJELHdDQWFDIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/services/actions.d.ts b/node_modules/@pm2/io/build/main/services/actions.d.ts
new file mode 100644
index 0000000..d2ad7c5
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/services/actions.d.ts
@@ -0,0 +1,20 @@
+export declare class Action {
+ handler: Function;
+ name: string;
+ type: string;
+ isScoped: boolean;
+ callback?: Function;
+ arity: number;
+ opts: Object | null | undefined;
+}
+export declare class ActionService {
+ private timer;
+ private transport;
+ private actions;
+ private logger;
+ private listener;
+ init(): void;
+ destroy(): void;
+ registerAction(actionName?: string, opts?: Object | undefined | Function, handler?: Function): void;
+ scopedAction(actionName?: string, handler?: Function): any;
+}
diff --git a/node_modules/@pm2/io/build/main/services/actions.js b/node_modules/@pm2/io/build/main/services/actions.js
new file mode 100644
index 0000000..94ac6f8
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/services/actions.js
@@ -0,0 +1,147 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ActionService = exports.Action = void 0;
+const serviceManager_1 = require("../serviceManager");
+const Debug = require("debug");
+class Action {
+}
+exports.Action = Action;
+class ActionService {
+ constructor() {
+ this.timer = undefined;
+ this.transport = undefined;
+ this.actions = new Map();
+ this.logger = Debug('axm:services:actions');
+ }
+ listener(data) {
+ this.logger(`Received new message from reverse`);
+ if (!data)
+ return false;
+ const actionName = data.msg ? data.msg : data.action_name ? data.action_name : data;
+ let action = this.actions.get(actionName);
+ if (typeof action !== 'object') {
+ return this.logger(`Received action ${actionName} but failed to find the implementation`);
+ }
+ if (!action.isScoped) {
+ this.logger(`Succesfully called custom action ${action.name} with arity ${action.handler.length}`);
+ if (action.handler.length === 2) {
+ let params = {};
+ if (typeof data === 'object') {
+ params = data.opts;
+ }
+ return action.handler(params, action.callback);
+ }
+ return action.handler(action.callback);
+ }
+ if (data.uuid === undefined) {
+ return this.logger(`Received scoped action ${action.name} but without uuid`);
+ }
+ const stream = {
+ send: (dt) => {
+ this.transport.send('axm:scoped_action:stream', {
+ data: dt,
+ uuid: data.uuid,
+ action_name: actionName
+ });
+ },
+ error: (dt) => {
+ this.transport.send('axm:scoped_action:error', {
+ data: dt,
+ uuid: data.uuid,
+ action_name: actionName
+ });
+ },
+ end: (dt) => {
+ this.transport.send('axm:scoped_action:end', {
+ data: dt,
+ uuid: data.uuid,
+ action_name: actionName
+ });
+ }
+ };
+ this.logger(`Succesfully called scoped action ${action.name}`);
+ return action.handler(data.opts || {}, stream);
+ }
+ init() {
+ this.transport = serviceManager_1.ServiceManager.get('transport');
+ if (this.transport === undefined) {
+ return this.logger(`Failed to load transport service`);
+ }
+ this.actions.clear();
+ this.transport.on('data', this.listener.bind(this));
+ }
+ destroy() {
+ if (this.timer !== undefined) {
+ clearInterval(this.timer);
+ }
+ if (this.transport !== undefined) {
+ this.transport.removeListener('data', this.listener.bind(this));
+ }
+ }
+ registerAction(actionName, opts, handler) {
+ if (typeof opts === 'function') {
+ handler = opts;
+ opts = undefined;
+ }
+ if (typeof actionName !== 'string') {
+ console.error(`You must define an name when registering an action`);
+ return;
+ }
+ if (typeof handler !== 'function') {
+ console.error(`You must define an callback when registering an action`);
+ return;
+ }
+ if (this.transport === undefined) {
+ return this.logger(`Failed to load transport service`);
+ }
+ let type = 'custom';
+ if (actionName.indexOf('km:') === 0 || actionName.indexOf('internal:') === 0) {
+ type = 'internal';
+ }
+ const reply = (data) => {
+ this.transport.send('axm:reply', {
+ at: new Date().getTime(),
+ action_name: actionName,
+ return: data
+ });
+ };
+ const action = {
+ name: actionName,
+ callback: reply,
+ handler,
+ type,
+ isScoped: false,
+ arity: handler.length,
+ opts
+ };
+ this.logger(`Succesfully registered custom action ${action.name}`);
+ this.actions.set(actionName, action);
+ this.transport.addAction(action);
+ }
+ scopedAction(actionName, handler) {
+ if (typeof actionName !== 'string') {
+ console.error(`You must define an name when registering an action`);
+ return -1;
+ }
+ if (typeof handler !== 'function') {
+ console.error(`You must define an callback when registering an action`);
+ return -1;
+ }
+ if (this.transport === undefined) {
+ return this.logger(`Failed to load transport service`);
+ }
+ const action = {
+ name: actionName,
+ handler,
+ type: 'scoped',
+ isScoped: true,
+ arity: handler.length,
+ opts: null
+ };
+ this.logger(`Succesfully registered scoped action ${action.name}`);
+ this.actions.set(actionName, action);
+ this.transport.addAction(action);
+ }
+}
+exports.ActionService = ActionService;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWN0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIj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U8sQ0FBQyxDQUFDLENBQUE7UUFDWCxDQUFDO1FBQ0QsSUFBSSxPQUFPLE9BQU8sS0FBSyxVQUFVLEVBQUUsQ0FBQztZQUNsQyxPQUFPLENBQUMsS0FBSyxDQUFDLHdEQUF3RCxDQUFDLENBQUE7WUFDdkUsT0FBTyxDQUFDLENBQUMsQ0FBQTtRQUNYLENBQUM7UUFDRCxJQUFJLElBQUksQ0FBQyxTQUFTLEtBQUssU0FBUyxFQUFFLENBQUM7WUFDakMsT0FBTyxJQUFJLENBQUMsTUFBTSxDQUFDLGtDQUFrQyxDQUFDLENBQUE7UUFDeEQsQ0FBQztRQUVELE1BQU0sTUFBTSxHQUFXO1lBQ3JCLElBQUksRUFBRSxVQUFVO1lBQ2hCLE9BQU87WUFDUCxJQUFJLEVBQUUsUUFBUTtZQUNkLFFBQVEsRUFBRSxJQUFJO1lBQ2QsS0FBSyxFQUFFLE9BQU8sQ0FBQyxNQUFNO1lBQ3JCLElBQUksRUFBRSxJQUFJO1NBQ1gsQ0FBQTtRQUNELElBQUksQ0FBQyxNQUFNLENBQUMsd0NBQXdDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFBO1FBQ2xFLElBQUksQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsQ0FBQTtRQUNwQyxJQUFJLENBQUMsU0FBUyxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsQ0FBQTtJQUNsQyxDQUFDO0NBQ0Y7QUF0S0Qsc0NBc0tDIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/services/inspector.d.ts b/node_modules/@pm2/io/build/main/services/inspector.d.ts
new file mode 100644
index 0000000..155eb00
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/services/inspector.d.ts
@@ -0,0 +1,9 @@
+///
+import * as inspector from 'inspector';
+export declare class InspectorService {
+ private session;
+ private logger;
+ init(): inspector.Session;
+ getSession(): inspector.Session;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/services/inspector.js b/node_modules/@pm2/io/build/main/services/inspector.js
new file mode 100644
index 0000000..cab06e4
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/services/inspector.js
@@ -0,0 +1,43 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.InspectorService = void 0;
+const inspector = require("inspector");
+const debug_1 = require("debug");
+class InspectorService {
+ constructor() {
+ this.session = null;
+ this.logger = (0, debug_1.default)('axm:services:inspector');
+ }
+ init() {
+ this.logger(`Creating new inspector session`);
+ this.session = new inspector.Session();
+ this.session.connect();
+ this.logger('Connected to inspector');
+ this.session.post('Profiler.enable');
+ this.session.post('HeapProfiler.enable');
+ return this.session;
+ }
+ getSession() {
+ if (this.session === null) {
+ this.session = this.init();
+ return this.session;
+ }
+ else {
+ return this.session;
+ }
+ }
+ destroy() {
+ if (this.session !== null) {
+ this.session.post('Profiler.disable');
+ this.session.post('HeapProfiler.disable');
+ this.session.disconnect();
+ this.session = null;
+ }
+ else {
+ this.logger('No open session');
+ }
+ }
+}
+exports.InspectorService = InspectorService;
+module.exports = InspectorService;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5zcGVjdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NlcnZpY2VzL2luc3BlY3Rvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx1Q0FBc0M7QUFDdEMsaUNBQXlCO0FBRXpCLE1BQWEsZ0JBQWdCO0lBQTdCO1FBRVUsWUFBTyxHQUE2QixJQUFJLENBQUE7UUFDeEMsV0FBTSxHQUFhLElBQUEsZUFBSyxFQUFDLHdCQUF3QixDQUFDLENBQUE7SUErQjVELENBQUM7SUE3QkMsSUFBSTtRQUNGLElBQUksQ0FBQyxNQUFNLENBQUMsZ0NBQWdDLENBQUMsQ0FBQTtRQUM3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QTtRQUNoQyxDQUFDO0lBQ0gsQ0FBQztDQUNGO0FBbENELDRDQWtDQztBQUVELE1BQU0sQ0FBQyxPQUFPLEdBQUcsZ0JBQWdCLENBQUEifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/services/metrics.d.ts b/node_modules/@pm2/io/build/main/services/metrics.d.ts
new file mode 100644
index 0000000..cbd9b68
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/services/metrics.d.ts
@@ -0,0 +1,63 @@
+import Meter from '../utils/metrics/meter';
+import Counter from '../utils/metrics/counter';
+import Histogram from '../utils/metrics/histogram';
+import { Service } from '../serviceManager';
+import Gauge from '../utils/metrics/gauge';
+export declare enum MetricType {
+ 'meter' = "meter",
+ 'histogram' = "histogram",
+ 'counter' = "counter",
+ 'gauge' = "gauge",
+ 'metric' = "metric"
+}
+export declare enum MetricMeasurements {
+ 'min' = "min",
+ 'max' = "max",
+ 'sum' = "sum",
+ 'count' = "count",
+ 'variance' = "variance",
+ 'mean' = "mean",
+ 'stddev' = "stddev",
+ 'median' = "median",
+ 'p75' = "p75",
+ 'p95' = "p95",
+ 'p99' = "p99",
+ 'p999' = "p999"
+}
+export interface InternalMetric {
+ name?: string;
+ type?: MetricType;
+ id?: string;
+ historic?: boolean;
+ unit?: string;
+ handler: Function;
+ implementation: any;
+ value?: number;
+}
+export declare class Metric {
+ name?: string;
+ id?: string;
+ historic?: boolean;
+ unit?: string;
+ value?: () => number;
+}
+export declare class MetricBulk extends Metric {
+ type: MetricType;
+}
+export declare class HistogramOptions extends Metric {
+ measurement: MetricMeasurements;
+}
+export declare class MetricService implements Service {
+ private metrics;
+ private timer;
+ private transport;
+ private logger;
+ init(): void;
+ registerMetric(metric: InternalMetric): void;
+ meter(opts: Metric): Meter;
+ counter(opts: Metric): Counter;
+ histogram(opts: HistogramOptions): Histogram;
+ metric(opts: Metric): Gauge;
+ deleteMetric(name: string): boolean;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/services/metrics.js b/node_modules/@pm2/io/build/main/services/metrics.js
new file mode 100644
index 0000000..3578496
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/services/metrics.js
@@ -0,0 +1,187 @@
+'use strict';
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.MetricService = exports.HistogramOptions = exports.MetricBulk = exports.Metric = exports.MetricMeasurements = exports.MetricType = void 0;
+const meter_1 = require("../utils/metrics/meter");
+const counter_1 = require("../utils/metrics/counter");
+const histogram_1 = require("../utils/metrics/histogram");
+const serviceManager_1 = require("../serviceManager");
+const constants_1 = require("../constants");
+const Debug = require("debug");
+const gauge_1 = require("../utils/metrics/gauge");
+var MetricType;
+(function (MetricType) {
+ MetricType["meter"] = "meter";
+ MetricType["histogram"] = "histogram";
+ MetricType["counter"] = "counter";
+ MetricType["gauge"] = "gauge";
+ MetricType["metric"] = "metric";
+})(MetricType || (exports.MetricType = MetricType = {}));
+var MetricMeasurements;
+(function (MetricMeasurements) {
+ MetricMeasurements["min"] = "min";
+ MetricMeasurements["max"] = "max";
+ MetricMeasurements["sum"] = "sum";
+ MetricMeasurements["count"] = "count";
+ MetricMeasurements["variance"] = "variance";
+ MetricMeasurements["mean"] = "mean";
+ MetricMeasurements["stddev"] = "stddev";
+ MetricMeasurements["median"] = "median";
+ MetricMeasurements["p75"] = "p75";
+ MetricMeasurements["p95"] = "p95";
+ MetricMeasurements["p99"] = "p99";
+ MetricMeasurements["p999"] = "p999";
+})(MetricMeasurements || (exports.MetricMeasurements = MetricMeasurements = {}));
+class Metric {
+}
+exports.Metric = Metric;
+class MetricBulk extends Metric {
+}
+exports.MetricBulk = MetricBulk;
+class HistogramOptions extends Metric {
+}
+exports.HistogramOptions = HistogramOptions;
+class MetricService {
+ constructor() {
+ this.metrics = new Map();
+ this.timer = null;
+ this.transport = null;
+ this.logger = Debug('axm:services:metrics');
+ }
+ init() {
+ this.transport = serviceManager_1.ServiceManager.get('transport');
+ if (this.transport === null)
+ return this.logger('Failed to init metrics service cause no transporter');
+ this.logger('init');
+ this.timer = setInterval(() => {
+ if (this.transport === null)
+ return this.logger('Abort metrics update since transport is not available');
+ this.logger('refreshing metrics value');
+ for (let metric of this.metrics.values()) {
+ metric.value = metric.handler();
+ }
+ this.logger('sending update metrics value to transporter');
+ const metricsToSend = Array.from(this.metrics.values())
+ .filter(metric => {
+ if (metric === null || metric === undefined)
+ return false;
+ if (metric.value === undefined || metric.value === null)
+ return false;
+ const isNumber = typeof metric.value === 'number';
+ const isString = typeof metric.value === 'string';
+ const isBoolean = typeof metric.value === 'boolean';
+ const isValidNumber = !isNaN(metric.value);
+ return isString || isBoolean || (isNumber && isValidNumber);
+ });
+ this.transport.setMetrics(metricsToSend);
+ }, constants_1.default.METRIC_INTERVAL);
+ this.timer.unref();
+ }
+ registerMetric(metric) {
+ if (typeof metric.name !== 'string') {
+ console.error(`Invalid metric name declared: ${metric.name}`);
+ return console.trace();
+ }
+ else if (typeof metric.type !== 'string') {
+ console.error(`Invalid metric type declared: ${metric.type}`);
+ return console.trace();
+ }
+ else if (typeof metric.handler !== 'function') {
+ console.error(`Invalid metric handler declared: ${metric.handler}`);
+ return console.trace();
+ }
+ if (typeof metric.historic !== 'boolean') {
+ metric.historic = true;
+ }
+ this.logger(`Registering new metric: ${metric.name}`);
+ this.metrics.set(metric.name, metric);
+ }
+ meter(opts) {
+ const metric = {
+ name: opts.name,
+ type: MetricType.meter,
+ id: opts.id,
+ historic: opts.historic,
+ implementation: new meter_1.default(opts),
+ unit: opts.unit,
+ handler: function () {
+ return this.implementation.isUsed() ? this.implementation.val() : NaN;
+ }
+ };
+ this.registerMetric(metric);
+ return metric.implementation;
+ }
+ counter(opts) {
+ const metric = {
+ name: opts.name,
+ type: MetricType.counter,
+ id: opts.id,
+ historic: opts.historic,
+ implementation: new counter_1.default(opts),
+ unit: opts.unit,
+ handler: function () {
+ return this.implementation.isUsed() ? this.implementation.val() : NaN;
+ }
+ };
+ this.registerMetric(metric);
+ return metric.implementation;
+ }
+ histogram(opts) {
+ if (opts.measurement === undefined || opts.measurement === null) {
+ opts.measurement = MetricMeasurements.mean;
+ }
+ const metric = {
+ name: opts.name,
+ type: MetricType.histogram,
+ id: opts.id,
+ historic: opts.historic,
+ implementation: new histogram_1.default(opts),
+ unit: opts.unit,
+ handler: function () {
+ return this.implementation.isUsed() ?
+ (Math.round(this.implementation.val() * 100) / 100) : NaN;
+ }
+ };
+ this.registerMetric(metric);
+ return metric.implementation;
+ }
+ metric(opts) {
+ let metric;
+ if (typeof opts.value === 'function') {
+ metric = {
+ name: opts.name,
+ type: MetricType.gauge,
+ id: opts.id,
+ implementation: undefined,
+ historic: opts.historic,
+ unit: opts.unit,
+ handler: opts.value
+ };
+ }
+ else {
+ metric = {
+ name: opts.name,
+ type: MetricType.gauge,
+ id: opts.id,
+ historic: opts.historic,
+ implementation: new gauge_1.default(),
+ unit: opts.unit,
+ handler: function () {
+ return this.implementation.isUsed() ? this.implementation.val() : NaN;
+ }
+ };
+ }
+ this.registerMetric(metric);
+ return metric.implementation;
+ }
+ deleteMetric(name) {
+ return this.metrics.delete(name);
+ }
+ destroy() {
+ if (this.timer !== null) {
+ clearInterval(this.timer);
+ }
+ this.metrics.clear();
+ }
+}
+exports.MetricService = MetricService;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0cmljcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zZXJ2aWNlcy9tZXRyaWNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFlBQVksQ0FBQTs7O0FBRVosa0RBQTBDO0FBQzFDLHNEQUE4QztBQUM5QywwREFBa0Q7QUFDbEQsc0RBQTJEO0FBQzNELDRDQUFvQztBQUVwQywrQkFBOEI7QUFDOUIsa0RBQTBDO0FBRTFDLElBQVksVUFNWDtBQU5ELFdBQVksVUFBVTtJQUNwQiw2QkFBaUIsQ0FBQTtJQUNqQixxQ0FB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BQUUsSUFBSSxDQUFDLEVBQUU7Z0JBQ1gsUUFBUSxFQUFFLElBQUksQ0FBQyxRQUFRO2dCQUN2QixjQUFjLEVBQUUsSUFBSSxlQUFLLEVBQUU7Z0JBQzNCLElBQUksRUFBRSxJQUFJLENBQUMsSUFBSTtnQkFDZixPQUFPLEVBQUU7b0JBQ1AsT0FBTyxJQUFJLENBQUMsY0FBYyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUE7Z0JBQ3ZFLENBQUM7YUFDRixDQUFBO1FBQ0gsQ0FBQztRQUVELElBQUksQ0FBQyxjQUFjLENBQUMsTUFBTSxDQUFDLENBQUE7UUFFM0IsT0FBTyxNQUFNLENBQUMsY0FBYyxDQUFBO0lBQzlCLENBQUM7SUFFRCxZQUFZLENBQUUsSUFBWTtRQUN4QixPQUFPLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFBO0lBQ2xDLENBQUM7SUFFRCxPQUFPO1FBQ0wsSUFBSSxJQUFJLENBQUMsS0FBSyxLQUFLLElBQUksRUFBRSxDQUFDO1lBQ3hCLGFBQWEsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUE7UUFDM0IsQ0FBQztRQUNELElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLENBQUE7SUFDdEIsQ0FBQztDQUNGO0FBOUpELHNDQThKQyJ9
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/services/runtimeStats.d.ts b/node_modules/@pm2/io/build/main/services/runtimeStats.d.ts
new file mode 100644
index 0000000..d652bd1
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/services/runtimeStats.d.ts
@@ -0,0 +1,10 @@
+import { EventEmitter2 } from 'eventemitter2';
+export declare class RuntimeStatsService extends EventEmitter2 {
+ private logger;
+ private handle;
+ private noduleInstance;
+ private enabled;
+ init(): any;
+ isEnabled(): boolean;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/services/runtimeStats.js b/node_modules/@pm2/io/build/main/services/runtimeStats.js
new file mode 100644
index 0000000..2f48ba9
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/services/runtimeStats.js
@@ -0,0 +1,50 @@
+'use strict';
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.RuntimeStatsService = void 0;
+const debug_1 = require("debug");
+const module_1 = require("../utils/module");
+const eventemitter2_1 = require("eventemitter2");
+class RuntimeStatsService extends eventemitter2_1.EventEmitter2 {
+ constructor() {
+ super(...arguments);
+ this.logger = (0, debug_1.default)('axm:services:runtimeStats');
+ this.enabled = false;
+ }
+ init() {
+ this.logger('init');
+ if (process.env.PM2_APM_DISABLE_RUNTIME_STATS === 'true') {
+ return this.logger('disabling service because of the environment flag');
+ }
+ const modulePath = module_1.default.detectModule('@pm2/node-runtime-stats');
+ if (typeof modulePath !== 'string')
+ return;
+ const RuntimeStats = module_1.default.loadModule(modulePath);
+ if (RuntimeStats instanceof Error) {
+ return this.logger(`Failed to require module @pm2/node-runtime-stats: ${RuntimeStats.message}`);
+ }
+ this.noduleInstance = new RuntimeStats({
+ delay: 1000
+ });
+ this.logger('starting runtime stats');
+ this.noduleInstance.start();
+ this.handle = (data) => {
+ this.logger('received runtime stats', data);
+ this.emit('data', data);
+ };
+ this.noduleInstance.on('sense', this.handle);
+ this.enabled = true;
+ }
+ isEnabled() {
+ return this.enabled;
+ }
+ destroy() {
+ if (this.noduleInstance !== undefined && this.noduleInstance !== null) {
+ this.logger('removing listener on runtime stats service');
+ this.noduleInstance.removeListener('sense', this.handle);
+ this.noduleInstance.stop();
+ }
+ this.logger('destroy');
+ }
+}
+exports.RuntimeStatsService = RuntimeStatsService;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnVudGltZVN0YXRzLmpzIiwic291cmNlUm9vdC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DLE1BQU0sQ0FBQyx3QkFBd0IsQ0FBQyxDQUFBO1FBQ3JDLElBQUksQ0FBQyxjQUFjLENBQUMsS0FBSyxFQUFFLENBQUE7UUFDM0IsSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLElBQUksRUFBRSxFQUFFO1lBQ3JCLElBQUksQ0FBQyxNQUFNLENBQUMsd0JBQXdCLEVBQUUsSUFBSSxDQUFDLENBQUE7WUFDM0MsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUUsSUFBSSxDQUFDLENBQUE7UUFDekIsQ0FBQyxDQUFBO1FBR0QsSUFBSSxDQUFDLGNBQWMsQ0FBQyxFQUFFLENBQUMsT0FBTyxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQTtRQUM1QyxJQUFJLENBQUMsT0FBTyxHQUFHLElBQUksQ0FBQTtJQUNyQixDQUFDO0lBS0QsU0FBUztRQUNQLE9BQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQTtJQUNyQixDQUFDO0lBRUQsT0FBTztRQUNMLElBQUksSUFBSSxDQUFDLGNBQWMsS0FBSyxTQUFTLElBQUksSUFBSSxDQUFDLGNBQWMsS0FBSyxJQUFJLEVBQUUsQ0FBQztZQUN0RSxJQUFJLENBQUMsTUFBTSxDQUFDLDRDQUE0QyxDQUFDLENBQUE7WUFDekQsSUFBSSxDQUFDLGNBQWMsQ0FBQyxjQUFjLENBQUMsT0FBTyxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQTtZQUN4RCxJQUFJLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxDQUFBO1FBQzVCLENBQUM7UUFDRCxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFBO0lBQ3hCLENBQUM7Q0FDRjtBQWxERCxrREFrREMifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/services/transport.d.ts b/node_modules/@pm2/io/build/main/services/transport.d.ts
new file mode 100644
index 0000000..686ee98
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/services/transport.d.ts
@@ -0,0 +1,22 @@
+import { Action } from './actions';
+import { InternalMetric } from './metrics';
+import { EventEmitter2 } from 'eventemitter2';
+export declare class TransportConfig {
+ publicKey: string;
+ secretKey: string;
+ appName: string;
+ serverName?: string;
+ sendLogs?: Boolean;
+ logFilter?: string | RegExp;
+ disableLogs?: Boolean;
+ proxy?: string;
+}
+export interface Transport extends EventEmitter2 {
+ init: (config: TransportConfig) => Transport;
+ destroy: () => void;
+ send: (channel: string, payload: Object) => void;
+ addAction: (action: Action) => void;
+ setMetrics: (metrics: InternalMetric[]) => void;
+ setOptions: (options: any) => void;
+}
+export declare function createTransport(name: string, config: TransportConfig): Transport;
diff --git a/node_modules/@pm2/io/build/main/services/transport.js b/node_modules/@pm2/io/build/main/services/transport.js
new file mode 100644
index 0000000..d0a0a4e
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/services/transport.js
@@ -0,0 +1,14 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.createTransport = exports.TransportConfig = void 0;
+const IPCTransport_1 = require("../transports/IPCTransport");
+class TransportConfig {
+}
+exports.TransportConfig = TransportConfig;
+function createTransport(name, config) {
+ const transport = new IPCTransport_1.IPCTransport();
+ transport.init(config);
+ return transport;
+}
+exports.createTransport = createTransport;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNwb3J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NlcnZpY2VzL3RyYW5zcG9ydC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFHQSw2REFBeUQ7QUFJekQsTUFBYSxlQUFlO0NBMEMzQjtBQTFDRCwwQ0EwQ0M7QUFnQ0QsU0FBZ0IsZUFBZSxDQUFFLElBQVksRUFBRSxNQUF1QjtJQUNwRSxNQUFNLFNBQVMsR0FBRyxJQUFJLDJCQUFZLEVBQUUsQ0FBQTtJQUNwQyxTQUFTLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFBO0lBQ3RCLE9BQU8sU0FBUyxDQUFBO0FBZWxCLENBQUM7QUFsQkQsMENBa0JDIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/transports/IPCTransport.d.ts b/node_modules/@pm2/io/build/main/transports/IPCTransport.d.ts
new file mode 100644
index 0000000..21f45df
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/transports/IPCTransport.d.ts
@@ -0,0 +1,17 @@
+import { Transport, TransportConfig } from '../services/transport';
+import { Action } from '../services/actions';
+import { InternalMetric } from '../services/metrics';
+import { EventEmitter2 } from 'eventemitter2';
+export declare class IPCTransport extends EventEmitter2 implements Transport {
+ private initiated;
+ private logger;
+ private onMessage;
+ private autoExitHandle;
+ init(config?: TransportConfig): Transport;
+ private autoExitHook;
+ setMetrics(metrics: InternalMetric[]): void;
+ addAction(action: Action): void;
+ setOptions(options: any): -1 | undefined;
+ send(channel: any, payload: any): -1 | undefined;
+ destroy(): void;
+}
diff --git a/node_modules/@pm2/io/build/main/transports/IPCTransport.js b/node_modules/@pm2/io/build/main/transports/IPCTransport.js
new file mode 100644
index 0000000..eae1236
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/transports/IPCTransport.js
@@ -0,0 +1,103 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.IPCTransport = void 0;
+const Debug = require("debug");
+const eventemitter2_1 = require("eventemitter2");
+const cluster = require("cluster");
+class IPCTransport extends eventemitter2_1.EventEmitter2 {
+ constructor() {
+ super(...arguments);
+ this.initiated = false;
+ this.logger = Debug('axm:transport:ipc');
+ }
+ init(config) {
+ this.logger('Init new transport service');
+ if (this.initiated === true) {
+ console.error(`Trying to re-init the transport, please avoid`);
+ return this;
+ }
+ this.initiated = true;
+ this.logger('Agent launched');
+ this.onMessage = (data) => {
+ this.logger(`Received reverse message from IPC`);
+ this.emit('data', data);
+ };
+ process.on('message', this.onMessage);
+ if (cluster.isWorker === false) {
+ this.autoExitHook();
+ }
+ return this;
+ }
+ autoExitHook() {
+ this.autoExitHandle = setInterval(() => {
+ let currentProcess = (cluster.isWorker) ? cluster.worker.process : process;
+ if (currentProcess._getActiveHandles().length === 3) {
+ let handlers = currentProcess._getActiveHandles().map(h => h.constructor.name);
+ if (handlers.includes('Pipe') === true &&
+ handlers.includes('Socket') === true) {
+ process.removeListener('message', this.onMessage);
+ let tmp = setTimeout(_ => {
+ this.logger(`Still alive, listen back to IPC`);
+ process.on('message', this.onMessage);
+ }, 200);
+ tmp.unref();
+ }
+ }
+ }, 3000);
+ this.autoExitHandle.unref();
+ }
+ setMetrics(metrics) {
+ const serializedMetric = metrics.reduce((object, metric) => {
+ if (typeof metric.name !== 'string')
+ return object;
+ object[metric.name] = {
+ historic: metric.historic,
+ unit: metric.unit,
+ type: metric.id,
+ value: metric.value
+ };
+ return object;
+ }, {});
+ this.send('axm:monitor', serializedMetric);
+ }
+ addAction(action) {
+ this.logger(`Add action: ${action.name}:${action.type}`);
+ this.send('axm:action', {
+ action_name: action.name,
+ action_type: action.type,
+ arity: action.arity,
+ opts: action.opts
+ });
+ }
+ setOptions(options) {
+ this.logger(`Set options: [${Object.keys(options).join(',')}]`);
+ return this.send('axm:option:configuration', options);
+ }
+ send(channel, payload) {
+ if (typeof process.send !== 'function')
+ return -1;
+ if (process.connected === false) {
+ console.error('Process disconnected from parent! (not connected)');
+ return process.exit(1);
+ }
+ try {
+ process.send({ type: channel, data: payload });
+ }
+ catch (err) {
+ this.logger('Process disconnected from parent !');
+ this.logger(err);
+ return process.exit(1);
+ }
+ }
+ destroy() {
+ if (this.onMessage !== undefined) {
+ process.removeListener('message', this.onMessage);
+ }
+ if (this.autoExitHandle !== undefined) {
+ clearInterval(this.autoExitHandle);
+ }
+ this.logger('destroy');
+ }
+}
+exports.IPCTransport = IPCTransport;
+//# sourceMappingURL=data:application/json;base64,eyJ2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BQTtRQUN4QixDQUFDO0lBQ0gsQ0FBQztJQUVELE9BQU87UUFDTCxJQUFJLElBQUksQ0FBQyxTQUFTLEtBQUssU0FBUyxFQUFFLENBQUM7WUFDakMsT0FBTyxDQUFDLGNBQWMsQ0FBQyxTQUFTLEVBQUUsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFBO1FBQ25ELENBQUM7UUFDRCxJQUFJLElBQUksQ0FBQyxjQUFjLEtBQUssU0FBUyxFQUFFLENBQUM7WUFDdEMsYUFBYSxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsQ0FBQTtRQUNwQyxDQUFDO1FBQ0QsSUFBSSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQTtJQUN4QixDQUFDO0NBQ0Y7QUEzR0Qsb0NBMkdDIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/transports/WebsocketTransport.d.ts b/node_modules/@pm2/io/build/main/transports/WebsocketTransport.d.ts
new file mode 100644
index 0000000..e69de29
diff --git a/node_modules/@pm2/io/build/main/transports/WebsocketTransport.js b/node_modules/@pm2/io/build/main/transports/WebsocketTransport.js
new file mode 100644
index 0000000..83b515d
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/transports/WebsocketTransport.js
@@ -0,0 +1 @@
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiV2Vic29ja2V0VHJhbnNwb3J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3RyYW5zcG9ydHMvV2Vic29ja2V0VHJhbnNwb3J0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/BinaryHeap.d.ts b/node_modules/@pm2/io/build/main/utils/BinaryHeap.d.ts
new file mode 100644
index 0000000..c192bc1
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/BinaryHeap.d.ts
@@ -0,0 +1,16 @@
+export default class BinaryHeap {
+ private _elements;
+ constructor(options: any);
+ add(): void;
+ first(): any;
+ removeFirst(): any;
+ clone(): BinaryHeap;
+ toSortedArray(): any[];
+ toArray(): never[];
+ size(): any;
+ _bubble(bubbleIndex: any): void;
+ _sink(sinkIndex: any): void;
+ _parentIndex(index: any): number;
+ _childIndexes(index: any): number[];
+ _score(element: any): any;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/BinaryHeap.js b/node_modules/@pm2/io/build/main/utils/BinaryHeap.js
new file mode 100644
index 0000000..8c8b48a
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/BinaryHeap.js
@@ -0,0 +1,109 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+class BinaryHeap {
+ constructor(options) {
+ options = options || {};
+ this._elements = options.elements || [];
+ this._score = options.score || this._score;
+ }
+ add() {
+ for (let i = 0; i < arguments.length; i++) {
+ const element = arguments[i];
+ this._elements.push(element);
+ this._bubble(this._elements.length - 1);
+ }
+ }
+ first() {
+ return this._elements[0];
+ }
+ removeFirst() {
+ const root = this._elements[0];
+ const last = this._elements.pop();
+ if (this._elements.length > 0) {
+ this._elements[0] = last;
+ this._sink(0);
+ }
+ return root;
+ }
+ clone() {
+ return new BinaryHeap({
+ elements: this.toArray(),
+ score: this._score
+ });
+ }
+ toSortedArray() {
+ const array = [];
+ const clone = this.clone();
+ while (true) {
+ const element = clone.removeFirst();
+ if (element === undefined)
+ break;
+ array.push(element);
+ }
+ return array;
+ }
+ toArray() {
+ return [].concat(this._elements);
+ }
+ size() {
+ return this._elements.length;
+ }
+ _bubble(bubbleIndex) {
+ const bubbleElement = this._elements[bubbleIndex];
+ const bubbleScore = this._score(bubbleElement);
+ while (bubbleIndex > 0) {
+ const parentIndex = this._parentIndex(bubbleIndex);
+ const parentElement = this._elements[parentIndex];
+ const parentScore = this._score(parentElement);
+ if (bubbleScore <= parentScore)
+ break;
+ this._elements[parentIndex] = bubbleElement;
+ this._elements[bubbleIndex] = parentElement;
+ bubbleIndex = parentIndex;
+ }
+ }
+ _sink(sinkIndex) {
+ const sinkElement = this._elements[sinkIndex];
+ const sinkScore = this._score(sinkElement);
+ const length = this._elements.length;
+ while (true) {
+ let swapIndex;
+ let swapScore;
+ let swapElement = null;
+ const childIndexes = this._childIndexes(sinkIndex);
+ for (let i = 0; i < childIndexes.length; i++) {
+ const childIndex = childIndexes[i];
+ if (childIndex >= length)
+ break;
+ const childElement = this._elements[childIndex];
+ const childScore = this._score(childElement);
+ if (childScore > sinkScore) {
+ if (swapScore === undefined || swapScore < childScore) {
+ swapIndex = childIndex;
+ swapScore = childScore;
+ swapElement = childElement;
+ }
+ }
+ }
+ if (swapIndex === undefined)
+ break;
+ this._elements[swapIndex] = sinkElement;
+ this._elements[sinkIndex] = swapElement;
+ sinkIndex = swapIndex;
+ }
+ }
+ _parentIndex(index) {
+ return Math.floor((index - 1) / 2);
+ }
+ _childIndexes(index) {
+ return [
+ 2 * index + 1,
+ 2 * index + 2
+ ];
+ }
+ _score(element) {
+ return element.valueOf();
+ }
+}
+exports.default = BinaryHeap;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQmluYXJ5SGVhcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy91dGlscy9CaW5hcnlIZWFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBcUIsVUFBVTtJQUk3QixZQUFhLE9BQU87UUFDbEIsT0FBTyxHQUFHLE9BQU8sSUFBSSxFQUFFLENBQUE7UUFFdkIsSUFBSSxDQUFDLFNBQVMsR0FBRyxPQUFPLENBQUMsUUFBUSxJQUFJLEVBQUUsQ0FBQTtRQUN2QyxJQUFJLENBQUMsTUFBTSxHQUFHLE9BQU8sQ0FBQyxLQUFLLElBQUksSUFBSSxDQUFDLE1BQU0sQ0FBQTtJQUM1QyxDQUFDO0lBRU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nQkFFNUMsSUFBSSxVQUFVLEdBQUcsU0FBUyxFQUFFLENBQUM7b0JBQzNCLElBQUksU0FBUyxLQUFLLFNBQVMsSUFBSSxTQUFTLEdBQUcsVUFBVSxFQUFFLENBQUM7d0JBQ3RELFNBQVMsR0FBRyxVQUFVLENBQUE7d0JBQ3RCLFNBQVMsR0FBRyxVQUFVLENBQUE7d0JBQ3RCLFdBQVcsR0FBRyxZQUFZLENBQUE7b0JBQzVCLENBQUM7Z0JBQ0gsQ0FBQztZQUNILENBQUM7WUFFRCxJQUFJLFNBQVMsS0FBSyxTQUFTO2dCQUFFLE1BQUs7WUFFbEMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxTQUFTLENBQUMsR0FBRyxXQUFXLENBQUE7WUFDdkMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxTQUFTLENBQUMsR0FBRyxXQUFXLENBQUE7WUFDdkMsU0FBUyxHQUFHLFNBQVMsQ0FBQTtRQUN2QixDQUFDO0lBQ0gsQ0FBQztJQUVELFlBQVksQ0FBRSxLQUFLO1FBQ2pCLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLEtBQUssR0FBRyxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQTtJQUNwQyxDQUFDO0lBRUQsYUFBYSxDQUFFLEtBQUs7UUFDbEIsT0FBTztZQUNMLENBQUMsR0FBRyxLQUFLLEdBQUcsQ0FBQztZQUNiLENBQUMsR0FBRyxLQUFLLEdBQUcsQ0FBQztTQUNkLENBQUE7SUFDSCxDQUFDO0lBRUQsTUFBTSxDQUFFLE9BQU87UUFDYixPQUFPLE9BQU8sQ0FBQyxPQUFPLEVBQUUsQ0FBQTtJQUMxQixDQUFDO0NBQ0Y7QUFwSUQsNkJBb0lDIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/EDS.d.ts b/node_modules/@pm2/io/build/main/utils/EDS.d.ts
new file mode 100644
index 0000000..63d1055
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/EDS.d.ts
@@ -0,0 +1,21 @@
+export default class ExponentiallyDecayingSample {
+ private RESCALE_INTERVAL;
+ private ALPHA;
+ private SIZE;
+ private _elements;
+ private _rescaleInterval;
+ private _alpha;
+ private _size;
+ private _landmark;
+ private _nextRescale;
+ private _mean;
+ constructor(options?: any);
+ update(value: any, timestamp?: any): void;
+ toSortedArray(): any;
+ toArray(): any;
+ _weight(age: any): number;
+ _priority(age: any): number;
+ _random(): number;
+ _rescale(now: any): void;
+ avg(now: any): number;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/EDS.js b/node_modules/@pm2/io/build/main/utils/EDS.js
new file mode 100644
index 0000000..69fab03
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/EDS.js
@@ -0,0 +1,93 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const BinaryHeap_1 = require("./BinaryHeap");
+const units_1 = require("./units");
+class ExponentiallyDecayingSample {
+ constructor(options) {
+ this.RESCALE_INTERVAL = 1 * units_1.default.HOURS;
+ this.ALPHA = 0.015;
+ this.SIZE = 1028;
+ options = options || {};
+ this._elements = new BinaryHeap_1.default({
+ score: function (element) {
+ return -element.priority;
+ }
+ });
+ this._rescaleInterval = options.rescaleInterval || this.RESCALE_INTERVAL;
+ this._alpha = options.alpha || this.ALPHA;
+ this._size = options.size || this.SIZE;
+ this._random = options.random || this._random;
+ this._landmark = null;
+ this._nextRescale = null;
+ this._mean = null;
+ }
+ update(value, timestamp) {
+ const now = Date.now();
+ if (!this._landmark) {
+ this._landmark = now;
+ this._nextRescale = this._landmark + this._rescaleInterval;
+ }
+ timestamp = timestamp || now;
+ const newSize = this._elements.size() + 1;
+ const element = {
+ priority: this._priority(timestamp - this._landmark),
+ value: value
+ };
+ if (newSize <= this._size) {
+ this._elements.add(element);
+ }
+ else if (element.priority > this._elements.first().priority) {
+ this._elements.removeFirst();
+ this._elements.add(element);
+ }
+ if (now >= this._nextRescale)
+ this._rescale(now);
+ }
+ toSortedArray() {
+ return this._elements
+ .toSortedArray()
+ .map(function (element) {
+ return element.value;
+ });
+ }
+ toArray() {
+ return this._elements
+ .toArray()
+ .map(function (element) {
+ return element.value;
+ });
+ }
+ _weight(age) {
+ return Math.exp(this._alpha * (age / 1000));
+ }
+ _priority(age) {
+ return this._weight(age) / this._random();
+ }
+ _random() {
+ return Math.random();
+ }
+ _rescale(now) {
+ now = now || Date.now();
+ const self = this;
+ const oldLandmark = this._landmark;
+ this._landmark = now || Date.now();
+ this._nextRescale = now + this._rescaleInterval;
+ const factor = self._priority(-(self._landmark - oldLandmark));
+ this._elements
+ .toArray()
+ .forEach(function (element) {
+ element.priority *= factor;
+ });
+ }
+ avg(now) {
+ let sum = 0;
+ this._elements
+ .toArray()
+ .forEach(function (element) {
+ sum += element.value;
+ });
+ return (sum / this._elements.size());
+ }
+}
+exports.default = ExponentiallyDecayingSample;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRURTLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3V0aWxzL0VEUy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDZDQUFxQztBQUNyQyxtQ0FBMkI7QUFFM0IsTUFBcUIsMkJBQTJCO0lBYTlDLFlBQWEsT0FBUTtRQVpiLHFCQUFnQixHQUFHLENBQUMsR0FBRyxlQUFLLENBQUMsS0FBSyxDQUFBO1FBQ2xDLFVBQUssR0FBRyxLQUFLLENBQUE7UUFDYixTQUFJLEdBQUcsSUFBSSxDQUFBO1FBV2pCLE9BQU8sR0FBRyxPQUFPLElBQUksRUFBRSxDQUFBO1FBRXZCLElBQUksQ0FBQyxTQUFTLEdBQUcsSUFBSSxvQkFBVSxDQUFDO1lBQzlCLEtBQUssRUFBRSxVQUFVLE9BQU87Z0JBQ3RCLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFBO1lBQzFCLEN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0FBTztZQUN4QixHQUFHLElBQUksT0FBTyxDQUFDLEtBQUssQ0FBQTtRQUN0QixDQUFDLENBQUMsQ0FBQTtRQUNKLE9BQU8sQ0FBQyxHQUFHLEdBQUcsSUFBSSxDQUFDLFNBQVMsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFBO0lBQ3RDLENBQUM7Q0FDRjtBQWpIRCw4Q0FpSEMifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/EWMA.d.ts b/node_modules/@pm2/io/build/main/utils/EWMA.d.ts
new file mode 100644
index 0000000..f1d2849
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/EWMA.d.ts
@@ -0,0 +1,12 @@
+export default class ExponentiallyWeightedMovingAverage {
+ private _timePeriod;
+ private _tickInterval;
+ private _alpha;
+ private _count;
+ private _rate;
+ private TICK_INTERVAL;
+ constructor(timePeriod?: number, tickInterval?: number);
+ update(n: any): void;
+ tick(): void;
+ rate(timeUnit: any): number;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/EWMA.js b/node_modules/@pm2/io/build/main/utils/EWMA.js
new file mode 100644
index 0000000..bbf5659
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/EWMA.js
@@ -0,0 +1,26 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const units_1 = require("./units");
+class ExponentiallyWeightedMovingAverage {
+ constructor(timePeriod, tickInterval) {
+ this._count = 0;
+ this._rate = 0;
+ this.TICK_INTERVAL = 5 * units_1.default.SECONDS;
+ this._timePeriod = timePeriod || 1 * units_1.default.MINUTES;
+ this._tickInterval = tickInterval || this.TICK_INTERVAL;
+ this._alpha = 1 - Math.exp(-this._tickInterval / this._timePeriod);
+ }
+ update(n) {
+ this._count += n;
+ }
+ tick() {
+ const instantRate = this._count / this._tickInterval;
+ this._count = 0;
+ this._rate += (this._alpha * (instantRate - this._rate));
+ }
+ rate(timeUnit) {
+ return (this._rate || 0) * timeUnit;
+ }
+}
+exports.default = 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BSyxDQUFDLENBQUMsQ0FBQTtJQUMxRCxDQUFDO0lBRUQsSUFBSSxDQUFFLFFBQVE7UUFDWixPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssSUFBSSxDQUFDLENBQUMsR0FBRyxRQUFRLENBQUE7SUFDckMsQ0FBQztDQUNGO0FBN0JELHFEQTZCQyJ9
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/autocast.d.ts b/node_modules/@pm2/io/build/main/utils/autocast.d.ts
new file mode 100644
index 0000000..70fa9ac
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/autocast.d.ts
@@ -0,0 +1,13 @@
+export default class Autocast {
+ commonStrings: {
+ true: boolean;
+ false: boolean;
+ undefined: undefined;
+ null: null;
+ NaN: number;
+ };
+ process(key: any, value: any, o: any): void;
+ traverse(o: any, func: any): void;
+ autocast(s: any): any;
+ private _cast;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/autocast.js b/node_modules/@pm2/io/build/main/utils/autocast.js
new file mode 100644
index 0000000..f5432cd
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/autocast.js
@@ -0,0 +1,49 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+class Autocast {
+ constructor() {
+ this.commonStrings = {
+ 'true': true,
+ 'false': false,
+ 'undefined': undefined,
+ 'null': null,
+ 'NaN': NaN
+ };
+ }
+ process(key, value, o) {
+ if (typeof (value) === 'object')
+ return;
+ o[key] = this._cast(value);
+ }
+ traverse(o, func) {
+ for (let i in o) {
+ func.apply(this, [i, o[i], o]);
+ if (o[i] !== null && typeof (o[i]) === 'object') {
+ this.traverse(o[i], func);
+ }
+ }
+ }
+ autocast(s) {
+ if (typeof (s) === 'object') {
+ this.traverse(s, this.process);
+ return s;
+ }
+ return this._cast(s);
+ }
+ _cast(s) {
+ let key;
+ if (s instanceof Date)
+ return s;
+ if (typeof s === 'boolean')
+ return s;
+ if (!isNaN(s))
+ return Number(s);
+ for (key in this.commonStrings) {
+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SSxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUMsSUFBSSxDQUFDLENBQUE7WUFDMUIsQ0FBQztRQUNILENBQUM7SUFDSCxDQUFDO0lBS0QsUUFBUSxDQUFFLENBQUM7UUFDVCxJQUFJLE9BQU0sQ0FBQyxDQUFDLENBQUMsS0FBSyxRQUFRLEVBQUUsQ0FBQztZQUMzQixJQUFJLENBQUMsUUFBUSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUE7WUFDOUIsT0FBTyxDQUFDLENBQUE7UUFDVixDQUFDO1FBRUQsT0FBTyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFBO0lBQ3RCLENBQUM7SUFFTyxLQUFLLENBQUUsQ0FBQztRQUNkLElBQUksR0FBRyxDQUFBO1FBR1AsSUFBSSxDQUFDLFlBQVksSUFBSTtZQUFFLE9BQU8sQ0FBQyxDQUFBO1FBQy9CLElBQUksT0FBTyxDQUFDLEtBQUssU0FBUztZQUFFLE9BQU8sQ0FBQyxDQUFBO1FBR3BDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDO1lBQUUsT0FBTyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUE7UUFHL0IsS0FBSyxHQUFHLElBQUksSUFBSSxDQUFDLGFBQWEsRUFBRSxDQUFDO1lBQy9CLElBQUksQ0FBQyxLQUFLLEdBQUc7Z0JBQUUsT0FBTyxJQUFJLENBQUMsYUFBYSxDQUFDLEdBQUcsQ0FBQyxDQUFBO1FBQy9DLENBQUM7UUFHRCxPQUFPLENBQUMsQ0FBQTtJQUNWLENBQUM7Q0FDRjtBQXpERCwyQkF5REMifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/metrics/counter.d.ts b/node_modules/@pm2/io/build/main/utils/metrics/counter.d.ts
new file mode 100644
index 0000000..9bdf3b5
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/metrics/counter.d.ts
@@ -0,0 +1,10 @@
+export default class Counter {
+ private _count;
+ private used;
+ constructor(opts?: any);
+ val(): number;
+ inc(n?: number): void;
+ dec(n?: number): void;
+ reset(count?: number): void;
+ isUsed(): boolean;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/metrics/counter.js b/node_modules/@pm2/io/build/main/utils/metrics/counter.js
new file mode 100644
index 0000000..2a95161
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/metrics/counter.js
@@ -0,0 +1,28 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+class Counter {
+ constructor(opts) {
+ this.used = false;
+ opts = opts || {};
+ this._count = opts.count || 0;
+ }
+ val() {
+ return this._count;
+ }
+ inc(n) {
+ this.used = true;
+ this._count += (n || 1);
+ }
+ dec(n) {
+ this.used = true;
+ this._count -= (n || 1);
+ }
+ reset(count) {
+ this._count = count || 0;
+ }
+ isUsed() {
+ return this.used;
+ }
+}
+exports.default = Counter;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291bnRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlscy9tZXRyaWNzL2NvdW50ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFxQixPQUFPO0lBSTFCLFlBQWEsSUFBSztRQUZWLFNBQUksR0FBWSxLQUFLLENBQUE7UUFHM0IsSUFBSSxHQUFHLElBQUksSUFBSSxFQUFFLENBQUE7UUFDakIsSUFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsS0FBSyxJQUFJLENBQUMsQ0FBQTtJQUMvQixDQUFDO0lBRUQsR0FBRztRQUNELE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQTtJQUNwQixDQUFDO0lBRUQsR0FBRyxDQUFFLENBQVU7UUFDYixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQTtRQUNoQixJQUFJLENBQUMsTUFBTSxJQUFJLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFBO0lBQ3pCLENBQUM7SUFFRCxHQUFHLENBQUUsQ0FBVTtRQUNiLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFBO1FBQ2hCLElBQUksQ0FBQyxNQUFNLElBQUksQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUE7SUFDekIsQ0FBQztJQUVELEtBQUssQ0FBRSxLQUFjO1FBQ25CLElBQUksQ0FBQyxNQUFNLEdBQUcsS0FBSyxJQUFJLENBQUMsQ0FBQTtJQUMxQixDQUFDO0lBRUQsTUFBTTtRQUNKLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQTtJQUNsQixDQUFDO0NBQ0Y7QUE5QkQsMEJBOEJDIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/metrics/gauge.d.ts b/node_modules/@pm2/io/build/main/utils/metrics/gauge.d.ts
new file mode 100644
index 0000000..ba1d04c
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/metrics/gauge.d.ts
@@ -0,0 +1,7 @@
+export default class Gauge {
+ private value;
+ private used;
+ val(): number;
+ set(value: any): void;
+ isUsed(): boolean;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/metrics/gauge.js b/node_modules/@pm2/io/build/main/utils/metrics/gauge.js
new file mode 100644
index 0000000..9366a3f
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/metrics/gauge.js
@@ -0,0 +1,20 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+class Gauge {
+ constructor() {
+ this.value = 0;
+ this.used = false;
+ }
+ val() {
+ return this.value;
+ }
+ set(value) {
+ this.used = true;
+ this.value = value;
+ }
+ isUsed() {
+ return this.used;
+ }
+}
+exports.default = Gauge;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2F1Z2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdXRpbHMvbWV0cmljcy9nYXVnZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQXFCLEtBQUs7SUFBMUI7UUFDVSxVQUFLLEdBQUcsQ0FBQyxDQUFBO1FBQ1QsU0FBSSxHQUFHLEtBQUssQ0FBQTtJQWN0QixDQUFDO0lBWkMsR0FBRztRQUNELE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQTtJQUNuQixDQUFDO0lBRUQsR0FBRyxDQUFFLEtBQUs7UUFDUixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQTtRQUNoQixJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQTtJQUNwQixDQUFDO0lBRUQsTUFBTTtRQUNKLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQTtJQUNsQixDQUFDO0NBQ0Y7QUFoQkQsd0JBZ0JDIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/metrics/histogram.d.ts b/node_modules/@pm2/io/build/main/utils/metrics/histogram.d.ts
new file mode 100644
index 0000000..bde683c
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/metrics/histogram.d.ts
@@ -0,0 +1,43 @@
+export default class Histogram {
+ private _measurement;
+ private _callFn;
+ private _sample;
+ private _min;
+ private _max;
+ private _count;
+ private _sum;
+ private _varianceM;
+ private _varianceS;
+ private _ema;
+ private used;
+ constructor(opts?: any);
+ update(value: number): void;
+ percentiles(percentiles: any): {};
+ val(): any;
+ getMin(): any;
+ getMax(): any;
+ getSum(): number;
+ getCount(): number;
+ getEma(): number;
+ fullResults(): {
+ min: any;
+ max: any;
+ sum: number;
+ variance: number | null;
+ mean: number;
+ count: number;
+ median: any;
+ p75: any;
+ p95: any;
+ p99: any;
+ p999: any;
+ ema: number;
+ };
+ _updateMin(value: any): void;
+ _updateMax(value: any): void;
+ _updateVariance(value: any): any;
+ _updateEma(value: any): number | undefined;
+ _calculateMean(): number;
+ _calculateVariance(): number | null;
+ isUsed(): boolean;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/metrics/histogram.js b/node_modules/@pm2/io/build/main/utils/metrics/histogram.js
new file mode 100644
index 0000000..6677371
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/metrics/histogram.js
@@ -0,0 +1,160 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const EDS_1 = require("../EDS");
+class Histogram {
+ constructor(opts) {
+ this._sample = new EDS_1.default();
+ this._count = 0;
+ this._sum = 0;
+ this._varianceM = 0;
+ this._varianceS = 0;
+ this._ema = 0;
+ this.used = false;
+ opts = opts || {};
+ this._measurement = opts.measurement;
+ this._callFn = null;
+ const methods = {
+ min: this.getMin,
+ max: this.getMax,
+ sum: this.getSum,
+ count: this.getCount,
+ variance: this._calculateVariance,
+ mean: this._calculateMean,
+ ema: this.getEma()
+ };
+ if (methods.hasOwnProperty(this._measurement)) {
+ this._callFn = methods[this._measurement];
+ }
+ else {
+ this._callFn = function () {
+ const percentiles = this.percentiles([0.5, 0.75, 0.95, 0.99, 0.999]);
+ const medians = {
+ median: percentiles[0.5],
+ p75: percentiles[0.75],
+ p95: percentiles[0.95],
+ p99: percentiles[0.99],
+ p999: percentiles[0.999]
+ };
+ return medians[this._measurement];
+ };
+ }
+ }
+ update(value) {
+ this.used = true;
+ this._count++;
+ this._sum += value;
+ this._sample.update(value);
+ this._updateMin(value);
+ this._updateMax(value);
+ this._updateVariance(value);
+ this._updateEma(value);
+ }
+ percentiles(percentiles) {
+ const values = this._sample
+ .toArray()
+ .sort(function (a, b) {
+ return (a === b)
+ ? 0
+ : a - b;
+ });
+ const results = {};
+ for (let i = 0; i < percentiles.length; i++) {
+ const percentile = percentiles[i];
+ if (!values.length) {
+ results[percentile] = null;
+ continue;
+ }
+ const pos = percentile * (values.length + 1);
+ if (pos < 1) {
+ results[percentile] = values[0];
+ }
+ else if (pos >= values.length) {
+ results[percentile] = values[values.length - 1];
+ }
+ else {
+ const lower = values[Math.floor(pos) - 1];
+ const upper = values[Math.ceil(pos) - 1];
+ results[percentile] = lower + (pos - Math.floor(pos)) * (upper - lower);
+ }
+ }
+ return results;
+ }
+ val() {
+ if (typeof (this._callFn) === 'function') {
+ return this._callFn();
+ }
+ else {
+ return this._callFn;
+ }
+ }
+ getMin() {
+ return this._min;
+ }
+ getMax() {
+ return this._max;
+ }
+ getSum() {
+ return this._sum;
+ }
+ getCount() {
+ return this._count;
+ }
+ getEma() {
+ return this._ema;
+ }
+ fullResults() {
+ const percentiles = this.percentiles([0.5, 0.75, 0.95, 0.99, 0.999]);
+ return {
+ min: this._min,
+ max: this._max,
+ sum: this._sum,
+ variance: this._calculateVariance(),
+ mean: this._calculateMean(),
+ count: this._count,
+ median: percentiles[0.5],
+ p75: percentiles[0.75],
+ p95: percentiles[0.95],
+ p99: percentiles[0.99],
+ p999: percentiles[0.999],
+ ema: this._ema
+ };
+ }
+ _updateMin(value) {
+ if (this._min === undefined || value < this._min) {
+ this._min = value;
+ }
+ }
+ _updateMax(value) {
+ if (this._max === undefined || value > this._max) {
+ this._max = value;
+ }
+ }
+ _updateVariance(value) {
+ if (this._count === 1)
+ return this._varianceM = value;
+ const oldM = this._varianceM;
+ this._varianceM += ((value - oldM) / this._count);
+ this._varianceS += ((value - oldM) * (value - this._varianceM));
+ }
+ _updateEma(value) {
+ if (this._count <= 1)
+ return this._ema = this._calculateMean();
+ const alpha = 2 / (1 + this._count);
+ this._ema = value * alpha + this._ema * (1 - alpha);
+ }
+ _calculateMean() {
+ return (this._count === 0)
+ ? 0
+ : this._sum / this._count;
+ }
+ _calculateVariance() {
+ return (this._count <= 1)
+ ? null
+ : this._varianceS / (this._count - 1);
+ }
+ isUsed() {
+ return this.used;
+ }
+}
+exports.default = Histogram;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGlzdG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RCxjQUFjO1FBQ1osT0FBTyxDQUFDLElBQUksQ0FBQyxNQUFNLEtBQUssQ0FBQyxDQUFDO1lBQ3hCLENBQUMsQ0FBQyxDQUFDO1lBQ0gsQ0FBQyxDQUFDLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQTtJQUM3QixDQUFDO0lBRUQsa0JBQWtCO1FBQ2hCLE9BQU8sQ0FBQyxJQUFJLENBQUMsTUFBTSxJQUFJLENBQUMsQ0FBQztZQUN2QixDQUFDLENBQUMsSUFBSTtZQUNOLENBQUMsQ0FBQyxJQUFJLENBQUMsVUFBVSxHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQTtJQUN6QyxDQUFDO0lBRUQsTUFBTTtRQUNKLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQTtJQUNsQixDQUFDO0NBUUY7QUFyTUQsNEJBcU1DIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/metrics/meter.d.ts b/node_modules/@pm2/io/build/main/utils/metrics/meter.d.ts
new file mode 100644
index 0000000..9fc6c43
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/metrics/meter.d.ts
@@ -0,0 +1,12 @@
+export default class Meter {
+ private _tickInterval;
+ private _samples;
+ private _timeframe;
+ private _rate;
+ private _interval;
+ private used;
+ constructor(opts?: any);
+ mark: (n?: number) => void;
+ val: () => number;
+ isUsed(): boolean;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/metrics/meter.js b/node_modules/@pm2/io/build/main/utils/metrics/meter.js
new file mode 100644
index 0000000..aa17296
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/metrics/meter.js
@@ -0,0 +1,36 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const EWMA_1 = require("../EWMA");
+const units_1 = require("../units");
+class Meter {
+ constructor(opts) {
+ this.used = false;
+ this.mark = function (n = 1) {
+ this.used = true;
+ this._rate.update(n);
+ };
+ this.val = function () {
+ return Math.round(this._rate.rate(this._samples * units_1.default.SECONDS) * 100) / 100;
+ };
+ const self = this;
+ if (typeof opts !== 'object') {
+ opts = {};
+ }
+ this._samples = opts.samples || opts.seconds || 1;
+ this._timeframe = opts.timeframe || 60;
+ this._tickInterval = opts.tickInterval || 5 * units_1.default.SECONDS;
+ this._rate = new EWMA_1.default(this._timeframe * units_1.default.SECONDS, this._tickInterval);
+ if (opts.debug && opts.debug === true) {
+ return;
+ }
+ this._interval = setInterval(function () {
+ self._rate.tick();
+ }, this._tickInterval);
+ this._interval.unref();
+ }
+ isUsed() {
+ return this.used;
+ }
+}
+exports.default = Meter;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdXRpbHMvbWV0cmljcy9tZXRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGtDQUEwQjtBQUMxQixvQ0FBNEI7QUFFNUIsTUFBcUIsS0FBSztJQVN4QixZQUFhLElBQVU7UUFGZixTQUFJLEdBQVksS0FBSyxDQUFBO1FBMEI3QixTQUFJLEdBQUcsVUFBVSxJQUFZLENBQUM7WUFDNUIsSUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUE7WUFDaEIsSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUE7UUFDdEIsQ0FBQyxDQUFBO1FBRUQsUUFBRyxHQUFHO1lBQ0osT0FBTyxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxRQUFRLEdBQUcsZUFBSyxDQUFDLE9BQU8sQ0FBQyxHQUFHLEdBQUcsQ0FBQyxHQUFHLEdBQUcsQ0FBQTtRQUMvRSxDQUFDLENBQUE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2/io/build/main/utils/miscellaneous.d.ts
new file mode 100644
index 0000000..e9bc23a
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/miscellaneous.d.ts
@@ -0,0 +1,4 @@
+export default class MiscUtils {
+ static generateUUID(): string;
+ static getValueFromDump(property: any, parentProperty?: any): number;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/miscellaneous.js b/node_modules/@pm2/io/build/main/utils/miscellaneous.js
new file mode 100644
index 0000000..f2b94df
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/miscellaneous.js
@@ -0,0 +1,17 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const serviceManager_1 = require("../serviceManager");
+class MiscUtils {
+ static generateUUID() {
+ return Math.random().toString(36).substr(2, 16);
+ }
+ static getValueFromDump(property, parentProperty) {
+ if (!parentProperty) {
+ parentProperty = 'handles';
+ }
+ const dump = serviceManager_1.ServiceManager.get('eventLoopService').inspector.dump();
+ return dump[parentProperty].hasOwnProperty(property) ? dump[parentProperty][property].length : 0;
+ }
+}
+exports.default = MiscUtils;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlzY2VsbGFuZW91cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy91dGlscy9taXNjZWxsYW5lb3VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsc0RBQWtEO0FBRWxELE1BQXFCLFNBQVM7SUFDNUIsTUFBTSxDQUFDLFlBQVk7UUFDakIsT0FBTyxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUE7SUFDakQsQ0FBQztJQUVELE1BQU0sQ0FBQyxnQkFBZ0IsQ0FBRSxRQUFRLEVBQUUsY0FBZTtRQUNoRCxJQUFJLENBQUMsY0FBYyxFQUFFLENBQUM7WUFDcEIsY0FBYyxHQUFHLFNBQVMsQ0FBQTtRQUM1QixDQUFDO1FBQ0QsTUFBTSxJQUFJLEdBQUcsK0JBQWMsQ0FBQyxHQUFHLENBQUMsa0JBQWtCLENBQUMsQ0FBQyxTQUFTLENBQUMsSUFBSSxFQUFFLENBQUE7UUFDcEUsT0FBTyxJQUFJLENBQUMsY0FBYyxDQUFDLENBQUMsY0FBYyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLENBQUMsUUFBUSxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUE7SUFDbEcsQ0FBQztDQUNGO0FBWkQsNEJBWUMifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/module.d.ts b/node_modules/@pm2/io/build/main/utils/module.d.ts
new file mode 100644
index 0000000..f2408ab
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/module.d.ts
@@ -0,0 +1,5 @@
+export default class ModuleUtils {
+ static loadModule(modulePath: string, args?: Object): any | Error;
+ static detectModule(moduleName: string): string | null;
+ private static _lookForModule;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/module.js b/node_modules/@pm2/io/build/main/utils/module.js
new file mode 100644
index 0000000..f074223
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/module.js
@@ -0,0 +1,53 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const fs = require("fs");
+const Debug = require("debug");
+const path = require("path");
+const debug = Debug('axm:utils:module');
+class ModuleUtils {
+ static loadModule(modulePath, args) {
+ let nodule;
+ try {
+ if (args) {
+ nodule = require(modulePath).apply(this, args);
+ }
+ else {
+ nodule = require(modulePath);
+ }
+ debug(`Succesfully required module at path ${modulePath}`);
+ return nodule;
+ }
+ catch (err) {
+ debug(`Failed to load module at path ${modulePath}: ${err.message}`);
+ return err;
+ }
+ }
+ static detectModule(moduleName) {
+ const fakePath = ['./node_modules', '/node_modules'];
+ if (!require.main) {
+ return null;
+ }
+ const paths = typeof require.main.paths === 'undefined' ? fakePath : require.main.paths;
+ const requirePaths = paths.slice();
+ return ModuleUtils._lookForModule(requirePaths, moduleName);
+ }
+ static _lookForModule(requirePaths, moduleName) {
+ const fsConstants = fs.constants || fs;
+ for (let requirePath of requirePaths) {
+ const completePath = path.join(requirePath, moduleName);
+ debug(`Looking for module ${moduleName} in ${completePath}`);
+ try {
+ fs.accessSync(completePath, fsConstants.R_OK);
+ debug(`Found module ${moduleName} in path ${completePath}`);
+ return completePath;
+ }
+ catch (err) {
+ debug(`module ${moduleName} not found in path ${completePath}`);
+ continue;
+ }
+ }
+ return null;
+ }
+}
+exports.default = ModuleUtils;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3V0aWxzL21vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHlCQUF3QjtBQUN4QiwrQkFBOEI7QUFDOUIsNkJBQTRCO0FBRTVCLE1BQU0sS0FBSyxHQUFHLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFBO0FBRXZDLE1BQXFCLFdBQVc7SUFJOUIsTUFBTSxDQUFDLFVBQVUsQ0FBRSxVQUFrQixFQUFFLElBQWE7UUFDbEQsSUFBSSxNQUFNLENBQUE7UUFDVixJQUFJLENBQUM7WUFDSCxJQUFJLElBQUksRUFBRSxDQUFDO2dCQUNULE1BQU0sR0FBRyxPQUFPLENBQUMsVUFBVSxDQUFDLENBQUMsS0FBSyxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQTtZQUNoRCxDQUFDO2lCQUFNLENBQUM7Z0JBQ04sTUFBTSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQTtZQUM5QixDQUF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FFLFVBQVUsQ0FBQyxDQUFBO1lBQ3ZELEtBQUssQ0FBQyxzQkFBc0IsVUFBVSxPQUFPLFlBQVksRUFBRSxDQUFDLENBQUE7WUFDNUQsSUFBSSxDQUFDO2dCQUNILEVBQUUsQ0FBQyxVQUFVLENBQUMsWUFBWSxFQUFFLFdBQVcsQ0FBQyxJQUFJLENBQUMsQ0FBQTtnQkFDN0MsS0FBSyxDQUFDLGdCQUFnQixVQUFVLFlBQVksWUFBWSxFQUFFLENBQUMsQ0FBQTtnQkFDM0QsT0FBTyxZQUFZLENBQUE7WUFDckIsQ0FBQztZQUFDLE9BQU8sR0FBRyxFQUFFLENBQUM7Z0JBQ2IsS0FBSyxDQUFDLFVBQVUsVUFBVSxzQkFBc0IsWUFBWSxFQUFFLENBQUMsQ0FBQTtnQkFDL0QsU0FBUTtZQUNWLENBQUM7UUFDSCxDQUFDO1FBQ0QsT0FBTyxJQUFJLENBQUE7SUFDYixDQUFDO0NBQ0Y7QUF4REQsOEJBd0RDIn0=
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/stackParser.d.ts b/node_modules/@pm2/io/build/main/utils/stackParser.d.ts
new file mode 100644
index 0000000..a5c96cc
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/stackParser.d.ts
@@ -0,0 +1,37 @@
+export type MissFunction = (key: string) => any;
+export type CacheOptions = {
+ miss: MissFunction;
+ ttl?: number;
+};
+export type StackContext = {
+ callsite: string;
+ context: string;
+};
+export type FrameMetadata = {
+ line_number: number;
+ file_name: string;
+};
+export declare class Cache {
+ private cache;
+ private ttlCache;
+ private worker;
+ private tllTime;
+ private onMiss;
+ constructor(opts: CacheOptions);
+ workerFn(): void;
+ get(key: string): any;
+ set(key: string, value: any): boolean;
+ reset(): void;
+}
+export type StackTraceParserOptions = {
+ cache: Cache;
+ contextSize: number;
+};
+export declare class StackTraceParser {
+ private cache;
+ private contextSize;
+ constructor(options: StackTraceParserOptions);
+ isAbsolute(path: any): boolean;
+ parse(stack: FrameMetadata[]): StackContext | null;
+ retrieveContext(error: Error): StackContext | null;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/stackParser.js b/node_modules/@pm2/io/build/main/utils/stackParser.js
new file mode 100644
index 0000000..5130225
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/stackParser.js
@@ -0,0 +1,126 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.StackTraceParser = exports.Cache = void 0;
+class Cache {
+ constructor(opts) {
+ this.cache = {};
+ this.ttlCache = {};
+ this.onMiss = opts.miss;
+ this.tllTime = opts.ttl || -1;
+ if (opts.ttl) {
+ this.worker = setInterval(this.workerFn.bind(this), 1000);
+ this.worker.unref();
+ }
+ }
+ workerFn() {
+ let keys = Object.keys(this.ttlCache);
+ for (let i = 0; i < keys.length; i++) {
+ let key = keys[i];
+ let value = this.ttlCache[key];
+ if (Date.now() > value) {
+ delete this.cache[key];
+ delete this.ttlCache[key];
+ }
+ }
+ }
+ get(key) {
+ if (!key)
+ return null;
+ let value = this.cache[key];
+ if (value)
+ return value;
+ value = this.onMiss(key);
+ if (value) {
+ this.set(key, value);
+ }
+ return value;
+ }
+ set(key, value) {
+ if (!key || !value)
+ return false;
+ this.cache[key] = value;
+ if (this.tllTime > 0) {
+ this.ttlCache[key] = Date.now() + this.tllTime;
+ }
+ return true;
+ }
+ reset() {
+ this.cache = {};
+ this.ttlCache = {};
+ }
+}
+exports.Cache = Cache;
+class StackTraceParser {
+ constructor(options) {
+ this.contextSize = 3;
+ this.cache = options.cache;
+ this.contextSize = options.contextSize;
+ }
+ isAbsolute(path) {
+ if (process.platform === 'win32') {
+ let splitDeviceRe = /^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/;
+ let result = splitDeviceRe.exec(path);
+ if (result === null)
+ return path.charAt(0) === '/';
+ let device = result[1] || '';
+ let isUnc = Boolean(device && device.charAt(1) !== ':');
+ return Boolean(result[2] || isUnc);
+ }
+ else {
+ return path.charAt(0) === '/';
+ }
+ }
+ parse(stack) {
+ if (stack.length === 0)
+ return null;
+ const userFrame = stack.find(frame => {
+ const type = this.isAbsolute(frame.file_name) || frame.file_name[0] === '.' ? 'user' : 'core';
+ return type !== 'core' && frame.file_name.indexOf('node_modules') < 0 && frame.file_name.indexOf('@pm2/io') < 0;
+ });
+ if (userFrame === undefined)
+ return null;
+ const context = this.cache.get(userFrame.file_name);
+ const source = [];
+ if (context === null || context.length === 0)
+ return null;
+ const preLine = userFrame.line_number - this.contextSize - 1;
+ const start = preLine > 0 ? preLine : 0;
+ context.slice(start, userFrame.line_number - 1).forEach(function (line) {
+ source.push(line.replace(/\t/g, ' '));
+ });
+ if (context[userFrame.line_number - 1]) {
+ source.push(context[userFrame.line_number - 1].replace(/\t/g, ' ').replace(' ', '>>'));
+ }
+ const postLine = userFrame.line_number + this.contextSize;
+ context.slice(userFrame.line_number, postLine).forEach(function (line) {
+ source.push(line.replace(/\t/g, ' '));
+ });
+ return {
+ context: source.join('\n'),
+ callsite: [userFrame.file_name, userFrame.line_number].join(':')
+ };
+ }
+ retrieveContext(error) {
+ if (error.stack === undefined)
+ return null;
+ const frameRegex = /(\/[^\\\n]*)/g;
+ let tmp;
+ let frames = [];
+ while ((tmp = frameRegex.exec(error.stack))) {
+ frames.push(tmp[1]);
+ }
+ const stackFrames = frames.map((callsite) => {
+ if (callsite[callsite.length - 1] === ')') {
+ callsite = callsite.substr(0, callsite.length - 1);
+ }
+ let location = callsite.split(':');
+ return {
+ file_name: location[0],
+ line_number: parseInt(location[1], 10)
+ };
+ });
+ return this.parse(stackFrames);
+ }
+}
+exports.StackTraceParser = StackTraceParser;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhY2tQYXJzZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdXRpbHMvc3RhY2tQYXJzZXIudHMiXSwibmFtZXM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EMsQ0FBQztDQUNGO0FBbEZELDRDQWtGQyJ9
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/transactionAggregator.d.ts b/node_modules/@pm2/io/build/main/utils/transactionAggregator.d.ts
new file mode 100644
index 0000000..4908b05
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/transactionAggregator.d.ts
@@ -0,0 +1,74 @@
+import { EventEmitter2 } from 'eventemitter2';
+import EWMA from './EWMA';
+import Histogram from './metrics/histogram';
+export interface Span {
+ name: string;
+ labels: any;
+ kind: string;
+ startTime: number;
+ min: number;
+ max: number;
+ median: number;
+}
+export interface Variance {
+ spans: Span[];
+ count: number;
+ min: number;
+ max: number;
+ median: number;
+ p95: number;
+}
+export interface Route {
+ path: string;
+ meta: {
+ min: number;
+ max: number;
+ count: number;
+ meter: number;
+ median: number;
+ p95: number;
+ };
+ variances: Variance[];
+}
+export interface Trace {
+ routes: Route[];
+ meta: {
+ trace_count: number;
+ http_meter: number;
+ db_meter: number;
+ http_percentiles: {
+ median: number;
+ p95: number;
+ p99: number;
+ };
+ db_percentiles: any;
+ };
+}
+export interface TraceCache {
+ routes: any;
+ meta: {
+ trace_count: number;
+ http_meter: EWMA;
+ db_meter: EWMA;
+ histogram: Histogram;
+ db_histograms: any;
+ };
+}
+export declare class TransactionAggregator extends EventEmitter2 {
+ private spanTypes;
+ private cache;
+ private privacyRegex;
+ private worker;
+ init(sendInterval?: number): void;
+ destroy(): void;
+ getAggregation(): TraceCache;
+ validateData(packet: any): boolean;
+ aggregate(packet: any): false | TraceCache;
+ mergeTrace(aggregated: any, trace: any): void;
+ updateSpanDuration(spans: any, newSpans: any): void;
+ compareList(one: any[], two: any[]): boolean;
+ matchPath(path: any, routes: any): any;
+ prepareAggregationforShipping(): Trace;
+ isIdentifier(id: any): boolean;
+ censorSpans(spans: any): any;
+}
diff --git a/node_modules/@pm2/io/build/main/utils/transactionAggregator.js b/node_modules/@pm2/io/build/main/utils/transactionAggregator.js
new file mode 100644
index 0000000..4a0f966
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/transactionAggregator.js
@@ -0,0 +1,318 @@
+'use strict';
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.TransactionAggregator = void 0;
+const Debug = require("debug");
+const eventemitter2_1 = require("eventemitter2");
+const EWMA_1 = require("./EWMA");
+const histogram_1 = require("./metrics/histogram");
+const fclone = (data) => JSON.parse(JSON.stringify(data));
+const log = Debug('axm:features:tracing:aggregator');
+class TransactionAggregator extends eventemitter2_1.EventEmitter2 {
+ constructor() {
+ super(...arguments);
+ this.spanTypes = ['redis', 'mysql', 'pg', 'mongo', 'outbound_http'];
+ this.cache = {
+ routes: {},
+ meta: {
+ trace_count: 0,
+ http_meter: new EWMA_1.default(),
+ db_meter: new EWMA_1.default(),
+ histogram: new histogram_1.default({ measurement: 'median' }),
+ db_histograms: {}
+ }
+ };
+ this.privacyRegex = /":(?!\[|{)\\"[^"]*\\"|":(["'])(?:(?=(\\?))\2.)*?\1|":(?!\[|{)[^,}\]]*|":\[[^{]*]/g;
+ }
+ init(sendInterval = 30000) {
+ this.worker = setInterval(_ => {
+ let data = this.prepareAggregationforShipping();
+ this.emit('packet', { data });
+ }, sendInterval);
+ }
+ destroy() {
+ if (this.worker !== undefined) {
+ clearInterval(this.worker);
+ }
+ this.cache.routes = {};
+ }
+ getAggregation() {
+ return this.cache;
+ }
+ validateData(packet) {
+ if (!packet) {
+ log('Packet malformated', packet);
+ return false;
+ }
+ if (!packet.spans || !packet.spans[0]) {
+ log('Trace without spans: %s', Object.keys(packet.data));
+ return false;
+ }
+ if (!packet.spans[0].labels) {
+ log('Trace spans without labels: %s', Object.keys(packet.spans));
+ return false;
+ }
+ return true;
+ }
+ aggregate(packet) {
+ if (this.validateData(packet) === false)
+ return false;
+ let path = packet.spans[0].labels['http/path'];
+ if (process.env.PM2_APM_CENSOR_SPAMS !== '0') {
+ this.censorSpans(packet.spans);
+ }
+ packet.spans = packet.spans.filter((span) => {
+ return span.endTime !== span.startTime;
+ });
+ packet.spans.forEach((span) => {
+ span.mean = Math.round(new Date(span.endTime).getTime() - new Date(span.startTime).getTime());
+ delete span.endTime;
+ });
+ packet.spans.forEach((span) => {
+ if (!span.name || !span.kind)
+ return false;
+ if (span.kind === 'RPC_SERVER') {
+ this.cache.meta.histogram.update(span.mean);
+ return this.cache.meta.http_meter.update(1);
+ }
+ if (span.labels && span.labels['http/method'] && span.labels['http/status_code']) {
+ span.labels['service'] = span.name;
+ span.name = 'outbound_http';
+ }
+ for (let i = 0; i < this.spanTypes.length; i++) {
+ if (span.name.indexOf(this.spanTypes[i]) > -1) {
+ this.cache.meta.db_meter.update(1);
+ if (!this.cache.meta.db_histograms[this.spanTypes[i]]) {
+ this.cache.meta.db_histograms[this.spanTypes[i]] = new histogram_1.default({ measurement: 'mean' });
+ }
+ this.cache.meta.db_histograms[this.spanTypes[i]].update(span.mean);
+ break;
+ }
+ }
+ });
+ this.cache.meta.trace_count++;
+ if (path[0] === '/' && path !== '/') {
+ path = path.substr(1, path.length - 1);
+ }
+ let matched = this.matchPath(path, this.cache.routes);
+ if (!matched) {
+ this.cache.routes[path] = [];
+ this.mergeTrace(this.cache.routes[path], packet);
+ }
+ else {
+ this.mergeTrace(this.cache.routes[matched], packet);
+ }
+ return this.cache;
+ }
+ mergeTrace(aggregated, trace) {
+ if (!aggregated || !trace)
+ return;
+ if (trace.spans.length === 0)
+ return;
+ if (!aggregated.variances)
+ aggregated.variances = [];
+ if (!aggregated.meta) {
+ aggregated.meta = {
+ histogram: new histogram_1.default({ measurement: 'median' }),
+ meter: new EWMA_1.default()
+ };
+ }
+ aggregated.meta.histogram.update(trace.spans[0].mean);
+ aggregated.meta.meter.update();
+ const merge = (variance) => {
+ if (variance == null) {
+ delete trace.projectId;
+ delete trace.traceId;
+ trace.histogram = new histogram_1.default({ measurement: 'median' });
+ trace.histogram.update(trace.spans[0].mean);
+ trace.spans.forEach((span) => {
+ span.histogram = new histogram_1.default({ measurement: 'median' });
+ span.histogram.update(span.mean);
+ delete span.mean;
+ });
+ aggregated.variances.push(trace);
+ }
+ else {
+ variance.histogram.update(trace.spans[0].mean);
+ this.updateSpanDuration(variance.spans, trace.spans);
+ trace.spans.forEach((span) => {
+ delete span.labels.stacktrace;
+ });
+ }
+ };
+ for (let i = 0; i < aggregated.variances.length; i++) {
+ if (this.compareList(aggregated.variances[i].spans, trace.spans)) {
+ return merge(aggregated.variances[i]);
+ }
+ }
+ return merge(null);
+ }
+ updateSpanDuration(spans, newSpans) {
+ for (let i = 0; i < spans.length; i++) {
+ if (!newSpans[i])
+ continue;
+ spans[i].histogram.update(newSpans[i].mean);
+ }
+ }
+ compareList(one, two) {
+ if (one.length !== two.length)
+ return false;
+ for (let i = 0; i < one.length; i++) {
+ if (one[i].name !== two[i].name)
+ return false;
+ if (one[i].kind !== two[i].kind)
+ return false;
+ if (!one[i].labels && two[i].labels)
+ return false;
+ if (one[i].labels && !two[i].labels)
+ return false;
+ if (one[i].labels.length !== two[i].labels.length)
+ return false;
+ }
+ return true;
+ }
+ matchPath(path, routes) {
+ if (!path || !routes)
+ return false;
+ if (path === '/')
+ return routes[path] ? path : null;
+ if (path[path.length - 1] === '/') {
+ path = path.substr(0, path.length - 1);
+ }
+ path = path.split('/');
+ if (path.length === 1)
+ return routes[path[0]] ? routes[path[0]] : null;
+ let keys = Object.keys(routes);
+ for (let i = 0; i < keys.length; i++) {
+ let route = keys[i];
+ let segments = route.split('/');
+ if (segments.length !== path.length)
+ continue;
+ for (let j = path.length - 1; j >= 0; j--) {
+ if (path[j] !== segments[j]) {
+ if (this.isIdentifier(path[j]) && segments[j] === '*' && path[j - 1] === segments[j - 1]) {
+ return segments.join('/');
+ }
+ else if (path[j - 1] !== undefined && path[j - 1] === segments[j - 1] && this.isIdentifier(path[j]) && this.isIdentifier(segments[j])) {
+ segments[j] = '*';
+ routes[segments.join('/')] = routes[route];
+ delete routes[keys[i]];
+ return segments.join('/');
+ }
+ else {
+ break;
+ }
+ }
+ if (j === 0)
+ return segments.join('/');
+ }
+ }
+ }
+ prepareAggregationforShipping() {
+ let routes = this.cache.routes;
+ const normalized = {
+ routes: [],
+ meta: {
+ trace_count: this.cache.meta.trace_count,
+ http_meter: Math.round(this.cache.meta.http_meter.rate(1000) * 100) / 100,
+ db_meter: Math.round(this.cache.meta.db_meter.rate(1000) * 100) / 100,
+ http_percentiles: {
+ median: this.cache.meta.histogram.percentiles([0.5])[0.5],
+ p95: this.cache.meta.histogram.percentiles([0.95])[0.95],
+ p99: this.cache.meta.histogram.percentiles([0.99])[0.99]
+ },
+ db_percentiles: {}
+ }
+ };
+ this.spanTypes.forEach((name) => {
+ let histogram = this.cache.meta.db_histograms[name];
+ if (!histogram)
+ return;
+ normalized.meta.db_percentiles[name] = histogram.percentiles([0.5])[0.5];
+ });
+ Object.keys(routes).forEach((path) => {
+ let data = routes[path];
+ if (!data.variances || data.variances.length === 0)
+ return;
+ const variances = data.variances.sort((a, b) => {
+ return b.count - a.count;
+ }).slice(0, 5);
+ let routeCopy = {
+ path: path === '/' ? '/' : '/' + path,
+ meta: {
+ min: data.meta.histogram.getMin(),
+ max: data.meta.histogram.getMax(),
+ count: data.meta.histogram.getCount(),
+ meter: Math.round(data.meta.meter.rate(1000) * 100) / 100,
+ median: data.meta.histogram.percentiles([0.5])[0.5],
+ p95: data.meta.histogram.percentiles([0.95])[0.95]
+ },
+ variances: []
+ };
+ variances.forEach((variance) => {
+ if (!variance.spans || variance.spans.length === 0)
+ return;
+ let tmp = {
+ spans: [],
+ count: variance.histogram.getCount(),
+ min: variance.histogram.getMin(),
+ max: variance.histogram.getMax(),
+ median: variance.histogram.percentiles([0.5])[0.5],
+ p95: variance.histogram.percentiles([0.95])[0.95]
+ };
+ variance.spans.forEach((oldSpan) => {
+ const span = fclone({
+ name: oldSpan.name,
+ labels: oldSpan.labels,
+ kind: oldSpan.kind,
+ startTime: oldSpan.startTime,
+ min: oldSpan.histogram ? oldSpan.histogram.getMin() : undefined,
+ max: oldSpan.histogram ? oldSpan.histogram.getMax() : undefined,
+ median: oldSpan.histogram ? oldSpan.histogram.percentiles([0.5])[0.5] : undefined
+ });
+ tmp.spans.push(span);
+ });
+ routeCopy.variances.push(tmp);
+ });
+ normalized.routes.push(routeCopy);
+ });
+ log(`sending formatted trace to remote endpoint`);
+ return normalized;
+ }
+ isIdentifier(id) {
+ id = typeof (id) !== 'string' ? id + '' : id;
+ if (id.match(/[0-9a-f]{8}-[0-9a-f]{4}-[14][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{12}[14][0-9a-f]{19}/i)) {
+ return true;
+ }
+ else if (id.match(/\d+/)) {
+ return true;
+ }
+ else if (id.match(/[0-9]+[a-z]+|[a-z]+[0-9]+/)) {
+ return true;
+ }
+ else if (id.match(/((?:[0-9a-zA-Z]+[@\-_.][0-9a-zA-Z]+|[0-9a-zA-Z]+[@\-_.]|[@\-_.][0-9a-zA-Z]+)+)/)) {
+ return true;
+ }
+ return false;
+ }
+ censorSpans(spans) {
+ if (!spans)
+ return log('spans is null');
+ spans.forEach((span) => {
+ if (!span.labels)
+ return;
+ delete span.labels.results;
+ delete span.labels.result;
+ delete span.spanId;
+ delete span.parentSpanId;
+ delete span.labels.values;
+ delete span.labels.stacktrace;
+ Object.keys(span.labels).forEach((key) => {
+ if (typeof (span.labels[key]) === 'string' && key !== 'stacktrace') {
+ span.labels[key] = span.labels[key].replace(this.privacyRegex, '\": \"?\"');
+ }
+ });
+ });
+ }
+}
+exports.TransactionAggregator = TransactionAggregator;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNhY3Rpb25BZ2dyZWdhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3V0aWxzL3RyYW5zYWN0aW9uQWdncmVnYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLENBQUE7OztBQUVaLCtCQ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FDLE1BQU0sQ0FBQyxHQUFHLENBQUMsR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsWUFBWSxFQUFFLFdBQVcsQ0FBQyxDQUFBO2dCQUM3RSxDQUFDO1lBQ0gsQ0FBQyxDQUFDLENBQUE7UUFDSixDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDRjtBQTVaRCxzREE0WkMifQ==
\ No newline at end of file
diff --git a/node_modules/@pm2/io/build/main/utils/units.d.ts b/node_modules/@pm2/io/build/main/utils/units.d.ts
new file mode 100644
index 0000000..1854194
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/units.d.ts
@@ -0,0 +1,10 @@
+declare const _default: {
+ NANOSECONDS: number;
+ MICROSECONDS: number;
+ MILLISECONDS: number;
+ SECONDS: number;
+ MINUTES: number;
+ HOURS: number;
+ DAYS: number;
+};
+export default _default;
diff --git a/node_modules/@pm2/io/build/main/utils/units.js b/node_modules/@pm2/io/build/main/utils/units.js
new file mode 100644
index 0000000..ce31159
--- /dev/null
+++ b/node_modules/@pm2/io/build/main/utils/units.js
@@ -0,0 +1,16 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const MILLISECONDS = 1;
+const SECONDS = 1000 * MILLISECONDS;
+const MINUTES = 60 * SECONDS;
+const HOURS = 60 * MINUTES;
+exports.default = {
+ NANOSECONDS: 1 / (1000 * 1000),
+ MICROSECONDS: 1 / 1000,
+ MILLISECONDS: MILLISECONDS,
+ SECONDS: SECONDS,
+ MINUTES: MINUTES,
+ HOURS: HOURS,
+ DAYS: 24 * HOURS
+};
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5pdHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdXRpbHMvdW5pdHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLFlBQVksR0FBRyxDQUFDLENBQUE7QUFDdEIsTUFBTSxPQUFPLEdBQUcsSUFBSSxHQUFHLFlBQVksQ0FBQTtBQUNuQyxNQUFNLE9BQU8sR0FBRyxFQUFFLEdBQUcsT0FBTyxDQUFBO0FBQzVCLE1BQU0sS0FBSyxHQUFHLEVBQUUsR0FBRyxPQUFPLENBQUE7QUFFMUIsa0JBQWU7SUFDYixXQUFXLEVBQUUsQ0FBQyxHQUFHLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztJQUM5QixZQUFZLEVBQUUsQ0FBQyxHQUFHLElBQUk7SUFDdEIsWUFBWSxFQUFFLFlBQVk7SUFDMUIsT0FBTyxFQUFFLE9BQU87SUFDaEIsT0FBTyxFQUFFLE9BQU87SUFDaEIsS0FBSyxFQUFFLEtBQUs7SUFDWixJQUFJLEVBQUUsRUFBRSxHQUFHLEtBQUs7Q0FDakIsQ0FBQSJ9
\ No newline at end of file
diff --git a/node_modules/@pm2/io/docker-compose.yml b/node_modules/@pm2/io/docker-compose.yml
new file mode 100644
index 0000000..dd6c5e6
--- /dev/null
+++ b/node_modules/@pm2/io/docker-compose.yml
@@ -0,0 +1,27 @@
+version: '2'
+
+services:
+ mongodb:
+ image: mongo:3.4
+ ports:
+ - "27017:27017"
+ environment:
+ AUTH: "no"
+ redis:
+ image: eywek/redis:5
+ ports:
+ - "6379:6379"
+ mysql:
+ image: mysql:5
+ ports:
+ - "3306:3306"
+ environment:
+ MYSQL_DATABASE: 'test'
+ MYSQL_ROOT_PASSWORD: 'password'
+ postgres:
+ image: postgres:11
+ ports:
+ - "5432:5432"
+ environment:
+ POSTGRES_DB: 'test'
+ POSTGRES_PASSWORD: 'password'
diff --git a/node_modules/@pm2/io/docs/README.md b/node_modules/@pm2/io/docs/README.md
new file mode 100644
index 0000000..3d8216a
--- /dev/null
+++ b/node_modules/@pm2/io/docs/README.md
@@ -0,0 +1,106 @@
+# PM2 APM Architecture
+
+The APM has been architected for a maximum composability when developing different features, each component have exactly one job and they have access to different low level API (like sendin/receiving data) to be able to do it.
+
+Here a simple (not exact) architecture diagram:
+
+
+
+## Concept
+
+### Manager
+
+There are two "Manager" in the implementation:
+ - The Service Manager which statically store reference to all services so they are available by other component.
+ - The Feature Manager which handle the configuration and instanciation of each feature.
+
+### Service
+
+A service is an internal component designed to group a speficic logic and provide a simple API to do that logic.
+They should not be accessible to user to allow us to change the low level API without breaking anything.
+
+### Feature
+
+Exaclty as it sound, a feature is a component that actually do something, for example:
+ - The tracing feature handle all the tracing infrastructure from the init to sending all trace data.
+ - The notify metrics provide an API to send error to the remote infrastructure
+
+Each feature expose different methods and there are not exposed by default to the user.
+
+### Public API
+
+By public API we mean all the functions that a user can call when instanciating the APM.
+Each function that need to be exposed is added into the main instance and then use the feature manager to call the actual method implmentation.
+This design help maintaining backward compatibility at the user level and not in the logic implementation.
+
+## Services
+
+### Transport
+
+The most important service is the Transport service which offer an interface to implement different type of transport. It also provide an API to create a transport instance.
+
+##### IPC Transport
+
+This is the default transport and it's based on IPC, a shared file descriptor used to transfer data to and from the PM2 daemon.
+Every data is sent as specific packet to the PM2 RPC system that will then broadcast them to the agent.
+See the agent: https://github.com/keymetrics/pm2-io-agent
+
+##### Websocket Transport
+
+The websocket transport is the new transporter used when we don't use the PM2 daemon and his agent to send data.
+It use this agent: https://github.com/keymetrics/pm2-io-agent-node to handle the low level networking to our servers.
+
+### Metrics
+
+The metrics service expose method to register metrics that will be sent to the remote endpoint, it then handle:
+- Fetching the value of the metrics every second, and sending them formatted to the transport service
+
+### Actions
+
+The action service, as the metric service, expose an API to register custom action. It handle the listening to the remote connection for new action request, call the actual user function and then send back the user data.
+
+### Inspector
+
+This service doesn't do much apart from offering a `inspector` session to every feature that need it. From Node 8 to node 10, there could be only one session in the whole process so this service is made to avoid having two session opened by different features.
+
+### RuntimeStats
+
+This service is simply a wrapper to the `@pm2/node-runtime-stats` module that allows to get low level metrics about the node runtime.
+Since multiple metrics are using it, we made a service out of it so we only have one instance of it.
+
+## Features
+
+### Notify
+
+The `notify` provides 3 API:
+ - `notifyError` to send custom error to the remote server
+ - `expressErrorHandler` which is a express middleware that catch error and send them
+ - `koaErrorHandler` same as express middleware but for koa
+
+It also handle the `unhandledRejection` and `uncaughtException` error event to also send them. In the case of `uncaughtException`, it also `exit` the process.
+
+### Profiling
+
+The profiling feature provide a wrapper on top of two different profilers implementation:
+ - `inspector` based profiling, which is a built-in API for Node 8 to interact with v8 API
+ - `addon` based profiling which is seperate c++ addon that need to be installed, it's only here to support Node 6.
+
+Both register customs actions with the `ActionService` to when a user can remotely start and stop profiles in their processes.
+
+### Tracing
+
+The tracing feature handle the `opencensus` agent which is in `src/census`, for more information about how they works, you should read about [Opencensus Node Agent](https://github.com/census-instrumentation/opencensus-node/)
+
+We got our own plugins to be able to iterate faster on them and since the opencensus API isn't stable yet, do not break between minor bump of opencensus.
+We implemented our own exporter that use the `TransportService` to send trace data to the remote server.
+
+### Metrics
+
+The Metrics service is implemented as a Manager because it only instanciate different metrics and don't do anything more.
+Here the current list of metrics implemented:
+ - Event loop Metrics: when the `@pm2/node-runtime-stats` addon is there, it use it to get metrics directly from libuv otherwise it fallback on computing it with javascript.
+ - HTTP Metrics: When the `http` or `https` module is required, add custom listener for request and compute latency/volume for them.
+ - Network Metrics: Patch the `net.Socket` implementation to count how much bytes are sent/received from/to the network
+ - Runtime Metrics: Only available when the `@pm2/node-runtime-stats` is there, it add metrics about the V8 GC and Linux Kernel metrics
+ - V8: Fetch from built-in `v8` module some metrics about heap usage.
+
diff --git a/node_modules/@pm2/io/node_modules/.bin/semver b/node_modules/@pm2/io/node_modules/.bin/semver
new file mode 120000
index 0000000..5aaadf4
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/.bin/semver
@@ -0,0 +1 @@
+../semver/bin/semver.js
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/CHANGELOG.md b/node_modules/@pm2/io/node_modules/async/CHANGELOG.md
new file mode 100644
index 0000000..ec6b871
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/CHANGELOG.md
@@ -0,0 +1,278 @@
+# v2.6.4
+- Fix potential prototype pollution exploit (#1828)
+
+# v2.6.3
+- Updated lodash to squelch a security warning (#1675)
+
+# v2.6.2
+- Updated lodash to squelch a security warning (#1620)
+
+# v2.6.1
+- Updated lodash to prevent `npm audit` warnings. (#1532, #1533)
+- Made `async-es` more optimized for webpack users (#1517)
+- Fixed a stack overflow with large collections and a synchronous iterator (#1514)
+- Various small fixes/chores (#1505, #1511, #1527, #1530)
+
+# v2.6.0
+- Added missing aliases for many methods. Previously, you could not (e.g.) `require('async/find')` or use `async.anyLimit`. (#1483)
+- Improved `queue` performance. (#1448, #1454)
+- Add missing sourcemap (#1452, #1453)
+- Various doc updates (#1448, #1471, #1483)
+
+# v2.5.0
+- Added `concatLimit`, the `Limit` equivalent of [`concat`](https://caolan.github.io/async/docs.html#concat) ([#1426](https://github.com/caolan/async/issues/1426), [#1430](https://github.com/caolan/async/pull/1430))
+- `concat` improvements: it now preserves order, handles falsy values and the `iteratee` callback takes a variable number of arguments ([#1437](https://github.com/caolan/async/issues/1437), [#1436](https://github.com/caolan/async/pull/1436))
+- Fixed an issue in `queue` where there was a size discrepancy between `workersList().length` and `running()` ([#1428](https://github.com/caolan/async/issues/1428), [#1429](https://github.com/caolan/async/pull/1429))
+- Various doc fixes ([#1422](https://github.com/caolan/async/issues/1422), [#1424](https://github.com/caolan/async/pull/1424))
+
+# v2.4.1
+- Fixed a bug preventing functions wrapped with `timeout()` from being re-used. ([#1418](https://github.com/caolan/async/issues/1418), [#1419](https://github.com/caolan/async/issues/1419))
+
+# v2.4.0
+- Added `tryEach`, for running async functions in parallel, where you only expect one to succeed. ([#1365](https://github.com/caolan/async/issues/1365), [#687](https://github.com/caolan/async/issues/687))
+- Improved performance, most notably in `parallel` and `waterfall` ([#1395](https://github.com/caolan/async/issues/1395))
+- Added `queue.remove()`, for removing items in a `queue` ([#1397](https://github.com/caolan/async/issues/1397), [#1391](https://github.com/caolan/async/issues/1391))
+- Fixed using `eval`, preventing Async from running in pages with Content Security Policy ([#1404](https://github.com/caolan/async/issues/1404), [#1403](https://github.com/caolan/async/issues/1403))
+- Fixed errors thrown in an `asyncify`ed function's callback being caught by the underlying Promise ([#1408](https://github.com/caolan/async/issues/1408))
+- Fixed timing of `queue.empty()` ([#1367](https://github.com/caolan/async/issues/1367))
+- Various doc fixes ([#1314](https://github.com/caolan/async/issues/1314), [#1394](https://github.com/caolan/async/issues/1394), [#1412](https://github.com/caolan/async/issues/1412))
+
+# v2.3.0
+- Added support for ES2017 `async` functions. Wherever you can pass a Node-style/CPS function that uses a callback, you can also pass an `async` function. Previously, you had to wrap `async` functions with `asyncify`. The caveat is that it will only work if `async` functions are supported natively in your environment, transpiled implementations can't be detected. ([#1386](https://github.com/caolan/async/issues/1386), [#1390](https://github.com/caolan/async/issues/1390))
+- Small doc fix ([#1392](https://github.com/caolan/async/issues/1392))
+
+# v2.2.0
+- Added `groupBy`, and the `Series`/`Limit` equivalents, analogous to [`_.groupBy`](http://lodash.com/docs#groupBy) ([#1364](https://github.com/caolan/async/issues/1364))
+- Fixed `transform` bug when `callback` was not passed ([#1381](https://github.com/caolan/async/issues/1381))
+- Added note about `reflect` to `parallel` docs ([#1385](https://github.com/caolan/async/issues/1385))
+
+# v2.1.5
+- Fix `auto` bug when function names collided with Array.prototype ([#1358](https://github.com/caolan/async/issues/1358))
+- Improve some error messages ([#1349](https://github.com/caolan/async/issues/1349))
+- Avoid stack overflow case in queue
+- Fixed an issue in `some`, `every` and `find` where processing would continue after the result was determined.
+- Cleanup implementations of `some`, `every` and `find`
+
+# v2.1.3
+- Make bundle size smaller
+- Create optimized hotpath for `filter` in array case.
+
+# v2.1.2
+- Fixed a stackoverflow bug with `detect`, `some`, `every` on large inputs ([#1293](https://github.com/caolan/async/issues/1293)).
+
+# v2.1.0
+
+- `retry` and `retryable` now support an optional `errorFilter` function that determines if the `task` should retry on the error ([#1256](https://github.com/caolan/async/issues/1256), [#1261](https://github.com/caolan/async/issues/1261))
+- Optimized array iteration in `race`, `cargo`, `queue`, and `priorityQueue` ([#1253](https://github.com/caolan/async/issues/1253))
+- Added alias documentation to doc site ([#1251](https://github.com/caolan/async/issues/1251), [#1254](https://github.com/caolan/async/issues/1254))
+- Added [BootStrap scrollspy](http://getbootstrap.com/javascript/#scrollspy) to docs to highlight in the sidebar the current method being viewed ([#1289](https://github.com/caolan/async/issues/1289), [#1300](https://github.com/caolan/async/issues/1300))
+- Various minor doc fixes ([#1263](https://github.com/caolan/async/issues/1263), [#1264](https://github.com/caolan/async/issues/1264), [#1271](https://github.com/caolan/async/issues/1271), [#1278](https://github.com/caolan/async/issues/1278), [#1280](https://github.com/caolan/async/issues/1280), [#1282](https://github.com/caolan/async/issues/1282), [#1302](https://github.com/caolan/async/issues/1302))
+
+# v2.0.1
+
+- Significantly optimized all iteration based collection methods such as `each`, `map`, `filter`, etc ([#1245](https://github.com/caolan/async/issues/1245), [#1246](https://github.com/caolan/async/issues/1246), [#1247](https://github.com/caolan/async/issues/1247)).
+
+# v2.0.0
+
+Lots of changes here!
+
+First and foremost, we have a slick new [site for docs](https://caolan.github.io/async/). Special thanks to [**@hargasinski**](https://github.com/hargasinski) for his work converting our old docs to `jsdoc` format and implementing the new website. Also huge ups to [**@ivanseidel**](https://github.com/ivanseidel) for designing our new logo. It was a long process for both of these tasks, but I think these changes turned out extraordinary well.
+
+The biggest feature is modularization. You can now `require("async/series")` to only require the `series` function. Every Async library function is available this way. You still can `require("async")` to require the entire library, like you could do before.
+
+We also provide Async as a collection of ES2015 modules. You can now `import {each} from 'async-es'` or `import waterfall from 'async-es/waterfall'`. If you are using only a few Async functions, and are using a ES bundler such as Rollup, this can significantly lower your build size.
+
+Major thanks to [**@Kikobeats**](github.com/Kikobeats), [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for doing the majority of the modularization work, as well as [**@jdalton**](github.com/jdalton) and [**@Rich-Harris**](github.com/Rich-Harris) for advisory work on the general modularization strategy.
+
+Another one of the general themes of the 2.0 release is standardization of what an "async" function is. We are now more strictly following the node-style continuation passing style. That is, an async function is a function that:
+
+1. Takes a variable number of arguments
+2. The last argument is always a callback
+3. The callback can accept any number of arguments
+4. The first argument passed to the callback will be treated as an error result, if the argument is truthy
+5. Any number of result arguments can be passed after the "error" argument
+6. The callback is called once and exactly once, either on the same tick or later tick of the JavaScript event loop.
+
+There were several cases where Async accepted some functions that did not strictly have these properties, most notably `auto`, `every`, `some`, `filter`, `reject` and `detect`.
+
+Another theme is performance. We have eliminated internal deferrals in all cases where they make sense. For example, in `waterfall` and `auto`, there was a `setImmediate` between each task -- these deferrals have been removed. A `setImmediate` call can add up to 1ms of delay. This might not seem like a lot, but it can add up if you are using many Async functions in the course of processing a HTTP request, for example. Nearly all asynchronous functions that do I/O already have some sort of deferral built in, so the extra deferral is unnecessary. The trade-off of this change is removing our built-in stack-overflow defense. Many synchronous callback calls in series can quickly overflow the JS call stack. If you do have a function that is sometimes synchronous (calling its callback on the same tick), and are running into stack overflows, wrap it with `async.ensureAsync()`.
+
+Another big performance win has been re-implementing `queue`, `cargo`, and `priorityQueue` with [doubly linked lists](https://en.wikipedia.org/wiki/Doubly_linked_list) instead of arrays. This has lead to queues being an order of [magnitude faster on large sets of tasks](https://github.com/caolan/async/pull/1205).
+
+## New Features
+
+- Async is now modularized. Individual functions can be `require()`d from the main package. (`require('async/auto')`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996))
+- Async is also available as a collection of ES2015 modules in the new `async-es` package. (`import {forEachSeries} from 'async-es'`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996))
+- Added `race`, analogous to `Promise.race()`. It will run an array of async tasks in parallel and will call its callback with the result of the first task to respond. ([#568](https://github.com/caolan/async/issues/568), [#1038](https://github.com/caolan/async/issues/1038))
+- Collection methods now accept ES2015 iterators. Maps, Sets, and anything that implements the iterator spec can now be passed directly to `each`, `map`, `parallel`, etc.. ([#579](https://github.com/caolan/async/issues/579), [#839](https://github.com/caolan/async/issues/839), [#1074](https://github.com/caolan/async/issues/1074))
+- Added `mapValues`, for mapping over the properties of an object and returning an object with the same keys. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177))
+- Added `timeout`, a wrapper for an async function that will make the task time-out after the specified time. ([#1007](https://github.com/caolan/async/issues/1007), [#1027](https://github.com/caolan/async/issues/1027))
+- Added `reflect` and `reflectAll`, analagous to [`Promise.reflect()`](http://bluebirdjs.com/docs/api/reflect.html), a wrapper for async tasks that always succeeds, by gathering results and errors into an object. ([#942](https://github.com/caolan/async/issues/942), [#1012](https://github.com/caolan/async/issues/1012), [#1095](https://github.com/caolan/async/issues/1095))
+- `constant` supports dynamic arguments -- it will now always use its last argument as the callback. ([#1016](https://github.com/caolan/async/issues/1016), [#1052](https://github.com/caolan/async/issues/1052))
+- `setImmediate` and `nextTick` now support arguments to partially apply to the deferred function, like the node-native versions do. ([#940](https://github.com/caolan/async/issues/940), [#1053](https://github.com/caolan/async/issues/1053))
+- `auto` now supports resolving cyclic dependencies using [Kahn's algorithm](https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm) ([#1140](https://github.com/caolan/async/issues/1140)).
+- Added `autoInject`, a relative of `auto` that automatically spreads a task's dependencies as arguments to the task function. ([#608](https://github.com/caolan/async/issues/608), [#1055](https://github.com/caolan/async/issues/1055), [#1099](https://github.com/caolan/async/issues/1099), [#1100](https://github.com/caolan/async/issues/1100))
+- You can now limit the concurrency of `auto` tasks. ([#635](https://github.com/caolan/async/issues/635), [#637](https://github.com/caolan/async/issues/637))
+- Added `retryable`, a relative of `retry` that wraps an async function, making it retry when called. ([#1058](https://github.com/caolan/async/issues/1058))
+- `retry` now supports specifying a function that determines the next time interval, useful for exponential backoff, logging and other retry strategies. ([#1161](https://github.com/caolan/async/issues/1161))
+- `retry` will now pass all of the arguments the task function was resolved with to the callback ([#1231](https://github.com/caolan/async/issues/1231)).
+- Added `q.unsaturated` -- callback called when a `queue`'s number of running workers falls below a threshold. ([#868](https://github.com/caolan/async/issues/868), [#1030](https://github.com/caolan/async/issues/1030), [#1033](https://github.com/caolan/async/issues/1033), [#1034](https://github.com/caolan/async/issues/1034))
+- Added `q.error` -- a callback called whenever a `queue` task calls its callback with an error. ([#1170](https://github.com/caolan/async/issues/1170))
+- `applyEach` and `applyEachSeries` now pass results to the final callback. ([#1088](https://github.com/caolan/async/issues/1088))
+
+## Breaking changes
+
+- Calling a callback more than once is considered an error, and an error will be thrown. This had an explicit breaking change in `waterfall`. If you were relying on this behavior, you should more accurately represent your control flow as an event emitter or stream. ([#814](https://github.com/caolan/async/issues/814), [#815](https://github.com/caolan/async/issues/815), [#1048](https://github.com/caolan/async/issues/1048), [#1050](https://github.com/caolan/async/issues/1050))
+- `auto` task functions now always take the callback as the last argument. If a task has dependencies, the `results` object will be passed as the first argument. To migrate old task functions, wrap them with [`_.flip`](https://lodash.com/docs#flip) ([#1036](https://github.com/caolan/async/issues/1036), [#1042](https://github.com/caolan/async/issues/1042))
+- Internal `setImmediate` calls have been refactored away. This may make existing flows vulnerable to stack overflows if you use many synchronous functions in series. Use `ensureAsync` to work around this. ([#696](https://github.com/caolan/async/issues/696), [#704](https://github.com/caolan/async/issues/704), [#1049](https://github.com/caolan/async/issues/1049), [#1050](https://github.com/caolan/async/issues/1050))
+- `map` used to return an object when iterating over an object. `map` now always returns an array, like in other libraries. The previous object behavior has been split out into `mapValues`. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177))
+- `filter`, `reject`, `some`, `every`, `detect` and their families like `{METHOD}Series` and `{METHOD}Limit` now expect an error as the first callback argument, rather than just a simple boolean. Pass `null` as the first argument, or use `fs.access` instead of `fs.exists`. ([#118](https://github.com/caolan/async/issues/118), [#774](https://github.com/caolan/async/issues/774), [#1028](https://github.com/caolan/async/issues/1028), [#1041](https://github.com/caolan/async/issues/1041))
+- `{METHOD}` and `{METHOD}Series` are now implemented in terms of `{METHOD}Limit`. This is a major internal simplification, and is not expected to cause many problems, but it does subtly affect how functions execute internally. ([#778](https://github.com/caolan/async/issues/778), [#847](https://github.com/caolan/async/issues/847))
+- `retry`'s callback is now optional. Previously, omitting the callback would partially apply the function, meaning it could be passed directly as a task to `series` or `auto`. The partially applied "control-flow" behavior has been separated out into `retryable`. ([#1054](https://github.com/caolan/async/issues/1054), [#1058](https://github.com/caolan/async/issues/1058))
+- The test function for `whilst`, `until`, and `during` used to be passed non-error args from the iteratee function's callback, but this led to weirdness where the first call of the test function would be passed no args. We have made it so the test function is never passed extra arguments, and only the `doWhilst`, `doUntil`, and `doDuring` functions pass iteratee callback arguments to the test function ([#1217](https://github.com/caolan/async/issues/1217), [#1224](https://github.com/caolan/async/issues/1224))
+- The `q.tasks` array has been renamed `q._tasks` and is now implemented as a doubly linked list (DLL). Any code that used to interact with this array will need to be updated to either use the provided helpers or support DLLs ([#1205](https://github.com/caolan/async/issues/1205)).
+- The timing of the `q.saturated()` callback in a `queue` has been modified to better reflect when tasks pushed to the queue will start queueing. ([#724](https://github.com/caolan/async/issues/724), [#1078](https://github.com/caolan/async/issues/1078))
+- Removed `iterator` method in favour of [ES2015 iterator protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators ) which natively supports arrays ([#1237](https://github.com/caolan/async/issues/1237))
+- Dropped support for Component, Jam, SPM, and Volo ([#1175](https://github.com/caolan/async/issues/1175), #[#176](https://github.com/caolan/async/issues/176))
+
+## Bug Fixes
+
+- Improved handling of no dependency cases in `auto` & `autoInject` ([#1147](https://github.com/caolan/async/issues/1147)).
+- Fixed a bug where the callback generated by `asyncify` with `Promises` could resolve twice ([#1197](https://github.com/caolan/async/issues/1197)).
+- Fixed several documented optional callbacks not actually being optional ([#1223](https://github.com/caolan/async/issues/1223)).
+
+## Other
+
+- Added `someSeries` and `everySeries` for symmetry, as well as a complete set of `any`/`anyLimit`/`anySeries` and `all`/`/allLmit`/`allSeries` aliases.
+- Added `find` as an alias for `detect. (as well as `findLimit` and `findSeries`).
+- Various doc fixes ([#1005](https://github.com/caolan/async/issues/1005), [#1008](https://github.com/caolan/async/issues/1008), [#1010](https://github.com/caolan/async/issues/1010), [#1015](https://github.com/caolan/async/issues/1015), [#1021](https://github.com/caolan/async/issues/1021), [#1037](https://github.com/caolan/async/issues/1037), [#1039](https://github.com/caolan/async/issues/1039), [#1051](https://github.com/caolan/async/issues/1051), [#1102](https://github.com/caolan/async/issues/1102), [#1107](https://github.com/caolan/async/issues/1107), [#1121](https://github.com/caolan/async/issues/1121), [#1123](https://github.com/caolan/async/issues/1123), [#1129](https://github.com/caolan/async/issues/1129), [#1135](https://github.com/caolan/async/issues/1135), [#1138](https://github.com/caolan/async/issues/1138), [#1141](https://github.com/caolan/async/issues/1141), [#1153](https://github.com/caolan/async/issues/1153), [#1216](https://github.com/caolan/async/issues/1216), [#1217](https://github.com/caolan/async/issues/1217), [#1232](https://github.com/caolan/async/issues/1232), [#1233](https://github.com/caolan/async/issues/1233), [#1236](https://github.com/caolan/async/issues/1236), [#1238](https://github.com/caolan/async/issues/1238))
+
+Thank you [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for taking the lead on version 2 of async.
+
+------------------------------------------
+
+# v1.5.2
+- Allow using `"constructor"` as an argument in `memoize` ([#998](https://github.com/caolan/async/issues/998))
+- Give a better error messsage when `auto` dependency checking fails ([#994](https://github.com/caolan/async/issues/994))
+- Various doc updates ([#936](https://github.com/caolan/async/issues/936), [#956](https://github.com/caolan/async/issues/956), [#979](https://github.com/caolan/async/issues/979), [#1002](https://github.com/caolan/async/issues/1002))
+
+# v1.5.1
+- Fix issue with `pause` in `queue` with concurrency enabled ([#946](https://github.com/caolan/async/issues/946))
+- `while` and `until` now pass the final result to callback ([#963](https://github.com/caolan/async/issues/963))
+- `auto` will properly handle concurrency when there is no callback ([#966](https://github.com/caolan/async/issues/966))
+- `auto` will no. properly stop execution when an error occurs ([#988](https://github.com/caolan/async/issues/988), [#993](https://github.com/caolan/async/issues/993))
+- Various doc fixes ([#971](https://github.com/caolan/async/issues/971), [#980](https://github.com/caolan/async/issues/980))
+
+# v1.5.0
+
+- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) ([#892](https://github.com/caolan/async/issues/892))
+- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. ([#873](https://github.com/caolan/async/issues/873))
+- `auto` now accepts an optional `concurrency` argument to limit the number o. running tasks ([#637](https://github.com/caolan/async/issues/637))
+- Added `queue#workersList()`, to retrieve the lis. of currently running tasks. ([#891](https://github.com/caolan/async/issues/891))
+- Various code simplifications ([#896](https://github.com/caolan/async/issues/896), [#904](https://github.com/caolan/async/issues/904))
+- Various doc fixes :scroll: ([#890](https://github.com/caolan/async/issues/890), [#894](https://github.com/caolan/async/issues/894), [#903](https://github.com/caolan/async/issues/903), [#905](https://github.com/caolan/async/issues/905), [#912](https://github.com/caolan/async/issues/912))
+
+# v1.4.2
+
+- Ensure coverage files don't get published on npm ([#879](https://github.com/caolan/async/issues/879))
+
+# v1.4.1
+
+- Add in overlooked `detectLimit` method ([#866](https://github.com/caolan/async/issues/866))
+- Removed unnecessary files from npm releases ([#861](https://github.com/caolan/async/issues/861))
+- Removed usage of a reserved word to prevent :boom: in older environments ([#870](https://github.com/caolan/async/issues/870))
+
+# v1.4.0
+
+- `asyncify` now supports promises ([#840](https://github.com/caolan/async/issues/840))
+- Added `Limit` versions of `filter` and `reject` ([#836](https://github.com/caolan/async/issues/836))
+- Add `Limit` versions of `detect`, `some` and `every` ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829))
+- `some`, `every` and `detect` now short circuit early ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829))
+- Improve detection of the global object ([#804](https://github.com/caolan/async/issues/804)), enabling use in WebWorkers
+- `whilst` now called with arguments from iterator ([#823](https://github.com/caolan/async/issues/823))
+- `during` now gets called with arguments from iterator ([#824](https://github.com/caolan/async/issues/824))
+- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0))
+
+
+# v1.3.0
+
+New Features:
+- Added `constant`
+- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. ([#671](https://github.com/caolan/async/issues/671), [#806](https://github.com/caolan/async/issues/806))
+- Added `during` and `doDuring`, which are like `whilst` with an async truth test. ([#800](https://github.com/caolan/async/issues/800))
+- `retry` now accepts an `interval` parameter to specify a delay between retries. ([#793](https://github.com/caolan/async/issues/793))
+- `async` should work better in Web Workers due to better `root` detection ([#804](https://github.com/caolan/async/issues/804))
+- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` ([#642](https://github.com/caolan/async/issues/642))
+- Various internal updates ([#786](https://github.com/caolan/async/issues/786), [#801](https://github.com/caolan/async/issues/801), [#802](https://github.com/caolan/async/issues/802), [#803](https://github.com/caolan/async/issues/803))
+- Various doc fixes ([#790](https://github.com/caolan/async/issues/790), [#794](https://github.com/caolan/async/issues/794))
+
+Bug Fixes:
+- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. ([#740](https://github.com/caolan/async/issues/740), [#744](https://github.com/caolan/async/issues/744), [#783](https://github.com/caolan/async/issues/783))
+
+
+# v1.2.1
+
+Bug Fix:
+
+- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782))
+
+
+# v1.2.0
+
+New Features:
+
+- Added `timesLimit` ([#743](https://github.com/caolan/async/issues/743))
+- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. ([#747](https://github.com/caolan/async/issues/747), [#772](https://github.com/caolan/async/issues/772))
+
+Bug Fixes:
+
+- Fixed a regression in `each` and family with empty arrays that have additional properties. ([#775](https://github.com/caolan/async/issues/775), [#777](https://github.com/caolan/async/issues/777))
+
+
+# v1.1.1
+
+Bug Fix:
+
+- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782))
+
+
+# v1.1.0
+
+New Features:
+
+- `cargo` now supports all of the same methods and event callbacks as `queue`.
+- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. ([#769](https://github.com/caolan/async/issues/769))
+- Optimized `map`, `eachOf`, and `waterfall` families of functions
+- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array ([#667](https://github.com/caolan/async/issues/667)).
+- The callback is now optional for the composed results of `compose` and `seq`. ([#618](https://github.com/caolan/async/issues/618))
+- Reduced file size by 4kb, (minified version by 1kb)
+- Added code coverage through `nyc` and `coveralls` ([#768](https://github.com/caolan/async/issues/768))
+
+Bug Fixes:
+
+- `forever` will no longer stack overflow with a synchronous iterator ([#622](https://github.com/caolan/async/issues/622))
+- `eachLimit` and other limit functions will stop iterating once an error occurs ([#754](https://github.com/caolan/async/issues/754))
+- Always pass `null` in callbacks when there is no error ([#439](https://github.com/caolan/async/issues/439))
+- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue ([#668](https://github.com/caolan/async/issues/668))
+- `each` and family will properly handle an empty array ([#578](https://github.com/caolan/async/issues/578))
+- `eachSeries` and family will finish if the underlying array is modified during execution ([#557](https://github.com/caolan/async/issues/557))
+- `queue` will throw if a non-function is passed to `q.push()` ([#593](https://github.com/caolan/async/issues/593))
+- Doc fixes ([#629](https://github.com/caolan/async/issues/629), [#766](https://github.com/caolan/async/issues/766))
+
+
+# v1.0.0
+
+No known breaking changes, we are simply complying with semver from here on out.
+
+Changes:
+
+- Start using a changelog!
+- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) ([#168](https://github.com/caolan/async/issues/168) [#704](https://github.com/caolan/async/issues/704) [#321](https://github.com/caolan/async/issues/321))
+- Detect deadlocks in `auto` ([#663](https://github.com/caolan/async/issues/663))
+- Better support for require.js ([#527](https://github.com/caolan/async/issues/527))
+- Throw if queue created with concurrency `0` ([#714](https://github.com/caolan/async/issues/714))
+- Fix unneeded iteration in `queue.resume()` ([#758](https://github.com/caolan/async/issues/758))
+- Guard against timer mocking overriding `setImmediate` ([#609](https://github.com/caolan/async/issues/609) [#611](https://github.com/caolan/async/issues/611))
+- Miscellaneous doc fixes ([#542](https://github.com/caolan/async/issues/542) [#596](https://github.com/caolan/async/issues/596) [#615](https://github.com/caolan/async/issues/615) [#628](https://github.com/caolan/async/issues/628) [#631](https://github.com/caolan/async/issues/631) [#690](https://github.com/caolan/async/issues/690) [#729](https://github.com/caolan/async/issues/729))
+- Use single noop function internally ([#546](https://github.com/caolan/async/issues/546))
+- Optimize internal `_each`, `_map` and `_keys` functions.
diff --git a/node_modules/@pm2/io/node_modules/async/LICENSE b/node_modules/@pm2/io/node_modules/async/LICENSE
new file mode 100644
index 0000000..b18aed6
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010-2018 Caolan McMahon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/@pm2/io/node_modules/async/README.md b/node_modules/@pm2/io/node_modules/async/README.md
new file mode 100644
index 0000000..49cf950
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/README.md
@@ -0,0 +1,56 @@
+
+
+[](https://travis-ci.org/caolan/async)
+[](https://www.npmjs.com/package/async)
+[](https://coveralls.io/r/caolan/async?branch=master)
+[](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[](https://www.libhive.com/providers/npm/packages/async)
+[](https://www.jsdelivr.com/package/npm/async)
+
+
+Async is a utility module which provides straight-forward, powerful functions for working with [asynchronous JavaScript](http://caolan.github.io/async/global.html). Although originally designed for use with [Node.js](https://nodejs.org/) and installable via `npm install --save async`, it can also be used directly in the browser.
+
+This version of the package is optimized for the Node.js environment. If you use Async with webpack, install [`async-es`](https://www.npmjs.com/package/async-es) instead.
+
+For Documentation, visit
+
+*For Async v1.5.x documentation, go [HERE](https://github.com/caolan/async/blob/v1.5.2/README.md)*
+
+
+```javascript
+// for use with Node-style callbacks...
+var async = require("async");
+
+var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+var configs = {};
+
+async.forEachOf(obj, (value, key, callback) => {
+ fs.readFile(__dirname + value, "utf8", (err, data) => {
+ if (err) return callback(err);
+ try {
+ configs[key] = JSON.parse(data);
+ } catch (e) {
+ return callback(e);
+ }
+ callback();
+ });
+}, err => {
+ if (err) console.error(err.message);
+ // configs is now a map of JSON data
+ doSomethingWith(configs);
+});
+```
+
+```javascript
+var async = require("async");
+
+// ...or ES2017 async functions
+async.mapLimit(urls, 5, async function(url) {
+ const response = await fetch(url)
+ return response.body
+}, (err, results) => {
+ if (err) throw err
+ // results is now an array of the response bodies
+ console.log(results)
+})
+```
diff --git a/node_modules/@pm2/io/node_modules/async/all.js b/node_modules/@pm2/io/node_modules/async/all.js
new file mode 100644
index 0000000..d0565b0
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/all.js
@@ -0,0 +1,50 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _notId = require('./internal/notId');
+
+var _notId2 = _interopRequireDefault(_notId);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns `true` if every element in `coll` satisfies an async test. If any
+ * iteratee call returns `false`, the main `callback` is immediately called.
+ *
+ * @name every
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias all
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ * @example
+ *
+ * async.every(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // if result is true then every file exists
+ * });
+ */
+exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/allLimit.js b/node_modules/@pm2/io/node_modules/async/allLimit.js
new file mode 100644
index 0000000..a1a759a
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/allLimit.js
@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _notId = require('./internal/notId');
+
+var _notId2 = _interopRequireDefault(_notId);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name everyLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/allSeries.js b/node_modules/@pm2/io/node_modules/async/allSeries.js
new file mode 100644
index 0000000..23bfebb
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/allSeries.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _everyLimit = require('./everyLimit');
+
+var _everyLimit2 = _interopRequireDefault(_everyLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.
+ *
+ * @name everySeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in series.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_everyLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/any.js b/node_modules/@pm2/io/node_modules/async/any.js
new file mode 100644
index 0000000..a8e70f7
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/any.js
@@ -0,0 +1,52 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns `true` if at least one element in the `coll` satisfies an async test.
+ * If any iteratee call returns `true`, the main `callback` is immediately
+ * called.
+ *
+ * @name some
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias any
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in parallel.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ * @example
+ *
+ * async.some(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // if result is true then at least one of the files exists
+ * });
+ */
+exports.default = (0, _doParallel2.default)((0, _createTester2.default)(Boolean, _identity2.default));
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/anyLimit.js b/node_modules/@pm2/io/node_modules/async/anyLimit.js
new file mode 100644
index 0000000..24ca3f4
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/anyLimit.js
@@ -0,0 +1,43 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name someLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.some]{@link module:Collections.some}
+ * @alias anyLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in parallel.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ */
+exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(Boolean, _identity2.default));
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/anySeries.js b/node_modules/@pm2/io/node_modules/async/anySeries.js
new file mode 100644
index 0000000..dc24ed2
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/anySeries.js
@@ -0,0 +1,38 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _someLimit = require('./someLimit');
+
+var _someLimit2 = _interopRequireDefault(_someLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.
+ *
+ * @name someSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.some]{@link module:Collections.some}
+ * @alias anySeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in series.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_someLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/apply.js b/node_modules/@pm2/io/node_modules/async/apply.js
new file mode 100644
index 0000000..f590fa5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/apply.js
@@ -0,0 +1,68 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (fn /*, ...args*/) {
+ var args = (0, _slice2.default)(arguments, 1);
+ return function () /*callArgs*/{
+ var callArgs = (0, _slice2.default)(arguments);
+ return fn.apply(null, args.concat(callArgs));
+ };
+};
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+;
+
+/**
+ * Creates a continuation function with some arguments already applied.
+ *
+ * Useful as a shorthand when combined with other control flow functions. Any
+ * arguments passed to the returned function are added to the arguments
+ * originally passed to apply.
+ *
+ * @name apply
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {Function} fn - The function you want to eventually apply all
+ * arguments to. Invokes with (arguments...).
+ * @param {...*} arguments... - Any number of arguments to automatically apply
+ * when the continuation is called.
+ * @returns {Function} the partially-applied function
+ * @example
+ *
+ * // using apply
+ * async.parallel([
+ * async.apply(fs.writeFile, 'testfile1', 'test1'),
+ * async.apply(fs.writeFile, 'testfile2', 'test2')
+ * ]);
+ *
+ *
+ * // the same process without using apply
+ * async.parallel([
+ * function(callback) {
+ * fs.writeFile('testfile1', 'test1', callback);
+ * },
+ * function(callback) {
+ * fs.writeFile('testfile2', 'test2', callback);
+ * }
+ * ]);
+ *
+ * // It's possible to pass any number of additional arguments when calling the
+ * // continuation:
+ *
+ * node> var fn = async.apply(sys.puts, 'one');
+ * node> fn('two', 'three');
+ * one
+ * two
+ * three
+ */
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/applyEach.js b/node_modules/@pm2/io/node_modules/async/applyEach.js
new file mode 100644
index 0000000..06c0845
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/applyEach.js
@@ -0,0 +1,51 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _applyEach = require('./internal/applyEach');
+
+var _applyEach2 = _interopRequireDefault(_applyEach);
+
+var _map = require('./map');
+
+var _map2 = _interopRequireDefault(_map);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Applies the provided arguments to each function in the array, calling
+ * `callback` after all functions have completed. If you only provide the first
+ * argument, `fns`, then it will return a function which lets you pass in the
+ * arguments as if it were a single function call. If more arguments are
+ * provided, `callback` is required while `args` is still optional.
+ *
+ * @name applyEach
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s
+ * to all call with the same arguments
+ * @param {...*} [args] - any number of separate arguments to pass to the
+ * function.
+ * @param {Function} [callback] - the final argument should be the callback,
+ * called when all functions have completed processing.
+ * @returns {Function} - If only the first argument, `fns`, is provided, it will
+ * return a function which lets you pass in the arguments as if it were a single
+ * function call. The signature is `(..args, callback)`. If invoked with any
+ * arguments, `callback` is required.
+ * @example
+ *
+ * async.applyEach([enableSearch, updateSchema], 'bucket', callback);
+ *
+ * // partial application example:
+ * async.each(
+ * buckets,
+ * async.applyEach([enableSearch, updateSchema]),
+ * callback
+ * );
+ */
+exports.default = (0, _applyEach2.default)(_map2.default);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/applyEachSeries.js b/node_modules/@pm2/io/node_modules/async/applyEachSeries.js
new file mode 100644
index 0000000..ad80280
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/applyEachSeries.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _applyEach = require('./internal/applyEach');
+
+var _applyEach2 = _interopRequireDefault(_applyEach);
+
+var _mapSeries = require('./mapSeries');
+
+var _mapSeries2 = _interopRequireDefault(_mapSeries);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.
+ *
+ * @name applyEachSeries
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.applyEach]{@link module:ControlFlow.applyEach}
+ * @category Control Flow
+ * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all
+ * call with the same arguments
+ * @param {...*} [args] - any number of separate arguments to pass to the
+ * function.
+ * @param {Function} [callback] - the final argument should be the callback,
+ * called when all functions have completed processing.
+ * @returns {Function} - If only the first argument is provided, it will return
+ * a function which lets you pass in the arguments as if it were a single
+ * function call.
+ */
+exports.default = (0, _applyEach2.default)(_mapSeries2.default);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/asyncify.js b/node_modules/@pm2/io/node_modules/async/asyncify.js
new file mode 100644
index 0000000..5e3fc91
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/asyncify.js
@@ -0,0 +1,110 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = asyncify;
+
+var _isObject = require('lodash/isObject');
+
+var _isObject2 = _interopRequireDefault(_isObject);
+
+var _initialParams = require('./internal/initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+var _setImmediate = require('./internal/setImmediate');
+
+var _setImmediate2 = _interopRequireDefault(_setImmediate);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Take a sync function and make it async, passing its return value to a
+ * callback. This is useful for plugging sync functions into a waterfall,
+ * series, or other async functions. Any arguments passed to the generated
+ * function will be passed to the wrapped function (except for the final
+ * callback argument). Errors thrown will be passed to the callback.
+ *
+ * If the function passed to `asyncify` returns a Promise, that promises's
+ * resolved/rejected state will be used to call the callback, rather than simply
+ * the synchronous return value.
+ *
+ * This also means you can asyncify ES2017 `async` functions.
+ *
+ * @name asyncify
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @alias wrapSync
+ * @category Util
+ * @param {Function} func - The synchronous function, or Promise-returning
+ * function to convert to an {@link AsyncFunction}.
+ * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be
+ * invoked with `(args..., callback)`.
+ * @example
+ *
+ * // passing a regular synchronous function
+ * async.waterfall([
+ * async.apply(fs.readFile, filename, "utf8"),
+ * async.asyncify(JSON.parse),
+ * function (data, next) {
+ * // data is the result of parsing the text.
+ * // If there was a parsing error, it would have been caught.
+ * }
+ * ], callback);
+ *
+ * // passing a function returning a promise
+ * async.waterfall([
+ * async.apply(fs.readFile, filename, "utf8"),
+ * async.asyncify(function (contents) {
+ * return db.model.create(contents);
+ * }),
+ * function (model, next) {
+ * // `model` is the instantiated model object.
+ * // If there was an error, this function would be skipped.
+ * }
+ * ], callback);
+ *
+ * // es2017 example, though `asyncify` is not needed if your JS environment
+ * // supports async functions out of the box
+ * var q = async.queue(async.asyncify(async function(file) {
+ * var intermediateStep = await processFile(file);
+ * return await somePromise(intermediateStep)
+ * }));
+ *
+ * q.push(files);
+ */
+function asyncify(func) {
+ return (0, _initialParams2.default)(function (args, callback) {
+ var result;
+ try {
+ result = func.apply(this, args);
+ } catch (e) {
+ return callback(e);
+ }
+ // if result is Promise object
+ if ((0, _isObject2.default)(result) && typeof result.then === 'function') {
+ result.then(function (value) {
+ invokeCallback(callback, null, value);
+ }, function (err) {
+ invokeCallback(callback, err.message ? err : new Error(err));
+ });
+ } else {
+ callback(null, result);
+ }
+ });
+}
+
+function invokeCallback(callback, error, value) {
+ try {
+ callback(error, value);
+ } catch (e) {
+ (0, _setImmediate2.default)(rethrow, e);
+ }
+}
+
+function rethrow(error) {
+ throw error;
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/auto.js b/node_modules/@pm2/io/node_modules/async/auto.js
new file mode 100644
index 0000000..26c1d56
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/auto.js
@@ -0,0 +1,289 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (tasks, concurrency, callback) {
+ if (typeof concurrency === 'function') {
+ // concurrency is optional, shift the args.
+ callback = concurrency;
+ concurrency = null;
+ }
+ callback = (0, _once2.default)(callback || _noop2.default);
+ var keys = (0, _keys2.default)(tasks);
+ var numTasks = keys.length;
+ if (!numTasks) {
+ return callback(null);
+ }
+ if (!concurrency) {
+ concurrency = numTasks;
+ }
+
+ var results = {};
+ var runningTasks = 0;
+ var hasError = false;
+
+ var listeners = Object.create(null);
+
+ var readyTasks = [];
+
+ // for cycle detection:
+ var readyToCheck = []; // tasks that have been identified as reachable
+ // without the possibility of returning to an ancestor task
+ var uncheckedDependencies = {};
+
+ (0, _baseForOwn2.default)(tasks, function (task, key) {
+ if (!(0, _isArray2.default)(task)) {
+ // no dependencies
+ enqueueTask(key, [task]);
+ readyToCheck.push(key);
+ return;
+ }
+
+ var dependencies = task.slice(0, task.length - 1);
+ var remainingDependencies = dependencies.length;
+ if (remainingDependencies === 0) {
+ enqueueTask(key, task);
+ readyToCheck.push(key);
+ return;
+ }
+ uncheckedDependencies[key] = remainingDependencies;
+
+ (0, _arrayEach2.default)(dependencies, function (dependencyName) {
+ if (!tasks[dependencyName]) {
+ throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', '));
+ }
+ addListener(dependencyName, function () {
+ remainingDependencies--;
+ if (remainingDependencies === 0) {
+ enqueueTask(key, task);
+ }
+ });
+ });
+ });
+
+ checkForDeadlocks();
+ processQueue();
+
+ function enqueueTask(key, task) {
+ readyTasks.push(function () {
+ runTask(key, task);
+ });
+ }
+
+ function processQueue() {
+ if (readyTasks.length === 0 && runningTasks === 0) {
+ return callback(null, results);
+ }
+ while (readyTasks.length && runningTasks < concurrency) {
+ var run = readyTasks.shift();
+ run();
+ }
+ }
+
+ function addListener(taskName, fn) {
+ var taskListeners = listeners[taskName];
+ if (!taskListeners) {
+ taskListeners = listeners[taskName] = [];
+ }
+
+ taskListeners.push(fn);
+ }
+
+ function taskComplete(taskName) {
+ var taskListeners = listeners[taskName] || [];
+ (0, _arrayEach2.default)(taskListeners, function (fn) {
+ fn();
+ });
+ processQueue();
+ }
+
+ function runTask(key, task) {
+ if (hasError) return;
+
+ var taskCallback = (0, _onlyOnce2.default)(function (err, result) {
+ runningTasks--;
+ if (arguments.length > 2) {
+ result = (0, _slice2.default)(arguments, 1);
+ }
+ if (err) {
+ var safeResults = {};
+ (0, _baseForOwn2.default)(results, function (val, rkey) {
+ safeResults[rkey] = val;
+ });
+ safeResults[key] = result;
+ hasError = true;
+ listeners = Object.create(null);
+
+ callback(err, safeResults);
+ } else {
+ results[key] = result;
+ taskComplete(key);
+ }
+ });
+
+ runningTasks++;
+ var taskFn = (0, _wrapAsync2.default)(task[task.length - 1]);
+ if (task.length > 1) {
+ taskFn(results, taskCallback);
+ } else {
+ taskFn(taskCallback);
+ }
+ }
+
+ function checkForDeadlocks() {
+ // Kahn's algorithm
+ // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm
+ // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html
+ var currentTask;
+ var counter = 0;
+ while (readyToCheck.length) {
+ currentTask = readyToCheck.pop();
+ counter++;
+ (0, _arrayEach2.default)(getDependents(currentTask), function (dependent) {
+ if (--uncheckedDependencies[dependent] === 0) {
+ readyToCheck.push(dependent);
+ }
+ });
+ }
+
+ if (counter !== numTasks) {
+ throw new Error('async.auto cannot execute tasks due to a recursive dependency');
+ }
+ }
+
+ function getDependents(taskName) {
+ var result = [];
+ (0, _baseForOwn2.default)(tasks, function (task, key) {
+ if ((0, _isArray2.default)(task) && (0, _baseIndexOf2.default)(task, taskName, 0) >= 0) {
+ result.push(key);
+ }
+ });
+ return result;
+ }
+};
+
+var _arrayEach = require('lodash/_arrayEach');
+
+var _arrayEach2 = _interopRequireDefault(_arrayEach);
+
+var _baseForOwn = require('lodash/_baseForOwn');
+
+var _baseForOwn2 = _interopRequireDefault(_baseForOwn);
+
+var _baseIndexOf = require('lodash/_baseIndexOf');
+
+var _baseIndexOf2 = _interopRequireDefault(_baseIndexOf);
+
+var _isArray = require('lodash/isArray');
+
+var _isArray2 = _interopRequireDefault(_isArray);
+
+var _keys = require('lodash/keys');
+
+var _keys2 = _interopRequireDefault(_keys);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+module.exports = exports['default'];
+
+/**
+ * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on
+ * their requirements. Each function can optionally depend on other functions
+ * being completed first, and each function is run as soon as its requirements
+ * are satisfied.
+ *
+ * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence
+ * will stop. Further tasks will not execute (so any other functions depending
+ * on it will not run), and the main `callback` is immediately called with the
+ * error.
+ *
+ * {@link AsyncFunction}s also receive an object containing the results of functions which
+ * have completed so far as the first argument, if they have dependencies. If a
+ * task function has no dependencies, it will only be passed a callback.
+ *
+ * @name auto
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Object} tasks - An object. Each of its properties is either a
+ * function or an array of requirements, with the {@link AsyncFunction} itself the last item
+ * in the array. The object's key of a property serves as the name of the task
+ * defined by that property, i.e. can be used when specifying requirements for
+ * other tasks. The function receives one or two arguments:
+ * * a `results` object, containing the results of the previously executed
+ * functions, only passed if the task has any dependencies,
+ * * a `callback(err, result)` function, which must be called when finished,
+ * passing an `error` (which can be `null`) and the result of the function's
+ * execution.
+ * @param {number} [concurrency=Infinity] - An optional `integer` for
+ * determining the maximum number of tasks that can be run in parallel. By
+ * default, as many as possible.
+ * @param {Function} [callback] - An optional callback which is called when all
+ * the tasks have been completed. It receives the `err` argument if any `tasks`
+ * pass an error to their callback. Results are always returned; however, if an
+ * error occurs, no further `tasks` will be performed, and the results object
+ * will only contain partial results. Invoked with (err, results).
+ * @returns undefined
+ * @example
+ *
+ * async.auto({
+ * // this function will just be passed a callback
+ * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),
+ * showData: ['readData', function(results, cb) {
+ * // results.readData is the file's contents
+ * // ...
+ * }]
+ * }, callback);
+ *
+ * async.auto({
+ * get_data: function(callback) {
+ * console.log('in get_data');
+ * // async code to get some data
+ * callback(null, 'data', 'converted to array');
+ * },
+ * make_folder: function(callback) {
+ * console.log('in make_folder');
+ * // async code to create a directory to store a file in
+ * // this is run at the same time as getting the data
+ * callback(null, 'folder');
+ * },
+ * write_file: ['get_data', 'make_folder', function(results, callback) {
+ * console.log('in write_file', JSON.stringify(results));
+ * // once there is some data and the directory exists,
+ * // write the data to a file in the directory
+ * callback(null, 'filename');
+ * }],
+ * email_link: ['write_file', function(results, callback) {
+ * console.log('in email_link', JSON.stringify(results));
+ * // once the file is written let's email a link to it...
+ * // results.write_file contains the filename returned by write_file.
+ * callback(null, {'file':results.write_file, 'email':'user@example.com'});
+ * }]
+ * }, function(err, results) {
+ * console.log('err = ', err);
+ * console.log('results = ', results);
+ * });
+ */
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/autoInject.js b/node_modules/@pm2/io/node_modules/async/autoInject.js
new file mode 100644
index 0000000..bfbe7e8
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/autoInject.js
@@ -0,0 +1,170 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = autoInject;
+
+var _auto = require('./auto');
+
+var _auto2 = _interopRequireDefault(_auto);
+
+var _baseForOwn = require('lodash/_baseForOwn');
+
+var _baseForOwn2 = _interopRequireDefault(_baseForOwn);
+
+var _arrayMap = require('lodash/_arrayMap');
+
+var _arrayMap2 = _interopRequireDefault(_arrayMap);
+
+var _isArray = require('lodash/isArray');
+
+var _isArray2 = _interopRequireDefault(_isArray);
+
+var _trim = require('lodash/trim');
+
+var _trim2 = _interopRequireDefault(_trim);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m;
+var FN_ARG_SPLIT = /,/;
+var FN_ARG = /(=.+)?(\s*)$/;
+var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
+
+function parseParams(func) {
+ func = func.toString().replace(STRIP_COMMENTS, '');
+ func = func.match(FN_ARGS)[2].replace(' ', '');
+ func = func ? func.split(FN_ARG_SPLIT) : [];
+ func = func.map(function (arg) {
+ return (0, _trim2.default)(arg.replace(FN_ARG, ''));
+ });
+ return func;
+}
+
+/**
+ * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent
+ * tasks are specified as parameters to the function, after the usual callback
+ * parameter, with the parameter names matching the names of the tasks it
+ * depends on. This can provide even more readable task graphs which can be
+ * easier to maintain.
+ *
+ * If a final callback is specified, the task results are similarly injected,
+ * specified as named parameters after the initial error parameter.
+ *
+ * The autoInject function is purely syntactic sugar and its semantics are
+ * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.
+ *
+ * @name autoInject
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.auto]{@link module:ControlFlow.auto}
+ * @category Control Flow
+ * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of
+ * the form 'func([dependencies...], callback). The object's key of a property
+ * serves as the name of the task defined by that property, i.e. can be used
+ * when specifying requirements for other tasks.
+ * * The `callback` parameter is a `callback(err, result)` which must be called
+ * when finished, passing an `error` (which can be `null`) and the result of
+ * the function's execution. The remaining parameters name other tasks on
+ * which the task is dependent, and the results from those tasks are the
+ * arguments of those parameters.
+ * @param {Function} [callback] - An optional callback which is called when all
+ * the tasks have been completed. It receives the `err` argument if any `tasks`
+ * pass an error to their callback, and a `results` object with any completed
+ * task results, similar to `auto`.
+ * @example
+ *
+ * // The example from `auto` can be rewritten as follows:
+ * async.autoInject({
+ * get_data: function(callback) {
+ * // async code to get some data
+ * callback(null, 'data', 'converted to array');
+ * },
+ * make_folder: function(callback) {
+ * // async code to create a directory to store a file in
+ * // this is run at the same time as getting the data
+ * callback(null, 'folder');
+ * },
+ * write_file: function(get_data, make_folder, callback) {
+ * // once there is some data and the directory exists,
+ * // write the data to a file in the directory
+ * callback(null, 'filename');
+ * },
+ * email_link: function(write_file, callback) {
+ * // once the file is written let's email a link to it...
+ * // write_file contains the filename returned by write_file.
+ * callback(null, {'file':write_file, 'email':'user@example.com'});
+ * }
+ * }, function(err, results) {
+ * console.log('err = ', err);
+ * console.log('email_link = ', results.email_link);
+ * });
+ *
+ * // If you are using a JS minifier that mangles parameter names, `autoInject`
+ * // will not work with plain functions, since the parameter names will be
+ * // collapsed to a single letter identifier. To work around this, you can
+ * // explicitly specify the names of the parameters your task function needs
+ * // in an array, similar to Angular.js dependency injection.
+ *
+ * // This still has an advantage over plain `auto`, since the results a task
+ * // depends on are still spread into arguments.
+ * async.autoInject({
+ * //...
+ * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {
+ * callback(null, 'filename');
+ * }],
+ * email_link: ['write_file', function(write_file, callback) {
+ * callback(null, {'file':write_file, 'email':'user@example.com'});
+ * }]
+ * //...
+ * }, function(err, results) {
+ * console.log('err = ', err);
+ * console.log('email_link = ', results.email_link);
+ * });
+ */
+function autoInject(tasks, callback) {
+ var newTasks = {};
+
+ (0, _baseForOwn2.default)(tasks, function (taskFn, key) {
+ var params;
+ var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn);
+ var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0;
+
+ if ((0, _isArray2.default)(taskFn)) {
+ params = taskFn.slice(0, -1);
+ taskFn = taskFn[taskFn.length - 1];
+
+ newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);
+ } else if (hasNoDeps) {
+ // no dependencies, use the function as-is
+ newTasks[key] = taskFn;
+ } else {
+ params = parseParams(taskFn);
+ if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {
+ throw new Error("autoInject task functions require explicit parameters.");
+ }
+
+ // remove callback param
+ if (!fnIsAsync) params.pop();
+
+ newTasks[key] = params.concat(newTask);
+ }
+
+ function newTask(results, taskCb) {
+ var newArgs = (0, _arrayMap2.default)(params, function (name) {
+ return results[name];
+ });
+ newArgs.push(taskCb);
+ (0, _wrapAsync2.default)(taskFn).apply(null, newArgs);
+ }
+ });
+
+ (0, _auto2.default)(newTasks, callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/bower.json b/node_modules/@pm2/io/node_modules/async/bower.json
new file mode 100644
index 0000000..7dbeb14
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/bower.json
@@ -0,0 +1,17 @@
+{
+ "name": "async",
+ "main": "dist/async.js",
+ "ignore": [
+ "bower_components",
+ "lib",
+ "mocha_test",
+ "node_modules",
+ "perf",
+ "support",
+ "**/.*",
+ "*.config.js",
+ "*.json",
+ "index.js",
+ "Makefile"
+ ]
+}
diff --git a/node_modules/@pm2/io/node_modules/async/cargo.js b/node_modules/@pm2/io/node_modules/async/cargo.js
new file mode 100644
index 0000000..c7e59c7
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/cargo.js
@@ -0,0 +1,94 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cargo;
+
+var _queue = require('./internal/queue');
+
+var _queue2 = _interopRequireDefault(_queue);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * A cargo of tasks for the worker function to complete. Cargo inherits all of
+ * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}.
+ * @typedef {Object} CargoObject
+ * @memberOf module:ControlFlow
+ * @property {Function} length - A function returning the number of items
+ * waiting to be processed. Invoke like `cargo.length()`.
+ * @property {number} payload - An `integer` for determining how many tasks
+ * should be process per round. This property can be changed after a `cargo` is
+ * created to alter the payload on-the-fly.
+ * @property {Function} push - Adds `task` to the `queue`. The callback is
+ * called once the `worker` has finished processing the task. Instead of a
+ * single task, an array of `tasks` can be submitted. The respective callback is
+ * used for every task in the list. Invoke like `cargo.push(task, [callback])`.
+ * @property {Function} saturated - A callback that is called when the
+ * `queue.length()` hits the concurrency and further tasks will be queued.
+ * @property {Function} empty - A callback that is called when the last item
+ * from the `queue` is given to a `worker`.
+ * @property {Function} drain - A callback that is called when the last item
+ * from the `queue` has returned from the `worker`.
+ * @property {Function} idle - a function returning false if there are items
+ * waiting or being processed, or true if not. Invoke like `cargo.idle()`.
+ * @property {Function} pause - a function that pauses the processing of tasks
+ * until `resume()` is called. Invoke like `cargo.pause()`.
+ * @property {Function} resume - a function that resumes the processing of
+ * queued tasks when the queue is paused. Invoke like `cargo.resume()`.
+ * @property {Function} kill - a function that removes the `drain` callback and
+ * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`.
+ */
+
+/**
+ * Creates a `cargo` object with the specified payload. Tasks added to the
+ * cargo will be processed altogether (up to the `payload` limit). If the
+ * `worker` is in progress, the task is queued until it becomes available. Once
+ * the `worker` has completed some tasks, each callback of those tasks is
+ * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)
+ * for how `cargo` and `queue` work.
+ *
+ * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers
+ * at a time, cargo passes an array of tasks to a single worker, repeating
+ * when the worker is finished.
+ *
+ * @name cargo
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.queue]{@link module:ControlFlow.queue}
+ * @category Control Flow
+ * @param {AsyncFunction} worker - An asynchronous function for processing an array
+ * of queued tasks. Invoked with `(tasks, callback)`.
+ * @param {number} [payload=Infinity] - An optional `integer` for determining
+ * how many tasks should be processed per round; if omitted, the default is
+ * unlimited.
+ * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can
+ * attached as certain properties to listen for specific events during the
+ * lifecycle of the cargo and inner queue.
+ * @example
+ *
+ * // create a cargo object with payload 2
+ * var cargo = async.cargo(function(tasks, callback) {
+ * for (var i=0; i async.dir(hello, 'world');
+ * {hello: 'world'}
+ */
+exports.default = (0, _consoleFunc2.default)('dir');
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/dist/async.js b/node_modules/@pm2/io/node_modules/async/dist/async.js
new file mode 100644
index 0000000..61c7588
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/dist/async.js
@@ -0,0 +1,5612 @@
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
+ (factory((global.async = global.async || {})));
+}(this, (function (exports) { 'use strict';
+
+function slice(arrayLike, start) {
+ start = start|0;
+ var newLen = Math.max(arrayLike.length - start, 0);
+ var newArr = Array(newLen);
+ for(var idx = 0; idx < newLen; idx++) {
+ newArr[idx] = arrayLike[start + idx];
+ }
+ return newArr;
+}
+
+/**
+ * Creates a continuation function with some arguments already applied.
+ *
+ * Useful as a shorthand when combined with other control flow functions. Any
+ * arguments passed to the returned function are added to the arguments
+ * originally passed to apply.
+ *
+ * @name apply
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {Function} fn - The function you want to eventually apply all
+ * arguments to. Invokes with (arguments...).
+ * @param {...*} arguments... - Any number of arguments to automatically apply
+ * when the continuation is called.
+ * @returns {Function} the partially-applied function
+ * @example
+ *
+ * // using apply
+ * async.parallel([
+ * async.apply(fs.writeFile, 'testfile1', 'test1'),
+ * async.apply(fs.writeFile, 'testfile2', 'test2')
+ * ]);
+ *
+ *
+ * // the same process without using apply
+ * async.parallel([
+ * function(callback) {
+ * fs.writeFile('testfile1', 'test1', callback);
+ * },
+ * function(callback) {
+ * fs.writeFile('testfile2', 'test2', callback);
+ * }
+ * ]);
+ *
+ * // It's possible to pass any number of additional arguments when calling the
+ * // continuation:
+ *
+ * node> var fn = async.apply(sys.puts, 'one');
+ * node> fn('two', 'three');
+ * one
+ * two
+ * three
+ */
+var apply = function(fn/*, ...args*/) {
+ var args = slice(arguments, 1);
+ return function(/*callArgs*/) {
+ var callArgs = slice(arguments);
+ return fn.apply(null, args.concat(callArgs));
+ };
+};
+
+var initialParams = function (fn) {
+ return function (/*...args, callback*/) {
+ var args = slice(arguments);
+ var callback = args.pop();
+ fn.call(this, args, callback);
+ };
+};
+
+/**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return value != null && (type == 'object' || type == 'function');
+}
+
+var hasSetImmediate = typeof setImmediate === 'function' && setImmediate;
+var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';
+
+function fallback(fn) {
+ setTimeout(fn, 0);
+}
+
+function wrap(defer) {
+ return function (fn/*, ...args*/) {
+ var args = slice(arguments, 1);
+ defer(function () {
+ fn.apply(null, args);
+ });
+ };
+}
+
+var _defer;
+
+if (hasSetImmediate) {
+ _defer = setImmediate;
+} else if (hasNextTick) {
+ _defer = process.nextTick;
+} else {
+ _defer = fallback;
+}
+
+var setImmediate$1 = wrap(_defer);
+
+/**
+ * Take a sync function and make it async, passing its return value to a
+ * callback. This is useful for plugging sync functions into a waterfall,
+ * series, or other async functions. Any arguments passed to the generated
+ * function will be passed to the wrapped function (except for the final
+ * callback argument). Errors thrown will be passed to the callback.
+ *
+ * If the function passed to `asyncify` returns a Promise, that promises's
+ * resolved/rejected state will be used to call the callback, rather than simply
+ * the synchronous return value.
+ *
+ * This also means you can asyncify ES2017 `async` functions.
+ *
+ * @name asyncify
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @alias wrapSync
+ * @category Util
+ * @param {Function} func - The synchronous function, or Promise-returning
+ * function to convert to an {@link AsyncFunction}.
+ * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be
+ * invoked with `(args..., callback)`.
+ * @example
+ *
+ * // passing a regular synchronous function
+ * async.waterfall([
+ * async.apply(fs.readFile, filename, "utf8"),
+ * async.asyncify(JSON.parse),
+ * function (data, next) {
+ * // data is the result of parsing the text.
+ * // If there was a parsing error, it would have been caught.
+ * }
+ * ], callback);
+ *
+ * // passing a function returning a promise
+ * async.waterfall([
+ * async.apply(fs.readFile, filename, "utf8"),
+ * async.asyncify(function (contents) {
+ * return db.model.create(contents);
+ * }),
+ * function (model, next) {
+ * // `model` is the instantiated model object.
+ * // If there was an error, this function would be skipped.
+ * }
+ * ], callback);
+ *
+ * // es2017 example, though `asyncify` is not needed if your JS environment
+ * // supports async functions out of the box
+ * var q = async.queue(async.asyncify(async function(file) {
+ * var intermediateStep = await processFile(file);
+ * return await somePromise(intermediateStep)
+ * }));
+ *
+ * q.push(files);
+ */
+function asyncify(func) {
+ return initialParams(function (args, callback) {
+ var result;
+ try {
+ result = func.apply(this, args);
+ } catch (e) {
+ return callback(e);
+ }
+ // if result is Promise object
+ if (isObject(result) && typeof result.then === 'function') {
+ result.then(function(value) {
+ invokeCallback(callback, null, value);
+ }, function(err) {
+ invokeCallback(callback, err.message ? err : new Error(err));
+ });
+ } else {
+ callback(null, result);
+ }
+ });
+}
+
+function invokeCallback(callback, error, value) {
+ try {
+ callback(error, value);
+ } catch (e) {
+ setImmediate$1(rethrow, e);
+ }
+}
+
+function rethrow(error) {
+ throw error;
+}
+
+var supportsSymbol = typeof Symbol === 'function';
+
+function isAsync(fn) {
+ return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';
+}
+
+function wrapAsync(asyncFn) {
+ return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn;
+}
+
+function applyEach$1(eachfn) {
+ return function(fns/*, ...args*/) {
+ var args = slice(arguments, 1);
+ var go = initialParams(function(args, callback) {
+ var that = this;
+ return eachfn(fns, function (fn, cb) {
+ wrapAsync(fn).apply(that, args.concat(cb));
+ }, callback);
+ });
+ if (args.length) {
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ };
+}
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
+
+/** Detect free variable `self`. */
+var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+
+/** Used as a reference to the global object. */
+var root = freeGlobal || freeSelf || Function('return this')();
+
+/** Built-in value references. */
+var Symbol$1 = root.Symbol;
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString = objectProto.toString;
+
+/** Built-in value references. */
+var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
+
+/**
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the raw `toStringTag`.
+ */
+function getRawTag(value) {
+ var isOwn = hasOwnProperty.call(value, symToStringTag$1),
+ tag = value[symToStringTag$1];
+
+ try {
+ value[symToStringTag$1] = undefined;
+ var unmasked = true;
+ } catch (e) {}
+
+ var result = nativeObjectToString.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag$1] = tag;
+ } else {
+ delete value[symToStringTag$1];
+ }
+ }
+ return result;
+}
+
+/** Used for built-in method references. */
+var objectProto$1 = Object.prototype;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString$1 = objectProto$1.toString;
+
+/**
+ * Converts `value` to a string using `Object.prototype.toString`.
+ *
+ * @private
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ */
+function objectToString(value) {
+ return nativeObjectToString$1.call(value);
+}
+
+/** `Object#toString` result references. */
+var nullTag = '[object Null]';
+var undefinedTag = '[object Undefined]';
+
+/** Built-in value references. */
+var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
+
+/**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return (symToStringTag && symToStringTag in Object(value))
+ ? getRawTag(value)
+ : objectToString(value);
+}
+
+/** `Object#toString` result references. */
+var asyncTag = '[object AsyncFunction]';
+var funcTag = '[object Function]';
+var genTag = '[object GeneratorFunction]';
+var proxyTag = '[object Proxy]';
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ if (!isObject(value)) {
+ return false;
+ }
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
+ var tag = baseGetTag(value);
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
+}
+
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @example
+ *
+ * _.isLength(3);
+ * // => true
+ *
+ * _.isLength(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isLength(Infinity);
+ * // => false
+ *
+ * _.isLength('3');
+ * // => false
+ */
+function isLength(value) {
+ return typeof value == 'number' &&
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+/**
+ * Checks if `value` is array-like. A value is considered array-like if it's
+ * not a function and has a `value.length` that's an integer greater than or
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ * @example
+ *
+ * _.isArrayLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLike(document.body.children);
+ * // => true
+ *
+ * _.isArrayLike('abc');
+ * // => true
+ *
+ * _.isArrayLike(_.noop);
+ * // => false
+ */
+function isArrayLike(value) {
+ return value != null && isLength(value.length) && !isFunction(value);
+}
+
+// A temporary value used to identify if the loop should be broken.
+// See #1064, #1293
+var breakLoop = {};
+
+/**
+ * This method returns `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.3.0
+ * @category Util
+ * @example
+ *
+ * _.times(2, _.noop);
+ * // => [undefined, undefined]
+ */
+function noop() {
+ // No operation performed.
+}
+
+function once(fn) {
+ return function () {
+ if (fn === null) return;
+ var callFn = fn;
+ fn = null;
+ callFn.apply(this, arguments);
+ };
+}
+
+var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;
+
+var getIterator = function (coll) {
+ return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();
+};
+
+/**
+ * The base implementation of `_.times` without support for iteratee shorthands
+ * or max array length checks.
+ *
+ * @private
+ * @param {number} n The number of times to invoke `iteratee`.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the array of results.
+ */
+function baseTimes(n, iteratee) {
+ var index = -1,
+ result = Array(n);
+
+ while (++index < n) {
+ result[index] = iteratee(index);
+ }
+ return result;
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return value != null && typeof value == 'object';
+}
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]';
+
+/**
+ * The base implementation of `_.isArguments`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ */
+function baseIsArguments(value) {
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
+}
+
+/** Used for built-in method references. */
+var objectProto$3 = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
+
+/** Built-in value references. */
+var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
+
+/**
+ * Checks if `value` is likely an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ * else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
+ return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&
+ !propertyIsEnumerable.call(value, 'callee');
+};
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(document.body.children);
+ * // => false
+ *
+ * _.isArray('abc');
+ * // => false
+ *
+ * _.isArray(_.noop);
+ * // => false
+ */
+var isArray = Array.isArray;
+
+/**
+ * This method returns `false`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.13.0
+ * @category Util
+ * @returns {boolean} Returns `false`.
+ * @example
+ *
+ * _.times(2, _.stubFalse);
+ * // => [false, false]
+ */
+function stubFalse() {
+ return false;
+}
+
+/** Detect free variable `exports`. */
+var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
+
+/** Detect free variable `module`. */
+var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
+
+/** Detect the popular CommonJS extension `module.exports`. */
+var moduleExports = freeModule && freeModule.exports === freeExports;
+
+/** Built-in value references. */
+var Buffer = moduleExports ? root.Buffer : undefined;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
+
+/**
+ * Checks if `value` is a buffer.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
+ * @example
+ *
+ * _.isBuffer(new Buffer(2));
+ * // => true
+ *
+ * _.isBuffer(new Uint8Array(2));
+ * // => false
+ */
+var isBuffer = nativeIsBuffer || stubFalse;
+
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER$1 = 9007199254740991;
+
+/** Used to detect unsigned integer values. */
+var reIsUint = /^(?:0|[1-9]\d*)$/;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ var type = typeof value;
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
+
+ return !!length &&
+ (type == 'number' ||
+ (type != 'symbol' && reIsUint.test(value))) &&
+ (value > -1 && value % 1 == 0 && value < length);
+}
+
+/** `Object#toString` result references. */
+var argsTag$1 = '[object Arguments]';
+var arrayTag = '[object Array]';
+var boolTag = '[object Boolean]';
+var dateTag = '[object Date]';
+var errorTag = '[object Error]';
+var funcTag$1 = '[object Function]';
+var mapTag = '[object Map]';
+var numberTag = '[object Number]';
+var objectTag = '[object Object]';
+var regexpTag = '[object RegExp]';
+var setTag = '[object Set]';
+var stringTag = '[object String]';
+var weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]';
+var dataViewTag = '[object DataView]';
+var float32Tag = '[object Float32Array]';
+var float64Tag = '[object Float64Array]';
+var int8Tag = '[object Int8Array]';
+var int16Tag = '[object Int16Array]';
+var int32Tag = '[object Int32Array]';
+var uint8Tag = '[object Uint8Array]';
+var uint8ClampedTag = '[object Uint8ClampedArray]';
+var uint16Tag = '[object Uint16Array]';
+var uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values of typed arrays. */
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =
+typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
+typedArrayTags[errorTag] = typedArrayTags[funcTag$1] =
+typedArrayTags[mapTag] = typedArrayTags[numberTag] =
+typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
+typedArrayTags[setTag] = typedArrayTags[stringTag] =
+typedArrayTags[weakMapTag] = false;
+
+/**
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ */
+function baseIsTypedArray(value) {
+ return isObjectLike(value) &&
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
+}
+
+/**
+ * The base implementation of `_.unary` without support for storing metadata.
+ *
+ * @private
+ * @param {Function} func The function to cap arguments for.
+ * @returns {Function} Returns the new capped function.
+ */
+function baseUnary(func) {
+ return function(value) {
+ return func(value);
+ };
+}
+
+/** Detect free variable `exports`. */
+var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
+
+/** Detect free variable `module`. */
+var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
+
+/** Detect the popular CommonJS extension `module.exports`. */
+var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
+
+/** Detect free variable `process` from Node.js. */
+var freeProcess = moduleExports$1 && freeGlobal.process;
+
+/** Used to access faster Node.js helpers. */
+var nodeUtil = (function() {
+ try {
+ // Use `util.types` for Node.js 10+.
+ var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;
+
+ if (types) {
+ return types;
+ }
+
+ // Legacy `process.binding('util')` for Node.js < 10.
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
+ } catch (e) {}
+}());
+
+/* Node.js helper references. */
+var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
+
+/** Used for built-in method references. */
+var objectProto$2 = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
+
+/**
+ * Creates an array of the enumerable property names of the array-like `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @param {boolean} inherited Specify returning inherited property names.
+ * @returns {Array} Returns the array of property names.
+ */
+function arrayLikeKeys(value, inherited) {
+ var isArr = isArray(value),
+ isArg = !isArr && isArguments(value),
+ isBuff = !isArr && !isArg && isBuffer(value),
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
+ skipIndexes = isArr || isArg || isBuff || isType,
+ result = skipIndexes ? baseTimes(value.length, String) : [],
+ length = result.length;
+
+ for (var key in value) {
+ if ((inherited || hasOwnProperty$1.call(value, key)) &&
+ !(skipIndexes && (
+ // Safari 9 has enumerable `arguments.length` in strict mode.
+ key == 'length' ||
+ // Node.js 0.10 has enumerable non-index properties on buffers.
+ (isBuff && (key == 'offset' || key == 'parent')) ||
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
+ // Skip index properties.
+ isIndex(key, length)
+ ))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+/** Used for built-in method references. */
+var objectProto$5 = Object.prototype;
+
+/**
+ * Checks if `value` is likely a prototype object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
+ */
+function isPrototype(value) {
+ var Ctor = value && value.constructor,
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;
+
+ return value === proto;
+}
+
+/**
+ * Creates a unary function that invokes `func` with its argument transformed.
+ *
+ * @private
+ * @param {Function} func The function to wrap.
+ * @param {Function} transform The argument transform.
+ * @returns {Function} Returns the new function.
+ */
+function overArg(func, transform) {
+ return function(arg) {
+ return func(transform(arg));
+ };
+}
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeKeys = overArg(Object.keys, Object);
+
+/** Used for built-in method references. */
+var objectProto$4 = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
+
+/**
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function baseKeys(object) {
+ if (!isPrototype(object)) {
+ return nativeKeys(object);
+ }
+ var result = [];
+ for (var key in Object(object)) {
+ if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+function keys(object) {
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
+}
+
+function createArrayIterator(coll) {
+ var i = -1;
+ var len = coll.length;
+ return function next() {
+ return ++i < len ? {value: coll[i], key: i} : null;
+ }
+}
+
+function createES2015Iterator(iterator) {
+ var i = -1;
+ return function next() {
+ var item = iterator.next();
+ if (item.done)
+ return null;
+ i++;
+ return {value: item.value, key: i};
+ }
+}
+
+function createObjectIterator(obj) {
+ var okeys = keys(obj);
+ var i = -1;
+ var len = okeys.length;
+ return function next() {
+ var key = okeys[++i];
+ if (key === '__proto__') {
+ return next();
+ }
+ return i < len ? {value: obj[key], key: key} : null;
+ };
+}
+
+function iterator(coll) {
+ if (isArrayLike(coll)) {
+ return createArrayIterator(coll);
+ }
+
+ var iterator = getIterator(coll);
+ return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);
+}
+
+function onlyOnce(fn) {
+ return function() {
+ if (fn === null) throw new Error("Callback was already called.");
+ var callFn = fn;
+ fn = null;
+ callFn.apply(this, arguments);
+ };
+}
+
+function _eachOfLimit(limit) {
+ return function (obj, iteratee, callback) {
+ callback = once(callback || noop);
+ if (limit <= 0 || !obj) {
+ return callback(null);
+ }
+ var nextElem = iterator(obj);
+ var done = false;
+ var running = 0;
+ var looping = false;
+
+ function iterateeCallback(err, value) {
+ running -= 1;
+ if (err) {
+ done = true;
+ callback(err);
+ }
+ else if (value === breakLoop || (done && running <= 0)) {
+ done = true;
+ return callback(null);
+ }
+ else if (!looping) {
+ replenish();
+ }
+ }
+
+ function replenish () {
+ looping = true;
+ while (running < limit && !done) {
+ var elem = nextElem();
+ if (elem === null) {
+ done = true;
+ if (running <= 0) {
+ callback(null);
+ }
+ return;
+ }
+ running += 1;
+ iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));
+ }
+ looping = false;
+ }
+
+ replenish();
+ };
+}
+
+/**
+ * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name eachOfLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.eachOf]{@link module:Collections.eachOf}
+ * @alias forEachOfLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`. The `key` is the item's key, or index in the case of an
+ * array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachOfLimit(coll, limit, iteratee, callback) {
+ _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback);
+}
+
+function doLimit(fn, limit) {
+ return function (iterable, iteratee, callback) {
+ return fn(iterable, limit, iteratee, callback);
+ };
+}
+
+// eachOf implementation optimized for array-likes
+function eachOfArrayLike(coll, iteratee, callback) {
+ callback = once(callback || noop);
+ var index = 0,
+ completed = 0,
+ length = coll.length;
+ if (length === 0) {
+ callback(null);
+ }
+
+ function iteratorCallback(err, value) {
+ if (err) {
+ callback(err);
+ } else if ((++completed === length) || value === breakLoop) {
+ callback(null);
+ }
+ }
+
+ for (; index < length; index++) {
+ iteratee(coll[index], index, onlyOnce(iteratorCallback));
+ }
+}
+
+// a generic version of eachOf which can handle array, object, and iterator cases.
+var eachOfGeneric = doLimit(eachOfLimit, Infinity);
+
+/**
+ * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument
+ * to the iteratee.
+ *
+ * @name eachOf
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEachOf
+ * @category Collection
+ * @see [async.each]{@link module:Collections.each}
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each
+ * item in `coll`.
+ * The `key` is the item's key, or index in the case of an array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+ * var configs = {};
+ *
+ * async.forEachOf(obj, function (value, key, callback) {
+ * fs.readFile(__dirname + value, "utf8", function (err, data) {
+ * if (err) return callback(err);
+ * try {
+ * configs[key] = JSON.parse(data);
+ * } catch (e) {
+ * return callback(e);
+ * }
+ * callback();
+ * });
+ * }, function (err) {
+ * if (err) console.error(err.message);
+ * // configs is now a map of JSON data
+ * doSomethingWith(configs);
+ * });
+ */
+var eachOf = function(coll, iteratee, callback) {
+ var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;
+ eachOfImplementation(coll, wrapAsync(iteratee), callback);
+};
+
+function doParallel(fn) {
+ return function (obj, iteratee, callback) {
+ return fn(eachOf, obj, wrapAsync(iteratee), callback);
+ };
+}
+
+function _asyncMap(eachfn, arr, iteratee, callback) {
+ callback = callback || noop;
+ arr = arr || [];
+ var results = [];
+ var counter = 0;
+ var _iteratee = wrapAsync(iteratee);
+
+ eachfn(arr, function (value, _, callback) {
+ var index = counter++;
+ _iteratee(value, function (err, v) {
+ results[index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+}
+
+/**
+ * Produces a new collection of values by mapping each value in `coll` through
+ * the `iteratee` function. The `iteratee` is called with an item from `coll`
+ * and a callback for when it has finished processing. Each of these callback
+ * takes 2 arguments: an `error`, and the transformed item from `coll`. If
+ * `iteratee` passes an error to its callback, the main `callback` (for the
+ * `map` function) is immediately called with the error.
+ *
+ * Note, that since this function applies the `iteratee` to each item in
+ * parallel, there is no guarantee that the `iteratee` functions will complete
+ * in order. However, the results array will be in the same order as the
+ * original `coll`.
+ *
+ * If `map` is passed an Object, the results will be an Array. The results
+ * will roughly be in the order of the original Objects' keys (but this can
+ * vary across JavaScript engines).
+ *
+ * @name map
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with the transformed item.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Results is an Array of the
+ * transformed items from the `coll`. Invoked with (err, results).
+ * @example
+ *
+ * async.map(['file1','file2','file3'], fs.stat, function(err, results) {
+ * // results is now an array of stats for each file
+ * });
+ */
+var map = doParallel(_asyncMap);
+
+/**
+ * Applies the provided arguments to each function in the array, calling
+ * `callback` after all functions have completed. If you only provide the first
+ * argument, `fns`, then it will return a function which lets you pass in the
+ * arguments as if it were a single function call. If more arguments are
+ * provided, `callback` is required while `args` is still optional.
+ *
+ * @name applyEach
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s
+ * to all call with the same arguments
+ * @param {...*} [args] - any number of separate arguments to pass to the
+ * function.
+ * @param {Function} [callback] - the final argument should be the callback,
+ * called when all functions have completed processing.
+ * @returns {Function} - If only the first argument, `fns`, is provided, it will
+ * return a function which lets you pass in the arguments as if it were a single
+ * function call. The signature is `(..args, callback)`. If invoked with any
+ * arguments, `callback` is required.
+ * @example
+ *
+ * async.applyEach([enableSearch, updateSchema], 'bucket', callback);
+ *
+ * // partial application example:
+ * async.each(
+ * buckets,
+ * async.applyEach([enableSearch, updateSchema]),
+ * callback
+ * );
+ */
+var applyEach = applyEach$1(map);
+
+function doParallelLimit(fn) {
+ return function (obj, limit, iteratee, callback) {
+ return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback);
+ };
+}
+
+/**
+ * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name mapLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.map]{@link module:Collections.map}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with the transformed item.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Results is an array of the
+ * transformed items from the `coll`. Invoked with (err, results).
+ */
+var mapLimit = doParallelLimit(_asyncMap);
+
+/**
+ * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.
+ *
+ * @name mapSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.map]{@link module:Collections.map}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with the transformed item.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Results is an array of the
+ * transformed items from the `coll`. Invoked with (err, results).
+ */
+var mapSeries = doLimit(mapLimit, 1);
+
+/**
+ * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.
+ *
+ * @name applyEachSeries
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.applyEach]{@link module:ControlFlow.applyEach}
+ * @category Control Flow
+ * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all
+ * call with the same arguments
+ * @param {...*} [args] - any number of separate arguments to pass to the
+ * function.
+ * @param {Function} [callback] - the final argument should be the callback,
+ * called when all functions have completed processing.
+ * @returns {Function} - If only the first argument is provided, it will return
+ * a function which lets you pass in the arguments as if it were a single
+ * function call.
+ */
+var applyEachSeries = applyEach$1(mapSeries);
+
+/**
+ * A specialized version of `_.forEach` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+}
+
+/**
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var index = -1,
+ iterable = Object(object),
+ props = keysFunc(object),
+ length = props.length;
+
+ while (length--) {
+ var key = props[fromRight ? length : ++index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+
+/**
+ * The base implementation of `baseForOwn` which iterates over `object`
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseFor = createBaseFor();
+
+/**
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwn(object, iteratee) {
+ return object && baseFor(object, iteratee, keys);
+}
+
+/**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseFindIndex(array, predicate, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 1 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+/**
+ * The base implementation of `_.isNaN` without support for number objects.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
+ */
+function baseIsNaN(value) {
+ return value !== value;
+}
+
+/**
+ * A specialized version of `_.indexOf` which performs strict equality
+ * comparisons of values, i.e. `===`.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function strictIndexOf(array, value, fromIndex) {
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+/**
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOf(array, value, fromIndex) {
+ return value === value
+ ? strictIndexOf(array, value, fromIndex)
+ : baseFindIndex(array, baseIsNaN, fromIndex);
+}
+
+/**
+ * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on
+ * their requirements. Each function can optionally depend on other functions
+ * being completed first, and each function is run as soon as its requirements
+ * are satisfied.
+ *
+ * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence
+ * will stop. Further tasks will not execute (so any other functions depending
+ * on it will not run), and the main `callback` is immediately called with the
+ * error.
+ *
+ * {@link AsyncFunction}s also receive an object containing the results of functions which
+ * have completed so far as the first argument, if they have dependencies. If a
+ * task function has no dependencies, it will only be passed a callback.
+ *
+ * @name auto
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Object} tasks - An object. Each of its properties is either a
+ * function or an array of requirements, with the {@link AsyncFunction} itself the last item
+ * in the array. The object's key of a property serves as the name of the task
+ * defined by that property, i.e. can be used when specifying requirements for
+ * other tasks. The function receives one or two arguments:
+ * * a `results` object, containing the results of the previously executed
+ * functions, only passed if the task has any dependencies,
+ * * a `callback(err, result)` function, which must be called when finished,
+ * passing an `error` (which can be `null`) and the result of the function's
+ * execution.
+ * @param {number} [concurrency=Infinity] - An optional `integer` for
+ * determining the maximum number of tasks that can be run in parallel. By
+ * default, as many as possible.
+ * @param {Function} [callback] - An optional callback which is called when all
+ * the tasks have been completed. It receives the `err` argument if any `tasks`
+ * pass an error to their callback. Results are always returned; however, if an
+ * error occurs, no further `tasks` will be performed, and the results object
+ * will only contain partial results. Invoked with (err, results).
+ * @returns undefined
+ * @example
+ *
+ * async.auto({
+ * // this function will just be passed a callback
+ * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),
+ * showData: ['readData', function(results, cb) {
+ * // results.readData is the file's contents
+ * // ...
+ * }]
+ * }, callback);
+ *
+ * async.auto({
+ * get_data: function(callback) {
+ * console.log('in get_data');
+ * // async code to get some data
+ * callback(null, 'data', 'converted to array');
+ * },
+ * make_folder: function(callback) {
+ * console.log('in make_folder');
+ * // async code to create a directory to store a file in
+ * // this is run at the same time as getting the data
+ * callback(null, 'folder');
+ * },
+ * write_file: ['get_data', 'make_folder', function(results, callback) {
+ * console.log('in write_file', JSON.stringify(results));
+ * // once there is some data and the directory exists,
+ * // write the data to a file in the directory
+ * callback(null, 'filename');
+ * }],
+ * email_link: ['write_file', function(results, callback) {
+ * console.log('in email_link', JSON.stringify(results));
+ * // once the file is written let's email a link to it...
+ * // results.write_file contains the filename returned by write_file.
+ * callback(null, {'file':results.write_file, 'email':'user@example.com'});
+ * }]
+ * }, function(err, results) {
+ * console.log('err = ', err);
+ * console.log('results = ', results);
+ * });
+ */
+var auto = function (tasks, concurrency, callback) {
+ if (typeof concurrency === 'function') {
+ // concurrency is optional, shift the args.
+ callback = concurrency;
+ concurrency = null;
+ }
+ callback = once(callback || noop);
+ var keys$$1 = keys(tasks);
+ var numTasks = keys$$1.length;
+ if (!numTasks) {
+ return callback(null);
+ }
+ if (!concurrency) {
+ concurrency = numTasks;
+ }
+
+ var results = {};
+ var runningTasks = 0;
+ var hasError = false;
+
+ var listeners = Object.create(null);
+
+ var readyTasks = [];
+
+ // for cycle detection:
+ var readyToCheck = []; // tasks that have been identified as reachable
+ // without the possibility of returning to an ancestor task
+ var uncheckedDependencies = {};
+
+ baseForOwn(tasks, function (task, key) {
+ if (!isArray(task)) {
+ // no dependencies
+ enqueueTask(key, [task]);
+ readyToCheck.push(key);
+ return;
+ }
+
+ var dependencies = task.slice(0, task.length - 1);
+ var remainingDependencies = dependencies.length;
+ if (remainingDependencies === 0) {
+ enqueueTask(key, task);
+ readyToCheck.push(key);
+ return;
+ }
+ uncheckedDependencies[key] = remainingDependencies;
+
+ arrayEach(dependencies, function (dependencyName) {
+ if (!tasks[dependencyName]) {
+ throw new Error('async.auto task `' + key +
+ '` has a non-existent dependency `' +
+ dependencyName + '` in ' +
+ dependencies.join(', '));
+ }
+ addListener(dependencyName, function () {
+ remainingDependencies--;
+ if (remainingDependencies === 0) {
+ enqueueTask(key, task);
+ }
+ });
+ });
+ });
+
+ checkForDeadlocks();
+ processQueue();
+
+ function enqueueTask(key, task) {
+ readyTasks.push(function () {
+ runTask(key, task);
+ });
+ }
+
+ function processQueue() {
+ if (readyTasks.length === 0 && runningTasks === 0) {
+ return callback(null, results);
+ }
+ while(readyTasks.length && runningTasks < concurrency) {
+ var run = readyTasks.shift();
+ run();
+ }
+
+ }
+
+ function addListener(taskName, fn) {
+ var taskListeners = listeners[taskName];
+ if (!taskListeners) {
+ taskListeners = listeners[taskName] = [];
+ }
+
+ taskListeners.push(fn);
+ }
+
+ function taskComplete(taskName) {
+ var taskListeners = listeners[taskName] || [];
+ arrayEach(taskListeners, function (fn) {
+ fn();
+ });
+ processQueue();
+ }
+
+
+ function runTask(key, task) {
+ if (hasError) return;
+
+ var taskCallback = onlyOnce(function(err, result) {
+ runningTasks--;
+ if (arguments.length > 2) {
+ result = slice(arguments, 1);
+ }
+ if (err) {
+ var safeResults = {};
+ baseForOwn(results, function(val, rkey) {
+ safeResults[rkey] = val;
+ });
+ safeResults[key] = result;
+ hasError = true;
+ listeners = Object.create(null);
+
+ callback(err, safeResults);
+ } else {
+ results[key] = result;
+ taskComplete(key);
+ }
+ });
+
+ runningTasks++;
+ var taskFn = wrapAsync(task[task.length - 1]);
+ if (task.length > 1) {
+ taskFn(results, taskCallback);
+ } else {
+ taskFn(taskCallback);
+ }
+ }
+
+ function checkForDeadlocks() {
+ // Kahn's algorithm
+ // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm
+ // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html
+ var currentTask;
+ var counter = 0;
+ while (readyToCheck.length) {
+ currentTask = readyToCheck.pop();
+ counter++;
+ arrayEach(getDependents(currentTask), function (dependent) {
+ if (--uncheckedDependencies[dependent] === 0) {
+ readyToCheck.push(dependent);
+ }
+ });
+ }
+
+ if (counter !== numTasks) {
+ throw new Error(
+ 'async.auto cannot execute tasks due to a recursive dependency'
+ );
+ }
+ }
+
+ function getDependents(taskName) {
+ var result = [];
+ baseForOwn(tasks, function (task, key) {
+ if (isArray(task) && baseIndexOf(task, taskName, 0) >= 0) {
+ result.push(key);
+ }
+ });
+ return result;
+ }
+};
+
+/**
+ * A specialized version of `_.map` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+/** `Object#toString` result references. */
+var symbolTag = '[object Symbol]';
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
+}
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined;
+var symbolToString = symbolProto ? symbolProto.toString : undefined;
+
+/**
+ * The base implementation of `_.toString` which doesn't convert nullish
+ * values to empty strings.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+ if (isArray(value)) {
+ // Recursively convert values (susceptible to call stack limits).
+ return arrayMap(value, baseToString) + '';
+ }
+ if (isSymbol(value)) {
+ return symbolToString ? symbolToString.call(value) : '';
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
+
+/**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = end > length ? length : end;
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : ((end - start) >>> 0);
+ start >>>= 0;
+
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+}
+
+/**
+ * Casts `array` to a slice if it's needed.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {number} start The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the cast slice.
+ */
+function castSlice(array, start, end) {
+ var length = array.length;
+ end = end === undefined ? length : end;
+ return (!start && end >= length) ? array : baseSlice(array, start, end);
+}
+
+/**
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
+ * that is not found in the character symbols.
+ *
+ * @private
+ * @param {Array} strSymbols The string symbols to inspect.
+ * @param {Array} chrSymbols The character symbols to find.
+ * @returns {number} Returns the index of the last unmatched string symbol.
+ */
+function charsEndIndex(strSymbols, chrSymbols) {
+ var index = strSymbols.length;
+
+ while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
+ return index;
+}
+
+/**
+ * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
+ * that is not found in the character symbols.
+ *
+ * @private
+ * @param {Array} strSymbols The string symbols to inspect.
+ * @param {Array} chrSymbols The character symbols to find.
+ * @returns {number} Returns the index of the first unmatched string symbol.
+ */
+function charsStartIndex(strSymbols, chrSymbols) {
+ var index = -1,
+ length = strSymbols.length;
+
+ while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
+ return index;
+}
+
+/**
+ * Converts an ASCII `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */
+function asciiToArray(string) {
+ return string.split('');
+}
+
+/** Used to compose unicode character classes. */
+var rsAstralRange = '\\ud800-\\udfff';
+var rsComboMarksRange = '\\u0300-\\u036f';
+var reComboHalfMarksRange = '\\ufe20-\\ufe2f';
+var rsComboSymbolsRange = '\\u20d0-\\u20ff';
+var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
+var rsVarRange = '\\ufe0e\\ufe0f';
+
+/** Used to compose unicode capture groups. */
+var rsZWJ = '\\u200d';
+
+/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
+var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
+
+/**
+ * Checks if `string` contains Unicode symbols.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {boolean} Returns `true` if a symbol is found, else `false`.
+ */
+function hasUnicode(string) {
+ return reHasUnicode.test(string);
+}
+
+/** Used to compose unicode character classes. */
+var rsAstralRange$1 = '\\ud800-\\udfff';
+var rsComboMarksRange$1 = '\\u0300-\\u036f';
+var reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f';
+var rsComboSymbolsRange$1 = '\\u20d0-\\u20ff';
+var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
+var rsVarRange$1 = '\\ufe0e\\ufe0f';
+
+/** Used to compose unicode capture groups. */
+var rsAstral = '[' + rsAstralRange$1 + ']';
+var rsCombo = '[' + rsComboRange$1 + ']';
+var rsFitz = '\\ud83c[\\udffb-\\udfff]';
+var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')';
+var rsNonAstral = '[^' + rsAstralRange$1 + ']';
+var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}';
+var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]';
+var rsZWJ$1 = '\\u200d';
+
+/** Used to compose unicode regexes. */
+var reOptMod = rsModifier + '?';
+var rsOptVar = '[' + rsVarRange$1 + ']?';
+var rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*';
+var rsSeq = rsOptVar + reOptMod + rsOptJoin;
+var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
+
+/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
+var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
+
+/**
+ * Converts a Unicode `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */
+function unicodeToArray(string) {
+ return string.match(reUnicode) || [];
+}
+
+/**
+ * Converts `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */
+function stringToArray(string) {
+ return hasUnicode(string)
+ ? unicodeToArray(string)
+ : asciiToArray(string);
+}
+
+/**
+ * Converts `value` to a string. An empty string is returned for `null`
+ * and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+ return value == null ? '' : baseToString(value);
+}
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/**
+ * Removes leading and trailing whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trim(' abc ');
+ * // => 'abc'
+ *
+ * _.trim('-_-abc-_-', '_-');
+ * // => 'abc'
+ *
+ * _.map([' foo ', ' bar '], _.trim);
+ * // => ['foo', 'bar']
+ */
+function trim(string, chars, guard) {
+ string = toString(string);
+ if (string && (guard || chars === undefined)) {
+ return string.replace(reTrim, '');
+ }
+ if (!string || !(chars = baseToString(chars))) {
+ return string;
+ }
+ var strSymbols = stringToArray(string),
+ chrSymbols = stringToArray(chars),
+ start = charsStartIndex(strSymbols, chrSymbols),
+ end = charsEndIndex(strSymbols, chrSymbols) + 1;
+
+ return castSlice(strSymbols, start, end).join('');
+}
+
+var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m;
+var FN_ARG_SPLIT = /,/;
+var FN_ARG = /(=.+)?(\s*)$/;
+var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
+
+function parseParams(func) {
+ func = func.toString().replace(STRIP_COMMENTS, '');
+ func = func.match(FN_ARGS)[2].replace(' ', '');
+ func = func ? func.split(FN_ARG_SPLIT) : [];
+ func = func.map(function (arg){
+ return trim(arg.replace(FN_ARG, ''));
+ });
+ return func;
+}
+
+/**
+ * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent
+ * tasks are specified as parameters to the function, after the usual callback
+ * parameter, with the parameter names matching the names of the tasks it
+ * depends on. This can provide even more readable task graphs which can be
+ * easier to maintain.
+ *
+ * If a final callback is specified, the task results are similarly injected,
+ * specified as named parameters after the initial error parameter.
+ *
+ * The autoInject function is purely syntactic sugar and its semantics are
+ * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.
+ *
+ * @name autoInject
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.auto]{@link module:ControlFlow.auto}
+ * @category Control Flow
+ * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of
+ * the form 'func([dependencies...], callback). The object's key of a property
+ * serves as the name of the task defined by that property, i.e. can be used
+ * when specifying requirements for other tasks.
+ * * The `callback` parameter is a `callback(err, result)` which must be called
+ * when finished, passing an `error` (which can be `null`) and the result of
+ * the function's execution. The remaining parameters name other tasks on
+ * which the task is dependent, and the results from those tasks are the
+ * arguments of those parameters.
+ * @param {Function} [callback] - An optional callback which is called when all
+ * the tasks have been completed. It receives the `err` argument if any `tasks`
+ * pass an error to their callback, and a `results` object with any completed
+ * task results, similar to `auto`.
+ * @example
+ *
+ * // The example from `auto` can be rewritten as follows:
+ * async.autoInject({
+ * get_data: function(callback) {
+ * // async code to get some data
+ * callback(null, 'data', 'converted to array');
+ * },
+ * make_folder: function(callback) {
+ * // async code to create a directory to store a file in
+ * // this is run at the same time as getting the data
+ * callback(null, 'folder');
+ * },
+ * write_file: function(get_data, make_folder, callback) {
+ * // once there is some data and the directory exists,
+ * // write the data to a file in the directory
+ * callback(null, 'filename');
+ * },
+ * email_link: function(write_file, callback) {
+ * // once the file is written let's email a link to it...
+ * // write_file contains the filename returned by write_file.
+ * callback(null, {'file':write_file, 'email':'user@example.com'});
+ * }
+ * }, function(err, results) {
+ * console.log('err = ', err);
+ * console.log('email_link = ', results.email_link);
+ * });
+ *
+ * // If you are using a JS minifier that mangles parameter names, `autoInject`
+ * // will not work with plain functions, since the parameter names will be
+ * // collapsed to a single letter identifier. To work around this, you can
+ * // explicitly specify the names of the parameters your task function needs
+ * // in an array, similar to Angular.js dependency injection.
+ *
+ * // This still has an advantage over plain `auto`, since the results a task
+ * // depends on are still spread into arguments.
+ * async.autoInject({
+ * //...
+ * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {
+ * callback(null, 'filename');
+ * }],
+ * email_link: ['write_file', function(write_file, callback) {
+ * callback(null, {'file':write_file, 'email':'user@example.com'});
+ * }]
+ * //...
+ * }, function(err, results) {
+ * console.log('err = ', err);
+ * console.log('email_link = ', results.email_link);
+ * });
+ */
+function autoInject(tasks, callback) {
+ var newTasks = {};
+
+ baseForOwn(tasks, function (taskFn, key) {
+ var params;
+ var fnIsAsync = isAsync(taskFn);
+ var hasNoDeps =
+ (!fnIsAsync && taskFn.length === 1) ||
+ (fnIsAsync && taskFn.length === 0);
+
+ if (isArray(taskFn)) {
+ params = taskFn.slice(0, -1);
+ taskFn = taskFn[taskFn.length - 1];
+
+ newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);
+ } else if (hasNoDeps) {
+ // no dependencies, use the function as-is
+ newTasks[key] = taskFn;
+ } else {
+ params = parseParams(taskFn);
+ if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {
+ throw new Error("autoInject task functions require explicit parameters.");
+ }
+
+ // remove callback param
+ if (!fnIsAsync) params.pop();
+
+ newTasks[key] = params.concat(newTask);
+ }
+
+ function newTask(results, taskCb) {
+ var newArgs = arrayMap(params, function (name) {
+ return results[name];
+ });
+ newArgs.push(taskCb);
+ wrapAsync(taskFn).apply(null, newArgs);
+ }
+ });
+
+ auto(newTasks, callback);
+}
+
+// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation
+// used for queues. This implementation assumes that the node provided by the user can be modified
+// to adjust the next and last properties. We implement only the minimal functionality
+// for queue support.
+function DLL() {
+ this.head = this.tail = null;
+ this.length = 0;
+}
+
+function setInitial(dll, node) {
+ dll.length = 1;
+ dll.head = dll.tail = node;
+}
+
+DLL.prototype.removeLink = function(node) {
+ if (node.prev) node.prev.next = node.next;
+ else this.head = node.next;
+ if (node.next) node.next.prev = node.prev;
+ else this.tail = node.prev;
+
+ node.prev = node.next = null;
+ this.length -= 1;
+ return node;
+};
+
+DLL.prototype.empty = function () {
+ while(this.head) this.shift();
+ return this;
+};
+
+DLL.prototype.insertAfter = function(node, newNode) {
+ newNode.prev = node;
+ newNode.next = node.next;
+ if (node.next) node.next.prev = newNode;
+ else this.tail = newNode;
+ node.next = newNode;
+ this.length += 1;
+};
+
+DLL.prototype.insertBefore = function(node, newNode) {
+ newNode.prev = node.prev;
+ newNode.next = node;
+ if (node.prev) node.prev.next = newNode;
+ else this.head = newNode;
+ node.prev = newNode;
+ this.length += 1;
+};
+
+DLL.prototype.unshift = function(node) {
+ if (this.head) this.insertBefore(this.head, node);
+ else setInitial(this, node);
+};
+
+DLL.prototype.push = function(node) {
+ if (this.tail) this.insertAfter(this.tail, node);
+ else setInitial(this, node);
+};
+
+DLL.prototype.shift = function() {
+ return this.head && this.removeLink(this.head);
+};
+
+DLL.prototype.pop = function() {
+ return this.tail && this.removeLink(this.tail);
+};
+
+DLL.prototype.toArray = function () {
+ var arr = Array(this.length);
+ var curr = this.head;
+ for(var idx = 0; idx < this.length; idx++) {
+ arr[idx] = curr.data;
+ curr = curr.next;
+ }
+ return arr;
+};
+
+DLL.prototype.remove = function (testFn) {
+ var curr = this.head;
+ while(!!curr) {
+ var next = curr.next;
+ if (testFn(curr)) {
+ this.removeLink(curr);
+ }
+ curr = next;
+ }
+ return this;
+};
+
+function queue(worker, concurrency, payload) {
+ if (concurrency == null) {
+ concurrency = 1;
+ }
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+
+ var _worker = wrapAsync(worker);
+ var numRunning = 0;
+ var workersList = [];
+
+ var processingScheduled = false;
+ function _insert(data, insertAtFront, callback) {
+ if (callback != null && typeof callback !== 'function') {
+ throw new Error('task callback must be a function');
+ }
+ q.started = true;
+ if (!isArray(data)) {
+ data = [data];
+ }
+ if (data.length === 0 && q.idle()) {
+ // call drain immediately if there are no tasks
+ return setImmediate$1(function() {
+ q.drain();
+ });
+ }
+
+ for (var i = 0, l = data.length; i < l; i++) {
+ var item = {
+ data: data[i],
+ callback: callback || noop
+ };
+
+ if (insertAtFront) {
+ q._tasks.unshift(item);
+ } else {
+ q._tasks.push(item);
+ }
+ }
+
+ if (!processingScheduled) {
+ processingScheduled = true;
+ setImmediate$1(function() {
+ processingScheduled = false;
+ q.process();
+ });
+ }
+ }
+
+ function _next(tasks) {
+ return function(err){
+ numRunning -= 1;
+
+ for (var i = 0, l = tasks.length; i < l; i++) {
+ var task = tasks[i];
+
+ var index = baseIndexOf(workersList, task, 0);
+ if (index === 0) {
+ workersList.shift();
+ } else if (index > 0) {
+ workersList.splice(index, 1);
+ }
+
+ task.callback.apply(task, arguments);
+
+ if (err != null) {
+ q.error(err, task.data);
+ }
+ }
+
+ if (numRunning <= (q.concurrency - q.buffer) ) {
+ q.unsaturated();
+ }
+
+ if (q.idle()) {
+ q.drain();
+ }
+ q.process();
+ };
+ }
+
+ var isProcessing = false;
+ var q = {
+ _tasks: new DLL(),
+ concurrency: concurrency,
+ payload: payload,
+ saturated: noop,
+ unsaturated:noop,
+ buffer: concurrency / 4,
+ empty: noop,
+ drain: noop,
+ error: noop,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(data, false, callback);
+ },
+ kill: function () {
+ q.drain = noop;
+ q._tasks.empty();
+ },
+ unshift: function (data, callback) {
+ _insert(data, true, callback);
+ },
+ remove: function (testFn) {
+ q._tasks.remove(testFn);
+ },
+ process: function () {
+ // Avoid trying to start too many processing operations. This can occur
+ // when callbacks resolve synchronously (#1267).
+ if (isProcessing) {
+ return;
+ }
+ isProcessing = true;
+ while(!q.paused && numRunning < q.concurrency && q._tasks.length){
+ var tasks = [], data = [];
+ var l = q._tasks.length;
+ if (q.payload) l = Math.min(l, q.payload);
+ for (var i = 0; i < l; i++) {
+ var node = q._tasks.shift();
+ tasks.push(node);
+ workersList.push(node);
+ data.push(node.data);
+ }
+
+ numRunning += 1;
+
+ if (q._tasks.length === 0) {
+ q.empty();
+ }
+
+ if (numRunning === q.concurrency) {
+ q.saturated();
+ }
+
+ var cb = onlyOnce(_next(tasks));
+ _worker(data, cb);
+ }
+ isProcessing = false;
+ },
+ length: function () {
+ return q._tasks.length;
+ },
+ running: function () {
+ return numRunning;
+ },
+ workersList: function () {
+ return workersList;
+ },
+ idle: function() {
+ return q._tasks.length + numRunning === 0;
+ },
+ pause: function () {
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ setImmediate$1(q.process);
+ }
+ };
+ return q;
+}
+
+/**
+ * A cargo of tasks for the worker function to complete. Cargo inherits all of
+ * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}.
+ * @typedef {Object} CargoObject
+ * @memberOf module:ControlFlow
+ * @property {Function} length - A function returning the number of items
+ * waiting to be processed. Invoke like `cargo.length()`.
+ * @property {number} payload - An `integer` for determining how many tasks
+ * should be process per round. This property can be changed after a `cargo` is
+ * created to alter the payload on-the-fly.
+ * @property {Function} push - Adds `task` to the `queue`. The callback is
+ * called once the `worker` has finished processing the task. Instead of a
+ * single task, an array of `tasks` can be submitted. The respective callback is
+ * used for every task in the list. Invoke like `cargo.push(task, [callback])`.
+ * @property {Function} saturated - A callback that is called when the
+ * `queue.length()` hits the concurrency and further tasks will be queued.
+ * @property {Function} empty - A callback that is called when the last item
+ * from the `queue` is given to a `worker`.
+ * @property {Function} drain - A callback that is called when the last item
+ * from the `queue` has returned from the `worker`.
+ * @property {Function} idle - a function returning false if there are items
+ * waiting or being processed, or true if not. Invoke like `cargo.idle()`.
+ * @property {Function} pause - a function that pauses the processing of tasks
+ * until `resume()` is called. Invoke like `cargo.pause()`.
+ * @property {Function} resume - a function that resumes the processing of
+ * queued tasks when the queue is paused. Invoke like `cargo.resume()`.
+ * @property {Function} kill - a function that removes the `drain` callback and
+ * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`.
+ */
+
+/**
+ * Creates a `cargo` object with the specified payload. Tasks added to the
+ * cargo will be processed altogether (up to the `payload` limit). If the
+ * `worker` is in progress, the task is queued until it becomes available. Once
+ * the `worker` has completed some tasks, each callback of those tasks is
+ * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)
+ * for how `cargo` and `queue` work.
+ *
+ * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers
+ * at a time, cargo passes an array of tasks to a single worker, repeating
+ * when the worker is finished.
+ *
+ * @name cargo
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.queue]{@link module:ControlFlow.queue}
+ * @category Control Flow
+ * @param {AsyncFunction} worker - An asynchronous function for processing an array
+ * of queued tasks. Invoked with `(tasks, callback)`.
+ * @param {number} [payload=Infinity] - An optional `integer` for determining
+ * how many tasks should be processed per round; if omitted, the default is
+ * unlimited.
+ * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can
+ * attached as certain properties to listen for specific events during the
+ * lifecycle of the cargo and inner queue.
+ * @example
+ *
+ * // create a cargo object with payload 2
+ * var cargo = async.cargo(function(tasks, callback) {
+ * for (var i=0; i true
+ */
+function identity(value) {
+ return value;
+}
+
+function _createTester(check, getResult) {
+ return function(eachfn, arr, iteratee, cb) {
+ cb = cb || noop;
+ var testPassed = false;
+ var testResult;
+ eachfn(arr, function(value, _, callback) {
+ iteratee(value, function(err, result) {
+ if (err) {
+ callback(err);
+ } else if (check(result) && !testResult) {
+ testPassed = true;
+ testResult = getResult(true, value);
+ callback(null, breakLoop);
+ } else {
+ callback();
+ }
+ });
+ }, function(err) {
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, testPassed ? testResult : getResult(false));
+ }
+ });
+ };
+}
+
+function _findGetResult(v, x) {
+ return x;
+}
+
+/**
+ * Returns the first value in `coll` that passes an async truth test. The
+ * `iteratee` is applied in parallel, meaning the first iteratee to return
+ * `true` will fire the detect `callback` with that result. That means the
+ * result might not be the first item in the original `coll` (in terms of order)
+ * that passes the test.
+
+ * If order within the original `coll` is important, then look at
+ * [`detectSeries`]{@link module:Collections.detectSeries}.
+ *
+ * @name detect
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias find
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ * @example
+ *
+ * async.detect(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // result now equals the first file in the list that exists
+ * });
+ */
+var detect = doParallel(_createTester(identity, _findGetResult));
+
+/**
+ * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name detectLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.detect]{@link module:Collections.detect}
+ * @alias findLimit
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ */
+var detectLimit = doParallelLimit(_createTester(identity, _findGetResult));
+
+/**
+ * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.
+ *
+ * @name detectSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.detect]{@link module:Collections.detect}
+ * @alias findSeries
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ */
+var detectSeries = doLimit(detectLimit, 1);
+
+function consoleFunc(name) {
+ return function (fn/*, ...args*/) {
+ var args = slice(arguments, 1);
+ args.push(function (err/*, ...args*/) {
+ var args = slice(arguments, 1);
+ if (typeof console === 'object') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ } else if (console[name]) {
+ arrayEach(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ });
+ wrapAsync(fn).apply(null, args);
+ };
+}
+
+/**
+ * Logs the result of an [`async` function]{@link AsyncFunction} to the
+ * `console` using `console.dir` to display the properties of the resulting object.
+ * Only works in Node.js or in browsers that support `console.dir` and
+ * `console.error` (such as FF and Chrome).
+ * If multiple arguments are returned from the async function,
+ * `console.dir` is called on each argument in order.
+ *
+ * @name dir
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} function - The function you want to eventually apply
+ * all arguments to.
+ * @param {...*} arguments... - Any number of arguments to apply to the function.
+ * @example
+ *
+ * // in a module
+ * var hello = function(name, callback) {
+ * setTimeout(function() {
+ * callback(null, {hello: name});
+ * }, 1000);
+ * };
+ *
+ * // in the node repl
+ * node> async.dir(hello, 'world');
+ * {hello: 'world'}
+ */
+var dir = consoleFunc('dir');
+
+/**
+ * The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in
+ * the order of operations, the arguments `test` and `fn` are switched.
+ *
+ * Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function.
+ * @name doDuring
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.during]{@link module:ControlFlow.during}
+ * @category Control Flow
+ * @param {AsyncFunction} fn - An async function which is called each time
+ * `test` passes. Invoked with (callback).
+ * @param {AsyncFunction} test - asynchronous truth test to perform before each
+ * execution of `fn`. Invoked with (...args, callback), where `...args` are the
+ * non-error args from the previous callback of `fn`.
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `fn` has stopped. `callback`
+ * will be passed an error if one occurred, otherwise `null`.
+ */
+function doDuring(fn, test, callback) {
+ callback = onlyOnce(callback || noop);
+ var _fn = wrapAsync(fn);
+ var _test = wrapAsync(test);
+
+ function next(err/*, ...args*/) {
+ if (err) return callback(err);
+ var args = slice(arguments, 1);
+ args.push(check);
+ _test.apply(this, args);
+ }
+
+ function check(err, truth) {
+ if (err) return callback(err);
+ if (!truth) return callback(null);
+ _fn(next);
+ }
+
+ check(null, true);
+
+}
+
+/**
+ * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in
+ * the order of operations, the arguments `test` and `iteratee` are switched.
+ *
+ * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
+ *
+ * @name doWhilst
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.whilst]{@link module:ControlFlow.whilst}
+ * @category Control Flow
+ * @param {AsyncFunction} iteratee - A function which is called each time `test`
+ * passes. Invoked with (callback).
+ * @param {Function} test - synchronous truth test to perform after each
+ * execution of `iteratee`. Invoked with any non-error callback results of
+ * `iteratee`.
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `iteratee` has stopped.
+ * `callback` will be passed an error and any arguments passed to the final
+ * `iteratee`'s callback. Invoked with (err, [results]);
+ */
+function doWhilst(iteratee, test, callback) {
+ callback = onlyOnce(callback || noop);
+ var _iteratee = wrapAsync(iteratee);
+ var next = function(err/*, ...args*/) {
+ if (err) return callback(err);
+ var args = slice(arguments, 1);
+ if (test.apply(this, args)) return _iteratee(next);
+ callback.apply(null, [null].concat(args));
+ };
+ _iteratee(next);
+}
+
+/**
+ * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the
+ * argument ordering differs from `until`.
+ *
+ * @name doUntil
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}
+ * @category Control Flow
+ * @param {AsyncFunction} iteratee - An async function which is called each time
+ * `test` fails. Invoked with (callback).
+ * @param {Function} test - synchronous truth test to perform after each
+ * execution of `iteratee`. Invoked with any non-error callback results of
+ * `iteratee`.
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has passed and repeated execution of `iteratee` has stopped. `callback`
+ * will be passed an error and any arguments passed to the final `iteratee`'s
+ * callback. Invoked with (err, [results]);
+ */
+function doUntil(iteratee, test, callback) {
+ doWhilst(iteratee, function() {
+ return !test.apply(this, arguments);
+ }, callback);
+}
+
+/**
+ * Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that
+ * is passed a callback in the form of `function (err, truth)`. If error is
+ * passed to `test` or `fn`, the main callback is immediately called with the
+ * value of the error.
+ *
+ * @name during
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.whilst]{@link module:ControlFlow.whilst}
+ * @category Control Flow
+ * @param {AsyncFunction} test - asynchronous truth test to perform before each
+ * execution of `fn`. Invoked with (callback).
+ * @param {AsyncFunction} fn - An async function which is called each time
+ * `test` passes. Invoked with (callback).
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `fn` has stopped. `callback`
+ * will be passed an error, if one occurred, otherwise `null`.
+ * @example
+ *
+ * var count = 0;
+ *
+ * async.during(
+ * function (callback) {
+ * return callback(null, count < 5);
+ * },
+ * function (callback) {
+ * count++;
+ * setTimeout(callback, 1000);
+ * },
+ * function (err) {
+ * // 5 seconds have passed
+ * }
+ * );
+ */
+function during(test, fn, callback) {
+ callback = onlyOnce(callback || noop);
+ var _fn = wrapAsync(fn);
+ var _test = wrapAsync(test);
+
+ function next(err) {
+ if (err) return callback(err);
+ _test(check);
+ }
+
+ function check(err, truth) {
+ if (err) return callback(err);
+ if (!truth) return callback(null);
+ _fn(next);
+ }
+
+ _test(check);
+}
+
+function _withoutIndex(iteratee) {
+ return function (value, index, callback) {
+ return iteratee(value, callback);
+ };
+}
+
+/**
+ * Applies the function `iteratee` to each item in `coll`, in parallel.
+ * The `iteratee` is called with an item from the list, and a callback for when
+ * it has finished. If the `iteratee` passes an error to its `callback`, the
+ * main `callback` (for the `each` function) is immediately called with the
+ * error.
+ *
+ * Note, that since this function applies `iteratee` to each item in parallel,
+ * there is no guarantee that the iteratee functions will complete in order.
+ *
+ * @name each
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEach
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to
+ * each item in `coll`. Invoked with (item, callback).
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOf`.
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * // assuming openFiles is an array of file names and saveFile is a function
+ * // to save the modified contents of that file:
+ *
+ * async.each(openFiles, saveFile, function(err){
+ * // if any of the saves produced an error, err would equal that error
+ * });
+ *
+ * // assuming openFiles is an array of file names
+ * async.each(openFiles, function(file, callback) {
+ *
+ * // Perform operation on file here.
+ * console.log('Processing file ' + file);
+ *
+ * if( file.length > 32 ) {
+ * console.log('This file name is too long');
+ * callback('File name too long');
+ * } else {
+ * // Do work to process file here
+ * console.log('File processed');
+ * callback();
+ * }
+ * }, function(err) {
+ * // if any of the file processing produced an error, err would equal that error
+ * if( err ) {
+ * // One of the iterations produced an error.
+ * // All processing will now stop.
+ * console.log('A file failed to process');
+ * } else {
+ * console.log('All files have been processed successfully');
+ * }
+ * });
+ */
+function eachLimit(coll, iteratee, callback) {
+ eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback);
+}
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name eachLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfLimit`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachLimit$1(coll, limit, iteratee, callback) {
+ _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback);
+}
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.
+ *
+ * @name eachSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfSeries`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+var eachSeries = doLimit(eachLimit$1, 1);
+
+/**
+ * Wrap an async function and ensure it calls its callback on a later tick of
+ * the event loop. If the function already calls its callback on a next tick,
+ * no extra deferral is added. This is useful for preventing stack overflows
+ * (`RangeError: Maximum call stack size exceeded`) and generally keeping
+ * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)
+ * contained. ES2017 `async` functions are returned as-is -- they are immune
+ * to Zalgo's corrupting influences, as they always resolve on a later tick.
+ *
+ * @name ensureAsync
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} fn - an async function, one that expects a node-style
+ * callback as its last argument.
+ * @returns {AsyncFunction} Returns a wrapped function with the exact same call
+ * signature as the function passed in.
+ * @example
+ *
+ * function sometimesAsync(arg, callback) {
+ * if (cache[arg]) {
+ * return callback(null, cache[arg]); // this would be synchronous!!
+ * } else {
+ * doSomeIO(arg, callback); // this IO would be asynchronous
+ * }
+ * }
+ *
+ * // this has a risk of stack overflows if many results are cached in a row
+ * async.mapSeries(args, sometimesAsync, done);
+ *
+ * // this will defer sometimesAsync's callback if necessary,
+ * // preventing stack overflows
+ * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);
+ */
+function ensureAsync(fn) {
+ if (isAsync(fn)) return fn;
+ return initialParams(function (args, callback) {
+ var sync = true;
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ setImmediate$1(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ fn.apply(this, args);
+ sync = false;
+ });
+}
+
+function notId(v) {
+ return !v;
+}
+
+/**
+ * Returns `true` if every element in `coll` satisfies an async test. If any
+ * iteratee call returns `false`, the main `callback` is immediately called.
+ *
+ * @name every
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias all
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ * @example
+ *
+ * async.every(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // if result is true then every file exists
+ * });
+ */
+var every = doParallel(_createTester(notId, notId));
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name everyLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+var everyLimit = doParallelLimit(_createTester(notId, notId));
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.
+ *
+ * @name everySeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in series.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+var everySeries = doLimit(everyLimit, 1);
+
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+function filterArray(eachfn, arr, iteratee, callback) {
+ var truthValues = new Array(arr.length);
+ eachfn(arr, function (x, index, callback) {
+ iteratee(x, function (err, v) {
+ truthValues[index] = !!v;
+ callback(err);
+ });
+ }, function (err) {
+ if (err) return callback(err);
+ var results = [];
+ for (var i = 0; i < arr.length; i++) {
+ if (truthValues[i]) results.push(arr[i]);
+ }
+ callback(null, results);
+ });
+}
+
+function filterGeneric(eachfn, coll, iteratee, callback) {
+ var results = [];
+ eachfn(coll, function (x, index, callback) {
+ iteratee(x, function (err, v) {
+ if (err) {
+ callback(err);
+ } else {
+ if (v) {
+ results.push({index: index, value: x});
+ }
+ callback();
+ }
+ });
+ }, function (err) {
+ if (err) {
+ callback(err);
+ } else {
+ callback(null, arrayMap(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), baseProperty('value')));
+ }
+ });
+}
+
+function _filter(eachfn, coll, iteratee, callback) {
+ var filter = isArrayLike(coll) ? filterArray : filterGeneric;
+ filter(eachfn, coll, wrapAsync(iteratee), callback || noop);
+}
+
+/**
+ * Returns a new array of all the values in `coll` which pass an async truth
+ * test. This operation is performed in parallel, but the results array will be
+ * in the same order as the original.
+ *
+ * @name filter
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias select
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ * @example
+ *
+ * async.filter(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, results) {
+ * // results now equals an array of the existing files
+ * });
+ */
+var filter = doParallel(_filter);
+
+/**
+ * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name filterLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @alias selectLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+var filterLimit = doParallelLimit(_filter);
+
+/**
+ * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.
+ *
+ * @name filterSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @alias selectSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results)
+ */
+var filterSeries = doLimit(filterLimit, 1);
+
+/**
+ * Calls the asynchronous function `fn` with a callback parameter that allows it
+ * to call itself again, in series, indefinitely.
+
+ * If an error is passed to the callback then `errback` is called with the
+ * error, and execution stops, otherwise it will never be called.
+ *
+ * @name forever
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {AsyncFunction} fn - an async function to call repeatedly.
+ * Invoked with (next).
+ * @param {Function} [errback] - when `fn` passes an error to it's callback,
+ * this function will be called, and execution stops. Invoked with (err).
+ * @example
+ *
+ * async.forever(
+ * function(next) {
+ * // next is suitable for passing to things that need a callback(err [, whatever]);
+ * // it will result in this function being called again.
+ * },
+ * function(err) {
+ * // if next is called with a value in its first parameter, it will appear
+ * // in here as 'err', and execution will stop.
+ * }
+ * );
+ */
+function forever(fn, errback) {
+ var done = onlyOnce(errback || noop);
+ var task = wrapAsync(ensureAsync(fn));
+
+ function next(err) {
+ if (err) return done(err);
+ task(next);
+ }
+ next();
+}
+
+/**
+ * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name groupByLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.groupBy]{@link module:Collections.groupBy}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a `key` to group the value under.
+ * Invoked with (value, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Result is an `Object` whoses
+ * properties are arrays of values which returned the corresponding key.
+ */
+var groupByLimit = function(coll, limit, iteratee, callback) {
+ callback = callback || noop;
+ var _iteratee = wrapAsync(iteratee);
+ mapLimit(coll, limit, function(val, callback) {
+ _iteratee(val, function(err, key) {
+ if (err) return callback(err);
+ return callback(null, {key: key, val: val});
+ });
+ }, function(err, mapResults) {
+ var result = {};
+ // from MDN, handle object having an `hasOwnProperty` prop
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+
+ for (var i = 0; i < mapResults.length; i++) {
+ if (mapResults[i]) {
+ var key = mapResults[i].key;
+ var val = mapResults[i].val;
+
+ if (hasOwnProperty.call(result, key)) {
+ result[key].push(val);
+ } else {
+ result[key] = [val];
+ }
+ }
+ }
+
+ return callback(err, result);
+ });
+};
+
+/**
+ * Returns a new object, where each value corresponds to an array of items, from
+ * `coll`, that returned the corresponding key. That is, the keys of the object
+ * correspond to the values passed to the `iteratee` callback.
+ *
+ * Note: Since this function applies the `iteratee` to each item in parallel,
+ * there is no guarantee that the `iteratee` functions will complete in order.
+ * However, the values for each key in the `result` will be in the same order as
+ * the original `coll`. For Objects, the values will roughly be in the order of
+ * the original Objects' keys (but this can vary across JavaScript engines).
+ *
+ * @name groupBy
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a `key` to group the value under.
+ * Invoked with (value, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Result is an `Object` whoses
+ * properties are arrays of values which returned the corresponding key.
+ * @example
+ *
+ * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) {
+ * db.findById(userId, function(err, user) {
+ * if (err) return callback(err);
+ * return callback(null, user.age);
+ * });
+ * }, function(err, result) {
+ * // result is object containing the userIds grouped by age
+ * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']};
+ * });
+ */
+var groupBy = doLimit(groupByLimit, Infinity);
+
+/**
+ * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.
+ *
+ * @name groupBySeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.groupBy]{@link module:Collections.groupBy}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a `key` to group the value under.
+ * Invoked with (value, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Result is an `Object` whoses
+ * properties are arrays of values which returned the corresponding key.
+ */
+var groupBySeries = doLimit(groupByLimit, 1);
+
+/**
+ * Logs the result of an `async` function to the `console`. Only works in
+ * Node.js or in browsers that support `console.log` and `console.error` (such
+ * as FF and Chrome). If multiple arguments are returned from the async
+ * function, `console.log` is called on each argument in order.
+ *
+ * @name log
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} function - The function you want to eventually apply
+ * all arguments to.
+ * @param {...*} arguments... - Any number of arguments to apply to the function.
+ * @example
+ *
+ * // in a module
+ * var hello = function(name, callback) {
+ * setTimeout(function() {
+ * callback(null, 'hello ' + name);
+ * }, 1000);
+ * };
+ *
+ * // in the node repl
+ * node> async.log(hello, 'world');
+ * 'hello world'
+ */
+var log = consoleFunc('log');
+
+/**
+ * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name mapValuesLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.mapValues]{@link module:Collections.mapValues}
+ * @category Collection
+ * @param {Object} obj - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - A function to apply to each value and key
+ * in `coll`.
+ * The iteratee should complete with the transformed value as its result.
+ * Invoked with (value, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. `result` is a new object consisting
+ * of each key from `obj`, with each transformed value on the right-hand side.
+ * Invoked with (err, result).
+ */
+function mapValuesLimit(obj, limit, iteratee, callback) {
+ callback = once(callback || noop);
+ var newObj = {};
+ var _iteratee = wrapAsync(iteratee);
+ eachOfLimit(obj, limit, function(val, key, next) {
+ _iteratee(val, key, function (err, result) {
+ if (err) return next(err);
+ newObj[key] = result;
+ next();
+ });
+ }, function (err) {
+ callback(err, newObj);
+ });
+}
+
+/**
+ * A relative of [`map`]{@link module:Collections.map}, designed for use with objects.
+ *
+ * Produces a new Object by mapping each value of `obj` through the `iteratee`
+ * function. The `iteratee` is called each `value` and `key` from `obj` and a
+ * callback for when it has finished processing. Each of these callbacks takes
+ * two arguments: an `error`, and the transformed item from `obj`. If `iteratee`
+ * passes an error to its callback, the main `callback` (for the `mapValues`
+ * function) is immediately called with the error.
+ *
+ * Note, the order of the keys in the result is not guaranteed. The keys will
+ * be roughly in the order they complete, (but this is very engine-specific)
+ *
+ * @name mapValues
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Object} obj - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each value and key
+ * in `coll`.
+ * The iteratee should complete with the transformed value as its result.
+ * Invoked with (value, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. `result` is a new object consisting
+ * of each key from `obj`, with each transformed value on the right-hand side.
+ * Invoked with (err, result).
+ * @example
+ *
+ * async.mapValues({
+ * f1: 'file1',
+ * f2: 'file2',
+ * f3: 'file3'
+ * }, function (file, key, callback) {
+ * fs.stat(file, callback);
+ * }, function(err, result) {
+ * // result is now a map of stats for each file, e.g.
+ * // {
+ * // f1: [stats for file1],
+ * // f2: [stats for file2],
+ * // f3: [stats for file3]
+ * // }
+ * });
+ */
+
+var mapValues = doLimit(mapValuesLimit, Infinity);
+
+/**
+ * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.
+ *
+ * @name mapValuesSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.mapValues]{@link module:Collections.mapValues}
+ * @category Collection
+ * @param {Object} obj - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each value and key
+ * in `coll`.
+ * The iteratee should complete with the transformed value as its result.
+ * Invoked with (value, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. `result` is a new object consisting
+ * of each key from `obj`, with each transformed value on the right-hand side.
+ * Invoked with (err, result).
+ */
+var mapValuesSeries = doLimit(mapValuesLimit, 1);
+
+function has(obj, key) {
+ return key in obj;
+}
+
+/**
+ * Caches the results of an async function. When creating a hash to store
+ * function results against, the callback is omitted from the hash and an
+ * optional hash function can be used.
+ *
+ * If no hash function is specified, the first argument is used as a hash key,
+ * which may work reasonably if it is a string or a data type that converts to a
+ * distinct string. Note that objects and arrays will not behave reasonably.
+ * Neither will cases where the other arguments are significant. In such cases,
+ * specify your own hash function.
+ *
+ * The cache of results is exposed as the `memo` property of the function
+ * returned by `memoize`.
+ *
+ * @name memoize
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} fn - The async function to proxy and cache results from.
+ * @param {Function} hasher - An optional function for generating a custom hash
+ * for storing results. It has all the arguments applied to it apart from the
+ * callback, and must be synchronous.
+ * @returns {AsyncFunction} a memoized version of `fn`
+ * @example
+ *
+ * var slow_fn = function(name, callback) {
+ * // do something
+ * callback(null, result);
+ * };
+ * var fn = async.memoize(slow_fn);
+ *
+ * // fn can now be used as if it were slow_fn
+ * fn('some name', function() {
+ * // callback
+ * });
+ */
+function memoize(fn, hasher) {
+ var memo = Object.create(null);
+ var queues = Object.create(null);
+ hasher = hasher || identity;
+ var _fn = wrapAsync(fn);
+ var memoized = initialParams(function memoized(args, callback) {
+ var key = hasher.apply(null, args);
+ if (has(memo, key)) {
+ setImmediate$1(function() {
+ callback.apply(null, memo[key]);
+ });
+ } else if (has(queues, key)) {
+ queues[key].push(callback);
+ } else {
+ queues[key] = [callback];
+ _fn.apply(null, args.concat(function(/*args*/) {
+ var args = slice(arguments);
+ memo[key] = args;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, args);
+ }
+ }));
+ }
+ });
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+}
+
+/**
+ * Calls `callback` on a later loop around the event loop. In Node.js this just
+ * calls `process.nextTick`. In the browser it will use `setImmediate` if
+ * available, otherwise `setTimeout(callback, 0)`, which means other higher
+ * priority events may precede the execution of `callback`.
+ *
+ * This is used internally for browser-compatibility purposes.
+ *
+ * @name nextTick
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @see [async.setImmediate]{@link module:Utils.setImmediate}
+ * @category Util
+ * @param {Function} callback - The function to call on a later loop around
+ * the event loop. Invoked with (args...).
+ * @param {...*} args... - any number of additional arguments to pass to the
+ * callback on the next tick.
+ * @example
+ *
+ * var call_order = [];
+ * async.nextTick(function() {
+ * call_order.push('two');
+ * // call_order now equals ['one','two']
+ * });
+ * call_order.push('one');
+ *
+ * async.setImmediate(function (a, b, c) {
+ * // a, b, and c equal 1, 2, and 3
+ * }, 1, 2, 3);
+ */
+var _defer$1;
+
+if (hasNextTick) {
+ _defer$1 = process.nextTick;
+} else if (hasSetImmediate) {
+ _defer$1 = setImmediate;
+} else {
+ _defer$1 = fallback;
+}
+
+var nextTick = wrap(_defer$1);
+
+function _parallel(eachfn, tasks, callback) {
+ callback = callback || noop;
+ var results = isArrayLike(tasks) ? [] : {};
+
+ eachfn(tasks, function (task, key, callback) {
+ wrapAsync(task)(function (err, result) {
+ if (arguments.length > 2) {
+ result = slice(arguments, 1);
+ }
+ results[key] = result;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+}
+
+/**
+ * Run the `tasks` collection of functions in parallel, without waiting until
+ * the previous function has completed. If any of the functions pass an error to
+ * its callback, the main `callback` is immediately called with the value of the
+ * error. Once the `tasks` have completed, the results are passed to the final
+ * `callback` as an array.
+ *
+ * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about
+ * parallel execution of code. If your tasks do not use any timers or perform
+ * any I/O, they will actually be executed in series. Any synchronous setup
+ * sections for each task will happen one after the other. JavaScript remains
+ * single-threaded.
+ *
+ * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the
+ * execution of other tasks when a task fails.
+ *
+ * It is also possible to use an object instead of an array. Each property will
+ * be run as a function and the results will be passed to the final `callback`
+ * as an object instead of an array. This can be a more readable way of handling
+ * results from {@link async.parallel}.
+ *
+ * @name parallel
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection of
+ * [async functions]{@link AsyncFunction} to run.
+ * Each async function can complete with any number of optional `result` values.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed successfully. This function gets a results array
+ * (or object) containing all the result arguments passed to the task callbacks.
+ * Invoked with (err, results).
+ *
+ * @example
+ * async.parallel([
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'two');
+ * }, 100);
+ * }
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * // the results array will equal ['one','two'] even though
+ * // the second function had a shorter timeout.
+ * });
+ *
+ * // an example using an object instead of an array
+ * async.parallel({
+ * one: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 1);
+ * }, 200);
+ * },
+ * two: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 2);
+ * }, 100);
+ * }
+ * }, function(err, results) {
+ * // results is now equals to: {one: 1, two: 2}
+ * });
+ */
+function parallelLimit(tasks, callback) {
+ _parallel(eachOf, tasks, callback);
+}
+
+/**
+ * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name parallelLimit
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.parallel]{@link module:ControlFlow.parallel}
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection of
+ * [async functions]{@link AsyncFunction} to run.
+ * Each async function can complete with any number of optional `result` values.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed successfully. This function gets a results array
+ * (or object) containing all the result arguments passed to the task callbacks.
+ * Invoked with (err, results).
+ */
+function parallelLimit$1(tasks, limit, callback) {
+ _parallel(_eachOfLimit(limit), tasks, callback);
+}
+
+/**
+ * A queue of tasks for the worker function to complete.
+ * @typedef {Object} QueueObject
+ * @memberOf module:ControlFlow
+ * @property {Function} length - a function returning the number of items
+ * waiting to be processed. Invoke with `queue.length()`.
+ * @property {boolean} started - a boolean indicating whether or not any
+ * items have been pushed and processed by the queue.
+ * @property {Function} running - a function returning the number of items
+ * currently being processed. Invoke with `queue.running()`.
+ * @property {Function} workersList - a function returning the array of items
+ * currently being processed. Invoke with `queue.workersList()`.
+ * @property {Function} idle - a function returning false if there are items
+ * waiting or being processed, or true if not. Invoke with `queue.idle()`.
+ * @property {number} concurrency - an integer for determining how many `worker`
+ * functions should be run in parallel. This property can be changed after a
+ * `queue` is created to alter the concurrency on-the-fly.
+ * @property {Function} push - add a new task to the `queue`. Calls `callback`
+ * once the `worker` has finished processing the task. Instead of a single task,
+ * a `tasks` array can be submitted. The respective callback is used for every
+ * task in the list. Invoke with `queue.push(task, [callback])`,
+ * @property {Function} unshift - add a new task to the front of the `queue`.
+ * Invoke with `queue.unshift(task, [callback])`.
+ * @property {Function} remove - remove items from the queue that match a test
+ * function. The test function will be passed an object with a `data` property,
+ * and a `priority` property, if this is a
+ * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.
+ * Invoked with `queue.remove(testFn)`, where `testFn` is of the form
+ * `function ({data, priority}) {}` and returns a Boolean.
+ * @property {Function} saturated - a callback that is called when the number of
+ * running workers hits the `concurrency` limit, and further tasks will be
+ * queued.
+ * @property {Function} unsaturated - a callback that is called when the number
+ * of running workers is less than the `concurrency` & `buffer` limits, and
+ * further tasks will not be queued.
+ * @property {number} buffer - A minimum threshold buffer in order to say that
+ * the `queue` is `unsaturated`.
+ * @property {Function} empty - a callback that is called when the last item
+ * from the `queue` is given to a `worker`.
+ * @property {Function} drain - a callback that is called when the last item
+ * from the `queue` has returned from the `worker`.
+ * @property {Function} error - a callback that is called when a task errors.
+ * Has the signature `function(error, task)`.
+ * @property {boolean} paused - a boolean for determining whether the queue is
+ * in a paused state.
+ * @property {Function} pause - a function that pauses the processing of tasks
+ * until `resume()` is called. Invoke with `queue.pause()`.
+ * @property {Function} resume - a function that resumes the processing of
+ * queued tasks when the queue is paused. Invoke with `queue.resume()`.
+ * @property {Function} kill - a function that removes the `drain` callback and
+ * empties remaining tasks from the queue forcing it to go idle. No more tasks
+ * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.
+ */
+
+/**
+ * Creates a `queue` object with the specified `concurrency`. Tasks added to the
+ * `queue` are processed in parallel (up to the `concurrency` limit). If all
+ * `worker`s are in progress, the task is queued until one becomes available.
+ * Once a `worker` completes a `task`, that `task`'s callback is called.
+ *
+ * @name queue
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {AsyncFunction} worker - An async function for processing a queued task.
+ * If you want to handle errors from an individual task, pass a callback to
+ * `q.push()`. Invoked with (task, callback).
+ * @param {number} [concurrency=1] - An `integer` for determining how many
+ * `worker` functions should be run in parallel. If omitted, the concurrency
+ * defaults to `1`. If the concurrency is `0`, an error is thrown.
+ * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can
+ * attached as certain properties to listen for specific events during the
+ * lifecycle of the queue.
+ * @example
+ *
+ * // create a queue object with concurrency 2
+ * var q = async.queue(function(task, callback) {
+ * console.log('hello ' + task.name);
+ * callback();
+ * }, 2);
+ *
+ * // assign a callback
+ * q.drain = function() {
+ * console.log('all items have been processed');
+ * };
+ *
+ * // add some items to the queue
+ * q.push({name: 'foo'}, function(err) {
+ * console.log('finished processing foo');
+ * });
+ * q.push({name: 'bar'}, function (err) {
+ * console.log('finished processing bar');
+ * });
+ *
+ * // add some items to the queue (batch-wise)
+ * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {
+ * console.log('finished processing item');
+ * });
+ *
+ * // add some items to the front of the queue
+ * q.unshift({name: 'bar'}, function (err) {
+ * console.log('finished processing bar');
+ * });
+ */
+var queue$1 = function (worker, concurrency) {
+ var _worker = wrapAsync(worker);
+ return queue(function (items, cb) {
+ _worker(items[0], cb);
+ }, concurrency, 1);
+};
+
+/**
+ * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and
+ * completed in ascending priority order.
+ *
+ * @name priorityQueue
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.queue]{@link module:ControlFlow.queue}
+ * @category Control Flow
+ * @param {AsyncFunction} worker - An async function for processing a queued task.
+ * If you want to handle errors from an individual task, pass a callback to
+ * `q.push()`.
+ * Invoked with (task, callback).
+ * @param {number} concurrency - An `integer` for determining how many `worker`
+ * functions should be run in parallel. If omitted, the concurrency defaults to
+ * `1`. If the concurrency is `0`, an error is thrown.
+ * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two
+ * differences between `queue` and `priorityQueue` objects:
+ * * `push(task, priority, [callback])` - `priority` should be a number. If an
+ * array of `tasks` is given, all tasks will be assigned the same priority.
+ * * The `unshift` method was removed.
+ */
+var priorityQueue = function(worker, concurrency) {
+ // Start with a normal queue
+ var q = queue$1(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function(data, priority, callback) {
+ if (callback == null) callback = noop;
+ if (typeof callback !== 'function') {
+ throw new Error('task callback must be a function');
+ }
+ q.started = true;
+ if (!isArray(data)) {
+ data = [data];
+ }
+ if (data.length === 0) {
+ // call drain immediately if there are no tasks
+ return setImmediate$1(function() {
+ q.drain();
+ });
+ }
+
+ priority = priority || 0;
+ var nextNode = q._tasks.head;
+ while (nextNode && priority >= nextNode.priority) {
+ nextNode = nextNode.next;
+ }
+
+ for (var i = 0, l = data.length; i < l; i++) {
+ var item = {
+ data: data[i],
+ priority: priority,
+ callback: callback
+ };
+
+ if (nextNode) {
+ q._tasks.insertBefore(nextNode, item);
+ } else {
+ q._tasks.push(item);
+ }
+ }
+ setImmediate$1(q.process);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+};
+
+/**
+ * Runs the `tasks` array of functions in parallel, without waiting until the
+ * previous function has completed. Once any of the `tasks` complete or pass an
+ * error to its callback, the main `callback` is immediately called. It's
+ * equivalent to `Promise.race()`.
+ *
+ * @name race
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}
+ * to run. Each function can complete with an optional `result` value.
+ * @param {Function} callback - A callback to run once any of the functions have
+ * completed. This function gets an error or result from the first function that
+ * completed. Invoked with (err, result).
+ * @returns undefined
+ * @example
+ *
+ * async.race([
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'two');
+ * }, 100);
+ * }
+ * ],
+ * // main callback
+ * function(err, result) {
+ * // the result will be equal to 'two' as it finishes earlier
+ * });
+ */
+function race(tasks, callback) {
+ callback = once(callback || noop);
+ if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));
+ if (!tasks.length) return callback();
+ for (var i = 0, l = tasks.length; i < l; i++) {
+ wrapAsync(tasks[i])(callback);
+ }
+}
+
+/**
+ * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.
+ *
+ * @name reduceRight
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reduce]{@link module:Collections.reduce}
+ * @alias foldr
+ * @category Collection
+ * @param {Array} array - A collection to iterate over.
+ * @param {*} memo - The initial state of the reduction.
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * array to produce the next step in the reduction.
+ * The `iteratee` should complete with the next state of the reduction.
+ * If the iteratee complete with an error, the reduction is stopped and the
+ * main `callback` is immediately called with the error.
+ * Invoked with (memo, item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the reduced value. Invoked with
+ * (err, result).
+ */
+function reduceRight (array, memo, iteratee, callback) {
+ var reversed = slice(array).reverse();
+ reduce(reversed, memo, iteratee, callback);
+}
+
+/**
+ * Wraps the async function in another function that always completes with a
+ * result object, even when it errors.
+ *
+ * The result object has either the property `error` or `value`.
+ *
+ * @name reflect
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} fn - The async function you want to wrap
+ * @returns {Function} - A function that always passes null to it's callback as
+ * the error. The second argument to the callback will be an `object` with
+ * either an `error` or a `value` property.
+ * @example
+ *
+ * async.parallel([
+ * async.reflect(function(callback) {
+ * // do some stuff ...
+ * callback(null, 'one');
+ * }),
+ * async.reflect(function(callback) {
+ * // do some more stuff but error ...
+ * callback('bad stuff happened');
+ * }),
+ * async.reflect(function(callback) {
+ * // do some more stuff ...
+ * callback(null, 'two');
+ * })
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * // values
+ * // results[0].value = 'one'
+ * // results[1].error = 'bad stuff happened'
+ * // results[2].value = 'two'
+ * });
+ */
+function reflect(fn) {
+ var _fn = wrapAsync(fn);
+ return initialParams(function reflectOn(args, reflectCallback) {
+ args.push(function callback(error, cbArg) {
+ if (error) {
+ reflectCallback(null, { error: error });
+ } else {
+ var value;
+ if (arguments.length <= 2) {
+ value = cbArg;
+ } else {
+ value = slice(arguments, 1);
+ }
+ reflectCallback(null, { value: value });
+ }
+ });
+
+ return _fn.apply(this, args);
+ });
+}
+
+/**
+ * A helper function that wraps an array or an object of functions with `reflect`.
+ *
+ * @name reflectAll
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @see [async.reflect]{@link module:Utils.reflect}
+ * @category Util
+ * @param {Array|Object|Iterable} tasks - The collection of
+ * [async functions]{@link AsyncFunction} to wrap in `async.reflect`.
+ * @returns {Array} Returns an array of async functions, each wrapped in
+ * `async.reflect`
+ * @example
+ *
+ * let tasks = [
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * function(callback) {
+ * // do some more stuff but error ...
+ * callback(new Error('bad stuff happened'));
+ * },
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'two');
+ * }, 100);
+ * }
+ * ];
+ *
+ * async.parallel(async.reflectAll(tasks),
+ * // optional callback
+ * function(err, results) {
+ * // values
+ * // results[0].value = 'one'
+ * // results[1].error = Error('bad stuff happened')
+ * // results[2].value = 'two'
+ * });
+ *
+ * // an example using an object instead of an array
+ * let tasks = {
+ * one: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * two: function(callback) {
+ * callback('two');
+ * },
+ * three: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'three');
+ * }, 100);
+ * }
+ * };
+ *
+ * async.parallel(async.reflectAll(tasks),
+ * // optional callback
+ * function(err, results) {
+ * // values
+ * // results.one.value = 'one'
+ * // results.two.error = 'two'
+ * // results.three.value = 'three'
+ * });
+ */
+function reflectAll(tasks) {
+ var results;
+ if (isArray(tasks)) {
+ results = arrayMap(tasks, reflect);
+ } else {
+ results = {};
+ baseForOwn(tasks, function(task, key) {
+ results[key] = reflect.call(this, task);
+ });
+ }
+ return results;
+}
+
+function reject$1(eachfn, arr, iteratee, callback) {
+ _filter(eachfn, arr, function(value, cb) {
+ iteratee(value, function(err, v) {
+ cb(err, !v);
+ });
+ }, callback);
+}
+
+/**
+ * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.
+ *
+ * @name reject
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - An async truth test to apply to each item in
+ * `coll`.
+ * The should complete with a boolean value as its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ * @example
+ *
+ * async.reject(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, results) {
+ * // results now equals an array of missing files
+ * createFiles(results);
+ * });
+ */
+var reject = doParallel(reject$1);
+
+/**
+ * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name rejectLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reject]{@link module:Collections.reject}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} iteratee - An async truth test to apply to each item in
+ * `coll`.
+ * The should complete with a boolean value as its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+var rejectLimit = doParallelLimit(reject$1);
+
+/**
+ * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.
+ *
+ * @name rejectSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reject]{@link module:Collections.reject}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - An async truth test to apply to each item in
+ * `coll`.
+ * The should complete with a boolean value as its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+var rejectSeries = doLimit(rejectLimit, 1);
+
+/**
+ * Creates a function that returns `value`.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.4.0
+ * @category Util
+ * @param {*} value The value to return from the new function.
+ * @returns {Function} Returns the new constant function.
+ * @example
+ *
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
+ *
+ * console.log(objects);
+ * // => [{ 'a': 1 }, { 'a': 1 }]
+ *
+ * console.log(objects[0] === objects[1]);
+ * // => true
+ */
+function constant$1(value) {
+ return function() {
+ return value;
+ };
+}
+
+/**
+ * Attempts to get a successful response from `task` no more than `times` times
+ * before returning an error. If the task is successful, the `callback` will be
+ * passed the result of the successful task. If all attempts fail, the callback
+ * will be passed the error and result (if any) of the final attempt.
+ *
+ * @name retry
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @see [async.retryable]{@link module:ControlFlow.retryable}
+ * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an
+ * object with `times` and `interval` or a number.
+ * * `times` - The number of attempts to make before giving up. The default
+ * is `5`.
+ * * `interval` - The time to wait between retries, in milliseconds. The
+ * default is `0`. The interval may also be specified as a function of the
+ * retry count (see example).
+ * * `errorFilter` - An optional synchronous function that is invoked on
+ * erroneous result. If it returns `true` the retry attempts will continue;
+ * if the function returns `false` the retry flow is aborted with the current
+ * attempt's error and result being returned to the final callback.
+ * Invoked with (err).
+ * * If `opts` is a number, the number specifies the number of times to retry,
+ * with the default interval of `0`.
+ * @param {AsyncFunction} task - An async function to retry.
+ * Invoked with (callback).
+ * @param {Function} [callback] - An optional callback which is called when the
+ * task has succeeded, or after the final failed attempt. It receives the `err`
+ * and `result` arguments of the last attempt at completing the `task`. Invoked
+ * with (err, results).
+ *
+ * @example
+ *
+ * // The `retry` function can be used as a stand-alone control flow by passing
+ * // a callback, as shown below:
+ *
+ * // try calling apiMethod 3 times
+ * async.retry(3, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod 3 times, waiting 200 ms between each retry
+ * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod 10 times with exponential backoff
+ * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)
+ * async.retry({
+ * times: 10,
+ * interval: function(retryCount) {
+ * return 50 * Math.pow(2, retryCount);
+ * }
+ * }, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod the default 5 times no delay between each retry
+ * async.retry(apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod only when error condition satisfies, all other
+ * // errors will abort the retry control flow and return to final callback
+ * async.retry({
+ * errorFilter: function(err) {
+ * return err.message === 'Temporary error'; // only retry on a specific error
+ * }
+ * }, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // to retry individual methods that are not as reliable within other
+ * // control flow functions, use the `retryable` wrapper:
+ * async.auto({
+ * users: api.getUsers.bind(api),
+ * payments: async.retryable(3, api.getPayments.bind(api))
+ * }, function(err, results) {
+ * // do something with the results
+ * });
+ *
+ */
+function retry(opts, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var DEFAULT_INTERVAL = 0;
+
+ var options = {
+ times: DEFAULT_TIMES,
+ intervalFunc: constant$1(DEFAULT_INTERVAL)
+ };
+
+ function parseTimes(acc, t) {
+ if (typeof t === 'object') {
+ acc.times = +t.times || DEFAULT_TIMES;
+
+ acc.intervalFunc = typeof t.interval === 'function' ?
+ t.interval :
+ constant$1(+t.interval || DEFAULT_INTERVAL);
+
+ acc.errorFilter = t.errorFilter;
+ } else if (typeof t === 'number' || typeof t === 'string') {
+ acc.times = +t || DEFAULT_TIMES;
+ } else {
+ throw new Error("Invalid arguments for async.retry");
+ }
+ }
+
+ if (arguments.length < 3 && typeof opts === 'function') {
+ callback = task || noop;
+ task = opts;
+ } else {
+ parseTimes(options, opts);
+ callback = callback || noop;
+ }
+
+ if (typeof task !== 'function') {
+ throw new Error("Invalid arguments for async.retry");
+ }
+
+ var _task = wrapAsync(task);
+
+ var attempt = 1;
+ function retryAttempt() {
+ _task(function(err) {
+ if (err && attempt++ < options.times &&
+ (typeof options.errorFilter != 'function' ||
+ options.errorFilter(err))) {
+ setTimeout(retryAttempt, options.intervalFunc(attempt));
+ } else {
+ callback.apply(null, arguments);
+ }
+ });
+ }
+
+ retryAttempt();
+}
+
+/**
+ * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method
+ * wraps a task and makes it retryable, rather than immediately calling it
+ * with retries.
+ *
+ * @name retryable
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.retry]{@link module:ControlFlow.retry}
+ * @category Control Flow
+ * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional
+ * options, exactly the same as from `retry`
+ * @param {AsyncFunction} task - the asynchronous function to wrap.
+ * This function will be passed any arguments passed to the returned wrapper.
+ * Invoked with (...args, callback).
+ * @returns {AsyncFunction} The wrapped function, which when invoked, will
+ * retry on an error, based on the parameters specified in `opts`.
+ * This function will accept the same parameters as `task`.
+ * @example
+ *
+ * async.auto({
+ * dep1: async.retryable(3, getFromFlakyService),
+ * process: ["dep1", async.retryable(3, function (results, cb) {
+ * maybeProcessData(results.dep1, cb);
+ * })]
+ * }, callback);
+ */
+var retryable = function (opts, task) {
+ if (!task) {
+ task = opts;
+ opts = null;
+ }
+ var _task = wrapAsync(task);
+ return initialParams(function (args, callback) {
+ function taskFn(cb) {
+ _task.apply(null, args.concat(cb));
+ }
+
+ if (opts) retry(opts, taskFn, callback);
+ else retry(taskFn, callback);
+
+ });
+};
+
+/**
+ * Run the functions in the `tasks` collection in series, each one running once
+ * the previous function has completed. If any functions in the series pass an
+ * error to its callback, no more functions are run, and `callback` is
+ * immediately called with the value of the error. Otherwise, `callback`
+ * receives an array of results when `tasks` have completed.
+ *
+ * It is also possible to use an object instead of an array. Each property will
+ * be run as a function, and the results will be passed to the final `callback`
+ * as an object instead of an array. This can be a more readable way of handling
+ * results from {@link async.series}.
+ *
+ * **Note** that while many implementations preserve the order of object
+ * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+ * explicitly states that
+ *
+ * > The mechanics and order of enumerating the properties is not specified.
+ *
+ * So if you rely on the order in which your series of functions are executed,
+ * and want this to work on all platforms, consider using an array.
+ *
+ * @name series
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection containing
+ * [async functions]{@link AsyncFunction} to run in series.
+ * Each function can complete with any number of optional `result` values.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed. This function gets a results array (or object)
+ * containing all the result arguments passed to the `task` callbacks. Invoked
+ * with (err, result).
+ * @example
+ * async.series([
+ * function(callback) {
+ * // do some stuff ...
+ * callback(null, 'one');
+ * },
+ * function(callback) {
+ * // do some more stuff ...
+ * callback(null, 'two');
+ * }
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * // results is now equal to ['one', 'two']
+ * });
+ *
+ * async.series({
+ * one: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 1);
+ * }, 200);
+ * },
+ * two: function(callback){
+ * setTimeout(function() {
+ * callback(null, 2);
+ * }, 100);
+ * }
+ * }, function(err, results) {
+ * // results is now equal to: {one: 1, two: 2}
+ * });
+ */
+function series(tasks, callback) {
+ _parallel(eachOfSeries, tasks, callback);
+}
+
+/**
+ * Returns `true` if at least one element in the `coll` satisfies an async test.
+ * If any iteratee call returns `true`, the main `callback` is immediately
+ * called.
+ *
+ * @name some
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias any
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in parallel.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ * @example
+ *
+ * async.some(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // if result is true then at least one of the files exists
+ * });
+ */
+var some = doParallel(_createTester(Boolean, identity));
+
+/**
+ * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name someLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.some]{@link module:Collections.some}
+ * @alias anyLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in parallel.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ */
+var someLimit = doParallelLimit(_createTester(Boolean, identity));
+
+/**
+ * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.
+ *
+ * @name someSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.some]{@link module:Collections.some}
+ * @alias anySeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in series.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ */
+var someSeries = doLimit(someLimit, 1);
+
+/**
+ * Sorts a list by the results of running each `coll` value through an async
+ * `iteratee`.
+ *
+ * @name sortBy
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a value to use as the sort criteria as
+ * its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} callback - A callback which is called after all the
+ * `iteratee` functions have finished, or an error occurs. Results is the items
+ * from the original `coll` sorted by the values returned by the `iteratee`
+ * calls. Invoked with (err, results).
+ * @example
+ *
+ * async.sortBy(['file1','file2','file3'], function(file, callback) {
+ * fs.stat(file, function(err, stats) {
+ * callback(err, stats.mtime);
+ * });
+ * }, function(err, results) {
+ * // results is now the original array of files sorted by
+ * // modified date
+ * });
+ *
+ * // By modifying the callback parameter the
+ * // sorting order can be influenced:
+ *
+ * // ascending order
+ * async.sortBy([1,9,3,5], function(x, callback) {
+ * callback(null, x);
+ * }, function(err,result) {
+ * // result callback
+ * });
+ *
+ * // descending order
+ * async.sortBy([1,9,3,5], function(x, callback) {
+ * callback(null, x*-1); //<- x*-1 instead of x, turns the order around
+ * }, function(err,result) {
+ * // result callback
+ * });
+ */
+function sortBy (coll, iteratee, callback) {
+ var _iteratee = wrapAsync(iteratee);
+ map(coll, function (x, callback) {
+ _iteratee(x, function (err, criteria) {
+ if (err) return callback(err);
+ callback(null, {value: x, criteria: criteria});
+ });
+ }, function (err, results) {
+ if (err) return callback(err);
+ callback(null, arrayMap(results.sort(comparator), baseProperty('value')));
+ });
+
+ function comparator(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }
+}
+
+/**
+ * Sets a time limit on an asynchronous function. If the function does not call
+ * its callback within the specified milliseconds, it will be called with a
+ * timeout error. The code property for the error object will be `'ETIMEDOUT'`.
+ *
+ * @name timeout
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} asyncFn - The async function to limit in time.
+ * @param {number} milliseconds - The specified time limit.
+ * @param {*} [info] - Any variable you want attached (`string`, `object`, etc)
+ * to timeout Error for more information..
+ * @returns {AsyncFunction} Returns a wrapped function that can be used with any
+ * of the control flow functions.
+ * Invoke this function with the same parameters as you would `asyncFunc`.
+ * @example
+ *
+ * function myFunction(foo, callback) {
+ * doAsyncTask(foo, function(err, data) {
+ * // handle errors
+ * if (err) return callback(err);
+ *
+ * // do some stuff ...
+ *
+ * // return processed data
+ * return callback(null, data);
+ * });
+ * }
+ *
+ * var wrapped = async.timeout(myFunction, 1000);
+ *
+ * // call `wrapped` as you would `myFunction`
+ * wrapped({ bar: 'bar' }, function(err, data) {
+ * // if `myFunction` takes < 1000 ms to execute, `err`
+ * // and `data` will have their expected values
+ *
+ * // else `err` will be an Error with the code 'ETIMEDOUT'
+ * });
+ */
+function timeout(asyncFn, milliseconds, info) {
+ var fn = wrapAsync(asyncFn);
+
+ return initialParams(function (args, callback) {
+ var timedOut = false;
+ var timer;
+
+ function timeoutCallback() {
+ var name = asyncFn.name || 'anonymous';
+ var error = new Error('Callback function "' + name + '" timed out.');
+ error.code = 'ETIMEDOUT';
+ if (info) {
+ error.info = info;
+ }
+ timedOut = true;
+ callback(error);
+ }
+
+ args.push(function () {
+ if (!timedOut) {
+ callback.apply(null, arguments);
+ clearTimeout(timer);
+ }
+ });
+
+ // setup timer and call original function
+ timer = setTimeout(timeoutCallback, milliseconds);
+ fn.apply(null, args);
+ });
+}
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeCeil = Math.ceil;
+var nativeMax = Math.max;
+
+/**
+ * The base implementation of `_.range` and `_.rangeRight` which doesn't
+ * coerce arguments.
+ *
+ * @private
+ * @param {number} start The start of the range.
+ * @param {number} end The end of the range.
+ * @param {number} step The value to increment or decrement by.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Array} Returns the range of numbers.
+ */
+function baseRange(start, end, step, fromRight) {
+ var index = -1,
+ length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
+ result = Array(length);
+
+ while (length--) {
+ result[fromRight ? length : ++index] = start;
+ start += step;
+ }
+ return result;
+}
+
+/**
+ * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name timesLimit
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.times]{@link module:ControlFlow.times}
+ * @category Control Flow
+ * @param {number} count - The number of times to run the function.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - The async function to call `n` times.
+ * Invoked with the iteration index and a callback: (n, next).
+ * @param {Function} callback - see [async.map]{@link module:Collections.map}.
+ */
+function timeLimit(count, limit, iteratee, callback) {
+ var _iteratee = wrapAsync(iteratee);
+ mapLimit(baseRange(0, count, 1), limit, _iteratee, callback);
+}
+
+/**
+ * Calls the `iteratee` function `n` times, and accumulates results in the same
+ * manner you would use with [map]{@link module:Collections.map}.
+ *
+ * @name times
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.map]{@link module:Collections.map}
+ * @category Control Flow
+ * @param {number} n - The number of times to run the function.
+ * @param {AsyncFunction} iteratee - The async function to call `n` times.
+ * Invoked with the iteration index and a callback: (n, next).
+ * @param {Function} callback - see {@link module:Collections.map}.
+ * @example
+ *
+ * // Pretend this is some complicated async factory
+ * var createUser = function(id, callback) {
+ * callback(null, {
+ * id: 'user' + id
+ * });
+ * };
+ *
+ * // generate 5 users
+ * async.times(5, function(n, next) {
+ * createUser(n, function(err, user) {
+ * next(err, user);
+ * });
+ * }, function(err, users) {
+ * // we should now have 5 users
+ * });
+ */
+var times = doLimit(timeLimit, Infinity);
+
+/**
+ * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.
+ *
+ * @name timesSeries
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.times]{@link module:ControlFlow.times}
+ * @category Control Flow
+ * @param {number} n - The number of times to run the function.
+ * @param {AsyncFunction} iteratee - The async function to call `n` times.
+ * Invoked with the iteration index and a callback: (n, next).
+ * @param {Function} callback - see {@link module:Collections.map}.
+ */
+var timesSeries = doLimit(timeLimit, 1);
+
+/**
+ * A relative of `reduce`. Takes an Object or Array, and iterates over each
+ * element in series, each step potentially mutating an `accumulator` value.
+ * The type of the accumulator defaults to the type of collection passed in.
+ *
+ * @name transform
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {*} [accumulator] - The initial state of the transform. If omitted,
+ * it will default to an empty Object or Array, depending on the type of `coll`
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * collection that potentially modifies the accumulator.
+ * Invoked with (accumulator, item, key, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the transformed accumulator.
+ * Invoked with (err, result).
+ * @example
+ *
+ * async.transform([1,2,3], function(acc, item, index, callback) {
+ * // pointless async:
+ * process.nextTick(function() {
+ * acc.push(item * 2)
+ * callback(null)
+ * });
+ * }, function(err, result) {
+ * // result is now equal to [2, 4, 6]
+ * });
+ *
+ * @example
+ *
+ * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) {
+ * setImmediate(function () {
+ * obj[key] = val * 2;
+ * callback();
+ * })
+ * }, function (err, result) {
+ * // result is equal to {a: 2, b: 4, c: 6}
+ * })
+ */
+function transform (coll, accumulator, iteratee, callback) {
+ if (arguments.length <= 3) {
+ callback = iteratee;
+ iteratee = accumulator;
+ accumulator = isArray(coll) ? [] : {};
+ }
+ callback = once(callback || noop);
+ var _iteratee = wrapAsync(iteratee);
+
+ eachOf(coll, function(v, k, cb) {
+ _iteratee(accumulator, v, k, cb);
+ }, function(err) {
+ callback(err, accumulator);
+ });
+}
+
+/**
+ * It runs each task in series but stops whenever any of the functions were
+ * successful. If one of the tasks were successful, the `callback` will be
+ * passed the result of the successful task. If all tasks fail, the callback
+ * will be passed the error and result (if any) of the final attempt.
+ *
+ * @name tryEach
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection containing functions to
+ * run, each function is passed a `callback(err, result)` it must call on
+ * completion with an error `err` (which can be `null`) and an optional `result`
+ * value.
+ * @param {Function} [callback] - An optional callback which is called when one
+ * of the tasks has succeeded, or all have failed. It receives the `err` and
+ * `result` arguments of the last attempt at completing the `task`. Invoked with
+ * (err, results).
+ * @example
+ * async.tryEach([
+ * function getDataFromFirstWebsite(callback) {
+ * // Try getting the data from the first website
+ * callback(err, data);
+ * },
+ * function getDataFromSecondWebsite(callback) {
+ * // First website failed,
+ * // Try getting the data from the backup website
+ * callback(err, data);
+ * }
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * Now do something with the data.
+ * });
+ *
+ */
+function tryEach(tasks, callback) {
+ var error = null;
+ var result;
+ callback = callback || noop;
+ eachSeries(tasks, function(task, callback) {
+ wrapAsync(task)(function (err, res/*, ...args*/) {
+ if (arguments.length > 2) {
+ result = slice(arguments, 1);
+ } else {
+ result = res;
+ }
+ error = err;
+ callback(!err);
+ });
+ }, function () {
+ callback(error, result);
+ });
+}
+
+/**
+ * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,
+ * unmemoized form. Handy for testing.
+ *
+ * @name unmemoize
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @see [async.memoize]{@link module:Utils.memoize}
+ * @category Util
+ * @param {AsyncFunction} fn - the memoized function
+ * @returns {AsyncFunction} a function that calls the original unmemoized function
+ */
+function unmemoize(fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+}
+
+/**
+ * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when
+ * stopped, or an error occurs.
+ *
+ * @name whilst
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Function} test - synchronous truth test to perform before each
+ * execution of `iteratee`. Invoked with ().
+ * @param {AsyncFunction} iteratee - An async function which is called each time
+ * `test` passes. Invoked with (callback).
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `iteratee` has stopped. `callback`
+ * will be passed an error and any arguments passed to the final `iteratee`'s
+ * callback. Invoked with (err, [results]);
+ * @returns undefined
+ * @example
+ *
+ * var count = 0;
+ * async.whilst(
+ * function() { return count < 5; },
+ * function(callback) {
+ * count++;
+ * setTimeout(function() {
+ * callback(null, count);
+ * }, 1000);
+ * },
+ * function (err, n) {
+ * // 5 seconds have passed, n = 5
+ * }
+ * );
+ */
+function whilst(test, iteratee, callback) {
+ callback = onlyOnce(callback || noop);
+ var _iteratee = wrapAsync(iteratee);
+ if (!test()) return callback(null);
+ var next = function(err/*, ...args*/) {
+ if (err) return callback(err);
+ if (test()) return _iteratee(next);
+ var args = slice(arguments, 1);
+ callback.apply(null, [null].concat(args));
+ };
+ _iteratee(next);
+}
+
+/**
+ * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when
+ * stopped, or an error occurs. `callback` will be passed an error and any
+ * arguments passed to the final `iteratee`'s callback.
+ *
+ * The inverse of [whilst]{@link module:ControlFlow.whilst}.
+ *
+ * @name until
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.whilst]{@link module:ControlFlow.whilst}
+ * @category Control Flow
+ * @param {Function} test - synchronous truth test to perform before each
+ * execution of `iteratee`. Invoked with ().
+ * @param {AsyncFunction} iteratee - An async function which is called each time
+ * `test` fails. Invoked with (callback).
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has passed and repeated execution of `iteratee` has stopped. `callback`
+ * will be passed an error and any arguments passed to the final `iteratee`'s
+ * callback. Invoked with (err, [results]);
+ */
+function until(test, iteratee, callback) {
+ whilst(function() {
+ return !test.apply(this, arguments);
+ }, iteratee, callback);
+}
+
+/**
+ * Runs the `tasks` array of functions in series, each passing their results to
+ * the next in the array. However, if any of the `tasks` pass an error to their
+ * own callback, the next function is not executed, and the main `callback` is
+ * immediately called with the error.
+ *
+ * @name waterfall
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}
+ * to run.
+ * Each function should complete with any number of `result` values.
+ * The `result` values will be passed as arguments, in order, to the next task.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed. This will be passed the results of the last task's
+ * callback. Invoked with (err, [results]).
+ * @returns undefined
+ * @example
+ *
+ * async.waterfall([
+ * function(callback) {
+ * callback(null, 'one', 'two');
+ * },
+ * function(arg1, arg2, callback) {
+ * // arg1 now equals 'one' and arg2 now equals 'two'
+ * callback(null, 'three');
+ * },
+ * function(arg1, callback) {
+ * // arg1 now equals 'three'
+ * callback(null, 'done');
+ * }
+ * ], function (err, result) {
+ * // result now equals 'done'
+ * });
+ *
+ * // Or, with named functions:
+ * async.waterfall([
+ * myFirstFunction,
+ * mySecondFunction,
+ * myLastFunction,
+ * ], function (err, result) {
+ * // result now equals 'done'
+ * });
+ * function myFirstFunction(callback) {
+ * callback(null, 'one', 'two');
+ * }
+ * function mySecondFunction(arg1, arg2, callback) {
+ * // arg1 now equals 'one' and arg2 now equals 'two'
+ * callback(null, 'three');
+ * }
+ * function myLastFunction(arg1, callback) {
+ * // arg1 now equals 'three'
+ * callback(null, 'done');
+ * }
+ */
+var waterfall = function(tasks, callback) {
+ callback = once(callback || noop);
+ if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));
+ if (!tasks.length) return callback();
+ var taskIndex = 0;
+
+ function nextTask(args) {
+ var task = wrapAsync(tasks[taskIndex++]);
+ args.push(onlyOnce(next));
+ task.apply(null, args);
+ }
+
+ function next(err/*, ...args*/) {
+ if (err || taskIndex === tasks.length) {
+ return callback.apply(null, arguments);
+ }
+ nextTask(slice(arguments, 1));
+ }
+
+ nextTask([]);
+};
+
+/**
+ * An "async function" in the context of Async is an asynchronous function with
+ * a variable number of parameters, with the final parameter being a callback.
+ * (`function (arg1, arg2, ..., callback) {}`)
+ * The final callback is of the form `callback(err, results...)`, which must be
+ * called once the function is completed. The callback should be called with a
+ * Error as its first argument to signal that an error occurred.
+ * Otherwise, if no error occurred, it should be called with `null` as the first
+ * argument, and any additional `result` arguments that may apply, to signal
+ * successful completion.
+ * The callback must be called exactly once, ideally on a later tick of the
+ * JavaScript event loop.
+ *
+ * This type of function is also referred to as a "Node-style async function",
+ * or a "continuation passing-style function" (CPS). Most of the methods of this
+ * library are themselves CPS/Node-style async functions, or functions that
+ * return CPS/Node-style async functions.
+ *
+ * Wherever we accept a Node-style async function, we also directly accept an
+ * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.
+ * In this case, the `async` function will not be passed a final callback
+ * argument, and any thrown error will be used as the `err` argument of the
+ * implicit callback, and the return value will be used as the `result` value.
+ * (i.e. a `rejected` of the returned Promise becomes the `err` callback
+ * argument, and a `resolved` value becomes the `result`.)
+ *
+ * Note, due to JavaScript limitations, we can only detect native `async`
+ * functions and not transpilied implementations.
+ * Your environment must have `async`/`await` support for this to work.
+ * (e.g. Node > v7.6, or a recent version of a modern browser).
+ * If you are using `async` functions through a transpiler (e.g. Babel), you
+ * must still wrap the function with [asyncify]{@link module:Utils.asyncify},
+ * because the `async function` will be compiled to an ordinary function that
+ * returns a promise.
+ *
+ * @typedef {Function} AsyncFunction
+ * @static
+ */
+
+/**
+ * Async is a utility module which provides straight-forward, powerful functions
+ * for working with asynchronous JavaScript. Although originally designed for
+ * use with [Node.js](http://nodejs.org) and installable via
+ * `npm install --save async`, it can also be used directly in the browser.
+ * @module async
+ * @see AsyncFunction
+ */
+
+
+/**
+ * A collection of `async` functions for manipulating collections, such as
+ * arrays and objects.
+ * @module Collections
+ */
+
+/**
+ * A collection of `async` functions for controlling the flow through a script.
+ * @module ControlFlow
+ */
+
+/**
+ * A collection of `async` utility functions.
+ * @module Utils
+ */
+
+var index = {
+ apply: apply,
+ applyEach: applyEach,
+ applyEachSeries: applyEachSeries,
+ asyncify: asyncify,
+ auto: auto,
+ autoInject: autoInject,
+ cargo: cargo,
+ compose: compose,
+ concat: concat,
+ concatLimit: concatLimit,
+ concatSeries: concatSeries,
+ constant: constant,
+ detect: detect,
+ detectLimit: detectLimit,
+ detectSeries: detectSeries,
+ dir: dir,
+ doDuring: doDuring,
+ doUntil: doUntil,
+ doWhilst: doWhilst,
+ during: during,
+ each: eachLimit,
+ eachLimit: eachLimit$1,
+ eachOf: eachOf,
+ eachOfLimit: eachOfLimit,
+ eachOfSeries: eachOfSeries,
+ eachSeries: eachSeries,
+ ensureAsync: ensureAsync,
+ every: every,
+ everyLimit: everyLimit,
+ everySeries: everySeries,
+ filter: filter,
+ filterLimit: filterLimit,
+ filterSeries: filterSeries,
+ forever: forever,
+ groupBy: groupBy,
+ groupByLimit: groupByLimit,
+ groupBySeries: groupBySeries,
+ log: log,
+ map: map,
+ mapLimit: mapLimit,
+ mapSeries: mapSeries,
+ mapValues: mapValues,
+ mapValuesLimit: mapValuesLimit,
+ mapValuesSeries: mapValuesSeries,
+ memoize: memoize,
+ nextTick: nextTick,
+ parallel: parallelLimit,
+ parallelLimit: parallelLimit$1,
+ priorityQueue: priorityQueue,
+ queue: queue$1,
+ race: race,
+ reduce: reduce,
+ reduceRight: reduceRight,
+ reflect: reflect,
+ reflectAll: reflectAll,
+ reject: reject,
+ rejectLimit: rejectLimit,
+ rejectSeries: rejectSeries,
+ retry: retry,
+ retryable: retryable,
+ seq: seq,
+ series: series,
+ setImmediate: setImmediate$1,
+ some: some,
+ someLimit: someLimit,
+ someSeries: someSeries,
+ sortBy: sortBy,
+ timeout: timeout,
+ times: times,
+ timesLimit: timeLimit,
+ timesSeries: timesSeries,
+ transform: transform,
+ tryEach: tryEach,
+ unmemoize: unmemoize,
+ until: until,
+ waterfall: waterfall,
+ whilst: whilst,
+
+ // aliases
+ all: every,
+ allLimit: everyLimit,
+ allSeries: everySeries,
+ any: some,
+ anyLimit: someLimit,
+ anySeries: someSeries,
+ find: detect,
+ findLimit: detectLimit,
+ findSeries: detectSeries,
+ forEach: eachLimit,
+ forEachSeries: eachSeries,
+ forEachLimit: eachLimit$1,
+ forEachOf: eachOf,
+ forEachOfSeries: eachOfSeries,
+ forEachOfLimit: eachOfLimit,
+ inject: reduce,
+ foldl: reduce,
+ foldr: reduceRight,
+ select: filter,
+ selectLimit: filterLimit,
+ selectSeries: filterSeries,
+ wrapSync: asyncify
+};
+
+exports['default'] = index;
+exports.apply = apply;
+exports.applyEach = applyEach;
+exports.applyEachSeries = applyEachSeries;
+exports.asyncify = asyncify;
+exports.auto = auto;
+exports.autoInject = autoInject;
+exports.cargo = cargo;
+exports.compose = compose;
+exports.concat = concat;
+exports.concatLimit = concatLimit;
+exports.concatSeries = concatSeries;
+exports.constant = constant;
+exports.detect = detect;
+exports.detectLimit = detectLimit;
+exports.detectSeries = detectSeries;
+exports.dir = dir;
+exports.doDuring = doDuring;
+exports.doUntil = doUntil;
+exports.doWhilst = doWhilst;
+exports.during = during;
+exports.each = eachLimit;
+exports.eachLimit = eachLimit$1;
+exports.eachOf = eachOf;
+exports.eachOfLimit = eachOfLimit;
+exports.eachOfSeries = eachOfSeries;
+exports.eachSeries = eachSeries;
+exports.ensureAsync = ensureAsync;
+exports.every = every;
+exports.everyLimit = everyLimit;
+exports.everySeries = everySeries;
+exports.filter = filter;
+exports.filterLimit = filterLimit;
+exports.filterSeries = filterSeries;
+exports.forever = forever;
+exports.groupBy = groupBy;
+exports.groupByLimit = groupByLimit;
+exports.groupBySeries = groupBySeries;
+exports.log = log;
+exports.map = map;
+exports.mapLimit = mapLimit;
+exports.mapSeries = mapSeries;
+exports.mapValues = mapValues;
+exports.mapValuesLimit = mapValuesLimit;
+exports.mapValuesSeries = mapValuesSeries;
+exports.memoize = memoize;
+exports.nextTick = nextTick;
+exports.parallel = parallelLimit;
+exports.parallelLimit = parallelLimit$1;
+exports.priorityQueue = priorityQueue;
+exports.queue = queue$1;
+exports.race = race;
+exports.reduce = reduce;
+exports.reduceRight = reduceRight;
+exports.reflect = reflect;
+exports.reflectAll = reflectAll;
+exports.reject = reject;
+exports.rejectLimit = rejectLimit;
+exports.rejectSeries = rejectSeries;
+exports.retry = retry;
+exports.retryable = retryable;
+exports.seq = seq;
+exports.series = series;
+exports.setImmediate = setImmediate$1;
+exports.some = some;
+exports.someLimit = someLimit;
+exports.someSeries = someSeries;
+exports.sortBy = sortBy;
+exports.timeout = timeout;
+exports.times = times;
+exports.timesLimit = timeLimit;
+exports.timesSeries = timesSeries;
+exports.transform = transform;
+exports.tryEach = tryEach;
+exports.unmemoize = unmemoize;
+exports.until = until;
+exports.waterfall = waterfall;
+exports.whilst = whilst;
+exports.all = every;
+exports.allLimit = everyLimit;
+exports.allSeries = everySeries;
+exports.any = some;
+exports.anyLimit = someLimit;
+exports.anySeries = someSeries;
+exports.find = detect;
+exports.findLimit = detectLimit;
+exports.findSeries = detectSeries;
+exports.forEach = eachLimit;
+exports.forEachSeries = eachSeries;
+exports.forEachLimit = eachLimit$1;
+exports.forEachOf = eachOf;
+exports.forEachOfSeries = eachOfSeries;
+exports.forEachOfLimit = eachOfLimit;
+exports.inject = reduce;
+exports.foldl = reduce;
+exports.foldr = reduceRight;
+exports.select = filter;
+exports.selectLimit = filterLimit;
+exports.selectSeries = filterSeries;
+exports.wrapSync = asyncify;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+})));
diff --git a/node_modules/@pm2/io/node_modules/async/dist/async.min.js b/node_modules/@pm2/io/node_modules/async/dist/async.min.js
new file mode 100644
index 0000000..0b9e113
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/dist/async.min.js
@@ -0,0 +1,2 @@
+!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.async=n.async||{})}(this,function(n){"use strict";function t(n,t){t|=0;for(var e=Math.max(n.length-t,0),r=Array(e),u=0;u-1&&n%1==0&&n<=Tt}function d(n){return null!=n&&v(n.length)&&!y(n)}function m(){}function g(n){return function(){if(null!==n){var t=n;n=null,t.apply(this,arguments)}}}function b(n,t){for(var e=-1,r=Array(n);++e-1&&n%1==0&&nu?0:u+t),e=e>u?u:e,e<0&&(e+=u),u=t>e?0:e-t>>>0,t>>>=0;for(var i=Array(u);++r=r?n:Z(n,t,e)}function tn(n,t){for(var e=n.length;e--&&J(t,n[e],0)>-1;);return e}function en(n,t){for(var e=-1,r=n.length;++e-1;);return e}function rn(n){return n.split("")}function un(n){return Xe.test(n)}function on(n){return n.match(mr)||[]}function cn(n){return un(n)?on(n):rn(n)}function fn(n){return null==n?"":Y(n)}function an(n,t,e){if(n=fn(n),n&&(e||void 0===t))return n.replace(gr,"");if(!n||!(t=Y(t)))return n;var r=cn(n),u=cn(t),i=en(r,u),o=tn(r,u)+1;return nn(r,i,o).join("")}function ln(n){return n=n.toString().replace(kr,""),n=n.match(br)[2].replace(" ",""),n=n?n.split(jr):[],n=n.map(function(n){return an(n.replace(Sr,""))})}function sn(n,t){var e={};N(n,function(n,t){function r(t,e){var r=K(u,function(n){return t[n]});r.push(e),a(n).apply(null,r)}var u,i=f(n),o=!i&&1===n.length||i&&0===n.length;if(Pt(n))u=n.slice(0,-1),n=n[n.length-1],e[t]=u.concat(u.length>0?r:n);else if(o)e[t]=n;else{if(u=ln(n),0===n.length&&!i&&0===u.length)throw new Error("autoInject task functions require explicit parameters.");i||u.pop(),e[t]=u.concat(r)}}),Ve(e,t)}function pn(){this.head=this.tail=null,this.length=0}function hn(n,t){n.length=1,n.head=n.tail=t}function yn(n,t,e){function r(n,t,e){if(null!=e&&"function"!=typeof e)throw new Error("task callback must be a function");if(s.started=!0,Pt(n)||(n=[n]),0===n.length&&s.idle())return lt(function(){s.drain()});for(var r=0,u=n.length;r0&&c.splice(i,1),u.callback.apply(u,arguments),null!=t&&s.error(t,u.data)}o<=s.concurrency-s.buffer&&s.unsaturated(),s.idle()&&s.drain(),s.process()}}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var i=a(n),o=0,c=[],f=!1,l=!1,s={_tasks:new pn,concurrency:t,payload:e,saturated:m,unsaturated:m,buffer:t/4,empty:m,drain:m,error:m,started:!1,paused:!1,push:function(n,t){r(n,!1,t)},kill:function(){s.drain=m,s._tasks.empty()},unshift:function(n,t){r(n,!0,t)},remove:function(n){s._tasks.remove(n)},process:function(){if(!l){for(l=!0;!s.paused&&o2&&(i=t(arguments,1)),u[e]=i,r(n)})},function(n){r(n,u)})}function Dn(n,t){Vn(Fe,n,t)}function Rn(n,t,e){Vn(q(t),n,e)}function Cn(n,t){if(t=g(t||m),!Pt(n))return t(new TypeError("First argument to race must be an array of functions"));if(!n.length)return t();for(var e=0,r=n.length;er?1:0}var u=a(t);Ie(n,function(n,t){u(n,function(e,r){return e?t(e):void t(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,K(t.sort(r),Bn("value")))})}function Xn(n,t,e){var r=a(n);return ct(function(u,i){function o(){var t=n.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",e&&(r.info=e),f=!0,i(r)}var c,f=!1;u.push(function(){f||(i.apply(null,arguments),clearTimeout(c))}),c=setTimeout(o,t),r.apply(null,u)})}function Yn(n,t,e,r){for(var u=-1,i=iu(uu((t-n)/(e||1)),0),o=Array(i);i--;)o[r?i:++u]=n,n+=e;return o}function Zn(n,t,e,r){var u=a(e);Ue(Yn(0,n,1),t,u,r)}function nt(n,t,e,r){arguments.length<=3&&(r=e,e=t,t=Pt(n)?[]:{}),r=g(r||m);var u=a(e);Fe(n,function(n,e,r){u(t,n,e,r)},function(n){r(n,t)})}function tt(n,e){var r,u=null;e=e||m,Ur(n,function(n,e){a(n)(function(n,i){r=arguments.length>2?t(arguments,1):i,u=n,e(!n)})},function(){e(u,r)})}function et(n){return function(){return(n.unmemoized||n).apply(null,arguments)}}function rt(n,e,r){r=U(r||m);var u=a(e);if(!n())return r(null);var i=function(e){if(e)return r(e);if(n())return u(i);var o=t(arguments,1);r.apply(null,[null].concat(o))};u(i)}function ut(n,t,e){rt(function(){return!n.apply(this,arguments)},t,e)}var it,ot=function(n){var e=t(arguments,1);return function(){var r=t(arguments);return n.apply(null,e.concat(r))}},ct=function(n){return function(){var e=t(arguments),r=e.pop();n.call(this,e,r)}},ft="function"==typeof setImmediate&&setImmediate,at="object"==typeof process&&"function"==typeof process.nextTick;it=ft?setImmediate:at?process.nextTick:r;var lt=u(it),st="function"==typeof Symbol,pt="object"==typeof global&&global&&global.Object===Object&&global,ht="object"==typeof self&&self&&self.Object===Object&&self,yt=pt||ht||Function("return this")(),vt=yt.Symbol,dt=Object.prototype,mt=dt.hasOwnProperty,gt=dt.toString,bt=vt?vt.toStringTag:void 0,jt=Object.prototype,St=jt.toString,kt="[object Null]",Lt="[object Undefined]",Ot=vt?vt.toStringTag:void 0,wt="[object AsyncFunction]",xt="[object Function]",Et="[object GeneratorFunction]",At="[object Proxy]",Tt=9007199254740991,_t={},Bt="function"==typeof Symbol&&Symbol.iterator,Ft=function(n){return Bt&&n[Bt]&&n[Bt]()},It="[object Arguments]",Mt=Object.prototype,Ut=Mt.hasOwnProperty,qt=Mt.propertyIsEnumerable,zt=S(function(){return arguments}())?S:function(n){return j(n)&&Ut.call(n,"callee")&&!qt.call(n,"callee")},Pt=Array.isArray,Vt="object"==typeof n&&n&&!n.nodeType&&n,Dt=Vt&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=Dt&&Dt.exports===Vt,Ct=Rt?yt.Buffer:void 0,$t=Ct?Ct.isBuffer:void 0,Wt=$t||k,Nt=9007199254740991,Qt=/^(?:0|[1-9]\d*)$/,Gt="[object Arguments]",Ht="[object Array]",Jt="[object Boolean]",Kt="[object Date]",Xt="[object Error]",Yt="[object Function]",Zt="[object Map]",ne="[object Number]",te="[object Object]",ee="[object RegExp]",re="[object Set]",ue="[object String]",ie="[object WeakMap]",oe="[object ArrayBuffer]",ce="[object DataView]",fe="[object Float32Array]",ae="[object Float64Array]",le="[object Int8Array]",se="[object Int16Array]",pe="[object Int32Array]",he="[object Uint8Array]",ye="[object Uint8ClampedArray]",ve="[object Uint16Array]",de="[object Uint32Array]",me={};me[fe]=me[ae]=me[le]=me[se]=me[pe]=me[he]=me[ye]=me[ve]=me[de]=!0,me[Gt]=me[Ht]=me[oe]=me[Jt]=me[ce]=me[Kt]=me[Xt]=me[Yt]=me[Zt]=me[ne]=me[te]=me[ee]=me[re]=me[ue]=me[ie]=!1;var ge="object"==typeof n&&n&&!n.nodeType&&n,be=ge&&"object"==typeof module&&module&&!module.nodeType&&module,je=be&&be.exports===ge,Se=je&&pt.process,ke=function(){try{var n=be&&be.require&&be.require("util").types;return n?n:Se&&Se.binding&&Se.binding("util")}catch(n){}}(),Le=ke&&ke.isTypedArray,Oe=Le?w(Le):O,we=Object.prototype,xe=we.hasOwnProperty,Ee=Object.prototype,Ae=A(Object.keys,Object),Te=Object.prototype,_e=Te.hasOwnProperty,Be=P(z,1/0),Fe=function(n,t,e){var r=d(n)?V:Be;r(n,a(t),e)},Ie=D(R),Me=l(Ie),Ue=C(R),qe=P(Ue,1),ze=l(qe),Pe=W(),Ve=function(n,e,r){function u(n,t){j.push(function(){f(n,t)})}function i(){if(0===j.length&&0===v)return r(null,y);for(;j.length&&v2&&(u=t(arguments,1)),e){var i={};N(y,function(n,t){i[t]=n}),i[n]=u,d=!0,b=Object.create(null),r(e,i)}else y[n]=u,c(n)});v++;var i=a(e[e.length-1]);e.length>1?i(y,u):i(u)}}function l(){for(var n,t=0;S.length;)n=S.pop(),t++,$(s(n),function(n){0===--k[n]&&S.push(n)});if(t!==h)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function s(t){var e=[];return N(n,function(n,r){Pt(n)&&J(n,t,0)>=0&&e.push(r)}),e}"function"==typeof e&&(r=e,e=null),r=g(r||m);var p=_(n),h=p.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=!1,b=Object.create(null),j=[],S=[],k={};N(n,function(t,e){if(!Pt(t))return u(e,[t]),void S.push(e);var r=t.slice(0,t.length-1),i=r.length;return 0===i?(u(e,t),void S.push(e)):(k[e]=i,void $(r,function(c){if(!n[c])throw new Error("async.auto task `"+e+"` has a non-existent dependency `"+c+"` in "+r.join(", "));o(c,function(){i--,0===i&&u(e,t)})}))}),l(),i()},De="[object Symbol]",Re=1/0,Ce=vt?vt.prototype:void 0,$e=Ce?Ce.toString:void 0,We="\\ud800-\\udfff",Ne="\\u0300-\\u036f",Qe="\\ufe20-\\ufe2f",Ge="\\u20d0-\\u20ff",He=Ne+Qe+Ge,Je="\\ufe0e\\ufe0f",Ke="\\u200d",Xe=RegExp("["+Ke+We+He+Je+"]"),Ye="\\ud800-\\udfff",Ze="\\u0300-\\u036f",nr="\\ufe20-\\ufe2f",tr="\\u20d0-\\u20ff",er=Ze+nr+tr,rr="\\ufe0e\\ufe0f",ur="["+Ye+"]",ir="["+er+"]",or="\\ud83c[\\udffb-\\udfff]",cr="(?:"+ir+"|"+or+")",fr="[^"+Ye+"]",ar="(?:\\ud83c[\\udde6-\\uddff]){2}",lr="[\\ud800-\\udbff][\\udc00-\\udfff]",sr="\\u200d",pr=cr+"?",hr="["+rr+"]?",yr="(?:"+sr+"(?:"+[fr,ar,lr].join("|")+")"+hr+pr+")*",vr=hr+pr+yr,dr="(?:"+[fr+ir+"?",ir,ar,lr,ur].join("|")+")",mr=RegExp(or+"(?="+or+")|"+dr+vr,"g"),gr=/^\s+|\s+$/g,br=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,jr=/,/,Sr=/(=.+)?(\s*)$/,kr=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;pn.prototype.removeLink=function(n){return n.prev?n.prev.next=n.next:this.head=n.next,n.next?n.next.prev=n.prev:this.tail=n.prev,n.prev=n.next=null,this.length-=1,n},pn.prototype.empty=function(){for(;this.head;)this.shift();return this},pn.prototype.insertAfter=function(n,t){t.prev=n,t.next=n.next,n.next?n.next.prev=t:this.tail=t,n.next=t,this.length+=1},pn.prototype.insertBefore=function(n,t){t.prev=n.prev,t.next=n,n.prev?n.prev.next=t:this.head=t,n.prev=t,this.length+=1},pn.prototype.unshift=function(n){this.head?this.insertBefore(this.head,n):hn(this,n)},pn.prototype.push=function(n){this.tail?this.insertAfter(this.tail,n):hn(this,n)},pn.prototype.shift=function(){return this.head&&this.removeLink(this.head)},pn.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},pn.prototype.toArray=function(){for(var n=Array(this.length),t=this.head,e=0;e=u.priority;)u=u.next;for(var i=0,o=n.length;i 32 ) {
+ * console.log('This file name is too long');
+ * callback('File name too long');
+ * } else {
+ * // Do work to process file here
+ * console.log('File processed');
+ * callback();
+ * }
+ * }, function(err) {
+ * // if any of the file processing produced an error, err would equal that error
+ * if( err ) {
+ * // One of the iterations produced an error.
+ * // All processing will now stop.
+ * console.log('A file failed to process');
+ * } else {
+ * console.log('All files have been processed successfully');
+ * }
+ * });
+ */
+function eachLimit(coll, iteratee, callback) {
+ (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/eachLimit.js b/node_modules/@pm2/io/node_modules/async/eachLimit.js
new file mode 100644
index 0000000..fff721b
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/eachLimit.js
@@ -0,0 +1,45 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = eachLimit;
+
+var _eachOfLimit = require('./internal/eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _withoutIndex = require('./internal/withoutIndex');
+
+var _withoutIndex2 = _interopRequireDefault(_withoutIndex);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name eachLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfLimit`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachLimit(coll, limit, iteratee, callback) {
+ (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/eachOf.js b/node_modules/@pm2/io/node_modules/async/eachOf.js
new file mode 100644
index 0000000..055b9bd
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/eachOf.js
@@ -0,0 +1,111 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (coll, iteratee, callback) {
+ var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;
+ eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback);
+};
+
+var _isArrayLike = require('lodash/isArrayLike');
+
+var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
+
+var _breakLoop = require('./internal/breakLoop');
+
+var _breakLoop2 = _interopRequireDefault(_breakLoop);
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+// eachOf implementation optimized for array-likes
+function eachOfArrayLike(coll, iteratee, callback) {
+ callback = (0, _once2.default)(callback || _noop2.default);
+ var index = 0,
+ completed = 0,
+ length = coll.length;
+ if (length === 0) {
+ callback(null);
+ }
+
+ function iteratorCallback(err, value) {
+ if (err) {
+ callback(err);
+ } else if (++completed === length || value === _breakLoop2.default) {
+ callback(null);
+ }
+ }
+
+ for (; index < length; index++) {
+ iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));
+ }
+}
+
+// a generic version of eachOf which can handle array, object, and iterator cases.
+var eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity);
+
+/**
+ * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument
+ * to the iteratee.
+ *
+ * @name eachOf
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEachOf
+ * @category Collection
+ * @see [async.each]{@link module:Collections.each}
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each
+ * item in `coll`.
+ * The `key` is the item's key, or index in the case of an array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+ * var configs = {};
+ *
+ * async.forEachOf(obj, function (value, key, callback) {
+ * fs.readFile(__dirname + value, "utf8", function (err, data) {
+ * if (err) return callback(err);
+ * try {
+ * configs[key] = JSON.parse(data);
+ * } catch (e) {
+ * return callback(e);
+ * }
+ * callback();
+ * });
+ * }, function (err) {
+ * if (err) console.error(err.message);
+ * // configs is now a map of JSON data
+ * doSomethingWith(configs);
+ * });
+ */
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/eachOfLimit.js b/node_modules/@pm2/io/node_modules/async/eachOfLimit.js
new file mode 100644
index 0000000..30a1329
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/eachOfLimit.js
@@ -0,0 +1,41 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = eachOfLimit;
+
+var _eachOfLimit2 = require('./internal/eachOfLimit');
+
+var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name eachOfLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.eachOf]{@link module:Collections.eachOf}
+ * @alias forEachOfLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`. The `key` is the item's key, or index in the case of an
+ * array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachOfLimit(coll, limit, iteratee, callback) {
+ (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/eachOfSeries.js b/node_modules/@pm2/io/node_modules/async/eachOfSeries.js
new file mode 100644
index 0000000..9dfd711
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/eachOfSeries.js
@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.
+ *
+ * @name eachOfSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.eachOf]{@link module:Collections.eachOf}
+ * @alias forEachOfSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Invoked with (err).
+ */
+exports.default = (0, _doLimit2.default)(_eachOfLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/eachSeries.js b/node_modules/@pm2/io/node_modules/async/eachSeries.js
new file mode 100644
index 0000000..55c7840
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/eachSeries.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _eachLimit = require('./eachLimit');
+
+var _eachLimit2 = _interopRequireDefault(_eachLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.
+ *
+ * @name eachSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfSeries`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+exports.default = (0, _doLimit2.default)(_eachLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/ensureAsync.js b/node_modules/@pm2/io/node_modules/async/ensureAsync.js
new file mode 100644
index 0000000..1f57aec
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/ensureAsync.js
@@ -0,0 +1,73 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = ensureAsync;
+
+var _setImmediate = require('./internal/setImmediate');
+
+var _setImmediate2 = _interopRequireDefault(_setImmediate);
+
+var _initialParams = require('./internal/initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Wrap an async function and ensure it calls its callback on a later tick of
+ * the event loop. If the function already calls its callback on a next tick,
+ * no extra deferral is added. This is useful for preventing stack overflows
+ * (`RangeError: Maximum call stack size exceeded`) and generally keeping
+ * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)
+ * contained. ES2017 `async` functions are returned as-is -- they are immune
+ * to Zalgo's corrupting influences, as they always resolve on a later tick.
+ *
+ * @name ensureAsync
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} fn - an async function, one that expects a node-style
+ * callback as its last argument.
+ * @returns {AsyncFunction} Returns a wrapped function with the exact same call
+ * signature as the function passed in.
+ * @example
+ *
+ * function sometimesAsync(arg, callback) {
+ * if (cache[arg]) {
+ * return callback(null, cache[arg]); // this would be synchronous!!
+ * } else {
+ * doSomeIO(arg, callback); // this IO would be asynchronous
+ * }
+ * }
+ *
+ * // this has a risk of stack overflows if many results are cached in a row
+ * async.mapSeries(args, sometimesAsync, done);
+ *
+ * // this will defer sometimesAsync's callback if necessary,
+ * // preventing stack overflows
+ * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);
+ */
+function ensureAsync(fn) {
+ if ((0, _wrapAsync.isAsync)(fn)) return fn;
+ return (0, _initialParams2.default)(function (args, callback) {
+ var sync = true;
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ (0, _setImmediate2.default)(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ fn.apply(this, args);
+ sync = false;
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/every.js b/node_modules/@pm2/io/node_modules/async/every.js
new file mode 100644
index 0000000..d0565b0
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/every.js
@@ -0,0 +1,50 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _notId = require('./internal/notId');
+
+var _notId2 = _interopRequireDefault(_notId);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns `true` if every element in `coll` satisfies an async test. If any
+ * iteratee call returns `false`, the main `callback` is immediately called.
+ *
+ * @name every
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias all
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ * @example
+ *
+ * async.every(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // if result is true then every file exists
+ * });
+ */
+exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/everyLimit.js b/node_modules/@pm2/io/node_modules/async/everyLimit.js
new file mode 100644
index 0000000..a1a759a
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/everyLimit.js
@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _notId = require('./internal/notId');
+
+var _notId2 = _interopRequireDefault(_notId);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name everyLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/everySeries.js b/node_modules/@pm2/io/node_modules/async/everySeries.js
new file mode 100644
index 0000000..23bfebb
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/everySeries.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _everyLimit = require('./everyLimit');
+
+var _everyLimit2 = _interopRequireDefault(_everyLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.
+ *
+ * @name everySeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in series.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_everyLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/filter.js b/node_modules/@pm2/io/node_modules/async/filter.js
new file mode 100644
index 0000000..54772d5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/filter.js
@@ -0,0 +1,45 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _filter = require('./internal/filter');
+
+var _filter2 = _interopRequireDefault(_filter);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns a new array of all the values in `coll` which pass an async truth
+ * test. This operation is performed in parallel, but the results array will be
+ * in the same order as the original.
+ *
+ * @name filter
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias select
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ * @example
+ *
+ * async.filter(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, results) {
+ * // results now equals an array of the existing files
+ * });
+ */
+exports.default = (0, _doParallel2.default)(_filter2.default);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/filterLimit.js b/node_modules/@pm2/io/node_modules/async/filterLimit.js
new file mode 100644
index 0000000..06216f7
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/filterLimit.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _filter = require('./internal/filter');
+
+var _filter2 = _interopRequireDefault(_filter);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name filterLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @alias selectLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+exports.default = (0, _doParallelLimit2.default)(_filter2.default);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/filterSeries.js b/node_modules/@pm2/io/node_modules/async/filterSeries.js
new file mode 100644
index 0000000..e48d966
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/filterSeries.js
@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _filterLimit = require('./filterLimit');
+
+var _filterLimit2 = _interopRequireDefault(_filterLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.
+ *
+ * @name filterSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @alias selectSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results)
+ */
+exports.default = (0, _doLimit2.default)(_filterLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/find.js b/node_modules/@pm2/io/node_modules/async/find.js
new file mode 100644
index 0000000..db46783
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/find.js
@@ -0,0 +1,61 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _findGetResult = require('./internal/findGetResult');
+
+var _findGetResult2 = _interopRequireDefault(_findGetResult);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns the first value in `coll` that passes an async truth test. The
+ * `iteratee` is applied in parallel, meaning the first iteratee to return
+ * `true` will fire the detect `callback` with that result. That means the
+ * result might not be the first item in the original `coll` (in terms of order)
+ * that passes the test.
+
+ * If order within the original `coll` is important, then look at
+ * [`detectSeries`]{@link module:Collections.detectSeries}.
+ *
+ * @name detect
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias find
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ * @example
+ *
+ * async.detect(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // result now equals the first file in the list that exists
+ * });
+ */
+exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/findLimit.js b/node_modules/@pm2/io/node_modules/async/findLimit.js
new file mode 100644
index 0000000..6bf6560
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/findLimit.js
@@ -0,0 +1,48 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _findGetResult = require('./internal/findGetResult');
+
+var _findGetResult2 = _interopRequireDefault(_findGetResult);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name detectLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.detect]{@link module:Collections.detect}
+ * @alias findLimit
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ */
+exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/findSeries.js b/node_modules/@pm2/io/node_modules/async/findSeries.js
new file mode 100644
index 0000000..6fe16c9
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/findSeries.js
@@ -0,0 +1,38 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _detectLimit = require('./detectLimit');
+
+var _detectLimit2 = _interopRequireDefault(_detectLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.
+ *
+ * @name detectSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.detect]{@link module:Collections.detect}
+ * @alias findSeries
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_detectLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/foldl.js b/node_modules/@pm2/io/node_modules/async/foldl.js
new file mode 100644
index 0000000..3fb8019
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/foldl.js
@@ -0,0 +1,78 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = reduce;
+
+var _eachOfSeries = require('./eachOfSeries');
+
+var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Reduces `coll` into a single value using an async `iteratee` to return each
+ * successive step. `memo` is the initial state of the reduction. This function
+ * only operates in series.
+ *
+ * For performance reasons, it may make sense to split a call to this function
+ * into a parallel map, and then use the normal `Array.prototype.reduce` on the
+ * results. This function is for situations where each step in the reduction
+ * needs to be async; if you can get the data before reducing it, then it's
+ * probably a good idea to do so.
+ *
+ * @name reduce
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias inject
+ * @alias foldl
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {*} memo - The initial state of the reduction.
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * array to produce the next step in the reduction.
+ * The `iteratee` should complete with the next state of the reduction.
+ * If the iteratee complete with an error, the reduction is stopped and the
+ * main `callback` is immediately called with the error.
+ * Invoked with (memo, item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the reduced value. Invoked with
+ * (err, result).
+ * @example
+ *
+ * async.reduce([1,2,3], 0, function(memo, item, callback) {
+ * // pointless async:
+ * process.nextTick(function() {
+ * callback(null, memo + item)
+ * });
+ * }, function(err, result) {
+ * // result is now equal to the last value of memo, which is 6
+ * });
+ */
+function reduce(coll, memo, iteratee, callback) {
+ callback = (0, _once2.default)(callback || _noop2.default);
+ var _iteratee = (0, _wrapAsync2.default)(iteratee);
+ (0, _eachOfSeries2.default)(coll, function (x, i, callback) {
+ _iteratee(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/foldr.js b/node_modules/@pm2/io/node_modules/async/foldr.js
new file mode 100644
index 0000000..3d17d32
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/foldr.js
@@ -0,0 +1,44 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = reduceRight;
+
+var _reduce = require('./reduce');
+
+var _reduce2 = _interopRequireDefault(_reduce);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.
+ *
+ * @name reduceRight
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reduce]{@link module:Collections.reduce}
+ * @alias foldr
+ * @category Collection
+ * @param {Array} array - A collection to iterate over.
+ * @param {*} memo - The initial state of the reduction.
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * array to produce the next step in the reduction.
+ * The `iteratee` should complete with the next state of the reduction.
+ * If the iteratee complete with an error, the reduction is stopped and the
+ * main `callback` is immediately called with the error.
+ * Invoked with (memo, item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the reduced value. Invoked with
+ * (err, result).
+ */
+function reduceRight(array, memo, iteratee, callback) {
+ var reversed = (0, _slice2.default)(array).reverse();
+ (0, _reduce2.default)(reversed, memo, iteratee, callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/forEach.js b/node_modules/@pm2/io/node_modules/async/forEach.js
new file mode 100644
index 0000000..4b20af3
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/forEach.js
@@ -0,0 +1,82 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = eachLimit;
+
+var _eachOf = require('./eachOf');
+
+var _eachOf2 = _interopRequireDefault(_eachOf);
+
+var _withoutIndex = require('./internal/withoutIndex');
+
+var _withoutIndex2 = _interopRequireDefault(_withoutIndex);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Applies the function `iteratee` to each item in `coll`, in parallel.
+ * The `iteratee` is called with an item from the list, and a callback for when
+ * it has finished. If the `iteratee` passes an error to its `callback`, the
+ * main `callback` (for the `each` function) is immediately called with the
+ * error.
+ *
+ * Note, that since this function applies `iteratee` to each item in parallel,
+ * there is no guarantee that the iteratee functions will complete in order.
+ *
+ * @name each
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEach
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to
+ * each item in `coll`. Invoked with (item, callback).
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOf`.
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * // assuming openFiles is an array of file names and saveFile is a function
+ * // to save the modified contents of that file:
+ *
+ * async.each(openFiles, saveFile, function(err){
+ * // if any of the saves produced an error, err would equal that error
+ * });
+ *
+ * // assuming openFiles is an array of file names
+ * async.each(openFiles, function(file, callback) {
+ *
+ * // Perform operation on file here.
+ * console.log('Processing file ' + file);
+ *
+ * if( file.length > 32 ) {
+ * console.log('This file name is too long');
+ * callback('File name too long');
+ * } else {
+ * // Do work to process file here
+ * console.log('File processed');
+ * callback();
+ * }
+ * }, function(err) {
+ * // if any of the file processing produced an error, err would equal that error
+ * if( err ) {
+ * // One of the iterations produced an error.
+ * // All processing will now stop.
+ * console.log('A file failed to process');
+ * } else {
+ * console.log('All files have been processed successfully');
+ * }
+ * });
+ */
+function eachLimit(coll, iteratee, callback) {
+ (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/forEachLimit.js b/node_modules/@pm2/io/node_modules/async/forEachLimit.js
new file mode 100644
index 0000000..fff721b
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/forEachLimit.js
@@ -0,0 +1,45 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = eachLimit;
+
+var _eachOfLimit = require('./internal/eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _withoutIndex = require('./internal/withoutIndex');
+
+var _withoutIndex2 = _interopRequireDefault(_withoutIndex);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name eachLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfLimit`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachLimit(coll, limit, iteratee, callback) {
+ (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/forEachOf.js b/node_modules/@pm2/io/node_modules/async/forEachOf.js
new file mode 100644
index 0000000..055b9bd
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/forEachOf.js
@@ -0,0 +1,111 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (coll, iteratee, callback) {
+ var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;
+ eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback);
+};
+
+var _isArrayLike = require('lodash/isArrayLike');
+
+var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
+
+var _breakLoop = require('./internal/breakLoop');
+
+var _breakLoop2 = _interopRequireDefault(_breakLoop);
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+// eachOf implementation optimized for array-likes
+function eachOfArrayLike(coll, iteratee, callback) {
+ callback = (0, _once2.default)(callback || _noop2.default);
+ var index = 0,
+ completed = 0,
+ length = coll.length;
+ if (length === 0) {
+ callback(null);
+ }
+
+ function iteratorCallback(err, value) {
+ if (err) {
+ callback(err);
+ } else if (++completed === length || value === _breakLoop2.default) {
+ callback(null);
+ }
+ }
+
+ for (; index < length; index++) {
+ iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));
+ }
+}
+
+// a generic version of eachOf which can handle array, object, and iterator cases.
+var eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity);
+
+/**
+ * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument
+ * to the iteratee.
+ *
+ * @name eachOf
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEachOf
+ * @category Collection
+ * @see [async.each]{@link module:Collections.each}
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each
+ * item in `coll`.
+ * The `key` is the item's key, or index in the case of an array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+ * var configs = {};
+ *
+ * async.forEachOf(obj, function (value, key, callback) {
+ * fs.readFile(__dirname + value, "utf8", function (err, data) {
+ * if (err) return callback(err);
+ * try {
+ * configs[key] = JSON.parse(data);
+ * } catch (e) {
+ * return callback(e);
+ * }
+ * callback();
+ * });
+ * }, function (err) {
+ * if (err) console.error(err.message);
+ * // configs is now a map of JSON data
+ * doSomethingWith(configs);
+ * });
+ */
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/forEachOfLimit.js b/node_modules/@pm2/io/node_modules/async/forEachOfLimit.js
new file mode 100644
index 0000000..30a1329
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/forEachOfLimit.js
@@ -0,0 +1,41 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = eachOfLimit;
+
+var _eachOfLimit2 = require('./internal/eachOfLimit');
+
+var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name eachOfLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.eachOf]{@link module:Collections.eachOf}
+ * @alias forEachOfLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`. The `key` is the item's key, or index in the case of an
+ * array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachOfLimit(coll, limit, iteratee, callback) {
+ (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/forEachOfSeries.js b/node_modules/@pm2/io/node_modules/async/forEachOfSeries.js
new file mode 100644
index 0000000..9dfd711
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/forEachOfSeries.js
@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.
+ *
+ * @name eachOfSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.eachOf]{@link module:Collections.eachOf}
+ * @alias forEachOfSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Invoked with (err).
+ */
+exports.default = (0, _doLimit2.default)(_eachOfLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/forEachSeries.js b/node_modules/@pm2/io/node_modules/async/forEachSeries.js
new file mode 100644
index 0000000..55c7840
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/forEachSeries.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _eachLimit = require('./eachLimit');
+
+var _eachLimit2 = _interopRequireDefault(_eachLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.
+ *
+ * @name eachSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfSeries`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+exports.default = (0, _doLimit2.default)(_eachLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/forever.js b/node_modules/@pm2/io/node_modules/async/forever.js
new file mode 100644
index 0000000..6c7b8a4
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/forever.js
@@ -0,0 +1,65 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = forever;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _ensureAsync = require('./ensureAsync');
+
+var _ensureAsync2 = _interopRequireDefault(_ensureAsync);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Calls the asynchronous function `fn` with a callback parameter that allows it
+ * to call itself again, in series, indefinitely.
+
+ * If an error is passed to the callback then `errback` is called with the
+ * error, and execution stops, otherwise it will never be called.
+ *
+ * @name forever
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {AsyncFunction} fn - an async function to call repeatedly.
+ * Invoked with (next).
+ * @param {Function} [errback] - when `fn` passes an error to it's callback,
+ * this function will be called, and execution stops. Invoked with (err).
+ * @example
+ *
+ * async.forever(
+ * function(next) {
+ * // next is suitable for passing to things that need a callback(err [, whatever]);
+ * // it will result in this function being called again.
+ * },
+ * function(err) {
+ * // if next is called with a value in its first parameter, it will appear
+ * // in here as 'err', and execution will stop.
+ * }
+ * );
+ */
+function forever(fn, errback) {
+ var done = (0, _onlyOnce2.default)(errback || _noop2.default);
+ var task = (0, _wrapAsync2.default)((0, _ensureAsync2.default)(fn));
+
+ function next(err) {
+ if (err) return done(err);
+ task(next);
+ }
+ next();
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/groupBy.js b/node_modules/@pm2/io/node_modules/async/groupBy.js
new file mode 100644
index 0000000..755cba7
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/groupBy.js
@@ -0,0 +1,54 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+var _groupByLimit = require('./groupByLimit');
+
+var _groupByLimit2 = _interopRequireDefault(_groupByLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns a new object, where each value corresponds to an array of items, from
+ * `coll`, that returned the corresponding key. That is, the keys of the object
+ * correspond to the values passed to the `iteratee` callback.
+ *
+ * Note: Since this function applies the `iteratee` to each item in parallel,
+ * there is no guarantee that the `iteratee` functions will complete in order.
+ * However, the values for each key in the `result` will be in the same order as
+ * the original `coll`. For Objects, the values will roughly be in the order of
+ * the original Objects' keys (but this can vary across JavaScript engines).
+ *
+ * @name groupBy
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a `key` to group the value under.
+ * Invoked with (value, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Result is an `Object` whoses
+ * properties are arrays of values which returned the corresponding key.
+ * @example
+ *
+ * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) {
+ * db.findById(userId, function(err, user) {
+ * if (err) return callback(err);
+ * return callback(null, user.age);
+ * });
+ * }, function(err, result) {
+ * // result is object containing the userIds grouped by age
+ * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']};
+ * });
+ */
+exports.default = (0, _doLimit2.default)(_groupByLimit2.default, Infinity);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/groupByLimit.js b/node_modules/@pm2/io/node_modules/async/groupByLimit.js
new file mode 100644
index 0000000..fec13f8
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/groupByLimit.js
@@ -0,0 +1,71 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (coll, limit, iteratee, callback) {
+ callback = callback || _noop2.default;
+ var _iteratee = (0, _wrapAsync2.default)(iteratee);
+ (0, _mapLimit2.default)(coll, limit, function (val, callback) {
+ _iteratee(val, function (err, key) {
+ if (err) return callback(err);
+ return callback(null, { key: key, val: val });
+ });
+ }, function (err, mapResults) {
+ var result = {};
+ // from MDN, handle object having an `hasOwnProperty` prop
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+
+ for (var i = 0; i < mapResults.length; i++) {
+ if (mapResults[i]) {
+ var key = mapResults[i].key;
+ var val = mapResults[i].val;
+
+ if (hasOwnProperty.call(result, key)) {
+ result[key].push(val);
+ } else {
+ result[key] = [val];
+ }
+ }
+ }
+
+ return callback(err, result);
+ });
+};
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _mapLimit = require('./mapLimit');
+
+var _mapLimit2 = _interopRequireDefault(_mapLimit);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+;
+/**
+ * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name groupByLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.groupBy]{@link module:Collections.groupBy}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a `key` to group the value under.
+ * Invoked with (value, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Result is an `Object` whoses
+ * properties are arrays of values which returned the corresponding key.
+ */
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/groupBySeries.js b/node_modules/@pm2/io/node_modules/async/groupBySeries.js
new file mode 100644
index 0000000..b94805e
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/groupBySeries.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+var _groupByLimit = require('./groupByLimit');
+
+var _groupByLimit2 = _interopRequireDefault(_groupByLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.
+ *
+ * @name groupBySeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.groupBy]{@link module:Collections.groupBy}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a `key` to group the value under.
+ * Invoked with (value, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Result is an `Object` whoses
+ * properties are arrays of values which returned the corresponding key.
+ */
+exports.default = (0, _doLimit2.default)(_groupByLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/index.js b/node_modules/@pm2/io/node_modules/async/index.js
new file mode 100644
index 0000000..c39d8d8
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/index.js
@@ -0,0 +1,582 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined;
+
+var _apply = require('./apply');
+
+var _apply2 = _interopRequireDefault(_apply);
+
+var _applyEach = require('./applyEach');
+
+var _applyEach2 = _interopRequireDefault(_applyEach);
+
+var _applyEachSeries = require('./applyEachSeries');
+
+var _applyEachSeries2 = _interopRequireDefault(_applyEachSeries);
+
+var _asyncify = require('./asyncify');
+
+var _asyncify2 = _interopRequireDefault(_asyncify);
+
+var _auto = require('./auto');
+
+var _auto2 = _interopRequireDefault(_auto);
+
+var _autoInject = require('./autoInject');
+
+var _autoInject2 = _interopRequireDefault(_autoInject);
+
+var _cargo = require('./cargo');
+
+var _cargo2 = _interopRequireDefault(_cargo);
+
+var _compose = require('./compose');
+
+var _compose2 = _interopRequireDefault(_compose);
+
+var _concat = require('./concat');
+
+var _concat2 = _interopRequireDefault(_concat);
+
+var _concatLimit = require('./concatLimit');
+
+var _concatLimit2 = _interopRequireDefault(_concatLimit);
+
+var _concatSeries = require('./concatSeries');
+
+var _concatSeries2 = _interopRequireDefault(_concatSeries);
+
+var _constant = require('./constant');
+
+var _constant2 = _interopRequireDefault(_constant);
+
+var _detect = require('./detect');
+
+var _detect2 = _interopRequireDefault(_detect);
+
+var _detectLimit = require('./detectLimit');
+
+var _detectLimit2 = _interopRequireDefault(_detectLimit);
+
+var _detectSeries = require('./detectSeries');
+
+var _detectSeries2 = _interopRequireDefault(_detectSeries);
+
+var _dir = require('./dir');
+
+var _dir2 = _interopRequireDefault(_dir);
+
+var _doDuring = require('./doDuring');
+
+var _doDuring2 = _interopRequireDefault(_doDuring);
+
+var _doUntil = require('./doUntil');
+
+var _doUntil2 = _interopRequireDefault(_doUntil);
+
+var _doWhilst = require('./doWhilst');
+
+var _doWhilst2 = _interopRequireDefault(_doWhilst);
+
+var _during = require('./during');
+
+var _during2 = _interopRequireDefault(_during);
+
+var _each = require('./each');
+
+var _each2 = _interopRequireDefault(_each);
+
+var _eachLimit = require('./eachLimit');
+
+var _eachLimit2 = _interopRequireDefault(_eachLimit);
+
+var _eachOf = require('./eachOf');
+
+var _eachOf2 = _interopRequireDefault(_eachOf);
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _eachOfSeries = require('./eachOfSeries');
+
+var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
+
+var _eachSeries = require('./eachSeries');
+
+var _eachSeries2 = _interopRequireDefault(_eachSeries);
+
+var _ensureAsync = require('./ensureAsync');
+
+var _ensureAsync2 = _interopRequireDefault(_ensureAsync);
+
+var _every = require('./every');
+
+var _every2 = _interopRequireDefault(_every);
+
+var _everyLimit = require('./everyLimit');
+
+var _everyLimit2 = _interopRequireDefault(_everyLimit);
+
+var _everySeries = require('./everySeries');
+
+var _everySeries2 = _interopRequireDefault(_everySeries);
+
+var _filter = require('./filter');
+
+var _filter2 = _interopRequireDefault(_filter);
+
+var _filterLimit = require('./filterLimit');
+
+var _filterLimit2 = _interopRequireDefault(_filterLimit);
+
+var _filterSeries = require('./filterSeries');
+
+var _filterSeries2 = _interopRequireDefault(_filterSeries);
+
+var _forever = require('./forever');
+
+var _forever2 = _interopRequireDefault(_forever);
+
+var _groupBy = require('./groupBy');
+
+var _groupBy2 = _interopRequireDefault(_groupBy);
+
+var _groupByLimit = require('./groupByLimit');
+
+var _groupByLimit2 = _interopRequireDefault(_groupByLimit);
+
+var _groupBySeries = require('./groupBySeries');
+
+var _groupBySeries2 = _interopRequireDefault(_groupBySeries);
+
+var _log = require('./log');
+
+var _log2 = _interopRequireDefault(_log);
+
+var _map = require('./map');
+
+var _map2 = _interopRequireDefault(_map);
+
+var _mapLimit = require('./mapLimit');
+
+var _mapLimit2 = _interopRequireDefault(_mapLimit);
+
+var _mapSeries = require('./mapSeries');
+
+var _mapSeries2 = _interopRequireDefault(_mapSeries);
+
+var _mapValues = require('./mapValues');
+
+var _mapValues2 = _interopRequireDefault(_mapValues);
+
+var _mapValuesLimit = require('./mapValuesLimit');
+
+var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit);
+
+var _mapValuesSeries = require('./mapValuesSeries');
+
+var _mapValuesSeries2 = _interopRequireDefault(_mapValuesSeries);
+
+var _memoize = require('./memoize');
+
+var _memoize2 = _interopRequireDefault(_memoize);
+
+var _nextTick = require('./nextTick');
+
+var _nextTick2 = _interopRequireDefault(_nextTick);
+
+var _parallel = require('./parallel');
+
+var _parallel2 = _interopRequireDefault(_parallel);
+
+var _parallelLimit = require('./parallelLimit');
+
+var _parallelLimit2 = _interopRequireDefault(_parallelLimit);
+
+var _priorityQueue = require('./priorityQueue');
+
+var _priorityQueue2 = _interopRequireDefault(_priorityQueue);
+
+var _queue = require('./queue');
+
+var _queue2 = _interopRequireDefault(_queue);
+
+var _race = require('./race');
+
+var _race2 = _interopRequireDefault(_race);
+
+var _reduce = require('./reduce');
+
+var _reduce2 = _interopRequireDefault(_reduce);
+
+var _reduceRight = require('./reduceRight');
+
+var _reduceRight2 = _interopRequireDefault(_reduceRight);
+
+var _reflect = require('./reflect');
+
+var _reflect2 = _interopRequireDefault(_reflect);
+
+var _reflectAll = require('./reflectAll');
+
+var _reflectAll2 = _interopRequireDefault(_reflectAll);
+
+var _reject = require('./reject');
+
+var _reject2 = _interopRequireDefault(_reject);
+
+var _rejectLimit = require('./rejectLimit');
+
+var _rejectLimit2 = _interopRequireDefault(_rejectLimit);
+
+var _rejectSeries = require('./rejectSeries');
+
+var _rejectSeries2 = _interopRequireDefault(_rejectSeries);
+
+var _retry = require('./retry');
+
+var _retry2 = _interopRequireDefault(_retry);
+
+var _retryable = require('./retryable');
+
+var _retryable2 = _interopRequireDefault(_retryable);
+
+var _seq = require('./seq');
+
+var _seq2 = _interopRequireDefault(_seq);
+
+var _series = require('./series');
+
+var _series2 = _interopRequireDefault(_series);
+
+var _setImmediate = require('./setImmediate');
+
+var _setImmediate2 = _interopRequireDefault(_setImmediate);
+
+var _some = require('./some');
+
+var _some2 = _interopRequireDefault(_some);
+
+var _someLimit = require('./someLimit');
+
+var _someLimit2 = _interopRequireDefault(_someLimit);
+
+var _someSeries = require('./someSeries');
+
+var _someSeries2 = _interopRequireDefault(_someSeries);
+
+var _sortBy = require('./sortBy');
+
+var _sortBy2 = _interopRequireDefault(_sortBy);
+
+var _timeout = require('./timeout');
+
+var _timeout2 = _interopRequireDefault(_timeout);
+
+var _times = require('./times');
+
+var _times2 = _interopRequireDefault(_times);
+
+var _timesLimit = require('./timesLimit');
+
+var _timesLimit2 = _interopRequireDefault(_timesLimit);
+
+var _timesSeries = require('./timesSeries');
+
+var _timesSeries2 = _interopRequireDefault(_timesSeries);
+
+var _transform = require('./transform');
+
+var _transform2 = _interopRequireDefault(_transform);
+
+var _tryEach = require('./tryEach');
+
+var _tryEach2 = _interopRequireDefault(_tryEach);
+
+var _unmemoize = require('./unmemoize');
+
+var _unmemoize2 = _interopRequireDefault(_unmemoize);
+
+var _until = require('./until');
+
+var _until2 = _interopRequireDefault(_until);
+
+var _waterfall = require('./waterfall');
+
+var _waterfall2 = _interopRequireDefault(_waterfall);
+
+var _whilst = require('./whilst');
+
+var _whilst2 = _interopRequireDefault(_whilst);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.default = {
+ apply: _apply2.default,
+ applyEach: _applyEach2.default,
+ applyEachSeries: _applyEachSeries2.default,
+ asyncify: _asyncify2.default,
+ auto: _auto2.default,
+ autoInject: _autoInject2.default,
+ cargo: _cargo2.default,
+ compose: _compose2.default,
+ concat: _concat2.default,
+ concatLimit: _concatLimit2.default,
+ concatSeries: _concatSeries2.default,
+ constant: _constant2.default,
+ detect: _detect2.default,
+ detectLimit: _detectLimit2.default,
+ detectSeries: _detectSeries2.default,
+ dir: _dir2.default,
+ doDuring: _doDuring2.default,
+ doUntil: _doUntil2.default,
+ doWhilst: _doWhilst2.default,
+ during: _during2.default,
+ each: _each2.default,
+ eachLimit: _eachLimit2.default,
+ eachOf: _eachOf2.default,
+ eachOfLimit: _eachOfLimit2.default,
+ eachOfSeries: _eachOfSeries2.default,
+ eachSeries: _eachSeries2.default,
+ ensureAsync: _ensureAsync2.default,
+ every: _every2.default,
+ everyLimit: _everyLimit2.default,
+ everySeries: _everySeries2.default,
+ filter: _filter2.default,
+ filterLimit: _filterLimit2.default,
+ filterSeries: _filterSeries2.default,
+ forever: _forever2.default,
+ groupBy: _groupBy2.default,
+ groupByLimit: _groupByLimit2.default,
+ groupBySeries: _groupBySeries2.default,
+ log: _log2.default,
+ map: _map2.default,
+ mapLimit: _mapLimit2.default,
+ mapSeries: _mapSeries2.default,
+ mapValues: _mapValues2.default,
+ mapValuesLimit: _mapValuesLimit2.default,
+ mapValuesSeries: _mapValuesSeries2.default,
+ memoize: _memoize2.default,
+ nextTick: _nextTick2.default,
+ parallel: _parallel2.default,
+ parallelLimit: _parallelLimit2.default,
+ priorityQueue: _priorityQueue2.default,
+ queue: _queue2.default,
+ race: _race2.default,
+ reduce: _reduce2.default,
+ reduceRight: _reduceRight2.default,
+ reflect: _reflect2.default,
+ reflectAll: _reflectAll2.default,
+ reject: _reject2.default,
+ rejectLimit: _rejectLimit2.default,
+ rejectSeries: _rejectSeries2.default,
+ retry: _retry2.default,
+ retryable: _retryable2.default,
+ seq: _seq2.default,
+ series: _series2.default,
+ setImmediate: _setImmediate2.default,
+ some: _some2.default,
+ someLimit: _someLimit2.default,
+ someSeries: _someSeries2.default,
+ sortBy: _sortBy2.default,
+ timeout: _timeout2.default,
+ times: _times2.default,
+ timesLimit: _timesLimit2.default,
+ timesSeries: _timesSeries2.default,
+ transform: _transform2.default,
+ tryEach: _tryEach2.default,
+ unmemoize: _unmemoize2.default,
+ until: _until2.default,
+ waterfall: _waterfall2.default,
+ whilst: _whilst2.default,
+
+ // aliases
+ all: _every2.default,
+ allLimit: _everyLimit2.default,
+ allSeries: _everySeries2.default,
+ any: _some2.default,
+ anyLimit: _someLimit2.default,
+ anySeries: _someSeries2.default,
+ find: _detect2.default,
+ findLimit: _detectLimit2.default,
+ findSeries: _detectSeries2.default,
+ forEach: _each2.default,
+ forEachSeries: _eachSeries2.default,
+ forEachLimit: _eachLimit2.default,
+ forEachOf: _eachOf2.default,
+ forEachOfSeries: _eachOfSeries2.default,
+ forEachOfLimit: _eachOfLimit2.default,
+ inject: _reduce2.default,
+ foldl: _reduce2.default,
+ foldr: _reduceRight2.default,
+ select: _filter2.default,
+ selectLimit: _filterLimit2.default,
+ selectSeries: _filterSeries2.default,
+ wrapSync: _asyncify2.default
+}; /**
+ * An "async function" in the context of Async is an asynchronous function with
+ * a variable number of parameters, with the final parameter being a callback.
+ * (`function (arg1, arg2, ..., callback) {}`)
+ * The final callback is of the form `callback(err, results...)`, which must be
+ * called once the function is completed. The callback should be called with a
+ * Error as its first argument to signal that an error occurred.
+ * Otherwise, if no error occurred, it should be called with `null` as the first
+ * argument, and any additional `result` arguments that may apply, to signal
+ * successful completion.
+ * The callback must be called exactly once, ideally on a later tick of the
+ * JavaScript event loop.
+ *
+ * This type of function is also referred to as a "Node-style async function",
+ * or a "continuation passing-style function" (CPS). Most of the methods of this
+ * library are themselves CPS/Node-style async functions, or functions that
+ * return CPS/Node-style async functions.
+ *
+ * Wherever we accept a Node-style async function, we also directly accept an
+ * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.
+ * In this case, the `async` function will not be passed a final callback
+ * argument, and any thrown error will be used as the `err` argument of the
+ * implicit callback, and the return value will be used as the `result` value.
+ * (i.e. a `rejected` of the returned Promise becomes the `err` callback
+ * argument, and a `resolved` value becomes the `result`.)
+ *
+ * Note, due to JavaScript limitations, we can only detect native `async`
+ * functions and not transpilied implementations.
+ * Your environment must have `async`/`await` support for this to work.
+ * (e.g. Node > v7.6, or a recent version of a modern browser).
+ * If you are using `async` functions through a transpiler (e.g. Babel), you
+ * must still wrap the function with [asyncify]{@link module:Utils.asyncify},
+ * because the `async function` will be compiled to an ordinary function that
+ * returns a promise.
+ *
+ * @typedef {Function} AsyncFunction
+ * @static
+ */
+
+/**
+ * Async is a utility module which provides straight-forward, powerful functions
+ * for working with asynchronous JavaScript. Although originally designed for
+ * use with [Node.js](http://nodejs.org) and installable via
+ * `npm install --save async`, it can also be used directly in the browser.
+ * @module async
+ * @see AsyncFunction
+ */
+
+/**
+ * A collection of `async` functions for manipulating collections, such as
+ * arrays and objects.
+ * @module Collections
+ */
+
+/**
+ * A collection of `async` functions for controlling the flow through a script.
+ * @module ControlFlow
+ */
+
+/**
+ * A collection of `async` utility functions.
+ * @module Utils
+ */
+
+exports.apply = _apply2.default;
+exports.applyEach = _applyEach2.default;
+exports.applyEachSeries = _applyEachSeries2.default;
+exports.asyncify = _asyncify2.default;
+exports.auto = _auto2.default;
+exports.autoInject = _autoInject2.default;
+exports.cargo = _cargo2.default;
+exports.compose = _compose2.default;
+exports.concat = _concat2.default;
+exports.concatLimit = _concatLimit2.default;
+exports.concatSeries = _concatSeries2.default;
+exports.constant = _constant2.default;
+exports.detect = _detect2.default;
+exports.detectLimit = _detectLimit2.default;
+exports.detectSeries = _detectSeries2.default;
+exports.dir = _dir2.default;
+exports.doDuring = _doDuring2.default;
+exports.doUntil = _doUntil2.default;
+exports.doWhilst = _doWhilst2.default;
+exports.during = _during2.default;
+exports.each = _each2.default;
+exports.eachLimit = _eachLimit2.default;
+exports.eachOf = _eachOf2.default;
+exports.eachOfLimit = _eachOfLimit2.default;
+exports.eachOfSeries = _eachOfSeries2.default;
+exports.eachSeries = _eachSeries2.default;
+exports.ensureAsync = _ensureAsync2.default;
+exports.every = _every2.default;
+exports.everyLimit = _everyLimit2.default;
+exports.everySeries = _everySeries2.default;
+exports.filter = _filter2.default;
+exports.filterLimit = _filterLimit2.default;
+exports.filterSeries = _filterSeries2.default;
+exports.forever = _forever2.default;
+exports.groupBy = _groupBy2.default;
+exports.groupByLimit = _groupByLimit2.default;
+exports.groupBySeries = _groupBySeries2.default;
+exports.log = _log2.default;
+exports.map = _map2.default;
+exports.mapLimit = _mapLimit2.default;
+exports.mapSeries = _mapSeries2.default;
+exports.mapValues = _mapValues2.default;
+exports.mapValuesLimit = _mapValuesLimit2.default;
+exports.mapValuesSeries = _mapValuesSeries2.default;
+exports.memoize = _memoize2.default;
+exports.nextTick = _nextTick2.default;
+exports.parallel = _parallel2.default;
+exports.parallelLimit = _parallelLimit2.default;
+exports.priorityQueue = _priorityQueue2.default;
+exports.queue = _queue2.default;
+exports.race = _race2.default;
+exports.reduce = _reduce2.default;
+exports.reduceRight = _reduceRight2.default;
+exports.reflect = _reflect2.default;
+exports.reflectAll = _reflectAll2.default;
+exports.reject = _reject2.default;
+exports.rejectLimit = _rejectLimit2.default;
+exports.rejectSeries = _rejectSeries2.default;
+exports.retry = _retry2.default;
+exports.retryable = _retryable2.default;
+exports.seq = _seq2.default;
+exports.series = _series2.default;
+exports.setImmediate = _setImmediate2.default;
+exports.some = _some2.default;
+exports.someLimit = _someLimit2.default;
+exports.someSeries = _someSeries2.default;
+exports.sortBy = _sortBy2.default;
+exports.timeout = _timeout2.default;
+exports.times = _times2.default;
+exports.timesLimit = _timesLimit2.default;
+exports.timesSeries = _timesSeries2.default;
+exports.transform = _transform2.default;
+exports.tryEach = _tryEach2.default;
+exports.unmemoize = _unmemoize2.default;
+exports.until = _until2.default;
+exports.waterfall = _waterfall2.default;
+exports.whilst = _whilst2.default;
+exports.all = _every2.default;
+exports.allLimit = _everyLimit2.default;
+exports.allSeries = _everySeries2.default;
+exports.any = _some2.default;
+exports.anyLimit = _someLimit2.default;
+exports.anySeries = _someSeries2.default;
+exports.find = _detect2.default;
+exports.findLimit = _detectLimit2.default;
+exports.findSeries = _detectSeries2.default;
+exports.forEach = _each2.default;
+exports.forEachSeries = _eachSeries2.default;
+exports.forEachLimit = _eachLimit2.default;
+exports.forEachOf = _eachOf2.default;
+exports.forEachOfSeries = _eachOfSeries2.default;
+exports.forEachOfLimit = _eachOfLimit2.default;
+exports.inject = _reduce2.default;
+exports.foldl = _reduce2.default;
+exports.foldr = _reduceRight2.default;
+exports.select = _filter2.default;
+exports.selectLimit = _filterLimit2.default;
+exports.selectSeries = _filterSeries2.default;
+exports.wrapSync = _asyncify2.default;
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/inject.js b/node_modules/@pm2/io/node_modules/async/inject.js
new file mode 100644
index 0000000..3fb8019
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/inject.js
@@ -0,0 +1,78 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = reduce;
+
+var _eachOfSeries = require('./eachOfSeries');
+
+var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Reduces `coll` into a single value using an async `iteratee` to return each
+ * successive step. `memo` is the initial state of the reduction. This function
+ * only operates in series.
+ *
+ * For performance reasons, it may make sense to split a call to this function
+ * into a parallel map, and then use the normal `Array.prototype.reduce` on the
+ * results. This function is for situations where each step in the reduction
+ * needs to be async; if you can get the data before reducing it, then it's
+ * probably a good idea to do so.
+ *
+ * @name reduce
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias inject
+ * @alias foldl
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {*} memo - The initial state of the reduction.
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * array to produce the next step in the reduction.
+ * The `iteratee` should complete with the next state of the reduction.
+ * If the iteratee complete with an error, the reduction is stopped and the
+ * main `callback` is immediately called with the error.
+ * Invoked with (memo, item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the reduced value. Invoked with
+ * (err, result).
+ * @example
+ *
+ * async.reduce([1,2,3], 0, function(memo, item, callback) {
+ * // pointless async:
+ * process.nextTick(function() {
+ * callback(null, memo + item)
+ * });
+ * }, function(err, result) {
+ * // result is now equal to the last value of memo, which is 6
+ * });
+ */
+function reduce(coll, memo, iteratee, callback) {
+ callback = (0, _once2.default)(callback || _noop2.default);
+ var _iteratee = (0, _wrapAsync2.default)(iteratee);
+ (0, _eachOfSeries2.default)(coll, function (x, i, callback) {
+ _iteratee(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/DoublyLinkedList.js b/node_modules/@pm2/io/node_modules/async/internal/DoublyLinkedList.js
new file mode 100644
index 0000000..7e71728
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/DoublyLinkedList.js
@@ -0,0 +1,88 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = DLL;
+// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation
+// used for queues. This implementation assumes that the node provided by the user can be modified
+// to adjust the next and last properties. We implement only the minimal functionality
+// for queue support.
+function DLL() {
+ this.head = this.tail = null;
+ this.length = 0;
+}
+
+function setInitial(dll, node) {
+ dll.length = 1;
+ dll.head = dll.tail = node;
+}
+
+DLL.prototype.removeLink = function (node) {
+ if (node.prev) node.prev.next = node.next;else this.head = node.next;
+ if (node.next) node.next.prev = node.prev;else this.tail = node.prev;
+
+ node.prev = node.next = null;
+ this.length -= 1;
+ return node;
+};
+
+DLL.prototype.empty = function () {
+ while (this.head) this.shift();
+ return this;
+};
+
+DLL.prototype.insertAfter = function (node, newNode) {
+ newNode.prev = node;
+ newNode.next = node.next;
+ if (node.next) node.next.prev = newNode;else this.tail = newNode;
+ node.next = newNode;
+ this.length += 1;
+};
+
+DLL.prototype.insertBefore = function (node, newNode) {
+ newNode.prev = node.prev;
+ newNode.next = node;
+ if (node.prev) node.prev.next = newNode;else this.head = newNode;
+ node.prev = newNode;
+ this.length += 1;
+};
+
+DLL.prototype.unshift = function (node) {
+ if (this.head) this.insertBefore(this.head, node);else setInitial(this, node);
+};
+
+DLL.prototype.push = function (node) {
+ if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node);
+};
+
+DLL.prototype.shift = function () {
+ return this.head && this.removeLink(this.head);
+};
+
+DLL.prototype.pop = function () {
+ return this.tail && this.removeLink(this.tail);
+};
+
+DLL.prototype.toArray = function () {
+ var arr = Array(this.length);
+ var curr = this.head;
+ for (var idx = 0; idx < this.length; idx++) {
+ arr[idx] = curr.data;
+ curr = curr.next;
+ }
+ return arr;
+};
+
+DLL.prototype.remove = function (testFn) {
+ var curr = this.head;
+ while (!!curr) {
+ var next = curr.next;
+ if (testFn(curr)) {
+ this.removeLink(curr);
+ }
+ curr = next;
+ }
+ return this;
+};
+module.exports = exports["default"];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/applyEach.js b/node_modules/@pm2/io/node_modules/async/internal/applyEach.js
new file mode 100644
index 0000000..322e03c
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/applyEach.js
@@ -0,0 +1,38 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = applyEach;
+
+var _slice = require('./slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _initialParams = require('./initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+var _wrapAsync = require('./wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function applyEach(eachfn) {
+ return function (fns /*, ...args*/) {
+ var args = (0, _slice2.default)(arguments, 1);
+ var go = (0, _initialParams2.default)(function (args, callback) {
+ var that = this;
+ return eachfn(fns, function (fn, cb) {
+ (0, _wrapAsync2.default)(fn).apply(that, args.concat(cb));
+ }, callback);
+ });
+ if (args.length) {
+ return go.apply(this, args);
+ } else {
+ return go;
+ }
+ };
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/breakLoop.js b/node_modules/@pm2/io/node_modules/async/internal/breakLoop.js
new file mode 100644
index 0000000..1065058
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/breakLoop.js
@@ -0,0 +1,9 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+// A temporary value used to identify if the loop should be broken.
+// See #1064, #1293
+exports.default = {};
+module.exports = exports["default"];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/consoleFunc.js b/node_modules/@pm2/io/node_modules/async/internal/consoleFunc.js
new file mode 100644
index 0000000..603f48e
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/consoleFunc.js
@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = consoleFunc;
+
+var _arrayEach = require('lodash/_arrayEach');
+
+var _arrayEach2 = _interopRequireDefault(_arrayEach);
+
+var _slice = require('./slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _wrapAsync = require('./wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function consoleFunc(name) {
+ return function (fn /*, ...args*/) {
+ var args = (0, _slice2.default)(arguments, 1);
+ args.push(function (err /*, ...args*/) {
+ var args = (0, _slice2.default)(arguments, 1);
+ if (typeof console === 'object') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ } else if (console[name]) {
+ (0, _arrayEach2.default)(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ });
+ (0, _wrapAsync2.default)(fn).apply(null, args);
+ };
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/createTester.js b/node_modules/@pm2/io/node_modules/async/internal/createTester.js
new file mode 100644
index 0000000..ce96e8b
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/createTester.js
@@ -0,0 +1,44 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _createTester;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _breakLoop = require('./breakLoop');
+
+var _breakLoop2 = _interopRequireDefault(_breakLoop);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _createTester(check, getResult) {
+ return function (eachfn, arr, iteratee, cb) {
+ cb = cb || _noop2.default;
+ var testPassed = false;
+ var testResult;
+ eachfn(arr, function (value, _, callback) {
+ iteratee(value, function (err, result) {
+ if (err) {
+ callback(err);
+ } else if (check(result) && !testResult) {
+ testPassed = true;
+ testResult = getResult(true, value);
+ callback(null, _breakLoop2.default);
+ } else {
+ callback();
+ }
+ });
+ }, function (err) {
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, testPassed ? testResult : getResult(false));
+ }
+ });
+ };
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/doLimit.js b/node_modules/@pm2/io/node_modules/async/internal/doLimit.js
new file mode 100644
index 0000000..963c608
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/doLimit.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = doLimit;
+function doLimit(fn, limit) {
+ return function (iterable, iteratee, callback) {
+ return fn(iterable, limit, iteratee, callback);
+ };
+}
+module.exports = exports["default"];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/doParallel.js b/node_modules/@pm2/io/node_modules/async/internal/doParallel.js
new file mode 100644
index 0000000..bb40207
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/doParallel.js
@@ -0,0 +1,23 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = doParallel;
+
+var _eachOf = require('../eachOf');
+
+var _eachOf2 = _interopRequireDefault(_eachOf);
+
+var _wrapAsync = require('./wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function doParallel(fn) {
+ return function (obj, iteratee, callback) {
+ return fn(_eachOf2.default, obj, (0, _wrapAsync2.default)(iteratee), callback);
+ };
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/doParallelLimit.js b/node_modules/@pm2/io/node_modules/async/internal/doParallelLimit.js
new file mode 100644
index 0000000..a7e963d
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/doParallelLimit.js
@@ -0,0 +1,23 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = doParallelLimit;
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _wrapAsync = require('./wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function doParallelLimit(fn) {
+ return function (obj, limit, iteratee, callback) {
+ return fn((0, _eachOfLimit2.default)(limit), obj, (0, _wrapAsync2.default)(iteratee), callback);
+ };
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/eachOfLimit.js b/node_modules/@pm2/io/node_modules/async/internal/eachOfLimit.js
new file mode 100644
index 0000000..6f6fe55
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/eachOfLimit.js
@@ -0,0 +1,74 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _eachOfLimit;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _iterator = require('./iterator');
+
+var _iterator2 = _interopRequireDefault(_iterator);
+
+var _onlyOnce = require('./onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _breakLoop = require('./breakLoop');
+
+var _breakLoop2 = _interopRequireDefault(_breakLoop);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _eachOfLimit(limit) {
+ return function (obj, iteratee, callback) {
+ callback = (0, _once2.default)(callback || _noop2.default);
+ if (limit <= 0 || !obj) {
+ return callback(null);
+ }
+ var nextElem = (0, _iterator2.default)(obj);
+ var done = false;
+ var running = 0;
+ var looping = false;
+
+ function iterateeCallback(err, value) {
+ running -= 1;
+ if (err) {
+ done = true;
+ callback(err);
+ } else if (value === _breakLoop2.default || done && running <= 0) {
+ done = true;
+ return callback(null);
+ } else if (!looping) {
+ replenish();
+ }
+ }
+
+ function replenish() {
+ looping = true;
+ while (running < limit && !done) {
+ var elem = nextElem();
+ if (elem === null) {
+ done = true;
+ if (running <= 0) {
+ callback(null);
+ }
+ return;
+ }
+ running += 1;
+ iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback));
+ }
+ looping = false;
+ }
+
+ replenish();
+ };
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/filter.js b/node_modules/@pm2/io/node_modules/async/internal/filter.js
new file mode 100644
index 0000000..74f3986
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/filter.js
@@ -0,0 +1,75 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _filter;
+
+var _arrayMap = require('lodash/_arrayMap');
+
+var _arrayMap2 = _interopRequireDefault(_arrayMap);
+
+var _isArrayLike = require('lodash/isArrayLike');
+
+var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
+
+var _baseProperty = require('lodash/_baseProperty');
+
+var _baseProperty2 = _interopRequireDefault(_baseProperty);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _wrapAsync = require('./wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function filterArray(eachfn, arr, iteratee, callback) {
+ var truthValues = new Array(arr.length);
+ eachfn(arr, function (x, index, callback) {
+ iteratee(x, function (err, v) {
+ truthValues[index] = !!v;
+ callback(err);
+ });
+ }, function (err) {
+ if (err) return callback(err);
+ var results = [];
+ for (var i = 0; i < arr.length; i++) {
+ if (truthValues[i]) results.push(arr[i]);
+ }
+ callback(null, results);
+ });
+}
+
+function filterGeneric(eachfn, coll, iteratee, callback) {
+ var results = [];
+ eachfn(coll, function (x, index, callback) {
+ iteratee(x, function (err, v) {
+ if (err) {
+ callback(err);
+ } else {
+ if (v) {
+ results.push({ index: index, value: x });
+ }
+ callback();
+ }
+ });
+ }, function (err) {
+ if (err) {
+ callback(err);
+ } else {
+ callback(null, (0, _arrayMap2.default)(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), (0, _baseProperty2.default)('value')));
+ }
+ });
+}
+
+function _filter(eachfn, coll, iteratee, callback) {
+ var filter = (0, _isArrayLike2.default)(coll) ? filterArray : filterGeneric;
+ filter(eachfn, coll, (0, _wrapAsync2.default)(iteratee), callback || _noop2.default);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/findGetResult.js b/node_modules/@pm2/io/node_modules/async/internal/findGetResult.js
new file mode 100644
index 0000000..f8d3fe0
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/findGetResult.js
@@ -0,0 +1,10 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _findGetResult;
+function _findGetResult(v, x) {
+ return x;
+}
+module.exports = exports["default"];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/getIterator.js b/node_modules/@pm2/io/node_modules/async/internal/getIterator.js
new file mode 100644
index 0000000..3eadd24
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/getIterator.js
@@ -0,0 +1,13 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (coll) {
+ return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();
+};
+
+var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;
+
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/initialParams.js b/node_modules/@pm2/io/node_modules/async/internal/initialParams.js
new file mode 100644
index 0000000..df02cb1
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/initialParams.js
@@ -0,0 +1,21 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (fn) {
+ return function () /*...args, callback*/{
+ var args = (0, _slice2.default)(arguments);
+ var callback = args.pop();
+ fn.call(this, args, callback);
+ };
+};
+
+var _slice = require('./slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/iterator.js b/node_modules/@pm2/io/node_modules/async/internal/iterator.js
new file mode 100644
index 0000000..886beb5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/iterator.js
@@ -0,0 +1,61 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = iterator;
+
+var _isArrayLike = require('lodash/isArrayLike');
+
+var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
+
+var _getIterator = require('./getIterator');
+
+var _getIterator2 = _interopRequireDefault(_getIterator);
+
+var _keys = require('lodash/keys');
+
+var _keys2 = _interopRequireDefault(_keys);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function createArrayIterator(coll) {
+ var i = -1;
+ var len = coll.length;
+ return function next() {
+ return ++i < len ? { value: coll[i], key: i } : null;
+ };
+}
+
+function createES2015Iterator(iterator) {
+ var i = -1;
+ return function next() {
+ var item = iterator.next();
+ if (item.done) return null;
+ i++;
+ return { value: item.value, key: i };
+ };
+}
+
+function createObjectIterator(obj) {
+ var okeys = (0, _keys2.default)(obj);
+ var i = -1;
+ var len = okeys.length;
+ return function next() {
+ var key = okeys[++i];
+ if (key === '__proto__') {
+ return next();
+ }
+ return i < len ? { value: obj[key], key: key } : null;
+ };
+}
+
+function iterator(coll) {
+ if ((0, _isArrayLike2.default)(coll)) {
+ return createArrayIterator(coll);
+ }
+
+ var iterator = (0, _getIterator2.default)(coll);
+ return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/map.js b/node_modules/@pm2/io/node_modules/async/internal/map.js
new file mode 100644
index 0000000..f4f2aa5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/map.js
@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _asyncMap;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _wrapAsync = require('./wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _asyncMap(eachfn, arr, iteratee, callback) {
+ callback = callback || _noop2.default;
+ arr = arr || [];
+ var results = [];
+ var counter = 0;
+ var _iteratee = (0, _wrapAsync2.default)(iteratee);
+
+ eachfn(arr, function (value, _, callback) {
+ var index = counter++;
+ _iteratee(value, function (err, v) {
+ results[index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/notId.js b/node_modules/@pm2/io/node_modules/async/internal/notId.js
new file mode 100644
index 0000000..0106c92
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/notId.js
@@ -0,0 +1,10 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = notId;
+function notId(v) {
+ return !v;
+}
+module.exports = exports["default"];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/once.js b/node_modules/@pm2/io/node_modules/async/internal/once.js
new file mode 100644
index 0000000..f0c379f
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/once.js
@@ -0,0 +1,15 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = once;
+function once(fn) {
+ return function () {
+ if (fn === null) return;
+ var callFn = fn;
+ fn = null;
+ callFn.apply(this, arguments);
+ };
+}
+module.exports = exports["default"];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/onlyOnce.js b/node_modules/@pm2/io/node_modules/async/internal/onlyOnce.js
new file mode 100644
index 0000000..f2e3001
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/onlyOnce.js
@@ -0,0 +1,15 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = onlyOnce;
+function onlyOnce(fn) {
+ return function () {
+ if (fn === null) throw new Error("Callback was already called.");
+ var callFn = fn;
+ fn = null;
+ callFn.apply(this, arguments);
+ };
+}
+module.exports = exports["default"];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/parallel.js b/node_modules/@pm2/io/node_modules/async/internal/parallel.js
new file mode 100644
index 0000000..c97293b
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/parallel.js
@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _parallel;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _isArrayLike = require('lodash/isArrayLike');
+
+var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
+
+var _slice = require('./slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _wrapAsync = require('./wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _parallel(eachfn, tasks, callback) {
+ callback = callback || _noop2.default;
+ var results = (0, _isArrayLike2.default)(tasks) ? [] : {};
+
+ eachfn(tasks, function (task, key, callback) {
+ (0, _wrapAsync2.default)(task)(function (err, result) {
+ if (arguments.length > 2) {
+ result = (0, _slice2.default)(arguments, 1);
+ }
+ results[key] = result;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/queue.js b/node_modules/@pm2/io/node_modules/async/internal/queue.js
new file mode 100644
index 0000000..19534a7
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/queue.js
@@ -0,0 +1,204 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = queue;
+
+var _baseIndexOf = require('lodash/_baseIndexOf');
+
+var _baseIndexOf2 = _interopRequireDefault(_baseIndexOf);
+
+var _isArray = require('lodash/isArray');
+
+var _isArray2 = _interopRequireDefault(_isArray);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _onlyOnce = require('./onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _setImmediate = require('./setImmediate');
+
+var _setImmediate2 = _interopRequireDefault(_setImmediate);
+
+var _DoublyLinkedList = require('./DoublyLinkedList');
+
+var _DoublyLinkedList2 = _interopRequireDefault(_DoublyLinkedList);
+
+var _wrapAsync = require('./wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function queue(worker, concurrency, payload) {
+ if (concurrency == null) {
+ concurrency = 1;
+ } else if (concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+
+ var _worker = (0, _wrapAsync2.default)(worker);
+ var numRunning = 0;
+ var workersList = [];
+
+ var processingScheduled = false;
+ function _insert(data, insertAtFront, callback) {
+ if (callback != null && typeof callback !== 'function') {
+ throw new Error('task callback must be a function');
+ }
+ q.started = true;
+ if (!(0, _isArray2.default)(data)) {
+ data = [data];
+ }
+ if (data.length === 0 && q.idle()) {
+ // call drain immediately if there are no tasks
+ return (0, _setImmediate2.default)(function () {
+ q.drain();
+ });
+ }
+
+ for (var i = 0, l = data.length; i < l; i++) {
+ var item = {
+ data: data[i],
+ callback: callback || _noop2.default
+ };
+
+ if (insertAtFront) {
+ q._tasks.unshift(item);
+ } else {
+ q._tasks.push(item);
+ }
+ }
+
+ if (!processingScheduled) {
+ processingScheduled = true;
+ (0, _setImmediate2.default)(function () {
+ processingScheduled = false;
+ q.process();
+ });
+ }
+ }
+
+ function _next(tasks) {
+ return function (err) {
+ numRunning -= 1;
+
+ for (var i = 0, l = tasks.length; i < l; i++) {
+ var task = tasks[i];
+
+ var index = (0, _baseIndexOf2.default)(workersList, task, 0);
+ if (index === 0) {
+ workersList.shift();
+ } else if (index > 0) {
+ workersList.splice(index, 1);
+ }
+
+ task.callback.apply(task, arguments);
+
+ if (err != null) {
+ q.error(err, task.data);
+ }
+ }
+
+ if (numRunning <= q.concurrency - q.buffer) {
+ q.unsaturated();
+ }
+
+ if (q.idle()) {
+ q.drain();
+ }
+ q.process();
+ };
+ }
+
+ var isProcessing = false;
+ var q = {
+ _tasks: new _DoublyLinkedList2.default(),
+ concurrency: concurrency,
+ payload: payload,
+ saturated: _noop2.default,
+ unsaturated: _noop2.default,
+ buffer: concurrency / 4,
+ empty: _noop2.default,
+ drain: _noop2.default,
+ error: _noop2.default,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(data, false, callback);
+ },
+ kill: function () {
+ q.drain = _noop2.default;
+ q._tasks.empty();
+ },
+ unshift: function (data, callback) {
+ _insert(data, true, callback);
+ },
+ remove: function (testFn) {
+ q._tasks.remove(testFn);
+ },
+ process: function () {
+ // Avoid trying to start too many processing operations. This can occur
+ // when callbacks resolve synchronously (#1267).
+ if (isProcessing) {
+ return;
+ }
+ isProcessing = true;
+ while (!q.paused && numRunning < q.concurrency && q._tasks.length) {
+ var tasks = [],
+ data = [];
+ var l = q._tasks.length;
+ if (q.payload) l = Math.min(l, q.payload);
+ for (var i = 0; i < l; i++) {
+ var node = q._tasks.shift();
+ tasks.push(node);
+ workersList.push(node);
+ data.push(node.data);
+ }
+
+ numRunning += 1;
+
+ if (q._tasks.length === 0) {
+ q.empty();
+ }
+
+ if (numRunning === q.concurrency) {
+ q.saturated();
+ }
+
+ var cb = (0, _onlyOnce2.default)(_next(tasks));
+ _worker(data, cb);
+ }
+ isProcessing = false;
+ },
+ length: function () {
+ return q._tasks.length;
+ },
+ running: function () {
+ return numRunning;
+ },
+ workersList: function () {
+ return workersList;
+ },
+ idle: function () {
+ return q._tasks.length + numRunning === 0;
+ },
+ pause: function () {
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) {
+ return;
+ }
+ q.paused = false;
+ (0, _setImmediate2.default)(q.process);
+ }
+ };
+ return q;
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/reject.js b/node_modules/@pm2/io/node_modules/async/internal/reject.js
new file mode 100644
index 0000000..5dbfcfb
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/reject.js
@@ -0,0 +1,21 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = reject;
+
+var _filter = require('./filter');
+
+var _filter2 = _interopRequireDefault(_filter);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function reject(eachfn, arr, iteratee, callback) {
+ (0, _filter2.default)(eachfn, arr, function (value, cb) {
+ iteratee(value, function (err, v) {
+ cb(err, !v);
+ });
+ }, callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/setImmediate.js b/node_modules/@pm2/io/node_modules/async/internal/setImmediate.js
new file mode 100644
index 0000000..3545f2b
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/setImmediate.js
@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.hasNextTick = exports.hasSetImmediate = undefined;
+exports.fallback = fallback;
+exports.wrap = wrap;
+
+var _slice = require('./slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === 'function' && setImmediate;
+var hasNextTick = exports.hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';
+
+function fallback(fn) {
+ setTimeout(fn, 0);
+}
+
+function wrap(defer) {
+ return function (fn /*, ...args*/) {
+ var args = (0, _slice2.default)(arguments, 1);
+ defer(function () {
+ fn.apply(null, args);
+ });
+ };
+}
+
+var _defer;
+
+if (hasSetImmediate) {
+ _defer = setImmediate;
+} else if (hasNextTick) {
+ _defer = process.nextTick;
+} else {
+ _defer = fallback;
+}
+
+exports.default = wrap(_defer);
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/slice.js b/node_modules/@pm2/io/node_modules/async/internal/slice.js
new file mode 100644
index 0000000..56f10c0
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/slice.js
@@ -0,0 +1,16 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = slice;
+function slice(arrayLike, start) {
+ start = start | 0;
+ var newLen = Math.max(arrayLike.length - start, 0);
+ var newArr = Array(newLen);
+ for (var idx = 0; idx < newLen; idx++) {
+ newArr[idx] = arrayLike[start + idx];
+ }
+ return newArr;
+}
+module.exports = exports["default"];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/withoutIndex.js b/node_modules/@pm2/io/node_modules/async/internal/withoutIndex.js
new file mode 100644
index 0000000..2bd3579
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/withoutIndex.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _withoutIndex;
+function _withoutIndex(iteratee) {
+ return function (value, index, callback) {
+ return iteratee(value, callback);
+ };
+}
+module.exports = exports["default"];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/internal/wrapAsync.js b/node_modules/@pm2/io/node_modules/async/internal/wrapAsync.js
new file mode 100644
index 0000000..bc6c966
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/internal/wrapAsync.js
@@ -0,0 +1,25 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isAsync = undefined;
+
+var _asyncify = require('../asyncify');
+
+var _asyncify2 = _interopRequireDefault(_asyncify);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var supportsSymbol = typeof Symbol === 'function';
+
+function isAsync(fn) {
+ return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';
+}
+
+function wrapAsync(asyncFn) {
+ return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;
+}
+
+exports.default = wrapAsync;
+exports.isAsync = isAsync;
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/log.js b/node_modules/@pm2/io/node_modules/async/log.js
new file mode 100644
index 0000000..c643867
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/log.js
@@ -0,0 +1,41 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _consoleFunc = require('./internal/consoleFunc');
+
+var _consoleFunc2 = _interopRequireDefault(_consoleFunc);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Logs the result of an `async` function to the `console`. Only works in
+ * Node.js or in browsers that support `console.log` and `console.error` (such
+ * as FF and Chrome). If multiple arguments are returned from the async
+ * function, `console.log` is called on each argument in order.
+ *
+ * @name log
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} function - The function you want to eventually apply
+ * all arguments to.
+ * @param {...*} arguments... - Any number of arguments to apply to the function.
+ * @example
+ *
+ * // in a module
+ * var hello = function(name, callback) {
+ * setTimeout(function() {
+ * callback(null, 'hello ' + name);
+ * }, 1000);
+ * };
+ *
+ * // in the node repl
+ * node> async.log(hello, 'world');
+ * 'hello world'
+ */
+exports.default = (0, _consoleFunc2.default)('log');
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/map.js b/node_modules/@pm2/io/node_modules/async/map.js
new file mode 100644
index 0000000..67c9cda
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/map.js
@@ -0,0 +1,54 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _map = require('./internal/map');
+
+var _map2 = _interopRequireDefault(_map);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Produces a new collection of values by mapping each value in `coll` through
+ * the `iteratee` function. The `iteratee` is called with an item from `coll`
+ * and a callback for when it has finished processing. Each of these callback
+ * takes 2 arguments: an `error`, and the transformed item from `coll`. If
+ * `iteratee` passes an error to its callback, the main `callback` (for the
+ * `map` function) is immediately called with the error.
+ *
+ * Note, that since this function applies the `iteratee` to each item in
+ * parallel, there is no guarantee that the `iteratee` functions will complete
+ * in order. However, the results array will be in the same order as the
+ * original `coll`.
+ *
+ * If `map` is passed an Object, the results will be an Array. The results
+ * will roughly be in the order of the original Objects' keys (but this can
+ * vary across JavaScript engines).
+ *
+ * @name map
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with the transformed item.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Results is an Array of the
+ * transformed items from the `coll`. Invoked with (err, results).
+ * @example
+ *
+ * async.map(['file1','file2','file3'], fs.stat, function(err, results) {
+ * // results is now an array of stats for each file
+ * });
+ */
+exports.default = (0, _doParallel2.default)(_map2.default);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/mapLimit.js b/node_modules/@pm2/io/node_modules/async/mapLimit.js
new file mode 100644
index 0000000..c8b60d8
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/mapLimit.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _map = require('./internal/map');
+
+var _map2 = _interopRequireDefault(_map);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name mapLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.map]{@link module:Collections.map}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with the transformed item.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Results is an array of the
+ * transformed items from the `coll`. Invoked with (err, results).
+ */
+exports.default = (0, _doParallelLimit2.default)(_map2.default);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/mapSeries.js b/node_modules/@pm2/io/node_modules/async/mapSeries.js
new file mode 100644
index 0000000..61b42d0
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/mapSeries.js
@@ -0,0 +1,36 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _mapLimit = require('./mapLimit');
+
+var _mapLimit2 = _interopRequireDefault(_mapLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.
+ *
+ * @name mapSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.map]{@link module:Collections.map}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with the transformed item.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Results is an array of the
+ * transformed items from the `coll`. Invoked with (err, results).
+ */
+exports.default = (0, _doLimit2.default)(_mapLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/mapValues.js b/node_modules/@pm2/io/node_modules/async/mapValues.js
new file mode 100644
index 0000000..3d838ca
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/mapValues.js
@@ -0,0 +1,63 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _mapValuesLimit = require('./mapValuesLimit');
+
+var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * A relative of [`map`]{@link module:Collections.map}, designed for use with objects.
+ *
+ * Produces a new Object by mapping each value of `obj` through the `iteratee`
+ * function. The `iteratee` is called each `value` and `key` from `obj` and a
+ * callback for when it has finished processing. Each of these callbacks takes
+ * two arguments: an `error`, and the transformed item from `obj`. If `iteratee`
+ * passes an error to its callback, the main `callback` (for the `mapValues`
+ * function) is immediately called with the error.
+ *
+ * Note, the order of the keys in the result is not guaranteed. The keys will
+ * be roughly in the order they complete, (but this is very engine-specific)
+ *
+ * @name mapValues
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Object} obj - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each value and key
+ * in `coll`.
+ * The iteratee should complete with the transformed value as its result.
+ * Invoked with (value, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. `result` is a new object consisting
+ * of each key from `obj`, with each transformed value on the right-hand side.
+ * Invoked with (err, result).
+ * @example
+ *
+ * async.mapValues({
+ * f1: 'file1',
+ * f2: 'file2',
+ * f3: 'file3'
+ * }, function (file, key, callback) {
+ * fs.stat(file, callback);
+ * }, function(err, result) {
+ * // result is now a map of stats for each file, e.g.
+ * // {
+ * // f1: [stats for file1],
+ * // f2: [stats for file2],
+ * // f3: [stats for file3]
+ * // }
+ * });
+ */
+
+exports.default = (0, _doLimit2.default)(_mapValuesLimit2.default, Infinity);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/mapValuesLimit.js b/node_modules/@pm2/io/node_modules/async/mapValuesLimit.js
new file mode 100644
index 0000000..912a8b5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/mapValuesLimit.js
@@ -0,0 +1,61 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = mapValuesLimit;
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name mapValuesLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.mapValues]{@link module:Collections.mapValues}
+ * @category Collection
+ * @param {Object} obj - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - A function to apply to each value and key
+ * in `coll`.
+ * The iteratee should complete with the transformed value as its result.
+ * Invoked with (value, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. `result` is a new object consisting
+ * of each key from `obj`, with each transformed value on the right-hand side.
+ * Invoked with (err, result).
+ */
+function mapValuesLimit(obj, limit, iteratee, callback) {
+ callback = (0, _once2.default)(callback || _noop2.default);
+ var newObj = {};
+ var _iteratee = (0, _wrapAsync2.default)(iteratee);
+ (0, _eachOfLimit2.default)(obj, limit, function (val, key, next) {
+ _iteratee(val, key, function (err, result) {
+ if (err) return next(err);
+ newObj[key] = result;
+ next();
+ });
+ }, function (err) {
+ callback(err, newObj);
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/mapValuesSeries.js b/node_modules/@pm2/io/node_modules/async/mapValuesSeries.js
new file mode 100644
index 0000000..b378c4a
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/mapValuesSeries.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _mapValuesLimit = require('./mapValuesLimit');
+
+var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.
+ *
+ * @name mapValuesSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.mapValues]{@link module:Collections.mapValues}
+ * @category Collection
+ * @param {Object} obj - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each value and key
+ * in `coll`.
+ * The iteratee should complete with the transformed value as its result.
+ * Invoked with (value, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. `result` is a new object consisting
+ * of each key from `obj`, with each transformed value on the right-hand side.
+ * Invoked with (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_mapValuesLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/memoize.js b/node_modules/@pm2/io/node_modules/async/memoize.js
new file mode 100644
index 0000000..1f2b566
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/memoize.js
@@ -0,0 +1,101 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = memoize;
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _setImmediate = require('./internal/setImmediate');
+
+var _setImmediate2 = _interopRequireDefault(_setImmediate);
+
+var _initialParams = require('./internal/initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function has(obj, key) {
+ return key in obj;
+}
+
+/**
+ * Caches the results of an async function. When creating a hash to store
+ * function results against, the callback is omitted from the hash and an
+ * optional hash function can be used.
+ *
+ * If no hash function is specified, the first argument is used as a hash key,
+ * which may work reasonably if it is a string or a data type that converts to a
+ * distinct string. Note that objects and arrays will not behave reasonably.
+ * Neither will cases where the other arguments are significant. In such cases,
+ * specify your own hash function.
+ *
+ * The cache of results is exposed as the `memo` property of the function
+ * returned by `memoize`.
+ *
+ * @name memoize
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} fn - The async function to proxy and cache results from.
+ * @param {Function} hasher - An optional function for generating a custom hash
+ * for storing results. It has all the arguments applied to it apart from the
+ * callback, and must be synchronous.
+ * @returns {AsyncFunction} a memoized version of `fn`
+ * @example
+ *
+ * var slow_fn = function(name, callback) {
+ * // do something
+ * callback(null, result);
+ * };
+ * var fn = async.memoize(slow_fn);
+ *
+ * // fn can now be used as if it were slow_fn
+ * fn('some name', function() {
+ * // callback
+ * });
+ */
+function memoize(fn, hasher) {
+ var memo = Object.create(null);
+ var queues = Object.create(null);
+ hasher = hasher || _identity2.default;
+ var _fn = (0, _wrapAsync2.default)(fn);
+ var memoized = (0, _initialParams2.default)(function memoized(args, callback) {
+ var key = hasher.apply(null, args);
+ if (has(memo, key)) {
+ (0, _setImmediate2.default)(function () {
+ callback.apply(null, memo[key]);
+ });
+ } else if (has(queues, key)) {
+ queues[key].push(callback);
+ } else {
+ queues[key] = [callback];
+ _fn.apply(null, args.concat(function () /*args*/{
+ var args = (0, _slice2.default)(arguments);
+ memo[key] = args;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, args);
+ }
+ }));
+ }
+ });
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/nextTick.js b/node_modules/@pm2/io/node_modules/async/nextTick.js
new file mode 100644
index 0000000..886f58e
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/nextTick.js
@@ -0,0 +1,51 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _setImmediate = require('./internal/setImmediate');
+
+/**
+ * Calls `callback` on a later loop around the event loop. In Node.js this just
+ * calls `process.nextTick`. In the browser it will use `setImmediate` if
+ * available, otherwise `setTimeout(callback, 0)`, which means other higher
+ * priority events may precede the execution of `callback`.
+ *
+ * This is used internally for browser-compatibility purposes.
+ *
+ * @name nextTick
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @see [async.setImmediate]{@link module:Utils.setImmediate}
+ * @category Util
+ * @param {Function} callback - The function to call on a later loop around
+ * the event loop. Invoked with (args...).
+ * @param {...*} args... - any number of additional arguments to pass to the
+ * callback on the next tick.
+ * @example
+ *
+ * var call_order = [];
+ * async.nextTick(function() {
+ * call_order.push('two');
+ * // call_order now equals ['one','two']
+ * });
+ * call_order.push('one');
+ *
+ * async.setImmediate(function (a, b, c) {
+ * // a, b, and c equal 1, 2, and 3
+ * }, 1, 2, 3);
+ */
+var _defer;
+
+if (_setImmediate.hasNextTick) {
+ _defer = process.nextTick;
+} else if (_setImmediate.hasSetImmediate) {
+ _defer = setImmediate;
+} else {
+ _defer = _setImmediate.fallback;
+}
+
+exports.default = (0, _setImmediate.wrap)(_defer);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/package.json b/node_modules/@pm2/io/node_modules/async/package.json
new file mode 100644
index 0000000..76b3db7
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/package.json
@@ -0,0 +1,80 @@
+{
+ "name": "async",
+ "description": "Higher-order functions and common patterns for asynchronous code",
+ "version": "2.6.4",
+ "main": "dist/async.js",
+ "author": "Caolan McMahon",
+ "homepage": "https://caolan.github.io/async/",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/caolan/async.git"
+ },
+ "bugs": {
+ "url": "https://github.com/caolan/async/issues"
+ },
+ "keywords": [
+ "async",
+ "callback",
+ "module",
+ "utility"
+ ],
+ "dependencies": {
+ "lodash": "^4.17.14"
+ },
+ "devDependencies": {
+ "babel-cli": "^6.24.0",
+ "babel-core": "^6.26.3",
+ "babel-plugin-add-module-exports": "^0.2.1",
+ "babel-plugin-istanbul": "^2.0.1",
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
+ "babel-preset-es2015": "^6.3.13",
+ "babel-preset-es2017": "^6.22.0",
+ "babelify": "^8.0.0",
+ "benchmark": "^2.1.1",
+ "bluebird": "^3.4.6",
+ "browserify": "^16.2.2",
+ "chai": "^4.1.2",
+ "cheerio": "^0.22.0",
+ "coveralls": "^3.0.1",
+ "es6-promise": "^2.3.0",
+ "eslint": "^2.13.1",
+ "fs-extra": "^0.26.7",
+ "gh-pages-deploy": "^0.5.0",
+ "jsdoc": "^3.4.0",
+ "karma": "^2.0.2",
+ "karma-browserify": "^5.2.0",
+ "karma-firefox-launcher": "^1.1.0",
+ "karma-mocha": "^1.2.0",
+ "karma-mocha-reporter": "^2.2.0",
+ "mocha": "^5.2.0",
+ "native-promise-only": "^0.8.0-a",
+ "nyc": "^11.8.0",
+ "rimraf": "^2.5.0",
+ "rollup": "^0.36.3",
+ "rollup-plugin-node-resolve": "^2.0.0",
+ "rollup-plugin-npm": "^2.0.0",
+ "rsvp": "^3.0.18",
+ "semver": "^5.5.0",
+ "uglify-js": "~2.7.3",
+ "yargs": "^11.0.0"
+ },
+ "scripts": {
+ "coverage": "nyc npm run mocha-node-test -- --grep @nycinvalid --invert",
+ "coveralls": "npm run coverage && nyc report --reporter=text-lcov | coveralls",
+ "jsdoc": "jsdoc -c ./support/jsdoc/jsdoc.json && node support/jsdoc/jsdoc-fix-html.js",
+ "lint": "eslint lib/ mocha_test/ perf/memory.js perf/suites.js perf/benchmark.js support/build/ support/*.js karma.conf.js",
+ "mocha-browser-test": "karma start",
+ "mocha-node-test": "mocha mocha_test/ --compilers js:babel-core/register",
+ "mocha-test": "npm run mocha-node-test && npm run mocha-browser-test",
+ "test": "npm run lint && npm run mocha-node-test"
+ },
+ "license": "MIT",
+ "gh-pages-deploy": {
+ "staticpath": "docs"
+ },
+ "nyc": {
+ "exclude": [
+ "mocha_test"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/parallel.js b/node_modules/@pm2/io/node_modules/async/parallel.js
new file mode 100644
index 0000000..da28a4d
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/parallel.js
@@ -0,0 +1,90 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = parallelLimit;
+
+var _eachOf = require('./eachOf');
+
+var _eachOf2 = _interopRequireDefault(_eachOf);
+
+var _parallel = require('./internal/parallel');
+
+var _parallel2 = _interopRequireDefault(_parallel);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Run the `tasks` collection of functions in parallel, without waiting until
+ * the previous function has completed. If any of the functions pass an error to
+ * its callback, the main `callback` is immediately called with the value of the
+ * error. Once the `tasks` have completed, the results are passed to the final
+ * `callback` as an array.
+ *
+ * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about
+ * parallel execution of code. If your tasks do not use any timers or perform
+ * any I/O, they will actually be executed in series. Any synchronous setup
+ * sections for each task will happen one after the other. JavaScript remains
+ * single-threaded.
+ *
+ * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the
+ * execution of other tasks when a task fails.
+ *
+ * It is also possible to use an object instead of an array. Each property will
+ * be run as a function and the results will be passed to the final `callback`
+ * as an object instead of an array. This can be a more readable way of handling
+ * results from {@link async.parallel}.
+ *
+ * @name parallel
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection of
+ * [async functions]{@link AsyncFunction} to run.
+ * Each async function can complete with any number of optional `result` values.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed successfully. This function gets a results array
+ * (or object) containing all the result arguments passed to the task callbacks.
+ * Invoked with (err, results).
+ *
+ * @example
+ * async.parallel([
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'two');
+ * }, 100);
+ * }
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * // the results array will equal ['one','two'] even though
+ * // the second function had a shorter timeout.
+ * });
+ *
+ * // an example using an object instead of an array
+ * async.parallel({
+ * one: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 1);
+ * }, 200);
+ * },
+ * two: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 2);
+ * }, 100);
+ * }
+ * }, function(err, results) {
+ * // results is now equals to: {one: 1, two: 2}
+ * });
+ */
+function parallelLimit(tasks, callback) {
+ (0, _parallel2.default)(_eachOf2.default, tasks, callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/parallelLimit.js b/node_modules/@pm2/io/node_modules/async/parallelLimit.js
new file mode 100644
index 0000000..a026526
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/parallelLimit.js
@@ -0,0 +1,40 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = parallelLimit;
+
+var _eachOfLimit = require('./internal/eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _parallel = require('./internal/parallel');
+
+var _parallel2 = _interopRequireDefault(_parallel);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name parallelLimit
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.parallel]{@link module:ControlFlow.parallel}
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection of
+ * [async functions]{@link AsyncFunction} to run.
+ * Each async function can complete with any number of optional `result` values.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed successfully. This function gets a results array
+ * (or object) containing all the result arguments passed to the task callbacks.
+ * Invoked with (err, results).
+ */
+function parallelLimit(tasks, limit, callback) {
+ (0, _parallel2.default)((0, _eachOfLimit2.default)(limit), tasks, callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/priorityQueue.js b/node_modules/@pm2/io/node_modules/async/priorityQueue.js
new file mode 100644
index 0000000..3a5f023
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/priorityQueue.js
@@ -0,0 +1,98 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (worker, concurrency) {
+ // Start with a normal queue
+ var q = (0, _queue2.default)(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ if (callback == null) callback = _noop2.default;
+ if (typeof callback !== 'function') {
+ throw new Error('task callback must be a function');
+ }
+ q.started = true;
+ if (!(0, _isArray2.default)(data)) {
+ data = [data];
+ }
+ if (data.length === 0) {
+ // call drain immediately if there are no tasks
+ return (0, _setImmediate2.default)(function () {
+ q.drain();
+ });
+ }
+
+ priority = priority || 0;
+ var nextNode = q._tasks.head;
+ while (nextNode && priority >= nextNode.priority) {
+ nextNode = nextNode.next;
+ }
+
+ for (var i = 0, l = data.length; i < l; i++) {
+ var item = {
+ data: data[i],
+ priority: priority,
+ callback: callback
+ };
+
+ if (nextNode) {
+ q._tasks.insertBefore(nextNode, item);
+ } else {
+ q._tasks.push(item);
+ }
+ }
+ (0, _setImmediate2.default)(q.process);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+};
+
+var _isArray = require('lodash/isArray');
+
+var _isArray2 = _interopRequireDefault(_isArray);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _setImmediate = require('./setImmediate');
+
+var _setImmediate2 = _interopRequireDefault(_setImmediate);
+
+var _queue = require('./queue');
+
+var _queue2 = _interopRequireDefault(_queue);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+module.exports = exports['default'];
+
+/**
+ * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and
+ * completed in ascending priority order.
+ *
+ * @name priorityQueue
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.queue]{@link module:ControlFlow.queue}
+ * @category Control Flow
+ * @param {AsyncFunction} worker - An async function for processing a queued task.
+ * If you want to handle errors from an individual task, pass a callback to
+ * `q.push()`.
+ * Invoked with (task, callback).
+ * @param {number} concurrency - An `integer` for determining how many `worker`
+ * functions should be run in parallel. If omitted, the concurrency defaults to
+ * `1`. If the concurrency is `0`, an error is thrown.
+ * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two
+ * differences between `queue` and `priorityQueue` objects:
+ * * `push(task, priority, [callback])` - `priority` should be a number. If an
+ * array of `tasks` is given, all tasks will be assigned the same priority.
+ * * The `unshift` method was removed.
+ */
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/queue.js b/node_modules/@pm2/io/node_modules/async/queue.js
new file mode 100644
index 0000000..0ca8ba2
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/queue.js
@@ -0,0 +1,130 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (worker, concurrency) {
+ var _worker = (0, _wrapAsync2.default)(worker);
+ return (0, _queue2.default)(function (items, cb) {
+ _worker(items[0], cb);
+ }, concurrency, 1);
+};
+
+var _queue = require('./internal/queue');
+
+var _queue2 = _interopRequireDefault(_queue);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+module.exports = exports['default'];
+
+/**
+ * A queue of tasks for the worker function to complete.
+ * @typedef {Object} QueueObject
+ * @memberOf module:ControlFlow
+ * @property {Function} length - a function returning the number of items
+ * waiting to be processed. Invoke with `queue.length()`.
+ * @property {boolean} started - a boolean indicating whether or not any
+ * items have been pushed and processed by the queue.
+ * @property {Function} running - a function returning the number of items
+ * currently being processed. Invoke with `queue.running()`.
+ * @property {Function} workersList - a function returning the array of items
+ * currently being processed. Invoke with `queue.workersList()`.
+ * @property {Function} idle - a function returning false if there are items
+ * waiting or being processed, or true if not. Invoke with `queue.idle()`.
+ * @property {number} concurrency - an integer for determining how many `worker`
+ * functions should be run in parallel. This property can be changed after a
+ * `queue` is created to alter the concurrency on-the-fly.
+ * @property {Function} push - add a new task to the `queue`. Calls `callback`
+ * once the `worker` has finished processing the task. Instead of a single task,
+ * a `tasks` array can be submitted. The respective callback is used for every
+ * task in the list. Invoke with `queue.push(task, [callback])`,
+ * @property {Function} unshift - add a new task to the front of the `queue`.
+ * Invoke with `queue.unshift(task, [callback])`.
+ * @property {Function} remove - remove items from the queue that match a test
+ * function. The test function will be passed an object with a `data` property,
+ * and a `priority` property, if this is a
+ * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.
+ * Invoked with `queue.remove(testFn)`, where `testFn` is of the form
+ * `function ({data, priority}) {}` and returns a Boolean.
+ * @property {Function} saturated - a callback that is called when the number of
+ * running workers hits the `concurrency` limit, and further tasks will be
+ * queued.
+ * @property {Function} unsaturated - a callback that is called when the number
+ * of running workers is less than the `concurrency` & `buffer` limits, and
+ * further tasks will not be queued.
+ * @property {number} buffer - A minimum threshold buffer in order to say that
+ * the `queue` is `unsaturated`.
+ * @property {Function} empty - a callback that is called when the last item
+ * from the `queue` is given to a `worker`.
+ * @property {Function} drain - a callback that is called when the last item
+ * from the `queue` has returned from the `worker`.
+ * @property {Function} error - a callback that is called when a task errors.
+ * Has the signature `function(error, task)`.
+ * @property {boolean} paused - a boolean for determining whether the queue is
+ * in a paused state.
+ * @property {Function} pause - a function that pauses the processing of tasks
+ * until `resume()` is called. Invoke with `queue.pause()`.
+ * @property {Function} resume - a function that resumes the processing of
+ * queued tasks when the queue is paused. Invoke with `queue.resume()`.
+ * @property {Function} kill - a function that removes the `drain` callback and
+ * empties remaining tasks from the queue forcing it to go idle. No more tasks
+ * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.
+ */
+
+/**
+ * Creates a `queue` object with the specified `concurrency`. Tasks added to the
+ * `queue` are processed in parallel (up to the `concurrency` limit). If all
+ * `worker`s are in progress, the task is queued until one becomes available.
+ * Once a `worker` completes a `task`, that `task`'s callback is called.
+ *
+ * @name queue
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {AsyncFunction} worker - An async function for processing a queued task.
+ * If you want to handle errors from an individual task, pass a callback to
+ * `q.push()`. Invoked with (task, callback).
+ * @param {number} [concurrency=1] - An `integer` for determining how many
+ * `worker` functions should be run in parallel. If omitted, the concurrency
+ * defaults to `1`. If the concurrency is `0`, an error is thrown.
+ * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can
+ * attached as certain properties to listen for specific events during the
+ * lifecycle of the queue.
+ * @example
+ *
+ * // create a queue object with concurrency 2
+ * var q = async.queue(function(task, callback) {
+ * console.log('hello ' + task.name);
+ * callback();
+ * }, 2);
+ *
+ * // assign a callback
+ * q.drain = function() {
+ * console.log('all items have been processed');
+ * };
+ *
+ * // add some items to the queue
+ * q.push({name: 'foo'}, function(err) {
+ * console.log('finished processing foo');
+ * });
+ * q.push({name: 'bar'}, function (err) {
+ * console.log('finished processing bar');
+ * });
+ *
+ * // add some items to the queue (batch-wise)
+ * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {
+ * console.log('finished processing item');
+ * });
+ *
+ * // add some items to the front of the queue
+ * q.unshift({name: 'bar'}, function (err) {
+ * console.log('finished processing bar');
+ * });
+ */
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/race.js b/node_modules/@pm2/io/node_modules/async/race.js
new file mode 100644
index 0000000..6713c74
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/race.js
@@ -0,0 +1,70 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = race;
+
+var _isArray = require('lodash/isArray');
+
+var _isArray2 = _interopRequireDefault(_isArray);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Runs the `tasks` array of functions in parallel, without waiting until the
+ * previous function has completed. Once any of the `tasks` complete or pass an
+ * error to its callback, the main `callback` is immediately called. It's
+ * equivalent to `Promise.race()`.
+ *
+ * @name race
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}
+ * to run. Each function can complete with an optional `result` value.
+ * @param {Function} callback - A callback to run once any of the functions have
+ * completed. This function gets an error or result from the first function that
+ * completed. Invoked with (err, result).
+ * @returns undefined
+ * @example
+ *
+ * async.race([
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'two');
+ * }, 100);
+ * }
+ * ],
+ * // main callback
+ * function(err, result) {
+ * // the result will be equal to 'two' as it finishes earlier
+ * });
+ */
+function race(tasks, callback) {
+ callback = (0, _once2.default)(callback || _noop2.default);
+ if (!(0, _isArray2.default)(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));
+ if (!tasks.length) return callback();
+ for (var i = 0, l = tasks.length; i < l; i++) {
+ (0, _wrapAsync2.default)(tasks[i])(callback);
+ }
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/reduce.js b/node_modules/@pm2/io/node_modules/async/reduce.js
new file mode 100644
index 0000000..3fb8019
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/reduce.js
@@ -0,0 +1,78 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = reduce;
+
+var _eachOfSeries = require('./eachOfSeries');
+
+var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Reduces `coll` into a single value using an async `iteratee` to return each
+ * successive step. `memo` is the initial state of the reduction. This function
+ * only operates in series.
+ *
+ * For performance reasons, it may make sense to split a call to this function
+ * into a parallel map, and then use the normal `Array.prototype.reduce` on the
+ * results. This function is for situations where each step in the reduction
+ * needs to be async; if you can get the data before reducing it, then it's
+ * probably a good idea to do so.
+ *
+ * @name reduce
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias inject
+ * @alias foldl
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {*} memo - The initial state of the reduction.
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * array to produce the next step in the reduction.
+ * The `iteratee` should complete with the next state of the reduction.
+ * If the iteratee complete with an error, the reduction is stopped and the
+ * main `callback` is immediately called with the error.
+ * Invoked with (memo, item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the reduced value. Invoked with
+ * (err, result).
+ * @example
+ *
+ * async.reduce([1,2,3], 0, function(memo, item, callback) {
+ * // pointless async:
+ * process.nextTick(function() {
+ * callback(null, memo + item)
+ * });
+ * }, function(err, result) {
+ * // result is now equal to the last value of memo, which is 6
+ * });
+ */
+function reduce(coll, memo, iteratee, callback) {
+ callback = (0, _once2.default)(callback || _noop2.default);
+ var _iteratee = (0, _wrapAsync2.default)(iteratee);
+ (0, _eachOfSeries2.default)(coll, function (x, i, callback) {
+ _iteratee(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/reduceRight.js b/node_modules/@pm2/io/node_modules/async/reduceRight.js
new file mode 100644
index 0000000..3d17d32
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/reduceRight.js
@@ -0,0 +1,44 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = reduceRight;
+
+var _reduce = require('./reduce');
+
+var _reduce2 = _interopRequireDefault(_reduce);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.
+ *
+ * @name reduceRight
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reduce]{@link module:Collections.reduce}
+ * @alias foldr
+ * @category Collection
+ * @param {Array} array - A collection to iterate over.
+ * @param {*} memo - The initial state of the reduction.
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * array to produce the next step in the reduction.
+ * The `iteratee` should complete with the next state of the reduction.
+ * If the iteratee complete with an error, the reduction is stopped and the
+ * main `callback` is immediately called with the error.
+ * Invoked with (memo, item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the reduced value. Invoked with
+ * (err, result).
+ */
+function reduceRight(array, memo, iteratee, callback) {
+ var reversed = (0, _slice2.default)(array).reverse();
+ (0, _reduce2.default)(reversed, memo, iteratee, callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/reflect.js b/node_modules/@pm2/io/node_modules/async/reflect.js
new file mode 100644
index 0000000..098ba86
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/reflect.js
@@ -0,0 +1,81 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = reflect;
+
+var _initialParams = require('./internal/initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Wraps the async function in another function that always completes with a
+ * result object, even when it errors.
+ *
+ * The result object has either the property `error` or `value`.
+ *
+ * @name reflect
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} fn - The async function you want to wrap
+ * @returns {Function} - A function that always passes null to it's callback as
+ * the error. The second argument to the callback will be an `object` with
+ * either an `error` or a `value` property.
+ * @example
+ *
+ * async.parallel([
+ * async.reflect(function(callback) {
+ * // do some stuff ...
+ * callback(null, 'one');
+ * }),
+ * async.reflect(function(callback) {
+ * // do some more stuff but error ...
+ * callback('bad stuff happened');
+ * }),
+ * async.reflect(function(callback) {
+ * // do some more stuff ...
+ * callback(null, 'two');
+ * })
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * // values
+ * // results[0].value = 'one'
+ * // results[1].error = 'bad stuff happened'
+ * // results[2].value = 'two'
+ * });
+ */
+function reflect(fn) {
+ var _fn = (0, _wrapAsync2.default)(fn);
+ return (0, _initialParams2.default)(function reflectOn(args, reflectCallback) {
+ args.push(function callback(error, cbArg) {
+ if (error) {
+ reflectCallback(null, { error: error });
+ } else {
+ var value;
+ if (arguments.length <= 2) {
+ value = cbArg;
+ } else {
+ value = (0, _slice2.default)(arguments, 1);
+ }
+ reflectCallback(null, { value: value });
+ }
+ });
+
+ return _fn.apply(this, args);
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/reflectAll.js b/node_modules/@pm2/io/node_modules/async/reflectAll.js
new file mode 100644
index 0000000..966e83d
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/reflectAll.js
@@ -0,0 +1,105 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = reflectAll;
+
+var _reflect = require('./reflect');
+
+var _reflect2 = _interopRequireDefault(_reflect);
+
+var _isArray = require('lodash/isArray');
+
+var _isArray2 = _interopRequireDefault(_isArray);
+
+var _arrayMap2 = require('lodash/_arrayMap');
+
+var _arrayMap3 = _interopRequireDefault(_arrayMap2);
+
+var _baseForOwn = require('lodash/_baseForOwn');
+
+var _baseForOwn2 = _interopRequireDefault(_baseForOwn);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * A helper function that wraps an array or an object of functions with `reflect`.
+ *
+ * @name reflectAll
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @see [async.reflect]{@link module:Utils.reflect}
+ * @category Util
+ * @param {Array|Object|Iterable} tasks - The collection of
+ * [async functions]{@link AsyncFunction} to wrap in `async.reflect`.
+ * @returns {Array} Returns an array of async functions, each wrapped in
+ * `async.reflect`
+ * @example
+ *
+ * let tasks = [
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * function(callback) {
+ * // do some more stuff but error ...
+ * callback(new Error('bad stuff happened'));
+ * },
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'two');
+ * }, 100);
+ * }
+ * ];
+ *
+ * async.parallel(async.reflectAll(tasks),
+ * // optional callback
+ * function(err, results) {
+ * // values
+ * // results[0].value = 'one'
+ * // results[1].error = Error('bad stuff happened')
+ * // results[2].value = 'two'
+ * });
+ *
+ * // an example using an object instead of an array
+ * let tasks = {
+ * one: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * two: function(callback) {
+ * callback('two');
+ * },
+ * three: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'three');
+ * }, 100);
+ * }
+ * };
+ *
+ * async.parallel(async.reflectAll(tasks),
+ * // optional callback
+ * function(err, results) {
+ * // values
+ * // results.one.value = 'one'
+ * // results.two.error = 'two'
+ * // results.three.value = 'three'
+ * });
+ */
+function reflectAll(tasks) {
+ var results;
+ if ((0, _isArray2.default)(tasks)) {
+ results = (0, _arrayMap3.default)(tasks, _reflect2.default);
+ } else {
+ results = {};
+ (0, _baseForOwn2.default)(tasks, function (task, key) {
+ results[key] = _reflect2.default.call(this, task);
+ });
+ }
+ return results;
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/reject.js b/node_modules/@pm2/io/node_modules/async/reject.js
new file mode 100644
index 0000000..53802b5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/reject.js
@@ -0,0 +1,45 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _reject = require('./internal/reject');
+
+var _reject2 = _interopRequireDefault(_reject);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.
+ *
+ * @name reject
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - An async truth test to apply to each item in
+ * `coll`.
+ * The should complete with a boolean value as its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ * @example
+ *
+ * async.reject(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, results) {
+ * // results now equals an array of missing files
+ * createFiles(results);
+ * });
+ */
+exports.default = (0, _doParallel2.default)(_reject2.default);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/rejectLimit.js b/node_modules/@pm2/io/node_modules/async/rejectLimit.js
new file mode 100644
index 0000000..74bba7f
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/rejectLimit.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _reject = require('./internal/reject');
+
+var _reject2 = _interopRequireDefault(_reject);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name rejectLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reject]{@link module:Collections.reject}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} iteratee - An async truth test to apply to each item in
+ * `coll`.
+ * The should complete with a boolean value as its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+exports.default = (0, _doParallelLimit2.default)(_reject2.default);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/rejectSeries.js b/node_modules/@pm2/io/node_modules/async/rejectSeries.js
new file mode 100644
index 0000000..f905588
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/rejectSeries.js
@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _rejectLimit = require('./rejectLimit');
+
+var _rejectLimit2 = _interopRequireDefault(_rejectLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.
+ *
+ * @name rejectSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reject]{@link module:Collections.reject}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - An async truth test to apply to each item in
+ * `coll`.
+ * The should complete with a boolean value as its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+exports.default = (0, _doLimit2.default)(_rejectLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/retry.js b/node_modules/@pm2/io/node_modules/async/retry.js
new file mode 100644
index 0000000..6a1aa1e
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/retry.js
@@ -0,0 +1,156 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = retry;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _constant = require('lodash/constant');
+
+var _constant2 = _interopRequireDefault(_constant);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Attempts to get a successful response from `task` no more than `times` times
+ * before returning an error. If the task is successful, the `callback` will be
+ * passed the result of the successful task. If all attempts fail, the callback
+ * will be passed the error and result (if any) of the final attempt.
+ *
+ * @name retry
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @see [async.retryable]{@link module:ControlFlow.retryable}
+ * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an
+ * object with `times` and `interval` or a number.
+ * * `times` - The number of attempts to make before giving up. The default
+ * is `5`.
+ * * `interval` - The time to wait between retries, in milliseconds. The
+ * default is `0`. The interval may also be specified as a function of the
+ * retry count (see example).
+ * * `errorFilter` - An optional synchronous function that is invoked on
+ * erroneous result. If it returns `true` the retry attempts will continue;
+ * if the function returns `false` the retry flow is aborted with the current
+ * attempt's error and result being returned to the final callback.
+ * Invoked with (err).
+ * * If `opts` is a number, the number specifies the number of times to retry,
+ * with the default interval of `0`.
+ * @param {AsyncFunction} task - An async function to retry.
+ * Invoked with (callback).
+ * @param {Function} [callback] - An optional callback which is called when the
+ * task has succeeded, or after the final failed attempt. It receives the `err`
+ * and `result` arguments of the last attempt at completing the `task`. Invoked
+ * with (err, results).
+ *
+ * @example
+ *
+ * // The `retry` function can be used as a stand-alone control flow by passing
+ * // a callback, as shown below:
+ *
+ * // try calling apiMethod 3 times
+ * async.retry(3, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod 3 times, waiting 200 ms between each retry
+ * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod 10 times with exponential backoff
+ * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)
+ * async.retry({
+ * times: 10,
+ * interval: function(retryCount) {
+ * return 50 * Math.pow(2, retryCount);
+ * }
+ * }, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod the default 5 times no delay between each retry
+ * async.retry(apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod only when error condition satisfies, all other
+ * // errors will abort the retry control flow and return to final callback
+ * async.retry({
+ * errorFilter: function(err) {
+ * return err.message === 'Temporary error'; // only retry on a specific error
+ * }
+ * }, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // to retry individual methods that are not as reliable within other
+ * // control flow functions, use the `retryable` wrapper:
+ * async.auto({
+ * users: api.getUsers.bind(api),
+ * payments: async.retryable(3, api.getPayments.bind(api))
+ * }, function(err, results) {
+ * // do something with the results
+ * });
+ *
+ */
+function retry(opts, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var DEFAULT_INTERVAL = 0;
+
+ var options = {
+ times: DEFAULT_TIMES,
+ intervalFunc: (0, _constant2.default)(DEFAULT_INTERVAL)
+ };
+
+ function parseTimes(acc, t) {
+ if (typeof t === 'object') {
+ acc.times = +t.times || DEFAULT_TIMES;
+
+ acc.intervalFunc = typeof t.interval === 'function' ? t.interval : (0, _constant2.default)(+t.interval || DEFAULT_INTERVAL);
+
+ acc.errorFilter = t.errorFilter;
+ } else if (typeof t === 'number' || typeof t === 'string') {
+ acc.times = +t || DEFAULT_TIMES;
+ } else {
+ throw new Error("Invalid arguments for async.retry");
+ }
+ }
+
+ if (arguments.length < 3 && typeof opts === 'function') {
+ callback = task || _noop2.default;
+ task = opts;
+ } else {
+ parseTimes(options, opts);
+ callback = callback || _noop2.default;
+ }
+
+ if (typeof task !== 'function') {
+ throw new Error("Invalid arguments for async.retry");
+ }
+
+ var _task = (0, _wrapAsync2.default)(task);
+
+ var attempt = 1;
+ function retryAttempt() {
+ _task(function (err) {
+ if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) {
+ setTimeout(retryAttempt, options.intervalFunc(attempt));
+ } else {
+ callback.apply(null, arguments);
+ }
+ });
+ }
+
+ retryAttempt();
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/retryable.js b/node_modules/@pm2/io/node_modules/async/retryable.js
new file mode 100644
index 0000000..002bfb0
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/retryable.js
@@ -0,0 +1,65 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (opts, task) {
+ if (!task) {
+ task = opts;
+ opts = null;
+ }
+ var _task = (0, _wrapAsync2.default)(task);
+ return (0, _initialParams2.default)(function (args, callback) {
+ function taskFn(cb) {
+ _task.apply(null, args.concat(cb));
+ }
+
+ if (opts) (0, _retry2.default)(opts, taskFn, callback);else (0, _retry2.default)(taskFn, callback);
+ });
+};
+
+var _retry = require('./retry');
+
+var _retry2 = _interopRequireDefault(_retry);
+
+var _initialParams = require('./internal/initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+module.exports = exports['default'];
+
+/**
+ * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method
+ * wraps a task and makes it retryable, rather than immediately calling it
+ * with retries.
+ *
+ * @name retryable
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.retry]{@link module:ControlFlow.retry}
+ * @category Control Flow
+ * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional
+ * options, exactly the same as from `retry`
+ * @param {AsyncFunction} task - the asynchronous function to wrap.
+ * This function will be passed any arguments passed to the returned wrapper.
+ * Invoked with (...args, callback).
+ * @returns {AsyncFunction} The wrapped function, which when invoked, will
+ * retry on an error, based on the parameters specified in `opts`.
+ * This function will accept the same parameters as `task`.
+ * @example
+ *
+ * async.auto({
+ * dep1: async.retryable(3, getFromFlakyService),
+ * process: ["dep1", async.retryable(3, function (results, cb) {
+ * maybeProcessData(results.dep1, cb);
+ * })]
+ * }, callback);
+ */
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/select.js b/node_modules/@pm2/io/node_modules/async/select.js
new file mode 100644
index 0000000..54772d5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/select.js
@@ -0,0 +1,45 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _filter = require('./internal/filter');
+
+var _filter2 = _interopRequireDefault(_filter);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns a new array of all the values in `coll` which pass an async truth
+ * test. This operation is performed in parallel, but the results array will be
+ * in the same order as the original.
+ *
+ * @name filter
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias select
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ * @example
+ *
+ * async.filter(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, results) {
+ * // results now equals an array of the existing files
+ * });
+ */
+exports.default = (0, _doParallel2.default)(_filter2.default);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/selectLimit.js b/node_modules/@pm2/io/node_modules/async/selectLimit.js
new file mode 100644
index 0000000..06216f7
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/selectLimit.js
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _filter = require('./internal/filter');
+
+var _filter2 = _interopRequireDefault(_filter);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name filterLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @alias selectLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+exports.default = (0, _doParallelLimit2.default)(_filter2.default);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/selectSeries.js b/node_modules/@pm2/io/node_modules/async/selectSeries.js
new file mode 100644
index 0000000..e48d966
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/selectSeries.js
@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _filterLimit = require('./filterLimit');
+
+var _filterLimit2 = _interopRequireDefault(_filterLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.
+ *
+ * @name filterSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @alias selectSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results)
+ */
+exports.default = (0, _doLimit2.default)(_filterLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/seq.js b/node_modules/@pm2/io/node_modules/async/seq.js
new file mode 100644
index 0000000..ff86ef9
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/seq.js
@@ -0,0 +1,91 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = seq;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _reduce = require('./reduce');
+
+var _reduce2 = _interopRequireDefault(_reduce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+var _arrayMap = require('lodash/_arrayMap');
+
+var _arrayMap2 = _interopRequireDefault(_arrayMap);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Version of the compose function that is more natural to read. Each function
+ * consumes the return value of the previous function. It is the equivalent of
+ * [compose]{@link module:ControlFlow.compose} with the arguments reversed.
+ *
+ * Each function is executed with the `this` binding of the composed function.
+ *
+ * @name seq
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.compose]{@link module:ControlFlow.compose}
+ * @category Control Flow
+ * @param {...AsyncFunction} functions - the asynchronous functions to compose
+ * @returns {Function} a function that composes the `functions` in order
+ * @example
+ *
+ * // Requires lodash (or underscore), express3 and dresende's orm2.
+ * // Part of an app, that fetches cats of the logged user.
+ * // This example uses `seq` function to avoid overnesting and error
+ * // handling clutter.
+ * app.get('/cats', function(request, response) {
+ * var User = request.models.User;
+ * async.seq(
+ * _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
+ * function(user, fn) {
+ * user.getCats(fn); // 'getCats' has signature (callback(err, data))
+ * }
+ * )(req.session.user_id, function (err, cats) {
+ * if (err) {
+ * console.error(err);
+ * response.json({ status: 'error', message: err.message });
+ * } else {
+ * response.json({ status: 'ok', message: 'Cats found', data: cats });
+ * }
+ * });
+ * });
+ */
+function seq() /*...functions*/{
+ var _functions = (0, _arrayMap2.default)(arguments, _wrapAsync2.default);
+ return function () /*...args*/{
+ var args = (0, _slice2.default)(arguments);
+ var that = this;
+
+ var cb = args[args.length - 1];
+ if (typeof cb == 'function') {
+ args.pop();
+ } else {
+ cb = _noop2.default;
+ }
+
+ (0, _reduce2.default)(_functions, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat(function (err /*, ...nextargs*/) {
+ var nextargs = (0, _slice2.default)(arguments, 1);
+ cb(err, nextargs);
+ }));
+ }, function (err, results) {
+ cb.apply(that, [err].concat(results));
+ });
+ };
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/series.js b/node_modules/@pm2/io/node_modules/async/series.js
new file mode 100644
index 0000000..e8c2928
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/series.js
@@ -0,0 +1,85 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = series;
+
+var _parallel = require('./internal/parallel');
+
+var _parallel2 = _interopRequireDefault(_parallel);
+
+var _eachOfSeries = require('./eachOfSeries');
+
+var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Run the functions in the `tasks` collection in series, each one running once
+ * the previous function has completed. If any functions in the series pass an
+ * error to its callback, no more functions are run, and `callback` is
+ * immediately called with the value of the error. Otherwise, `callback`
+ * receives an array of results when `tasks` have completed.
+ *
+ * It is also possible to use an object instead of an array. Each property will
+ * be run as a function, and the results will be passed to the final `callback`
+ * as an object instead of an array. This can be a more readable way of handling
+ * results from {@link async.series}.
+ *
+ * **Note** that while many implementations preserve the order of object
+ * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+ * explicitly states that
+ *
+ * > The mechanics and order of enumerating the properties is not specified.
+ *
+ * So if you rely on the order in which your series of functions are executed,
+ * and want this to work on all platforms, consider using an array.
+ *
+ * @name series
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection containing
+ * [async functions]{@link AsyncFunction} to run in series.
+ * Each function can complete with any number of optional `result` values.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed. This function gets a results array (or object)
+ * containing all the result arguments passed to the `task` callbacks. Invoked
+ * with (err, result).
+ * @example
+ * async.series([
+ * function(callback) {
+ * // do some stuff ...
+ * callback(null, 'one');
+ * },
+ * function(callback) {
+ * // do some more stuff ...
+ * callback(null, 'two');
+ * }
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * // results is now equal to ['one', 'two']
+ * });
+ *
+ * async.series({
+ * one: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 1);
+ * }, 200);
+ * },
+ * two: function(callback){
+ * setTimeout(function() {
+ * callback(null, 2);
+ * }, 100);
+ * }
+ * }, function(err, results) {
+ * // results is now equal to: {one: 1, two: 2}
+ * });
+ */
+function series(tasks, callback) {
+ (0, _parallel2.default)(_eachOfSeries2.default, tasks, callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/setImmediate.js b/node_modules/@pm2/io/node_modules/async/setImmediate.js
new file mode 100644
index 0000000..e52f7c5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/setImmediate.js
@@ -0,0 +1,45 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _setImmediate = require('./internal/setImmediate');
+
+var _setImmediate2 = _interopRequireDefault(_setImmediate);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Calls `callback` on a later loop around the event loop. In Node.js this just
+ * calls `setImmediate`. In the browser it will use `setImmediate` if
+ * available, otherwise `setTimeout(callback, 0)`, which means other higher
+ * priority events may precede the execution of `callback`.
+ *
+ * This is used internally for browser-compatibility purposes.
+ *
+ * @name setImmediate
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @see [async.nextTick]{@link module:Utils.nextTick}
+ * @category Util
+ * @param {Function} callback - The function to call on a later loop around
+ * the event loop. Invoked with (args...).
+ * @param {...*} args... - any number of additional arguments to pass to the
+ * callback on the next tick.
+ * @example
+ *
+ * var call_order = [];
+ * async.nextTick(function() {
+ * call_order.push('two');
+ * // call_order now equals ['one','two']
+ * });
+ * call_order.push('one');
+ *
+ * async.setImmediate(function (a, b, c) {
+ * // a, b, and c equal 1, 2, and 3
+ * }, 1, 2, 3);
+ */
+exports.default = _setImmediate2.default;
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/some.js b/node_modules/@pm2/io/node_modules/async/some.js
new file mode 100644
index 0000000..a8e70f7
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/some.js
@@ -0,0 +1,52 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns `true` if at least one element in the `coll` satisfies an async test.
+ * If any iteratee call returns `true`, the main `callback` is immediately
+ * called.
+ *
+ * @name some
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias any
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in parallel.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ * @example
+ *
+ * async.some(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // if result is true then at least one of the files exists
+ * });
+ */
+exports.default = (0, _doParallel2.default)((0, _createTester2.default)(Boolean, _identity2.default));
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/someLimit.js b/node_modules/@pm2/io/node_modules/async/someLimit.js
new file mode 100644
index 0000000..24ca3f4
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/someLimit.js
@@ -0,0 +1,43 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name someLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.some]{@link module:Collections.some}
+ * @alias anyLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in parallel.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ */
+exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(Boolean, _identity2.default));
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/someSeries.js b/node_modules/@pm2/io/node_modules/async/someSeries.js
new file mode 100644
index 0000000..dc24ed2
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/someSeries.js
@@ -0,0 +1,38 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _someLimit = require('./someLimit');
+
+var _someLimit2 = _interopRequireDefault(_someLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.
+ *
+ * @name someSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.some]{@link module:Collections.some}
+ * @alias anySeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in series.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_someLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/sortBy.js b/node_modules/@pm2/io/node_modules/async/sortBy.js
new file mode 100644
index 0000000..ee5e93d
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/sortBy.js
@@ -0,0 +1,91 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = sortBy;
+
+var _arrayMap = require('lodash/_arrayMap');
+
+var _arrayMap2 = _interopRequireDefault(_arrayMap);
+
+var _baseProperty = require('lodash/_baseProperty');
+
+var _baseProperty2 = _interopRequireDefault(_baseProperty);
+
+var _map = require('./map');
+
+var _map2 = _interopRequireDefault(_map);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Sorts a list by the results of running each `coll` value through an async
+ * `iteratee`.
+ *
+ * @name sortBy
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a value to use as the sort criteria as
+ * its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} callback - A callback which is called after all the
+ * `iteratee` functions have finished, or an error occurs. Results is the items
+ * from the original `coll` sorted by the values returned by the `iteratee`
+ * calls. Invoked with (err, results).
+ * @example
+ *
+ * async.sortBy(['file1','file2','file3'], function(file, callback) {
+ * fs.stat(file, function(err, stats) {
+ * callback(err, stats.mtime);
+ * });
+ * }, function(err, results) {
+ * // results is now the original array of files sorted by
+ * // modified date
+ * });
+ *
+ * // By modifying the callback parameter the
+ * // sorting order can be influenced:
+ *
+ * // ascending order
+ * async.sortBy([1,9,3,5], function(x, callback) {
+ * callback(null, x);
+ * }, function(err,result) {
+ * // result callback
+ * });
+ *
+ * // descending order
+ * async.sortBy([1,9,3,5], function(x, callback) {
+ * callback(null, x*-1); //<- x*-1 instead of x, turns the order around
+ * }, function(err,result) {
+ * // result callback
+ * });
+ */
+function sortBy(coll, iteratee, callback) {
+ var _iteratee = (0, _wrapAsync2.default)(iteratee);
+ (0, _map2.default)(coll, function (x, callback) {
+ _iteratee(x, function (err, criteria) {
+ if (err) return callback(err);
+ callback(null, { value: x, criteria: criteria });
+ });
+ }, function (err, results) {
+ if (err) return callback(err);
+ callback(null, (0, _arrayMap2.default)(results.sort(comparator), (0, _baseProperty2.default)('value')));
+ });
+
+ function comparator(left, right) {
+ var a = left.criteria,
+ b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/timeout.js b/node_modules/@pm2/io/node_modules/async/timeout.js
new file mode 100644
index 0000000..b5cb505
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/timeout.js
@@ -0,0 +1,89 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = timeout;
+
+var _initialParams = require('./internal/initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Sets a time limit on an asynchronous function. If the function does not call
+ * its callback within the specified milliseconds, it will be called with a
+ * timeout error. The code property for the error object will be `'ETIMEDOUT'`.
+ *
+ * @name timeout
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} asyncFn - The async function to limit in time.
+ * @param {number} milliseconds - The specified time limit.
+ * @param {*} [info] - Any variable you want attached (`string`, `object`, etc)
+ * to timeout Error for more information..
+ * @returns {AsyncFunction} Returns a wrapped function that can be used with any
+ * of the control flow functions.
+ * Invoke this function with the same parameters as you would `asyncFunc`.
+ * @example
+ *
+ * function myFunction(foo, callback) {
+ * doAsyncTask(foo, function(err, data) {
+ * // handle errors
+ * if (err) return callback(err);
+ *
+ * // do some stuff ...
+ *
+ * // return processed data
+ * return callback(null, data);
+ * });
+ * }
+ *
+ * var wrapped = async.timeout(myFunction, 1000);
+ *
+ * // call `wrapped` as you would `myFunction`
+ * wrapped({ bar: 'bar' }, function(err, data) {
+ * // if `myFunction` takes < 1000 ms to execute, `err`
+ * // and `data` will have their expected values
+ *
+ * // else `err` will be an Error with the code 'ETIMEDOUT'
+ * });
+ */
+function timeout(asyncFn, milliseconds, info) {
+ var fn = (0, _wrapAsync2.default)(asyncFn);
+
+ return (0, _initialParams2.default)(function (args, callback) {
+ var timedOut = false;
+ var timer;
+
+ function timeoutCallback() {
+ var name = asyncFn.name || 'anonymous';
+ var error = new Error('Callback function "' + name + '" timed out.');
+ error.code = 'ETIMEDOUT';
+ if (info) {
+ error.info = info;
+ }
+ timedOut = true;
+ callback(error);
+ }
+
+ args.push(function () {
+ if (!timedOut) {
+ callback.apply(null, arguments);
+ clearTimeout(timer);
+ }
+ });
+
+ // setup timer and call original function
+ timer = setTimeout(timeoutCallback, milliseconds);
+ fn.apply(null, args);
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/times.js b/node_modules/@pm2/io/node_modules/async/times.js
new file mode 100644
index 0000000..b5ca24d
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/times.js
@@ -0,0 +1,50 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _timesLimit = require('./timesLimit');
+
+var _timesLimit2 = _interopRequireDefault(_timesLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Calls the `iteratee` function `n` times, and accumulates results in the same
+ * manner you would use with [map]{@link module:Collections.map}.
+ *
+ * @name times
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.map]{@link module:Collections.map}
+ * @category Control Flow
+ * @param {number} n - The number of times to run the function.
+ * @param {AsyncFunction} iteratee - The async function to call `n` times.
+ * Invoked with the iteration index and a callback: (n, next).
+ * @param {Function} callback - see {@link module:Collections.map}.
+ * @example
+ *
+ * // Pretend this is some complicated async factory
+ * var createUser = function(id, callback) {
+ * callback(null, {
+ * id: 'user' + id
+ * });
+ * };
+ *
+ * // generate 5 users
+ * async.times(5, function(n, next) {
+ * createUser(n, function(err, user) {
+ * next(err, user);
+ * });
+ * }, function(err, users) {
+ * // we should now have 5 users
+ * });
+ */
+exports.default = (0, _doLimit2.default)(_timesLimit2.default, Infinity);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/timesLimit.js b/node_modules/@pm2/io/node_modules/async/timesLimit.js
new file mode 100644
index 0000000..aad8495
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/timesLimit.js
@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = timeLimit;
+
+var _mapLimit = require('./mapLimit');
+
+var _mapLimit2 = _interopRequireDefault(_mapLimit);
+
+var _baseRange = require('lodash/_baseRange');
+
+var _baseRange2 = _interopRequireDefault(_baseRange);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name timesLimit
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.times]{@link module:ControlFlow.times}
+ * @category Control Flow
+ * @param {number} count - The number of times to run the function.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - The async function to call `n` times.
+ * Invoked with the iteration index and a callback: (n, next).
+ * @param {Function} callback - see [async.map]{@link module:Collections.map}.
+ */
+function timeLimit(count, limit, iteratee, callback) {
+ var _iteratee = (0, _wrapAsync2.default)(iteratee);
+ (0, _mapLimit2.default)((0, _baseRange2.default)(0, count, 1), limit, _iteratee, callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/timesSeries.js b/node_modules/@pm2/io/node_modules/async/timesSeries.js
new file mode 100644
index 0000000..f187a35
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/timesSeries.js
@@ -0,0 +1,32 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _timesLimit = require('./timesLimit');
+
+var _timesLimit2 = _interopRequireDefault(_timesLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.
+ *
+ * @name timesSeries
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.times]{@link module:ControlFlow.times}
+ * @category Control Flow
+ * @param {number} n - The number of times to run the function.
+ * @param {AsyncFunction} iteratee - The async function to call `n` times.
+ * Invoked with the iteration index and a callback: (n, next).
+ * @param {Function} callback - see {@link module:Collections.map}.
+ */
+exports.default = (0, _doLimit2.default)(_timesLimit2.default, 1);
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/transform.js b/node_modules/@pm2/io/node_modules/async/transform.js
new file mode 100644
index 0000000..84ee217
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/transform.js
@@ -0,0 +1,87 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = transform;
+
+var _isArray = require('lodash/isArray');
+
+var _isArray2 = _interopRequireDefault(_isArray);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _eachOf = require('./eachOf');
+
+var _eachOf2 = _interopRequireDefault(_eachOf);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * A relative of `reduce`. Takes an Object or Array, and iterates over each
+ * element in series, each step potentially mutating an `accumulator` value.
+ * The type of the accumulator defaults to the type of collection passed in.
+ *
+ * @name transform
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {*} [accumulator] - The initial state of the transform. If omitted,
+ * it will default to an empty Object or Array, depending on the type of `coll`
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * collection that potentially modifies the accumulator.
+ * Invoked with (accumulator, item, key, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the transformed accumulator.
+ * Invoked with (err, result).
+ * @example
+ *
+ * async.transform([1,2,3], function(acc, item, index, callback) {
+ * // pointless async:
+ * process.nextTick(function() {
+ * acc.push(item * 2)
+ * callback(null)
+ * });
+ * }, function(err, result) {
+ * // result is now equal to [2, 4, 6]
+ * });
+ *
+ * @example
+ *
+ * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) {
+ * setImmediate(function () {
+ * obj[key] = val * 2;
+ * callback();
+ * })
+ * }, function (err, result) {
+ * // result is equal to {a: 2, b: 4, c: 6}
+ * })
+ */
+function transform(coll, accumulator, iteratee, callback) {
+ if (arguments.length <= 3) {
+ callback = iteratee;
+ iteratee = accumulator;
+ accumulator = (0, _isArray2.default)(coll) ? [] : {};
+ }
+ callback = (0, _once2.default)(callback || _noop2.default);
+ var _iteratee = (0, _wrapAsync2.default)(iteratee);
+
+ (0, _eachOf2.default)(coll, function (v, k, cb) {
+ _iteratee(accumulator, v, k, cb);
+ }, function (err) {
+ callback(err, accumulator);
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/tryEach.js b/node_modules/@pm2/io/node_modules/async/tryEach.js
new file mode 100644
index 0000000..f4e4c97
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/tryEach.js
@@ -0,0 +1,81 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = tryEach;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _eachSeries = require('./eachSeries');
+
+var _eachSeries2 = _interopRequireDefault(_eachSeries);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * It runs each task in series but stops whenever any of the functions were
+ * successful. If one of the tasks were successful, the `callback` will be
+ * passed the result of the successful task. If all tasks fail, the callback
+ * will be passed the error and result (if any) of the final attempt.
+ *
+ * @name tryEach
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection containing functions to
+ * run, each function is passed a `callback(err, result)` it must call on
+ * completion with an error `err` (which can be `null`) and an optional `result`
+ * value.
+ * @param {Function} [callback] - An optional callback which is called when one
+ * of the tasks has succeeded, or all have failed. It receives the `err` and
+ * `result` arguments of the last attempt at completing the `task`. Invoked with
+ * (err, results).
+ * @example
+ * async.tryEach([
+ * function getDataFromFirstWebsite(callback) {
+ * // Try getting the data from the first website
+ * callback(err, data);
+ * },
+ * function getDataFromSecondWebsite(callback) {
+ * // First website failed,
+ * // Try getting the data from the backup website
+ * callback(err, data);
+ * }
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * Now do something with the data.
+ * });
+ *
+ */
+function tryEach(tasks, callback) {
+ var error = null;
+ var result;
+ callback = callback || _noop2.default;
+ (0, _eachSeries2.default)(tasks, function (task, callback) {
+ (0, _wrapAsync2.default)(task)(function (err, res /*, ...args*/) {
+ if (arguments.length > 2) {
+ result = (0, _slice2.default)(arguments, 1);
+ } else {
+ result = res;
+ }
+ error = err;
+ callback(!err);
+ });
+ }, function () {
+ callback(error, result);
+ });
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/unmemoize.js b/node_modules/@pm2/io/node_modules/async/unmemoize.js
new file mode 100644
index 0000000..08f9f9f
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/unmemoize.js
@@ -0,0 +1,25 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = unmemoize;
+/**
+ * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,
+ * unmemoized form. Handy for testing.
+ *
+ * @name unmemoize
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @see [async.memoize]{@link module:Utils.memoize}
+ * @category Util
+ * @param {AsyncFunction} fn - the memoized function
+ * @returns {AsyncFunction} a function that calls the original unmemoized function
+ */
+function unmemoize(fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+}
+module.exports = exports["default"];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/until.js b/node_modules/@pm2/io/node_modules/async/until.js
new file mode 100644
index 0000000..29955ab
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/until.js
@@ -0,0 +1,41 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = until;
+
+var _whilst = require('./whilst');
+
+var _whilst2 = _interopRequireDefault(_whilst);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when
+ * stopped, or an error occurs. `callback` will be passed an error and any
+ * arguments passed to the final `iteratee`'s callback.
+ *
+ * The inverse of [whilst]{@link module:ControlFlow.whilst}.
+ *
+ * @name until
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.whilst]{@link module:ControlFlow.whilst}
+ * @category Control Flow
+ * @param {Function} test - synchronous truth test to perform before each
+ * execution of `iteratee`. Invoked with ().
+ * @param {AsyncFunction} iteratee - An async function which is called each time
+ * `test` fails. Invoked with (callback).
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has passed and repeated execution of `iteratee` has stopped. `callback`
+ * will be passed an error and any arguments passed to the final `iteratee`'s
+ * callback. Invoked with (err, [results]);
+ */
+function until(test, iteratee, callback) {
+ (0, _whilst2.default)(function () {
+ return !test.apply(this, arguments);
+ }, iteratee, callback);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/waterfall.js b/node_modules/@pm2/io/node_modules/async/waterfall.js
new file mode 100644
index 0000000..d547d6b
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/waterfall.js
@@ -0,0 +1,113 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (tasks, callback) {
+ callback = (0, _once2.default)(callback || _noop2.default);
+ if (!(0, _isArray2.default)(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));
+ if (!tasks.length) return callback();
+ var taskIndex = 0;
+
+ function nextTask(args) {
+ var task = (0, _wrapAsync2.default)(tasks[taskIndex++]);
+ args.push((0, _onlyOnce2.default)(next));
+ task.apply(null, args);
+ }
+
+ function next(err /*, ...args*/) {
+ if (err || taskIndex === tasks.length) {
+ return callback.apply(null, arguments);
+ }
+ nextTask((0, _slice2.default)(arguments, 1));
+ }
+
+ nextTask([]);
+};
+
+var _isArray = require('lodash/isArray');
+
+var _isArray2 = _interopRequireDefault(_isArray);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+module.exports = exports['default'];
+
+/**
+ * Runs the `tasks` array of functions in series, each passing their results to
+ * the next in the array. However, if any of the `tasks` pass an error to their
+ * own callback, the next function is not executed, and the main `callback` is
+ * immediately called with the error.
+ *
+ * @name waterfall
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}
+ * to run.
+ * Each function should complete with any number of `result` values.
+ * The `result` values will be passed as arguments, in order, to the next task.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed. This will be passed the results of the last task's
+ * callback. Invoked with (err, [results]).
+ * @returns undefined
+ * @example
+ *
+ * async.waterfall([
+ * function(callback) {
+ * callback(null, 'one', 'two');
+ * },
+ * function(arg1, arg2, callback) {
+ * // arg1 now equals 'one' and arg2 now equals 'two'
+ * callback(null, 'three');
+ * },
+ * function(arg1, callback) {
+ * // arg1 now equals 'three'
+ * callback(null, 'done');
+ * }
+ * ], function (err, result) {
+ * // result now equals 'done'
+ * });
+ *
+ * // Or, with named functions:
+ * async.waterfall([
+ * myFirstFunction,
+ * mySecondFunction,
+ * myLastFunction,
+ * ], function (err, result) {
+ * // result now equals 'done'
+ * });
+ * function myFirstFunction(callback) {
+ * callback(null, 'one', 'two');
+ * }
+ * function mySecondFunction(arg1, arg2, callback) {
+ * // arg1 now equals 'one' and arg2 now equals 'two'
+ * callback(null, 'three');
+ * }
+ * function myLastFunction(arg1, callback) {
+ * // arg1 now equals 'three'
+ * callback(null, 'done');
+ * }
+ */
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/whilst.js b/node_modules/@pm2/io/node_modules/async/whilst.js
new file mode 100644
index 0000000..9c4d8f6
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/whilst.js
@@ -0,0 +1,72 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = whilst;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when
+ * stopped, or an error occurs.
+ *
+ * @name whilst
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Function} test - synchronous truth test to perform before each
+ * execution of `iteratee`. Invoked with ().
+ * @param {AsyncFunction} iteratee - An async function which is called each time
+ * `test` passes. Invoked with (callback).
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `iteratee` has stopped. `callback`
+ * will be passed an error and any arguments passed to the final `iteratee`'s
+ * callback. Invoked with (err, [results]);
+ * @returns undefined
+ * @example
+ *
+ * var count = 0;
+ * async.whilst(
+ * function() { return count < 5; },
+ * function(callback) {
+ * count++;
+ * setTimeout(function() {
+ * callback(null, count);
+ * }, 1000);
+ * },
+ * function (err, n) {
+ * // 5 seconds have passed, n = 5
+ * }
+ * );
+ */
+function whilst(test, iteratee, callback) {
+ callback = (0, _onlyOnce2.default)(callback || _noop2.default);
+ var _iteratee = (0, _wrapAsync2.default)(iteratee);
+ if (!test()) return callback(null);
+ var next = function (err /*, ...args*/) {
+ if (err) return callback(err);
+ if (test()) return _iteratee(next);
+ var args = (0, _slice2.default)(arguments, 1);
+ callback.apply(null, [null].concat(args));
+ };
+ _iteratee(next);
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/async/wrapSync.js b/node_modules/@pm2/io/node_modules/async/wrapSync.js
new file mode 100644
index 0000000..5e3fc91
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/async/wrapSync.js
@@ -0,0 +1,110 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = asyncify;
+
+var _isObject = require('lodash/isObject');
+
+var _isObject2 = _interopRequireDefault(_isObject);
+
+var _initialParams = require('./internal/initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+var _setImmediate = require('./internal/setImmediate');
+
+var _setImmediate2 = _interopRequireDefault(_setImmediate);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Take a sync function and make it async, passing its return value to a
+ * callback. This is useful for plugging sync functions into a waterfall,
+ * series, or other async functions. Any arguments passed to the generated
+ * function will be passed to the wrapped function (except for the final
+ * callback argument). Errors thrown will be passed to the callback.
+ *
+ * If the function passed to `asyncify` returns a Promise, that promises's
+ * resolved/rejected state will be used to call the callback, rather than simply
+ * the synchronous return value.
+ *
+ * This also means you can asyncify ES2017 `async` functions.
+ *
+ * @name asyncify
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @alias wrapSync
+ * @category Util
+ * @param {Function} func - The synchronous function, or Promise-returning
+ * function to convert to an {@link AsyncFunction}.
+ * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be
+ * invoked with `(args..., callback)`.
+ * @example
+ *
+ * // passing a regular synchronous function
+ * async.waterfall([
+ * async.apply(fs.readFile, filename, "utf8"),
+ * async.asyncify(JSON.parse),
+ * function (data, next) {
+ * // data is the result of parsing the text.
+ * // If there was a parsing error, it would have been caught.
+ * }
+ * ], callback);
+ *
+ * // passing a function returning a promise
+ * async.waterfall([
+ * async.apply(fs.readFile, filename, "utf8"),
+ * async.asyncify(function (contents) {
+ * return db.model.create(contents);
+ * }),
+ * function (model, next) {
+ * // `model` is the instantiated model object.
+ * // If there was an error, this function would be skipped.
+ * }
+ * ], callback);
+ *
+ * // es2017 example, though `asyncify` is not needed if your JS environment
+ * // supports async functions out of the box
+ * var q = async.queue(async.asyncify(async function(file) {
+ * var intermediateStep = await processFile(file);
+ * return await somePromise(intermediateStep)
+ * }));
+ *
+ * q.push(files);
+ */
+function asyncify(func) {
+ return (0, _initialParams2.default)(function (args, callback) {
+ var result;
+ try {
+ result = func.apply(this, args);
+ } catch (e) {
+ return callback(e);
+ }
+ // if result is Promise object
+ if ((0, _isObject2.default)(result) && typeof result.then === 'function') {
+ result.then(function (value) {
+ invokeCallback(callback, null, value);
+ }, function (err) {
+ invokeCallback(callback, err.message ? err : new Error(err));
+ });
+ } else {
+ callback(null, result);
+ }
+ });
+}
+
+function invokeCallback(callback, error, value) {
+ try {
+ callback(error, value);
+ } catch (e) {
+ (0, _setImmediate2.default)(rethrow, e);
+ }
+}
+
+function rethrow(error) {
+ throw error;
+}
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/node_modules/@pm2/io/node_modules/eventemitter2/LICENSE.txt b/node_modules/@pm2/io/node_modules/eventemitter2/LICENSE.txt
new file mode 100644
index 0000000..3f021f5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/eventemitter2/LICENSE.txt
@@ -0,0 +1,21 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2016 Paolo Fragomeni and Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the 'Software'), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@pm2/io/node_modules/eventemitter2/README.md b/node_modules/@pm2/io/node_modules/eventemitter2/README.md
new file mode 100644
index 0000000..a1a7222
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/eventemitter2/README.md
@@ -0,0 +1,809 @@
+[](https://travis-ci.org/EventEmitter2/EventEmitter2)
+[](https://coveralls.io/github/EventEmitter2/EventEmitter2?branch=v6.4.3)
+[](http://badge.fury.io/js/eventemitter2)
+[](https://david-dm.org/asyncly/eventemitter2)
+[]()
+
+# SYNOPSIS
+
+EventEmitter2 is an implementation of the EventEmitter module found in Node.js.
+In addition to having a better benchmark performance than EventEmitter and being browser-compatible,
+it also extends the interface of EventEmitter with many additional non-breaking features.
+
+If you like this project please show your support with a [GitHub :star:](https://github.com/EventEmitter2/EventEmitter2/stargazers)!
+
+# DESCRIPTION
+
+### FEATURES
+ - ES5 compatible UMD module, that supports node.js, browser and workers of any kind
+ - Namespaces/Wildcards
+ - [Any](#emitteronanylistener) listeners
+ - Times To Listen (TTL), extends the `once` concept with [`many`](#emittermanyevent--eventns-timestolisten-listener-options)
+ - [Async listeners](#emitteronevent-listener-options-objectboolean) (using setImmediate|setTimeout|nextTick) with promise|async function support
+ - The [emitAsync](#emitteremitasyncevent--eventns-arg1-arg2-) method to return the results of the listeners via Promise.all
+ - Subscription methods ([on](#emitteronevent-listener-options-objectboolean), [once](#emitterprependoncelistenerevent--eventns-listener-options), [many](#emittermanyevent--eventns-timestolisten-listener-options), ...) can return a
+ [listener](#listener) object that makes it easy to remove the subscription when needed - just call the listener.off() method.
+ - Feature-rich [waitFor](#emitterwaitforevent--eventns-options) method to wait for events using promises
+ - [listenTo](#listentotargetemitter-events-objectevent--eventns-function-options) & [stopListeningTo](#stoplisteningtotarget-object-event-event--eventns-boolean) methods
+ for listening to an external event emitter of any kind and propagate its events through itself using optional reducers/filters
+ - Extended version of the [events.once](#eventemitter2onceemitter-event--eventns-options) method from the [node events API](https://nodejs.org/api/events.html#events_events_once_emitter_name)
+ - Browser & Workers environment compatibility
+ - Demonstrates good performance in benchmarks
+
+```
+Platform: win32, x64, 15267MB
+Node version: v13.11.0
+CPU: 4 x AMD Ryzen 3 2200U with Radeon Vega Mobile Gfx @ 2495MHz
+----------------------------------------------------------------
+EventEmitterHeatUp x 2,897,056 ops/sec ±3.86% (67 runs sampled)
+EventEmitter x 3,232,934 ops/sec ±3.50% (65 runs sampled)
+EventEmitter2 x 12,261,042 ops/sec ±4.72% (59 runs sampled)
+EventEmitter2 (wild) x 242,751 ops/sec ±5.15% (68 runs sampled)
+EventEmitter2 (wild) using plain events x 358,916 ops/sec ±2.58% (78 runs sampled)
+EventEmitter2 (wild) emitting ns x 1,837,323 ops/sec ±3.50% (72 runs sampled)
+EventEmitter2 (wild) emitting a plain event x 2,743,707 ops/sec ±4.08% (65 runs sampled)
+EventEmitter3 x 10,380,258 ops/sec ±3.93% (67 runs sampled)
+
+Fastest is EventEmitter2
+```
+
+### What's new
+
+To find out what's new see the project [CHANGELOG](https://github.com/EventEmitter2/EventEmitter2/blob/master/CHANGELOG.md)
+
+### Differences (Non-breaking, compatible with existing EventEmitter)
+
+ - The EventEmitter2 constructor takes an optional configuration object with the following default values:
+```javascript
+var EventEmitter2 = require('eventemitter2');
+var emitter = new EventEmitter2({
+
+ // set this to `true` to use wildcards
+ wildcard: false,
+
+ // the delimiter used to segment namespaces
+ delimiter: '.',
+
+ // set this to `true` if you want to emit the newListener event
+ newListener: false,
+
+ // set this to `true` if you want to emit the removeListener event
+ removeListener: false,
+
+ // the maximum amount of listeners that can be assigned to an event
+ maxListeners: 10,
+
+ // show event name in memory leak message when more than maximum amount of listeners is assigned
+ verboseMemoryLeak: false,
+
+ // disable throwing uncaughtException if an error event is emitted and it has no listeners
+ ignoreErrors: false
+});
+```
+
+ - Getting the actual event that fired.
+
+```javascript
+emitter.on('foo.*', function(value1, value2) {
+ console.log(this.event, value1, value2);
+});
+
+emitter.emit('foo.bar', 1, 2); // 'foo.bar' 1 2
+emitter.emit(['foo', 'bar'], 3, 4); // 'foo.bar' 3 4
+
+emitter.emit(Symbol(), 5, 6); // Symbol() 5 6
+emitter.emit(['foo', Symbol()], 7, 8); // ['foo', Symbol()] 7 8
+```
+**Note**: Generally this.event is normalized to a string ('event', 'event.test'),
+except the cases when event is a symbol or namespace contains a symbol.
+In these cases this.event remains as is (symbol and array).
+
+ - Fire an event N times and then remove it, an extension of the `once` concept.
+
+```javascript
+emitter.many('foo', 4, function() {
+ console.log('hello');
+});
+```
+
+ - Pass in a namespaced event as an array rather than a delimited string.
+
+```javascript
+emitter.many(['foo', 'bar', 'bazz'], 4, function() {
+ console.log('hello');
+});
+```
+
+# Installing
+
+```console
+$ npm install eventemitter2
+```
+
+Or you can use unpkg.com CDN to import this [module](https://unpkg.com/eventemitter2) as a script directly from the browser
+
+# API
+
+### Types definition
+- `Event`: string | symbol
+- `EventNS`: string | Event []
+
+## Class EventEmitter2
+
+### instance:
+- [emit(event: event | eventNS, ...values: any[]): boolean](#emitteremitevent--eventns-arg1-arg2-);
+
+- [emitAsync(event: event | eventNS, ...values: any[]): Promise](#emitteremitasyncevent--eventns-arg1-arg2-)
+
+- [addListener(event: event | eventNS, listener: ListenerFn, boolean|options?: object): this|Listener](#emitteraddlistenerevent-listener-options-objectboolean)
+
+- [on(event: event | eventNS, listener: ListenerFn, boolean|options?: object): this|Listener](#emitteraddlistenerevent-listener-options-objectboolean)
+
+- [once(event: event | eventNS, listener: ListenerFn, boolean|options?: object): this|Listener](#emitteronceevent--eventns-listener-options)
+
+- [many(event: event | eventNS, timesToListen: number, listener: ListenerFn, boolean|options?: object): this|Listener](#emittermanyevent--eventns-timestolisten-listener-options)
+
+- [prependMany(event: event | eventNS, timesToListen: number, listener: ListenerFn, boolean|options?: object): this|Listener](#emitterprependanylistener)
+
+- [prependOnceListener(event: event | eventNS, listener: ListenerFn, boolean|options?: object): this|Listener](#emitterprependoncelistenerevent--eventns-listener-options)
+
+- [prependListener(event: event | eventNS, listener: ListenerFn, boolean|options?: object): this|Listener](#emitterprependlistenerevent-listener-options)
+
+- [prependAny(listener: EventAndListener): this](#emitterprependanylistener)
+
+- [onAny(listener: EventAndListener): this](#emitteronanylistener)
+
+- [offAny(listener: ListenerFn): this](#emitteroffanylistener)
+
+- [removeListener(event: event | eventNS, listener: ListenerFn): this](#emitterremovelistenerevent--eventns-listener)
+
+- [off(event: event | eventNS, listener: ListenerFn): this](#emitteroffevent--eventns-listener)
+
+- [removeAllListeners(event?: event | eventNS): this](#emitterremovealllistenersevent--eventns)
+
+- [setMaxListeners(n: number): void](#emittersetmaxlistenersn)
+
+- [getMaxListeners(): number](#emittergetmaxlisteners)
+
+- [eventNames(nsAsArray?: boolean): string[]](#emittereventnamesnsasarray)
+
+- [listeners(event: event | eventNS): ListenerFn[]](#emitterlistenersevent--eventns)
+
+- [listenersAny(): ListenerFn[]](#emitterlistenersany)
+
+- [hasListeners(event?: event | eventNS): Boolean](#haslistenersevent--eventnsstringboolean)
+
+- [waitFor(event: event | eventNS, timeout?: number): CancelablePromise](#emitterwaitforevent--eventns-timeout)
+
+- [waitFor(event: event | eventNS, filter?: WaitForFilter): CancelablePromise](#emitterwaitforevent--eventns-filter)
+
+- [waitFor(event: event | eventNS, options?: WaitForOptions): CancelablePromise](#emitterwaitforevent--eventns-options)
+
+- [listenTo(target: GeneralEventEmitter, event: event | eventNS, options?: ListenToOptions): this](#listentotargetemitter-events-objectevent--eventns-function-options)
+
+- [listenTo(target: GeneralEventEmitter, events: (event | eventNS)[], options?: ListenToOptions): this](#listentotargetemitter-events-event--eventns-options)
+
+- [listenTo(target: GeneralEventEmitter, events: Object, options?: ListenToOptions): this](#listentotargetemitter-events-objectevent--eventns-function-options)
+
+- [stopListeningTo(target?: GeneralEventEmitter, event?: event | eventNS): Boolean](#stoplisteningtarget-object-event-event--eventns-boolean)
+
+### static:
+
+- [static once(emitter: EventEmitter2, event: string | symbol, options?: OnceOptions): CancelablePromise](#eventemitter2onceemitter-event--eventns-options)
+
+- [static defaultMaxListeners: number](#eventemitter2defaultmaxlisteners)
+
+The `event` argument specified in the API declaration can be a string or symbol for a simple event emitter
+and a string|symbol|Array(string|symbol) in a case of a wildcard emitter;
+
+When an `EventEmitter` instance experiences an error, the typical action is
+to emit an `error` event. Error events are treated as a special case.
+If there is no listener for it, then the default action is to print a stack
+trace and exit the program.
+
+All EventEmitters emit the event `newListener` when new listeners are
+added. EventEmitters also emit the event `removeListener` when listeners are
+removed, and `removeListenerAny` when listeners added through `onAny` are
+removed.
+
+
+**Namespaces** with **Wildcards**
+To use namespaces/wildcards, pass the `wildcard` option into the EventEmitter
+constructor. When namespaces/wildcards are enabled, events can either be
+strings (`foo.bar`) separated by a delimiter or arrays (`['foo', 'bar']`). The
+delimiter is also configurable as a constructor option.
+
+An event name passed to any event emitter method can contain a wild card (the
+`*` character). If the event name is a string, a wildcard may appear as `foo.*`.
+If the event name is an array, the wildcard may appear as `['foo', '*']`.
+
+If either of the above described events were passed to the `on` method,
+subsequent emits such as the following would be observed...
+
+```javascript
+emitter.emit(Symbol());
+emitter.emit('foo');
+emitter.emit('foo.bazz');
+emitter.emit(['foo', 'bar']);
+emitter.emit(['foo', Symbol()]);
+```
+
+**NOTE:** An event name may use more than one wildcard. For example,
+`foo.*.bar.*` is a valid event name, and would match events such as
+`foo.x.bar.y`, or `['foo', 'bazz', 'bar', 'test']`
+
+# Multi-level Wildcards
+A double wildcard (the string `**`) matches any number of levels (zero or more) of events. So if for example `'foo.**'` is passed to the `on` method, the following events would be observed:
+
+````javascript
+emitter.emit('foo');
+emitter.emit('foo.bar');
+emitter.emit('foo.bar.baz');
+emitter.emit(['foo', Symbol(), 'baz']);
+````
+
+On the other hand, if the single-wildcard event name was passed to the on method, the callback would only observe the second of these events.
+
+
+### emitter.addListener(event, listener, options?: object|boolean)
+### emitter.on(event, listener, options?: object|boolean)
+
+Adds a listener to the end of the listeners array for the specified event.
+
+```javascript
+emitter.on('data', function(value1, value2, value3, ...) {
+ console.log('The event was raised!');
+});
+```
+```javascript
+emitter.on('data', function(value) {
+ console.log('The event was raised!');
+});
+```
+
+**Options:**
+
+- `async:boolean= false`- invoke the listener in async mode using setImmediate (fallback to setTimeout if not available)
+or process.nextTick depending on the `nextTick` option.
+
+- `nextTick:boolean= false`- use process.nextTick instead of setImmediate to invoke the listener asynchronously.
+
+- `promisify:boolean= false`- additionally wraps the listener to a Promise for later invocation using `emitAsync` method.
+This option will be activated by default if its value is `undefined`
+and the listener function is an `asynchronous function` (whose constructor name is `AsyncFunction`).
+
+- `objectify:boolean= false`- activates returning a [listener](#listener) object instead of 'this' by the subscription method.
+
+#### listener
+The listener object has the following properties:
+- `emitter: EventEmitter2` - reference to the event emitter instance
+- `event: event|eventNS` - subscription event
+- `listener: Function` - reference to the listener
+- `off(): Function`- removes the listener (voids the subscription)
+
+````javascript
+var listener= emitter.on('event', function(){
+ console.log('hello!');
+}, {objectify: true});
+
+emitter.emit('event');
+
+listener.off();
+````
+
+**Note:** If the options argument is `true` it will be considered as `{promisify: true}`
+
+**Note:** If the options argument is `false` it will be considered as `{async: true}`
+
+```javascript
+var EventEmitter2= require('eventemitter2');
+var emitter= new EventEmitter2();
+
+emitter.on('event', function(){
+ console.log('The event was raised!');
+}, {async: true});
+
+emitter.emit('event');
+console.log('emitted');
+```
+Since the `async` option was set the output from the code above is as follows:
+````
+emitted
+The event was raised!
+````
+
+If the listener is an async function or function which returns a promise, use the `promisify` option as follows:
+
+```javascript
+var EventEmitter2= require('eventemitter2');
+var emitter= new EventEmitter2();
+
+emitter.on('event', function(){
+ console.log('The event was raised!');
+ return new Promise(function(resolve){
+ console.log('listener resolved');
+ setTimeout(resolve, 1000);
+ });
+}, {promisify: true});
+
+emitter.emitAsync('event').then(function(){
+ console.log('all listeners were resolved!');
+});
+
+console.log('emitted');
+````
+Output:
+````
+emitted
+The event was raised!
+listener resolved
+all listeners were resolved!
+````
+If the `promisify` option is false (default value) the output of the same code is as follows:
+````
+The event was raised!
+listener resolved
+emitted
+all listeners were resolved!
+````
+
+
+### emitter.prependListener(event, listener, options?)
+
+Adds a listener to the beginning of the listeners array for the specified event.
+
+```javascript
+emitter.prependListener('data', function(value1, value2, value3, ...) {
+ console.log('The event was raised!');
+});
+```
+
+**options:**
+
+`options?`: See the [addListener options](#emitteronevent-listener-options-objectboolean)
+
+### emitter.onAny(listener)
+
+Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the callback.
+
+```javascript
+emitter.onAny(function(event, value) {
+ console.log('All events trigger this.');
+});
+```
+
+### emitter.prependAny(listener)
+
+Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the callback. The listener is added to the beginning of the listeners array
+
+```javascript
+emitter.prependAny(function(event, value) {
+ console.log('All events trigger this.');
+});
+```
+
+### emitter.offAny(listener)
+
+Removes the listener that will be fired when any event is emitted.
+
+```javascript
+emitter.offAny(function(value) {
+ console.log('The event was raised!');
+});
+```
+
+#### emitter.once(event | eventNS, listener, options?)
+
+Adds a **one time** listener for the event. The listener is invoked
+only the first time the event is fired, after which it is removed.
+
+```javascript
+emitter.once('get', function (value) {
+ console.log('Ah, we have our first value!');
+});
+```
+
+**options:**
+
+`options?`: See the [addListener options](#emitteronevent-listener-options-objectboolean)
+
+#### emitter.prependOnceListener(event | eventNS, listener, options?)
+
+Adds a **one time** listener for the event. The listener is invoked
+only the first time the event is fired, after which it is removed.
+The listener is added to the beginning of the listeners array
+
+```javascript
+emitter.prependOnceListener('get', function (value) {
+ console.log('Ah, we have our first value!');
+});
+```
+
+**options:**
+
+`options?`: See the [addListener options](#emitteronevent-listener-options-objectboolean)
+
+### emitter.many(event | eventNS, timesToListen, listener, options?)
+
+Adds a listener that will execute **n times** for the event before being
+removed. The listener is invoked only the first **n times** the event is
+fired, after which it is removed.
+
+```javascript
+emitter.many('get', 4, function (value) {
+ console.log('This event will be listened to exactly four times.');
+});
+```
+
+**options:**
+
+`options?`: See the [addListener options](#emitteronevent-listener-options-objectboolean)
+
+### emitter.prependMany(event | eventNS, timesToListen, listener, options?)
+
+Adds a listener that will execute **n times** for the event before being
+removed. The listener is invoked only the first **n times** the event is
+fired, after which it is removed.
+The listener is added to the beginning of the listeners array.
+
+```javascript
+emitter.many('get', 4, function (value) {
+ console.log('This event will be listened to exactly four times.');
+});
+```
+
+**options:**
+
+`options?`: See the [addListener options](#emitteronevent-listener-options-objectboolean)
+
+### emitter.removeListener(event | eventNS, listener)
+### emitter.off(event | eventNS, listener)
+
+Remove a listener from the listener array for the specified event.
+**Caution**: Calling this method changes the array indices in the listener array behind the listener.
+
+```javascript
+var callback = function(value) {
+ console.log('someone connected!');
+};
+emitter.on('get', callback);
+// ...
+emitter.removeListener('get', callback);
+```
+
+
+### emitter.removeAllListeners([event | eventNS])
+
+Removes all listeners, or those of the specified event.
+
+
+### emitter.setMaxListeners(n)
+
+By default EventEmitters will print a warning if more than 10 listeners
+are added to it. This is a useful default which helps finding memory leaks.
+Obviously not all Emitters should be limited to 10. This function allows
+that to be increased. Set to zero for unlimited.
+
+
+### emitter.getMaxListeners()
+
+Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to EventEmitter2.defaultMaxListeners
+
+
+### emitter.listeners(event | eventNS)
+
+Returns an array of listeners for the specified event. This array can be
+manipulated, e.g. to remove listeners.
+
+```javascript
+emitter.on('get', function(value) {
+ console.log('someone connected!');
+});
+console.log(emitter.listeners('get')); // [ [Function] ]
+```
+
+### emitter.listenersAny()
+
+Returns an array of listeners that are listening for any event that is
+specified. This array can be manipulated, e.g. to remove listeners.
+
+```javascript
+emitter.onAny(function(value) {
+ console.log('someone connected!');
+});
+console.log(emitter.listenersAny()[0]); // [ [Function] ]
+```
+
+### emitter.emit(event | eventNS, [arg1], [arg2], [...])
+Execute each of the listeners that may be listening for the specified event
+name in order with the list of arguments.
+
+### emitter.emitAsync(event | eventNS, [arg1], [arg2], [...])
+
+Return the results of the listeners via [Promise.all](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Promise/all).
+Only this method doesn't work [IE](http://caniuse.com/#search=promise).
+
+```javascript
+emitter.on('get',function(i) {
+ return new Promise(function(resolve){
+ setTimeout(function(){
+ resolve(i+3);
+ },50);
+ });
+});
+emitter.on('get',function(i) {
+ return new Promise(function(resolve){
+ resolve(i+2)
+ });
+});
+emitter.on('get',function(i) {
+ return Promise.resolve(i+1);
+});
+emitter.on('get',function(i) {
+ return i+0;
+});
+emitter.on('get',function(i) {
+ // noop
+});
+
+emitter.emitAsync('get',0)
+.then(function(results){
+ console.log(results); // [3,2,1,0,undefined]
+});
+```
+
+### emitter.waitFor(event | eventNS, [options])
+### emitter.waitFor(event | eventNS, [timeout])
+### emitter.waitFor(event | eventNS, [filter])
+
+Returns a thenable object (promise interface) that resolves when a specific event occurs
+
+````javascript
+emitter.waitFor('event').then(function (data) {
+ console.log(data); // ['bar']
+});
+
+emitter.emit('event', 'bar');
+````
+
+````javascript
+emitter.waitFor('event', {
+ // handle first event data argument as an error (err, ...data)
+ handleError: false,
+ // the timeout for resolving the promise before it is rejected with an error (Error: timeout).
+ timeout: 0,
+ //filter function to determine acceptable values for resolving the promise.
+ filter: function(arg0, arg1){
+ return arg0==='foo' && arg1==='bar'
+ },
+ Promise: Promise, // Promise constructor to use,
+ overload: false // overload cancellation api in a case of external Promise class
+}).then(function(data){
+ console.log(data); // ['foo', 'bar']
+});
+
+emitter.emit('event', 'foo', 'bar')
+````
+
+````javascript
+var promise= emitter.waitFor('event');
+
+promise.then(null, function(error){
+ console.log(error); //Error: canceled
+});
+
+promise.cancel(); //stop listening the event and reject the promise
+````
+
+````javascript
+emitter.waitFor('event', {
+ handleError: true
+}).then(null, function(error){
+ console.log(error); //Error: custom error
+});
+
+emitter.emit('event', new Error('custom error')); // reject the promise
+````
+### emitter.eventNames(nsAsArray)
+
+Returns an array listing the events for which the emitter has registered listeners.
+```javascript
+var emitter= new EventEmitter2();
+emitter.on('foo', () => {});
+emitter.on('bar', () => {});
+emitter.on(Symbol('test'), () => {});
+emitter.on(['foo', Symbol('test2')], () => {});
+
+console.log(emitter.eventNames());
+// Prints: [ 'bar', 'foo', [ 'foo', Symbol(test2) ], [ 'foo', Symbol(test2) ] ]
+```
+**Note**: Listeners order not guaranteed
+### listenTo(targetEmitter, events: event | eventNS, options?)
+
+### listenTo(targetEmitter, events: (event | eventNS)[], options?)
+
+### listenTo(targetEmitter, events: Object, options?)
+
+Listens to the events emitted by an external emitter and propagate them through itself.
+The target object could be of any type that implements methods for subscribing and unsubscribing to its events.
+By default this method attempts to use `addListener`/`removeListener`, `on`/`off` and `addEventListener`/`removeEventListener` pairs,
+but you able to define own hooks `on(event, handler)` and `off(event, handler)` in the options object to use
+custom subscription API. In these hooks `this` refers to the target object.
+
+The options object has the following interface:
+- `on(event, handler): void`
+- `off(event, handler): void`
+- `reducer: (Function) | (Object): Boolean`
+
+In case you selected the `newListener` and `removeListener` options when creating the emitter,
+the subscription to the events of the target object will be conditional,
+depending on whether there are listeners in the emitter that could listen them.
+
+````javascript
+var EventEmitter2 = require('EventEmitter2');
+var http = require('http');
+
+var server = http.createServer(function(request, response){
+ console.log(request.url);
+ response.end('Hello Node.js Server!')
+}).listen(3000);
+
+server.on('connection', function(req, socket, head){
+ console.log('connect');
+});
+
+// activate the ability to attach listeners on demand
+var emitter= new EventEmitter2({
+ newListener: true,
+ removeListener: true
+});
+
+emitter.listenTo(server, {
+ 'connection': 'localConnection',
+ 'close': 'close'
+}, {
+ reducers: {
+ connection: function(event){
+ console.log('event name:' + event.name); //'localConnection'
+ console.log('original event name:' + event.original); //'connection'
+ return event.data[0].remoteAddress==='::1';
+ }
+ }
+});
+
+emitter.on('localConnection', function(socket){
+ console.log('local connection', socket.remoteAddress);
+});
+
+setTimeout(function(){
+ emitter.stopListeningTo(server);
+}, 30000);
+````
+An example of using a wildcard emitter in a browser:
+````javascript
+const ee= new EventEmitter2({
+ wildcard: true
+});
+
+ee.listenTo(document.querySelector('#test'), {
+ 'click': 'div.click',
+ 'mouseup': 'div.mouseup',
+ 'mousedown': 'div.mousedown'
+});
+
+ee.on('div.*', function(evt){
+ console.log('listenTo: '+ evt.type);
+});
+
+setTimeout(function(){
+ ee.stopListeningTo(document.querySelector('#test'));
+}, 30000);
+````
+
+### stopListeningTo(target?: Object, event: event | eventNS): Boolean
+
+Stops listening the targets. Returns true if some listener was removed.
+
+### hasListeners(event | eventNS?:String):Boolean
+
+Checks whether emitter has any listeners.
+
+### emitter.listeners(event | eventNS)
+
+Returns the array of listeners for the event named eventName.
+In wildcard mode this method returns namespaces as strings:
+````javascript
+var emitter= new EventEmitter2({
+ wildcard: true
+});
+emitter.on('a.b.c', function(){});
+emitter.on(['z', 'x', 'c'], function(){});
+console.log(emitter.eventNames()) // [ 'z.x.c', 'a.b.c' ]
+````
+If some namespace contains a Symbol member or the `nsAsArray` option is set the method will return namespace as an array of its members;
+````javascript
+var emitter= new EventEmitter2({
+ wildcard: true
+});
+emitter.on('a.b.c', function(){});
+emitter.on(['z', 'x', Symbol()], function(){});
+console.log(emitter.eventNames()) // [ [ 'z', 'x', Symbol() ], 'a.b.c' ]
+````
+
+### EventEmitter2.once(emitter, event | eventNS, [options])
+Creates a cancellable Promise that is fulfilled when the EventEmitter emits the given event or that is rejected
+when the EventEmitter emits 'error'.
+The Promise will resolve with an array of all the arguments emitted to the given event.
+This method is intentionally generic and works with the web platform EventTarget interface,
+which has no special 'error' event semantics and does not listen to the 'error' event.
+
+Basic example:
+````javascript
+var emitter= new EventEmitter2();
+
+EventEmitter2.once(emitter, 'event', {
+ timeout: 0,
+ Promise: Promise, // a custom Promise constructor
+ overload: false // overload promise cancellation api if exists with library implementation
+}).then(function(data){
+ console.log(data); // [1, 2, 3]
+});
+
+emitter.emit('event', 1, 2, 3);
+````
+With timeout option:
+````javascript
+EventEmitter2.once(emitter, 'event', {
+ timeout: 1000
+}).then(null, function(err){
+ console.log(err); // Error: timeout
+});
+````
+The library promise cancellation API:
+````javascript
+promise= EventEmitter2.once(emitter, 'event');
+// notice: the cancel method exists only in the first promise chain
+promise.then(null, function(err){
+ console.log(err); // Error: canceled
+});
+
+promise.cancel();
+````
+Using the custom Promise class (**[bluebird.js](https://www.npmjs.com/package/bluebird)**):
+````javascript
+var BBPromise = require("bluebird");
+
+EventEmitter2.once(emitter, 'event', {
+ Promise: BBPromise
+}).then(function(data){
+ console.log(data); // [4, 5, 6]
+});
+
+emitter.emit('event', 4, 5, 6);
+````
+
+````javascript
+var BBPromise = require("bluebird");
+
+BBPromise.config({
+ // if false or options.overload enabled, the library cancellation API will be used
+ cancellation: true
+});
+
+var promise= EventEmitter2.once(emitter, 'event', {
+ Promise: BBPromise,
+ overload: false // use bluebird cancellation API
+}).then(function(data){
+ // notice: never executed due to BlueBird cancellation logic
+}, function(err){
+ // notice: never executed due to BlueBird cancellation logic
+});
+
+promise.cancel();
+
+emitter.emit('event', 'never handled');
+````
+
+### EventEmitter2.defaultMaxListeners
+
+Sets default max listeners count globally for all instances, including those created before the change is made.
diff --git a/node_modules/@pm2/io/node_modules/eventemitter2/eventemitter2.d.ts b/node_modules/@pm2/io/node_modules/eventemitter2/eventemitter2.d.ts
new file mode 100644
index 0000000..230825b
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/eventemitter2/eventemitter2.d.ts
@@ -0,0 +1,156 @@
+export type event = (symbol|string);
+export type eventNS = string|event[];
+
+export interface ConstructorOptions {
+ /**
+ * @default false
+ * @description set this to `true` to use wildcards.
+ */
+ wildcard?: boolean,
+ /**
+ * @default '.'
+ * @description the delimiter used to segment namespaces.
+ */
+ delimiter?: string,
+ /**
+ * @default false
+ * @description set this to `true` if you want to emit the newListener events.
+ */
+ newListener?: boolean,
+ /**
+ * @default false
+ * @description set this to `true` if you want to emit the removeListener events.
+ */
+ removeListener?: boolean,
+ /**
+ * @default 10
+ * @description the maximum amount of listeners that can be assigned to an event.
+ */
+ maxListeners?: number
+ /**
+ * @default false
+ * @description show event name in memory leak message when more than maximum amount of listeners is assigned, default false
+ */
+ verboseMemoryLeak?: boolean
+ /**
+ * @default false
+ * @description disable throwing uncaughtException if an error event is emitted and it has no listeners
+ */
+ ignoreErrors?: boolean
+}
+export interface ListenerFn {
+ (...values: any[]): void;
+}
+export interface EventAndListener {
+ (event: string | string[], ...values: any[]): void;
+}
+
+export interface WaitForFilter { (...values: any[]): boolean }
+
+export interface WaitForOptions {
+ /**
+ * @default 0
+ */
+ timeout: number,
+ /**
+ * @default null
+ */
+ filter: WaitForFilter,
+ /**
+ * @default false
+ */
+ handleError: boolean,
+ /**
+ * @default Promise
+ */
+ Promise: Function,
+ /**
+ * @default false
+ */
+ overload: boolean
+}
+
+export interface CancelablePromise extends Promise{
+ cancel(reason: string): undefined
+}
+
+export interface OnceOptions {
+ /**
+ * @default 0
+ */
+ timeout: number,
+ /**
+ * @default Promise
+ */
+ Promise: Function,
+ /**
+ * @default false
+ */
+ overload: boolean
+}
+
+export interface ListenToOptions {
+ on?: { (event: event | eventNS, handler: ListenerFn): void },
+ off?: { (event: event | eventNS, handler: ListenerFn): void },
+ reducers: Function | Object
+}
+
+export interface GeneralEventEmitter{
+ addEventListener(event: event, handler: ListenerFn): this,
+ removeEventListener(event: event, handler: ListenerFn): this,
+ addListener?(event: event, handler: ListenerFn): this,
+ removeListener?(event: event, handler: ListenerFn): this,
+ on?(event: event, handler: ListenerFn): this,
+ off?(event: event, handler: ListenerFn): this
+}
+
+export interface OnOptions {
+ async?: boolean,
+ promisify?: boolean,
+ nextTick?: boolean,
+ objectify?: boolean
+}
+
+export interface Listener {
+ emitter: EventEmitter2;
+ event: event|eventNS;
+ listener: ListenerFn;
+ off(): this;
+}
+
+export declare class EventEmitter2 {
+ constructor(options?: ConstructorOptions)
+ emit(event: event | eventNS, ...values: any[]): boolean;
+ emitAsync(event: event | eventNS, ...values: any[]): Promise;
+ addListener(event: event | eventNS, listener: ListenerFn): this|Listener;
+ on(event: event | eventNS, listener: ListenerFn, options?: boolean|OnOptions): this|Listener;
+ prependListener(event: event | eventNS, listener: ListenerFn, options?: boolean|OnOptions): this|Listener;
+ once(event: event | eventNS, listener: ListenerFn, options?: true|OnOptions): this|Listener;
+ prependOnceListener(event: event | eventNS, listener: ListenerFn, options?: boolean|OnOptions): this|Listener;
+ many(event: event | eventNS, timesToListen: number, listener: ListenerFn, options?: boolean|OnOptions): this|Listener;
+ prependMany(event: event | eventNS, timesToListen: number, listener: ListenerFn, options?: boolean|OnOptions): this|Listener;
+ onAny(listener: EventAndListener): this;
+ prependAny(listener: EventAndListener): this;
+ offAny(listener: ListenerFn): this;
+ removeListener(event: event | eventNS, listener: ListenerFn): this;
+ off(event: event | eventNS, listener: ListenerFn): this;
+ removeAllListeners(event?: event | eventNS): this;
+ setMaxListeners(n: number): void;
+ getMaxListeners(): number;
+ eventNames(nsAsArray?: boolean): (event|eventNS)[];
+ listenerCount(event?: event | eventNS): number
+ listeners(event?: event | eventNS): ListenerFn[]
+ listenersAny(): ListenerFn[]
+ waitFor(event: event | eventNS, timeout?: number): CancelablePromise
+ waitFor(event: event | eventNS, filter?: WaitForFilter): CancelablePromise
+ waitFor(event: event | eventNS, options?: WaitForOptions): CancelablePromise
+ listenTo(target: GeneralEventEmitter, events: event | eventNS, options?: ListenToOptions): this;
+ listenTo(target: GeneralEventEmitter, events: event[], options?: ListenToOptions): this;
+ listenTo(target: GeneralEventEmitter, events: Object, options?: ListenToOptions): this;
+ stopListeningTo(target?: GeneralEventEmitter, event?: event | eventNS): Boolean;
+ hasListeners(event?: String): Boolean
+ static once(emitter: EventEmitter2, event: event | eventNS, options?: OnceOptions): CancelablePromise;
+ static defaultMaxListeners: number;
+}
+
+export default EventEmitter2;
diff --git a/node_modules/@pm2/io/node_modules/eventemitter2/index.js b/node_modules/@pm2/io/node_modules/eventemitter2/index.js
new file mode 100644
index 0000000..6f583b5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/eventemitter2/index.js
@@ -0,0 +1 @@
+module.exports = require('./lib/eventemitter2');
diff --git a/node_modules/@pm2/io/node_modules/eventemitter2/lib/eventemitter2.js b/node_modules/@pm2/io/node_modules/eventemitter2/lib/eventemitter2.js
new file mode 100644
index 0000000..7c2e550
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/eventemitter2/lib/eventemitter2.js
@@ -0,0 +1,1629 @@
+/*!
+ * EventEmitter2
+ * https://github.com/hij1nx/EventEmitter2
+ *
+ * Copyright (c) 2013 hij1nx
+ * Licensed under the MIT license.
+ */
+;!function(undefined) {
+ var hasOwnProperty= Object.hasOwnProperty;
+ var isArray = Array.isArray ? Array.isArray : function _isArray(obj) {
+ return Object.prototype.toString.call(obj) === "[object Array]";
+ };
+ var defaultMaxListeners = 10;
+ var nextTickSupported= typeof process=='object' && typeof process.nextTick=='function';
+ var symbolsSupported= typeof Symbol==='function';
+ var reflectSupported= typeof Reflect === 'object';
+ var setImmediateSupported= typeof setImmediate === 'function';
+ var _setImmediate= setImmediateSupported ? setImmediate : setTimeout;
+ var ownKeys= symbolsSupported? (reflectSupported && typeof Reflect.ownKeys==='function'? Reflect.ownKeys : function(obj){
+ var arr= Object.getOwnPropertyNames(obj);
+ arr.push.apply(arr, Object.getOwnPropertySymbols(obj));
+ return arr;
+ }) : Object.keys;
+
+ function init() {
+ this._events = {};
+ if (this._conf) {
+ configure.call(this, this._conf);
+ }
+ }
+
+ function configure(conf) {
+ if (conf) {
+ this._conf = conf;
+
+ conf.delimiter && (this.delimiter = conf.delimiter);
+
+ if(conf.maxListeners!==undefined){
+ this._maxListeners= conf.maxListeners;
+ }
+
+ conf.wildcard && (this.wildcard = conf.wildcard);
+ conf.newListener && (this._newListener = conf.newListener);
+ conf.removeListener && (this._removeListener = conf.removeListener);
+ conf.verboseMemoryLeak && (this.verboseMemoryLeak = conf.verboseMemoryLeak);
+ conf.ignoreErrors && (this.ignoreErrors = conf.ignoreErrors);
+
+ if (this.wildcard) {
+ this.listenerTree = {};
+ }
+ }
+ }
+
+ function logPossibleMemoryLeak(count, eventName) {
+ var errorMsg = '(node) warning: possible EventEmitter memory ' +
+ 'leak detected. ' + count + ' listeners added. ' +
+ 'Use emitter.setMaxListeners() to increase limit.';
+
+ if(this.verboseMemoryLeak){
+ errorMsg += ' Event name: ' + eventName + '.';
+ }
+
+ if(typeof process !== 'undefined' && process.emitWarning){
+ var e = new Error(errorMsg);
+ e.name = 'MaxListenersExceededWarning';
+ e.emitter = this;
+ e.count = count;
+ process.emitWarning(e);
+ } else {
+ console.error(errorMsg);
+
+ if (console.trace){
+ console.trace();
+ }
+ }
+ }
+
+ var toArray = function (a, b, c) {
+ var n = arguments.length;
+ switch (n) {
+ case 0:
+ return [];
+ case 1:
+ return [a];
+ case 2:
+ return [a, b];
+ case 3:
+ return [a, b, c];
+ default:
+ var arr = new Array(n);
+ while (n--) {
+ arr[n] = arguments[n];
+ }
+ return arr;
+ }
+ };
+
+ function toObject(keys, values) {
+ var obj = {};
+ var key;
+ var len = keys.length;
+ var valuesCount = values ? values.length : 0;
+ for (var i = 0; i < len; i++) {
+ key = keys[i];
+ obj[key] = i < valuesCount ? values[i] : undefined;
+ }
+ return obj;
+ }
+
+ function TargetObserver(emitter, target, options) {
+ this._emitter = emitter;
+ this._target = target;
+ this._listeners = {};
+ this._listenersCount = 0;
+
+ var on, off;
+
+ if (options.on || options.off) {
+ on = options.on;
+ off = options.off;
+ }
+
+ if (target.addEventListener) {
+ on = target.addEventListener;
+ off = target.removeEventListener;
+ } else if (target.addListener) {
+ on = target.addListener;
+ off = target.removeListener;
+ } else if (target.on) {
+ on = target.on;
+ off = target.off;
+ }
+
+ if (!on && !off) {
+ throw Error('target does not implement any known event API');
+ }
+
+ if (typeof on !== 'function') {
+ throw TypeError('on method must be a function');
+ }
+
+ if (typeof off !== 'function') {
+ throw TypeError('off method must be a function');
+ }
+
+ this._on = on;
+ this._off = off;
+
+ var _observers= emitter._observers;
+ if(_observers){
+ _observers.push(this);
+ }else{
+ emitter._observers= [this];
+ }
+ }
+
+ Object.assign(TargetObserver.prototype, {
+ subscribe: function(event, localEvent, reducer){
+ var observer= this;
+ var target= this._target;
+ var emitter= this._emitter;
+ var listeners= this._listeners;
+ var handler= function(){
+ var args= toArray.apply(null, arguments);
+ var eventObj= {
+ data: args,
+ name: localEvent,
+ original: event
+ };
+ if(reducer){
+ var result= reducer.call(target, eventObj);
+ if(result!==false){
+ emitter.emit.apply(emitter, [eventObj.name].concat(args))
+ }
+ return;
+ }
+ emitter.emit.apply(emitter, [localEvent].concat(args));
+ };
+
+
+ if(listeners[event]){
+ throw Error('Event \'' + event + '\' is already listening');
+ }
+
+ this._listenersCount++;
+
+ if(emitter._newListener && emitter._removeListener && !observer._onNewListener){
+
+ this._onNewListener = function (_event) {
+ if (_event === localEvent && listeners[event] === null) {
+ listeners[event] = handler;
+ observer._on.call(target, event, handler);
+ }
+ };
+
+ emitter.on('newListener', this._onNewListener);
+
+ this._onRemoveListener= function(_event){
+ if(_event === localEvent && !emitter.hasListeners(_event) && listeners[event]){
+ listeners[event]= null;
+ observer._off.call(target, event, handler);
+ }
+ };
+
+ listeners[event]= null;
+
+ emitter.on('removeListener', this._onRemoveListener);
+ }else{
+ listeners[event]= handler;
+ observer._on.call(target, event, handler);
+ }
+ },
+
+ unsubscribe: function(event){
+ var observer= this;
+ var listeners= this._listeners;
+ var emitter= this._emitter;
+ var handler;
+ var events;
+ var off= this._off;
+ var target= this._target;
+ var i;
+
+ if(event && typeof event!=='string'){
+ throw TypeError('event must be a string');
+ }
+
+ function clearRefs(){
+ if(observer._onNewListener){
+ emitter.off('newListener', observer._onNewListener);
+ emitter.off('removeListener', observer._onRemoveListener);
+ observer._onNewListener= null;
+ observer._onRemoveListener= null;
+ }
+ var index= findTargetIndex.call(emitter, observer);
+ emitter._observers.splice(index, 1);
+ }
+
+ if(event){
+ handler= listeners[event];
+ if(!handler) return;
+ off.call(target, event, handler);
+ delete listeners[event];
+ if(!--this._listenersCount){
+ clearRefs();
+ }
+ }else{
+ events= ownKeys(listeners);
+ i= events.length;
+ while(i-->0){
+ event= events[i];
+ off.call(target, event, listeners[event]);
+ }
+ this._listeners= {};
+ this._listenersCount= 0;
+ clearRefs();
+ }
+ }
+ });
+
+ function resolveOptions(options, schema, reducers, allowUnknown) {
+ var computedOptions = Object.assign({}, schema);
+
+ if (!options) return computedOptions;
+
+ if (typeof options !== 'object') {
+ throw TypeError('options must be an object')
+ }
+
+ var keys = Object.keys(options);
+ var length = keys.length;
+ var option, value;
+ var reducer;
+
+ function reject(reason) {
+ throw Error('Invalid "' + option + '" option value' + (reason ? '. Reason: ' + reason : ''))
+ }
+
+ for (var i = 0; i < length; i++) {
+ option = keys[i];
+ if (!allowUnknown && !hasOwnProperty.call(schema, option)) {
+ throw Error('Unknown "' + option + '" option');
+ }
+ value = options[option];
+ if (value !== undefined) {
+ reducer = reducers[option];
+ computedOptions[option] = reducer ? reducer(value, reject) : value;
+ }
+ }
+ return computedOptions;
+ }
+
+ function constructorReducer(value, reject) {
+ if (typeof value !== 'function' || !value.hasOwnProperty('prototype')) {
+ reject('value must be a constructor');
+ }
+ return value;
+ }
+
+ function makeTypeReducer(types) {
+ var message= 'value must be type of ' + types.join('|');
+ var len= types.length;
+ var firstType= types[0];
+ var secondType= types[1];
+
+ if (len === 1) {
+ return function (v, reject) {
+ if (typeof v === firstType) {
+ return v;
+ }
+ reject(message);
+ }
+ }
+
+ if (len === 2) {
+ return function (v, reject) {
+ var kind= typeof v;
+ if (kind === firstType || kind === secondType) return v;
+ reject(message);
+ }
+ }
+
+ return function (v, reject) {
+ var kind = typeof v;
+ var i = len;
+ while (i-- > 0) {
+ if (kind === types[i]) return v;
+ }
+ reject(message);
+ }
+ }
+
+ var functionReducer= makeTypeReducer(['function']);
+
+ var objectFunctionReducer= makeTypeReducer(['object', 'function']);
+
+ function makeCancelablePromise(Promise, executor, options) {
+ var isCancelable;
+ var callbacks;
+ var timer= 0;
+ var subscriptionClosed;
+
+ var promise = new Promise(function (resolve, reject, onCancel) {
+ options= resolveOptions(options, {
+ timeout: 0,
+ overload: false
+ }, {
+ timeout: function(value, reject){
+ value*= 1;
+ if (typeof value !== 'number' || value < 0 || !Number.isFinite(value)) {
+ reject('timeout must be a positive number');
+ }
+ return value;
+ }
+ });
+
+ isCancelable = !options.overload && typeof Promise.prototype.cancel === 'function' && typeof onCancel === 'function';
+
+ function cleanup() {
+ if (callbacks) {
+ callbacks = null;
+ }
+ if (timer) {
+ clearTimeout(timer);
+ timer = 0;
+ }
+ }
+
+ var _resolve= function(value){
+ cleanup();
+ resolve(value);
+ };
+
+ var _reject= function(err){
+ cleanup();
+ reject(err);
+ };
+
+ if (isCancelable) {
+ executor(_resolve, _reject, onCancel);
+ } else {
+ callbacks = [function(reason){
+ _reject(reason || Error('canceled'));
+ }];
+ executor(_resolve, _reject, function (cb) {
+ if (subscriptionClosed) {
+ throw Error('Unable to subscribe on cancel event asynchronously')
+ }
+ if (typeof cb !== 'function') {
+ throw TypeError('onCancel callback must be a function');
+ }
+ callbacks.push(cb);
+ });
+ subscriptionClosed= true;
+ }
+
+ if (options.timeout > 0) {
+ timer= setTimeout(function(){
+ var reason= Error('timeout');
+ reason.code = 'ETIMEDOUT'
+ timer= 0;
+ promise.cancel(reason);
+ reject(reason);
+ }, options.timeout);
+ }
+ });
+
+ if (!isCancelable) {
+ promise.cancel = function (reason) {
+ if (!callbacks) {
+ return;
+ }
+ var length = callbacks.length;
+ for (var i = 1; i < length; i++) {
+ callbacks[i](reason);
+ }
+ // internal callback to reject the promise
+ callbacks[0](reason);
+ callbacks = null;
+ };
+ }
+
+ return promise;
+ }
+
+ function findTargetIndex(observer) {
+ var observers = this._observers;
+ if(!observers){
+ return -1;
+ }
+ var len = observers.length;
+ for (var i = 0; i < len; i++) {
+ if (observers[i]._target === observer) return i;
+ }
+ return -1;
+ }
+
+ // Attention, function return type now is array, always !
+ // It has zero elements if no any matches found and one or more
+ // elements (leafs) if there are matches
+ //
+ function searchListenerTree(handlers, type, tree, i, typeLength) {
+ if (!tree) {
+ return null;
+ }
+
+ if (i === 0) {
+ var kind = typeof type;
+ if (kind === 'string') {
+ var ns, n, l = 0, j = 0, delimiter = this.delimiter, dl = delimiter.length;
+ if ((n = type.indexOf(delimiter)) !== -1) {
+ ns = new Array(5);
+ do {
+ ns[l++] = type.slice(j, n);
+ j = n + dl;
+ } while ((n = type.indexOf(delimiter, j)) !== -1);
+
+ ns[l++] = type.slice(j);
+ type = ns;
+ typeLength = l;
+ } else {
+ type = [type];
+ typeLength = 1;
+ }
+ } else if (kind === 'object') {
+ typeLength = type.length;
+ } else {
+ type = [type];
+ typeLength = 1;
+ }
+ }
+
+ var listeners= null, branch, xTree, xxTree, isolatedBranch, endReached, currentType = type[i],
+ nextType = type[i + 1], branches, _listeners;
+
+ if (i === typeLength) {
+ //
+ // If at the end of the event(s) list and the tree has listeners
+ // invoke those listeners.
+ //
+
+ if(tree._listeners) {
+ if (typeof tree._listeners === 'function') {
+ handlers && handlers.push(tree._listeners);
+ listeners = [tree];
+ } else {
+ handlers && handlers.push.apply(handlers, tree._listeners);
+ listeners = [tree];
+ }
+ }
+ } else {
+
+ if (currentType === '*') {
+ //
+ // If the event emitted is '*' at this part
+ // or there is a concrete match at this patch
+ //
+ branches = ownKeys(tree);
+ n = branches.length;
+ while (n-- > 0) {
+ branch = branches[n];
+ if (branch !== '_listeners') {
+ _listeners = searchListenerTree(handlers, type, tree[branch], i + 1, typeLength);
+ if (_listeners) {
+ if (listeners) {
+ listeners.push.apply(listeners, _listeners);
+ } else {
+ listeners = _listeners;
+ }
+ }
+ }
+ }
+ return listeners;
+ } else if (currentType === '**') {
+ endReached = (i + 1 === typeLength || (i + 2 === typeLength && nextType === '*'));
+ if (endReached && tree._listeners) {
+ // The next element has a _listeners, add it to the handlers.
+ listeners = searchListenerTree(handlers, type, tree, typeLength, typeLength);
+ }
+
+ branches = ownKeys(tree);
+ n = branches.length;
+ while (n-- > 0) {
+ branch = branches[n];
+ if (branch !== '_listeners') {
+ if (branch === '*' || branch === '**') {
+ if (tree[branch]._listeners && !endReached) {
+ _listeners = searchListenerTree(handlers, type, tree[branch], typeLength, typeLength);
+ if (_listeners) {
+ if (listeners) {
+ listeners.push.apply(listeners, _listeners);
+ } else {
+ listeners = _listeners;
+ }
+ }
+ }
+ _listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);
+ } else if (branch === nextType) {
+ _listeners = searchListenerTree(handlers, type, tree[branch], i + 2, typeLength);
+ } else {
+ // No match on this one, shift into the tree but not in the type array.
+ _listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);
+ }
+ if (_listeners) {
+ if (listeners) {
+ listeners.push.apply(listeners, _listeners);
+ } else {
+ listeners = _listeners;
+ }
+ }
+ }
+ }
+ return listeners;
+ } else if (tree[currentType]) {
+ listeners = searchListenerTree(handlers, type, tree[currentType], i + 1, typeLength);
+ }
+ }
+
+ xTree = tree['*'];
+ if (xTree) {
+ //
+ // If the listener tree will allow any match for this part,
+ // then recursively explore all branches of the tree
+ //
+ searchListenerTree(handlers, type, xTree, i + 1, typeLength);
+ }
+
+ xxTree = tree['**'];
+ if (xxTree) {
+ if (i < typeLength) {
+ if (xxTree._listeners) {
+ // If we have a listener on a '**', it will catch all, so add its handler.
+ searchListenerTree(handlers, type, xxTree, typeLength, typeLength);
+ }
+
+ // Build arrays of matching next branches and others.
+ branches= ownKeys(xxTree);
+ n= branches.length;
+ while(n-->0){
+ branch= branches[n];
+ if (branch !== '_listeners') {
+ if (branch === nextType) {
+ // We know the next element will match, so jump twice.
+ searchListenerTree(handlers, type, xxTree[branch], i + 2, typeLength);
+ } else if (branch === currentType) {
+ // Current node matches, move into the tree.
+ searchListenerTree(handlers, type, xxTree[branch], i + 1, typeLength);
+ } else {
+ isolatedBranch = {};
+ isolatedBranch[branch] = xxTree[branch];
+ searchListenerTree(handlers, type, {'**': isolatedBranch}, i + 1, typeLength);
+ }
+ }
+ }
+ } else if (xxTree._listeners) {
+ // We have reached the end and still on a '**'
+ searchListenerTree(handlers, type, xxTree, typeLength, typeLength);
+ } else if (xxTree['*'] && xxTree['*']._listeners) {
+ searchListenerTree(handlers, type, xxTree['*'], typeLength, typeLength);
+ }
+ }
+
+ return listeners;
+ }
+
+ function growListenerTree(type, listener, prepend) {
+ var len = 0, j = 0, i, delimiter = this.delimiter, dl= delimiter.length, ns;
+
+ if(typeof type==='string') {
+ if ((i = type.indexOf(delimiter)) !== -1) {
+ ns = new Array(5);
+ do {
+ ns[len++] = type.slice(j, i);
+ j = i + dl;
+ } while ((i = type.indexOf(delimiter, j)) !== -1);
+
+ ns[len++] = type.slice(j);
+ }else{
+ ns= [type];
+ len= 1;
+ }
+ }else{
+ ns= type;
+ len= type.length;
+ }
+
+ //
+ // Looks for two consecutive '**', if so, don't add the event at all.
+ //
+ if (len > 1) {
+ for (i = 0; i + 1 < len; i++) {
+ if (ns[i] === '**' && ns[i + 1] === '**') {
+ return;
+ }
+ }
+ }
+
+
+
+ var tree = this.listenerTree, name;
+
+ for (i = 0; i < len; i++) {
+ name = ns[i];
+
+ tree = tree[name] || (tree[name] = {});
+
+ if (i === len - 1) {
+ if (!tree._listeners) {
+ tree._listeners = listener;
+ } else {
+ if (typeof tree._listeners === 'function') {
+ tree._listeners = [tree._listeners];
+ }
+
+ if (prepend) {
+ tree._listeners.unshift(listener);
+ } else {
+ tree._listeners.push(listener);
+ }
+
+ if (
+ !tree._listeners.warned &&
+ this._maxListeners > 0 &&
+ tree._listeners.length > this._maxListeners
+ ) {
+ tree._listeners.warned = true;
+ logPossibleMemoryLeak.call(this, tree._listeners.length, name);
+ }
+ }
+ return true;
+ }
+ }
+
+ return true;
+ }
+
+ function collectTreeEvents(tree, events, root, asArray){
+ var branches= ownKeys(tree);
+ var i= branches.length;
+ var branch, branchName, path;
+ var hasListeners= tree['_listeners'];
+ var isArrayPath;
+
+ while(i-->0){
+ branchName= branches[i];
+
+ branch= tree[branchName];
+
+ if(branchName==='_listeners'){
+ path= root;
+ }else {
+ path = root ? root.concat(branchName) : [branchName];
+ }
+
+ isArrayPath= asArray || typeof branchName==='symbol';
+
+ hasListeners && events.push(isArrayPath? path : path.join(this.delimiter));
+
+ if(typeof branch==='object'){
+ collectTreeEvents.call(this, branch, events, path, isArrayPath);
+ }
+ }
+
+ return events;
+ }
+
+ function recursivelyGarbageCollect(root) {
+ var keys = ownKeys(root);
+ var i= keys.length;
+ var obj, key, flag;
+ while(i-->0){
+ key = keys[i];
+ obj = root[key];
+
+ if(obj){
+ flag= true;
+ if(key !== '_listeners' && !recursivelyGarbageCollect(obj)){
+ delete root[key];
+ }
+ }
+ }
+
+ return flag;
+ }
+
+ function Listener(emitter, event, listener){
+ this.emitter= emitter;
+ this.event= event;
+ this.listener= listener;
+ }
+
+ Listener.prototype.off= function(){
+ this.emitter.off(this.event, this.listener);
+ return this;
+ };
+
+ function setupListener(event, listener, options){
+ if (options === true) {
+ promisify = true;
+ } else if (options === false) {
+ async = true;
+ } else {
+ if (!options || typeof options !== 'object') {
+ throw TypeError('options should be an object or true');
+ }
+ var async = options.async;
+ var promisify = options.promisify;
+ var nextTick = options.nextTick;
+ var objectify = options.objectify;
+ }
+
+ if (async || nextTick || promisify) {
+ var _listener = listener;
+ var _origin = listener._origin || listener;
+
+ if (nextTick && !nextTickSupported) {
+ throw Error('process.nextTick is not supported');
+ }
+
+ if (promisify === undefined) {
+ promisify = listener.constructor.name === 'AsyncFunction';
+ }
+
+ listener = function () {
+ var args = arguments;
+ var context = this;
+ var event = this.event;
+
+ return promisify ? (nextTick ? Promise.resolve() : new Promise(function (resolve) {
+ _setImmediate(resolve);
+ }).then(function () {
+ context.event = event;
+ return _listener.apply(context, args)
+ })) : (nextTick ? process.nextTick : _setImmediate)(function () {
+ context.event = event;
+ _listener.apply(context, args)
+ });
+ };
+
+ listener._async = true;
+ listener._origin = _origin;
+ }
+
+ return [listener, objectify? new Listener(this, event, listener): this];
+ }
+
+ function EventEmitter(conf) {
+ this._events = {};
+ this._newListener = false;
+ this._removeListener = false;
+ this.verboseMemoryLeak = false;
+ configure.call(this, conf);
+ }
+
+ EventEmitter.EventEmitter2 = EventEmitter; // backwards compatibility for exporting EventEmitter property
+
+ EventEmitter.prototype.listenTo= function(target, events, options){
+ if(typeof target!=='object'){
+ throw TypeError('target musts be an object');
+ }
+
+ var emitter= this;
+
+ options = resolveOptions(options, {
+ on: undefined,
+ off: undefined,
+ reducers: undefined
+ }, {
+ on: functionReducer,
+ off: functionReducer,
+ reducers: objectFunctionReducer
+ });
+
+ function listen(events){
+ if(typeof events!=='object'){
+ throw TypeError('events must be an object');
+ }
+
+ var reducers= options.reducers;
+ var index= findTargetIndex.call(emitter, target);
+ var observer;
+
+ if(index===-1){
+ observer= new TargetObserver(emitter, target, options);
+ }else{
+ observer= emitter._observers[index];
+ }
+
+ var keys= ownKeys(events);
+ var len= keys.length;
+ var event;
+ var isSingleReducer= typeof reducers==='function';
+
+ for(var i=0; i 0) {
+ observer = observers[i];
+ if (!target || observer._target === target) {
+ observer.unsubscribe(event);
+ matched= true;
+ }
+ }
+
+ return matched;
+ };
+
+ // By default EventEmitters will print a warning if more than
+ // 10 listeners are added to it. This is a useful default which
+ // helps finding memory leaks.
+ //
+ // Obviously not all Emitters should be limited to 10. This function allows
+ // that to be increased. Set to zero for unlimited.
+
+ EventEmitter.prototype.delimiter = '.';
+
+ EventEmitter.prototype.setMaxListeners = function(n) {
+ if (n !== undefined) {
+ this._maxListeners = n;
+ if (!this._conf) this._conf = {};
+ this._conf.maxListeners = n;
+ }
+ };
+
+ EventEmitter.prototype.getMaxListeners = function() {
+ return this._maxListeners;
+ };
+
+ EventEmitter.prototype.event = '';
+
+ EventEmitter.prototype.once = function(event, fn, options) {
+ return this._once(event, fn, false, options);
+ };
+
+ EventEmitter.prototype.prependOnceListener = function(event, fn, options) {
+ return this._once(event, fn, true, options);
+ };
+
+ EventEmitter.prototype._once = function(event, fn, prepend, options) {
+ return this._many(event, 1, fn, prepend, options);
+ };
+
+ EventEmitter.prototype.many = function(event, ttl, fn, options) {
+ return this._many(event, ttl, fn, false, options);
+ };
+
+ EventEmitter.prototype.prependMany = function(event, ttl, fn, options) {
+ return this._many(event, ttl, fn, true, options);
+ };
+
+ EventEmitter.prototype._many = function(event, ttl, fn, prepend, options) {
+ var self = this;
+
+ if (typeof fn !== 'function') {
+ throw new Error('many only accepts instances of Function');
+ }
+
+ function listener() {
+ if (--ttl === 0) {
+ self.off(event, listener);
+ }
+ return fn.apply(this, arguments);
+ }
+
+ listener._origin = fn;
+
+ return this._on(event, listener, prepend, options);
+ };
+
+ EventEmitter.prototype.emit = function() {
+ if (!this._events && !this._all) {
+ return false;
+ }
+
+ this._events || init.call(this);
+
+ var type = arguments[0], ns, wildcard= this.wildcard;
+ var args,l,i,j, containsSymbol;
+
+ if (type === 'newListener' && !this._newListener) {
+ if (!this._events.newListener) {
+ return false;
+ }
+ }
+
+ if (wildcard) {
+ ns= type;
+ if(type!=='newListener' && type!=='removeListener'){
+ if (typeof type === 'object') {
+ l = type.length;
+ if (symbolsSupported) {
+ for (i = 0; i < l; i++) {
+ if (typeof type[i] === 'symbol') {
+ containsSymbol = true;
+ break;
+ }
+ }
+ }
+ if (!containsSymbol) {
+ type = type.join(this.delimiter);
+ }
+ }
+ }
+ }
+
+ var al = arguments.length;
+ var handler;
+
+ if (this._all && this._all.length) {
+ handler = this._all.slice();
+
+ for (i = 0, l = handler.length; i < l; i++) {
+ this.event = type;
+ switch (al) {
+ case 1:
+ handler[i].call(this, type);
+ break;
+ case 2:
+ handler[i].call(this, type, arguments[1]);
+ break;
+ case 3:
+ handler[i].call(this, type, arguments[1], arguments[2]);
+ break;
+ default:
+ handler[i].apply(this, arguments);
+ }
+ }
+ }
+
+ if (wildcard) {
+ handler = [];
+ searchListenerTree.call(this, handler, ns, this.listenerTree, 0, l);
+ } else {
+ handler = this._events[type];
+ if (typeof handler === 'function') {
+ this.event = type;
+ switch (al) {
+ case 1:
+ handler.call(this);
+ break;
+ case 2:
+ handler.call(this, arguments[1]);
+ break;
+ case 3:
+ handler.call(this, arguments[1], arguments[2]);
+ break;
+ default:
+ args = new Array(al - 1);
+ for (j = 1; j < al; j++) args[j - 1] = arguments[j];
+ handler.apply(this, args);
+ }
+ return true;
+ } else if (handler) {
+ // need to make copy of handlers because list can change in the middle
+ // of emit call
+ handler = handler.slice();
+ }
+ }
+
+ if (handler && handler.length) {
+ if (al > 3) {
+ args = new Array(al - 1);
+ for (j = 1; j < al; j++) args[j - 1] = arguments[j];
+ }
+ for (i = 0, l = handler.length; i < l; i++) {
+ this.event = type;
+ switch (al) {
+ case 1:
+ handler[i].call(this);
+ break;
+ case 2:
+ handler[i].call(this, arguments[1]);
+ break;
+ case 3:
+ handler[i].call(this, arguments[1], arguments[2]);
+ break;
+ default:
+ handler[i].apply(this, args);
+ }
+ }
+ return true;
+ } else if (!this.ignoreErrors && !this._all && type === 'error') {
+ if (arguments[1] instanceof Error) {
+ throw arguments[1]; // Unhandled 'error' event
+ } else {
+ throw new Error("Uncaught, unspecified 'error' event.");
+ }
+ }
+
+ return !!this._all;
+ };
+
+ EventEmitter.prototype.emitAsync = function() {
+ if (!this._events && !this._all) {
+ return false;
+ }
+
+ this._events || init.call(this);
+
+ var type = arguments[0], wildcard= this.wildcard, ns, containsSymbol;
+ var args,l,i,j;
+
+ if (type === 'newListener' && !this._newListener) {
+ if (!this._events.newListener) { return Promise.resolve([false]); }
+ }
+
+ if (wildcard) {
+ ns= type;
+ if(type!=='newListener' && type!=='removeListener'){
+ if (typeof type === 'object') {
+ l = type.length;
+ if (symbolsSupported) {
+ for (i = 0; i < l; i++) {
+ if (typeof type[i] === 'symbol') {
+ containsSymbol = true;
+ break;
+ }
+ }
+ }
+ if (!containsSymbol) {
+ type = type.join(this.delimiter);
+ }
+ }
+ }
+ }
+
+ var promises= [];
+
+ var al = arguments.length;
+ var handler;
+
+ if (this._all) {
+ for (i = 0, l = this._all.length; i < l; i++) {
+ this.event = type;
+ switch (al) {
+ case 1:
+ promises.push(this._all[i].call(this, type));
+ break;
+ case 2:
+ promises.push(this._all[i].call(this, type, arguments[1]));
+ break;
+ case 3:
+ promises.push(this._all[i].call(this, type, arguments[1], arguments[2]));
+ break;
+ default:
+ promises.push(this._all[i].apply(this, arguments));
+ }
+ }
+ }
+
+ if (wildcard) {
+ handler = [];
+ searchListenerTree.call(this, handler, ns, this.listenerTree, 0);
+ } else {
+ handler = this._events[type];
+ }
+
+ if (typeof handler === 'function') {
+ this.event = type;
+ switch (al) {
+ case 1:
+ promises.push(handler.call(this));
+ break;
+ case 2:
+ promises.push(handler.call(this, arguments[1]));
+ break;
+ case 3:
+ promises.push(handler.call(this, arguments[1], arguments[2]));
+ break;
+ default:
+ args = new Array(al - 1);
+ for (j = 1; j < al; j++) args[j - 1] = arguments[j];
+ promises.push(handler.apply(this, args));
+ }
+ } else if (handler && handler.length) {
+ handler = handler.slice();
+ if (al > 3) {
+ args = new Array(al - 1);
+ for (j = 1; j < al; j++) args[j - 1] = arguments[j];
+ }
+ for (i = 0, l = handler.length; i < l; i++) {
+ this.event = type;
+ switch (al) {
+ case 1:
+ promises.push(handler[i].call(this));
+ break;
+ case 2:
+ promises.push(handler[i].call(this, arguments[1]));
+ break;
+ case 3:
+ promises.push(handler[i].call(this, arguments[1], arguments[2]));
+ break;
+ default:
+ promises.push(handler[i].apply(this, args));
+ }
+ }
+ } else if (!this.ignoreErrors && !this._all && type === 'error') {
+ if (arguments[1] instanceof Error) {
+ return Promise.reject(arguments[1]); // Unhandled 'error' event
+ } else {
+ return Promise.reject("Uncaught, unspecified 'error' event.");
+ }
+ }
+
+ return Promise.all(promises);
+ };
+
+ EventEmitter.prototype.on = function(type, listener, options) {
+ return this._on(type, listener, false, options);
+ };
+
+ EventEmitter.prototype.prependListener = function(type, listener, options) {
+ return this._on(type, listener, true, options);
+ };
+
+ EventEmitter.prototype.onAny = function(fn) {
+ return this._onAny(fn, false);
+ };
+
+ EventEmitter.prototype.prependAny = function(fn) {
+ return this._onAny(fn, true);
+ };
+
+ EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+ EventEmitter.prototype._onAny = function(fn, prepend){
+ if (typeof fn !== 'function') {
+ throw new Error('onAny only accepts instances of Function');
+ }
+
+ if (!this._all) {
+ this._all = [];
+ }
+
+ // Add the function to the event listener collection.
+ if(prepend){
+ this._all.unshift(fn);
+ }else{
+ this._all.push(fn);
+ }
+
+ return this;
+ };
+
+ EventEmitter.prototype._on = function(type, listener, prepend, options) {
+ if (typeof type === 'function') {
+ this._onAny(type, listener);
+ return this;
+ }
+
+ if (typeof listener !== 'function') {
+ throw new Error('on only accepts instances of Function');
+ }
+ this._events || init.call(this);
+
+ var returnValue= this, temp;
+
+ if (options !== undefined) {
+ temp = setupListener.call(this, type, listener, options);
+ listener = temp[0];
+ returnValue = temp[1];
+ }
+
+ // To avoid recursion in the case that type == "newListeners"! Before
+ // adding it to the listeners, first emit "newListeners".
+ if (this._newListener) {
+ this.emit('newListener', type, listener);
+ }
+
+ if (this.wildcard) {
+ growListenerTree.call(this, type, listener, prepend);
+ return returnValue;
+ }
+
+ if (!this._events[type]) {
+ // Optimize the case of one listener. Don't need the extra array object.
+ this._events[type] = listener;
+ } else {
+ if (typeof this._events[type] === 'function') {
+ // Change to array.
+ this._events[type] = [this._events[type]];
+ }
+
+ // If we've already got an array, just add
+ if(prepend){
+ this._events[type].unshift(listener);
+ }else{
+ this._events[type].push(listener);
+ }
+
+ // Check for listener leak
+ if (
+ !this._events[type].warned &&
+ this._maxListeners > 0 &&
+ this._events[type].length > this._maxListeners
+ ) {
+ this._events[type].warned = true;
+ logPossibleMemoryLeak.call(this, this._events[type].length, type);
+ }
+ }
+
+ return returnValue;
+ };
+
+ EventEmitter.prototype.off = function(type, listener) {
+ if (typeof listener !== 'function') {
+ throw new Error('removeListener only takes instances of Function');
+ }
+
+ var handlers,leafs=[];
+
+ if(this.wildcard) {
+ var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice();
+ leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0);
+ if(!leafs) return this;
+ } else {
+ // does not use listeners(), so no side effect of creating _events[type]
+ if (!this._events[type]) return this;
+ handlers = this._events[type];
+ leafs.push({_listeners:handlers});
+ }
+
+ for (var iLeaf=0; iLeaf 0) {
+ fns = this._all;
+ for(i = 0, l = fns.length; i < l; i++) {
+ if(fn === fns[i]) {
+ fns.splice(i, 1);
+ if (this._removeListener)
+ this.emit("removeListenerAny", fn);
+ return this;
+ }
+ }
+ } else {
+ fns = this._all;
+ if (this._removeListener) {
+ for(i = 0, l = fns.length; i < l; i++)
+ this.emit("removeListenerAny", fns[i]);
+ }
+ this._all = [];
+ }
+ return this;
+ };
+
+ EventEmitter.prototype.removeListener = EventEmitter.prototype.off;
+
+ EventEmitter.prototype.removeAllListeners = function (type) {
+ if (type === undefined) {
+ !this._events || init.call(this);
+ return this;
+ }
+
+ if (this.wildcard) {
+ var leafs = searchListenerTree.call(this, null, type, this.listenerTree, 0), leaf, i;
+ if (!leafs) return this;
+ for (i = 0; i < leafs.length; i++) {
+ leaf = leafs[i];
+ leaf._listeners = null;
+ }
+ this.listenerTree && recursivelyGarbageCollect(this.listenerTree);
+ } else if (this._events) {
+ this._events[type] = null;
+ }
+ return this;
+ };
+
+ EventEmitter.prototype.listeners = function (type) {
+ var _events = this._events;
+ var keys, listeners, allListeners;
+ var i;
+ var listenerTree;
+
+ if (type === undefined) {
+ if (this.wildcard) {
+ throw Error('event name required for wildcard emitter');
+ }
+
+ if (!_events) {
+ return [];
+ }
+
+ keys = ownKeys(_events);
+ i = keys.length;
+ allListeners = [];
+ while (i-- > 0) {
+ listeners = _events[keys[i]];
+ if (typeof listeners === 'function') {
+ allListeners.push(listeners);
+ } else {
+ allListeners.push.apply(allListeners, listeners);
+ }
+ }
+ return allListeners;
+ } else {
+ if (this.wildcard) {
+ listenerTree= this.listenerTree;
+ if(!listenerTree) return [];
+ var handlers = [];
+ var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice();
+ searchListenerTree.call(this, handlers, ns, listenerTree, 0);
+ return handlers;
+ }
+
+ if (!_events) {
+ return [];
+ }
+
+ listeners = _events[type];
+
+ if (!listeners) {
+ return [];
+ }
+ return typeof listeners === 'function' ? [listeners] : listeners;
+ }
+ };
+
+ EventEmitter.prototype.eventNames = function(nsAsArray){
+ var _events= this._events;
+ return this.wildcard? collectTreeEvents.call(this, this.listenerTree, [], null, nsAsArray) : (_events? ownKeys(_events) : []);
+ };
+
+ EventEmitter.prototype.listenerCount = function(type) {
+ return this.listeners(type).length;
+ };
+
+ EventEmitter.prototype.hasListeners = function (type) {
+ if (this.wildcard) {
+ var handlers = [];
+ var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice();
+ searchListenerTree.call(this, handlers, ns, this.listenerTree, 0);
+ return handlers.length > 0;
+ }
+
+ var _events = this._events;
+ var _all = this._all;
+
+ return !!(_all && _all.length || _events && (type === undefined ? ownKeys(_events).length : _events[type]));
+ };
+
+ EventEmitter.prototype.listenersAny = function() {
+
+ if(this._all) {
+ return this._all;
+ }
+ else {
+ return [];
+ }
+
+ };
+
+ EventEmitter.prototype.waitFor = function (event, options) {
+ var self = this;
+ var type = typeof options;
+ if (type === 'number') {
+ options = {timeout: options};
+ } else if (type === 'function') {
+ options = {filter: options};
+ }
+
+ options= resolveOptions(options, {
+ timeout: 0,
+ filter: undefined,
+ handleError: false,
+ Promise: Promise,
+ overload: false
+ }, {
+ filter: functionReducer,
+ Promise: constructorReducer
+ });
+
+ return makeCancelablePromise(options.Promise, function (resolve, reject, onCancel) {
+ function listener() {
+ var filter= options.filter;
+ if (filter && !filter.apply(self, arguments)) {
+ return;
+ }
+ self.off(event, listener);
+ if (options.handleError) {
+ var err = arguments[0];
+ err ? reject(err) : resolve(toArray.apply(null, arguments).slice(1));
+ } else {
+ resolve(toArray.apply(null, arguments));
+ }
+ }
+
+ onCancel(function(){
+ self.off(event, listener);
+ });
+
+ self._on(event, listener, false);
+ }, {
+ timeout: options.timeout,
+ overload: options.overload
+ })
+ };
+
+ function once(emitter, name, options) {
+ options= resolveOptions(options, {
+ Promise: Promise,
+ timeout: 0,
+ overload: false
+ }, {
+ Promise: constructorReducer
+ });
+
+ var _Promise= options.Promise;
+
+ return makeCancelablePromise(_Promise, function(resolve, reject, onCancel){
+ var handler;
+ if (typeof emitter.addEventListener === 'function') {
+ handler= function () {
+ resolve(toArray.apply(null, arguments));
+ };
+
+ onCancel(function(){
+ emitter.removeEventListener(name, handler);
+ });
+
+ emitter.addEventListener(
+ name,
+ handler,
+ {once: true}
+ );
+ return;
+ }
+
+ var eventListener = function(){
+ errorListener && emitter.removeListener('error', errorListener);
+ resolve(toArray.apply(null, arguments));
+ };
+
+ var errorListener;
+
+ if (name !== 'error') {
+ errorListener = function (err){
+ emitter.removeListener(name, eventListener);
+ reject(err);
+ };
+
+ emitter.once('error', errorListener);
+ }
+
+ onCancel(function(){
+ errorListener && emitter.removeListener('error', errorListener);
+ emitter.removeListener(name, eventListener);
+ });
+
+ emitter.once(name, eventListener);
+ }, {
+ timeout: options.timeout,
+ overload: options.overload
+ });
+ }
+
+ var prototype= EventEmitter.prototype;
+
+ Object.defineProperties(EventEmitter, {
+ defaultMaxListeners: {
+ get: function () {
+ return prototype._maxListeners;
+ },
+ set: function (n) {
+ if (typeof n !== 'number' || n < 0 || Number.isNaN(n)) {
+ throw TypeError('n must be a non-negative number')
+ }
+ prototype._maxListeners = n;
+ },
+ enumerable: true
+ },
+ once: {
+ value: once,
+ writable: true,
+ configurable: true
+ }
+ });
+
+ Object.defineProperties(prototype, {
+ _maxListeners: {
+ value: defaultMaxListeners,
+ writable: true,
+ configurable: true
+ },
+ _observers: {value: null, writable: true, configurable: true}
+ });
+
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(function() {
+ return EventEmitter;
+ });
+ } else if (typeof exports === 'object') {
+ // CommonJS
+ module.exports = EventEmitter;
+ }
+ else {
+ // global for any kind of environment.
+ var _global= new Function('','return this')();
+ _global.EventEmitter2 = EventEmitter;
+ }
+}();
diff --git a/node_modules/@pm2/io/node_modules/eventemitter2/package.json b/node_modules/@pm2/io/node_modules/eventemitter2/package.json
new file mode 100644
index 0000000..bf56eed
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/eventemitter2/package.json
@@ -0,0 +1,89 @@
+{
+ "name": "eventemitter2",
+ "version": "6.4.9",
+ "description": "A feature-rich Node.js event emitter implementation with namespaces, wildcards, TTL, async listeners and browser/worker support.",
+ "keywords": [
+ "event",
+ "events",
+ "emitter",
+ "eventemitter",
+ "addEventListener",
+ "addListener",
+ "pub/sub",
+ "emit",
+ "emits",
+ "on",
+ "once",
+ "publish",
+ "subscribe"
+ ],
+ "author": "hij1nx http://twitter.com/hij1nx",
+ "contributors": [
+ "Eric Elliott",
+ "Charlie Robbins http://twitter.com/indexzero",
+ "Jameson Lee http://twitter.com/Jamesonjlee",
+ "Jeroen van Duffelen http://www.twitter.com/jvduf",
+ "Fedor Indutny http://www.twitter.com/indutny"
+ ],
+ "license": "MIT",
+ "repository": "git://github.com/hij1nx/EventEmitter2.git",
+ "devDependencies": {
+ "benchmark": "^2.1.4",
+ "bluebird": "^3.7.2",
+ "coveralls": "^3.0.11",
+ "mocha": "^7.1.1",
+ "nodeunit": "*",
+ "nyc": "^15.0.0"
+ },
+ "main": "./lib/eventemitter2.js",
+ "scripts": {
+ "test": "mocha ./test/loader.js --exit --timeout=3000",
+ "test:legacy": "nodeunit test/simple/ test/wildcardEvents/",
+ "test:coverage": "nyc --check-coverage npm run test",
+ "coverage:report": "nyc report --reporter=html --reporter=text",
+ "coveralls": "nyc report --reporter=text-lcov | coveralls",
+ "benchmark": "node test/perf/benchmark.js",
+ "prepublishOnly": "npm run test:coverage",
+ "postversion": "git push && git push --tags"
+ },
+ "files": [
+ "lib/eventemitter2.js",
+ "index.js",
+ "eventemitter2.d.ts"
+ ],
+ "typings": "./eventemitter2.d.ts",
+ "typescript": {
+ "definition": "./eventemitter2.d.ts"
+ },
+ "nyc": {
+ "lines": 80,
+ "functions": 80,
+ "branches": 75,
+ "statements": 80,
+ "watermarks": {
+ "lines": [
+ 80,
+ 95
+ ],
+ "functions": [
+ 80,
+ 95
+ ],
+ "branches": [
+ 80,
+ 95
+ ],
+ "statements": [
+ 80,
+ 95
+ ]
+ },
+ "include": [
+ "lib/**/*.js"
+ ],
+ "reporter": [
+ "lcov",
+ "text-summary"
+ ]
+ }
+}
diff --git a/node_modules/@pm2/io/node_modules/lru-cache/LICENSE b/node_modules/@pm2/io/node_modules/lru-cache/LICENSE
new file mode 100644
index 0000000..19129e3
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/lru-cache/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/@pm2/io/node_modules/lru-cache/README.md b/node_modules/@pm2/io/node_modules/lru-cache/README.md
new file mode 100644
index 0000000..435dfeb
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/lru-cache/README.md
@@ -0,0 +1,166 @@
+# lru cache
+
+A cache object that deletes the least-recently-used items.
+
+[](https://travis-ci.org/isaacs/node-lru-cache) [](https://coveralls.io/github/isaacs/node-lru-cache)
+
+## Installation:
+
+```javascript
+npm install lru-cache --save
+```
+
+## Usage:
+
+```javascript
+var LRU = require("lru-cache")
+ , options = { max: 500
+ , length: function (n, key) { return n * 2 + key.length }
+ , dispose: function (key, n) { n.close() }
+ , maxAge: 1000 * 60 * 60 }
+ , cache = new LRU(options)
+ , otherCache = new LRU(50) // sets just the max size
+
+cache.set("key", "value")
+cache.get("key") // "value"
+
+// non-string keys ARE fully supported
+// but note that it must be THE SAME object, not
+// just a JSON-equivalent object.
+var someObject = { a: 1 }
+cache.set(someObject, 'a value')
+// Object keys are not toString()-ed
+cache.set('[object Object]', 'a different value')
+assert.equal(cache.get(someObject), 'a value')
+// A similar object with same keys/values won't work,
+// because it's a different object identity
+assert.equal(cache.get({ a: 1 }), undefined)
+
+cache.reset() // empty the cache
+```
+
+If you put more stuff in it, then items will fall out.
+
+If you try to put an oversized thing in it, then it'll fall out right
+away.
+
+## Options
+
+* `max` The maximum size of the cache, checked by applying the length
+ function to all values in the cache. Not setting this is kind of
+ silly, since that's the whole purpose of this lib, but it defaults
+ to `Infinity`. Setting it to a non-number or negative number will
+ throw a `TypeError`. Setting it to 0 makes it be `Infinity`.
+* `maxAge` Maximum age in ms. Items are not pro-actively pruned out
+ as they age, but if you try to get an item that is too old, it'll
+ drop it and return undefined instead of giving it to you.
+ Setting this to a negative value will make everything seem old!
+ Setting it to a non-number will throw a `TypeError`.
+* `length` Function that is used to calculate the length of stored
+ items. If you're storing strings or buffers, then you probably want
+ to do something like `function(n, key){return n.length}`. The default is
+ `function(){return 1}`, which is fine if you want to store `max`
+ like-sized things. The item is passed as the first argument, and
+ the key is passed as the second argumnet.
+* `dispose` Function that is called on items when they are dropped
+ from the cache. This can be handy if you want to close file
+ descriptors or do other cleanup tasks when items are no longer
+ accessible. Called with `key, value`. It's called *before*
+ actually removing the item from the internal cache, so if you want
+ to immediately put it back in, you'll have to do that in a
+ `nextTick` or `setTimeout` callback or it won't do anything.
+* `stale` By default, if you set a `maxAge`, it'll only actually pull
+ stale items out of the cache when you `get(key)`. (That is, it's
+ not pre-emptively doing a `setTimeout` or anything.) If you set
+ `stale:true`, it'll return the stale value before deleting it. If
+ you don't set this, then it'll return `undefined` when you try to
+ get a stale entry, as if it had already been deleted.
+* `noDisposeOnSet` By default, if you set a `dispose()` method, then
+ it'll be called whenever a `set()` operation overwrites an existing
+ key. If you set this option, `dispose()` will only be called when a
+ key falls out of the cache, not when it is overwritten.
+* `updateAgeOnGet` When using time-expiring entries with `maxAge`,
+ setting this to `true` will make each item's effective time update
+ to the current time whenever it is retrieved from cache, causing it
+ to not expire. (It can still fall out of cache based on recency of
+ use, of course.)
+
+## API
+
+* `set(key, value, maxAge)`
+* `get(key) => value`
+
+ Both of these will update the "recently used"-ness of the key.
+ They do what you think. `maxAge` is optional and overrides the
+ cache `maxAge` option if provided.
+
+ If the key is not found, `get()` will return `undefined`.
+
+ The key and val can be any value.
+
+* `peek(key)`
+
+ Returns the key value (or `undefined` if not found) without
+ updating the "recently used"-ness of the key.
+
+ (If you find yourself using this a lot, you *might* be using the
+ wrong sort of data structure, but there are some use cases where
+ it's handy.)
+
+* `del(key)`
+
+ Deletes a key out of the cache.
+
+* `reset()`
+
+ Clear the cache entirely, throwing away all values.
+
+* `has(key)`
+
+ Check if a key is in the cache, without updating the recent-ness
+ or deleting it for being stale.
+
+* `forEach(function(value,key,cache), [thisp])`
+
+ Just like `Array.prototype.forEach`. Iterates over all the keys
+ in the cache, in order of recent-ness. (Ie, more recently used
+ items are iterated over first.)
+
+* `rforEach(function(value,key,cache), [thisp])`
+
+ The same as `cache.forEach(...)` but items are iterated over in
+ reverse order. (ie, less recently used items are iterated over
+ first.)
+
+* `keys()`
+
+ Return an array of the keys in the cache.
+
+* `values()`
+
+ Return an array of the values in the cache.
+
+* `length`
+
+ Return total length of objects in cache taking into account
+ `length` options function.
+
+* `itemCount`
+
+ Return total quantity of objects currently in cache. Note, that
+ `stale` (see options) items are returned as part of this item
+ count.
+
+* `dump()`
+
+ Return an array of the cache entries ready for serialization and usage
+ with 'destinationCache.load(arr)`.
+
+* `load(cacheEntriesArray)`
+
+ Loads another cache entries array, obtained with `sourceCache.dump()`,
+ into the cache. The destination cache is reset before loading new entries
+
+* `prune()`
+
+ Manually iterates over the entire cache proactively pruning old entries
diff --git a/node_modules/@pm2/io/node_modules/lru-cache/index.js b/node_modules/@pm2/io/node_modules/lru-cache/index.js
new file mode 100644
index 0000000..573b6b8
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/lru-cache/index.js
@@ -0,0 +1,334 @@
+'use strict'
+
+// A linked list to keep track of recently-used-ness
+const Yallist = require('yallist')
+
+const MAX = Symbol('max')
+const LENGTH = Symbol('length')
+const LENGTH_CALCULATOR = Symbol('lengthCalculator')
+const ALLOW_STALE = Symbol('allowStale')
+const MAX_AGE = Symbol('maxAge')
+const DISPOSE = Symbol('dispose')
+const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')
+const LRU_LIST = Symbol('lruList')
+const CACHE = Symbol('cache')
+const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')
+
+const naiveLength = () => 1
+
+// lruList is a yallist where the head is the youngest
+// item, and the tail is the oldest. the list contains the Hit
+// objects as the entries.
+// Each Hit object has a reference to its Yallist.Node. This
+// never changes.
+//
+// cache is a Map (or PseudoMap) that matches the keys to
+// the Yallist.Node object.
+class LRUCache {
+ constructor (options) {
+ if (typeof options === 'number')
+ options = { max: options }
+
+ if (!options)
+ options = {}
+
+ if (options.max && (typeof options.max !== 'number' || options.max < 0))
+ throw new TypeError('max must be a non-negative number')
+ // Kind of weird to have a default max of Infinity, but oh well.
+ const max = this[MAX] = options.max || Infinity
+
+ const lc = options.length || naiveLength
+ this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc
+ this[ALLOW_STALE] = options.stale || false
+ if (options.maxAge && typeof options.maxAge !== 'number')
+ throw new TypeError('maxAge must be a number')
+ this[MAX_AGE] = options.maxAge || 0
+ this[DISPOSE] = options.dispose
+ this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false
+ this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false
+ this.reset()
+ }
+
+ // resize the cache when the max changes.
+ set max (mL) {
+ if (typeof mL !== 'number' || mL < 0)
+ throw new TypeError('max must be a non-negative number')
+
+ this[MAX] = mL || Infinity
+ trim(this)
+ }
+ get max () {
+ return this[MAX]
+ }
+
+ set allowStale (allowStale) {
+ this[ALLOW_STALE] = !!allowStale
+ }
+ get allowStale () {
+ return this[ALLOW_STALE]
+ }
+
+ set maxAge (mA) {
+ if (typeof mA !== 'number')
+ throw new TypeError('maxAge must be a non-negative number')
+
+ this[MAX_AGE] = mA
+ trim(this)
+ }
+ get maxAge () {
+ return this[MAX_AGE]
+ }
+
+ // resize the cache when the lengthCalculator changes.
+ set lengthCalculator (lC) {
+ if (typeof lC !== 'function')
+ lC = naiveLength
+
+ if (lC !== this[LENGTH_CALCULATOR]) {
+ this[LENGTH_CALCULATOR] = lC
+ this[LENGTH] = 0
+ this[LRU_LIST].forEach(hit => {
+ hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)
+ this[LENGTH] += hit.length
+ })
+ }
+ trim(this)
+ }
+ get lengthCalculator () { return this[LENGTH_CALCULATOR] }
+
+ get length () { return this[LENGTH] }
+ get itemCount () { return this[LRU_LIST].length }
+
+ rforEach (fn, thisp) {
+ thisp = thisp || this
+ for (let walker = this[LRU_LIST].tail; walker !== null;) {
+ const prev = walker.prev
+ forEachStep(this, fn, walker, thisp)
+ walker = prev
+ }
+ }
+
+ forEach (fn, thisp) {
+ thisp = thisp || this
+ for (let walker = this[LRU_LIST].head; walker !== null;) {
+ const next = walker.next
+ forEachStep(this, fn, walker, thisp)
+ walker = next
+ }
+ }
+
+ keys () {
+ return this[LRU_LIST].toArray().map(k => k.key)
+ }
+
+ values () {
+ return this[LRU_LIST].toArray().map(k => k.value)
+ }
+
+ reset () {
+ if (this[DISPOSE] &&
+ this[LRU_LIST] &&
+ this[LRU_LIST].length) {
+ this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))
+ }
+
+ this[CACHE] = new Map() // hash of items by key
+ this[LRU_LIST] = new Yallist() // list of items in order of use recency
+ this[LENGTH] = 0 // length of items in the list
+ }
+
+ dump () {
+ return this[LRU_LIST].map(hit =>
+ isStale(this, hit) ? false : {
+ k: hit.key,
+ v: hit.value,
+ e: hit.now + (hit.maxAge || 0)
+ }).toArray().filter(h => h)
+ }
+
+ dumpLru () {
+ return this[LRU_LIST]
+ }
+
+ set (key, value, maxAge) {
+ maxAge = maxAge || this[MAX_AGE]
+
+ if (maxAge && typeof maxAge !== 'number')
+ throw new TypeError('maxAge must be a number')
+
+ const now = maxAge ? Date.now() : 0
+ const len = this[LENGTH_CALCULATOR](value, key)
+
+ if (this[CACHE].has(key)) {
+ if (len > this[MAX]) {
+ del(this, this[CACHE].get(key))
+ return false
+ }
+
+ const node = this[CACHE].get(key)
+ const item = node.value
+
+ // dispose of the old one before overwriting
+ // split out into 2 ifs for better coverage tracking
+ if (this[DISPOSE]) {
+ if (!this[NO_DISPOSE_ON_SET])
+ this[DISPOSE](key, item.value)
+ }
+
+ item.now = now
+ item.maxAge = maxAge
+ item.value = value
+ this[LENGTH] += len - item.length
+ item.length = len
+ this.get(key)
+ trim(this)
+ return true
+ }
+
+ const hit = new Entry(key, value, len, now, maxAge)
+
+ // oversized objects fall out of cache automatically.
+ if (hit.length > this[MAX]) {
+ if (this[DISPOSE])
+ this[DISPOSE](key, value)
+
+ return false
+ }
+
+ this[LENGTH] += hit.length
+ this[LRU_LIST].unshift(hit)
+ this[CACHE].set(key, this[LRU_LIST].head)
+ trim(this)
+ return true
+ }
+
+ has (key) {
+ if (!this[CACHE].has(key)) return false
+ const hit = this[CACHE].get(key).value
+ return !isStale(this, hit)
+ }
+
+ get (key) {
+ return get(this, key, true)
+ }
+
+ peek (key) {
+ return get(this, key, false)
+ }
+
+ pop () {
+ const node = this[LRU_LIST].tail
+ if (!node)
+ return null
+
+ del(this, node)
+ return node.value
+ }
+
+ del (key) {
+ del(this, this[CACHE].get(key))
+ }
+
+ load (arr) {
+ // reset the cache
+ this.reset()
+
+ const now = Date.now()
+ // A previous serialized cache has the most recent items first
+ for (let l = arr.length - 1; l >= 0; l--) {
+ const hit = arr[l]
+ const expiresAt = hit.e || 0
+ if (expiresAt === 0)
+ // the item was created without expiration in a non aged cache
+ this.set(hit.k, hit.v)
+ else {
+ const maxAge = expiresAt - now
+ // dont add already expired items
+ if (maxAge > 0) {
+ this.set(hit.k, hit.v, maxAge)
+ }
+ }
+ }
+ }
+
+ prune () {
+ this[CACHE].forEach((value, key) => get(this, key, false))
+ }
+}
+
+const get = (self, key, doUse) => {
+ const node = self[CACHE].get(key)
+ if (node) {
+ const hit = node.value
+ if (isStale(self, hit)) {
+ del(self, node)
+ if (!self[ALLOW_STALE])
+ return undefined
+ } else {
+ if (doUse) {
+ if (self[UPDATE_AGE_ON_GET])
+ node.value.now = Date.now()
+ self[LRU_LIST].unshiftNode(node)
+ }
+ }
+ return hit.value
+ }
+}
+
+const isStale = (self, hit) => {
+ if (!hit || (!hit.maxAge && !self[MAX_AGE]))
+ return false
+
+ const diff = Date.now() - hit.now
+ return hit.maxAge ? diff > hit.maxAge
+ : self[MAX_AGE] && (diff > self[MAX_AGE])
+}
+
+const trim = self => {
+ if (self[LENGTH] > self[MAX]) {
+ for (let walker = self[LRU_LIST].tail;
+ self[LENGTH] > self[MAX] && walker !== null;) {
+ // We know that we're about to delete this one, and also
+ // what the next least recently used key will be, so just
+ // go ahead and set it now.
+ const prev = walker.prev
+ del(self, walker)
+ walker = prev
+ }
+ }
+}
+
+const del = (self, node) => {
+ if (node) {
+ const hit = node.value
+ if (self[DISPOSE])
+ self[DISPOSE](hit.key, hit.value)
+
+ self[LENGTH] -= hit.length
+ self[CACHE].delete(hit.key)
+ self[LRU_LIST].removeNode(node)
+ }
+}
+
+class Entry {
+ constructor (key, value, length, now, maxAge) {
+ this.key = key
+ this.value = value
+ this.length = length
+ this.now = now
+ this.maxAge = maxAge || 0
+ }
+}
+
+const forEachStep = (self, fn, node, thisp) => {
+ let hit = node.value
+ if (isStale(self, hit)) {
+ del(self, node)
+ if (!self[ALLOW_STALE])
+ hit = undefined
+ }
+ if (hit)
+ fn.call(thisp, hit.value, hit.key, self)
+}
+
+module.exports = LRUCache
diff --git a/node_modules/@pm2/io/node_modules/lru-cache/package.json b/node_modules/@pm2/io/node_modules/lru-cache/package.json
new file mode 100644
index 0000000..43b7502
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/lru-cache/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "lru-cache",
+ "description": "A cache object that deletes the least-recently-used items.",
+ "version": "6.0.0",
+ "author": "Isaac Z. Schlueter ",
+ "keywords": [
+ "mru",
+ "lru",
+ "cache"
+ ],
+ "scripts": {
+ "test": "tap",
+ "snap": "tap",
+ "preversion": "npm test",
+ "postversion": "npm publish",
+ "prepublishOnly": "git push origin --follow-tags"
+ },
+ "main": "index.js",
+ "repository": "git://github.com/isaacs/node-lru-cache.git",
+ "devDependencies": {
+ "benchmark": "^2.1.4",
+ "tap": "^14.10.7"
+ },
+ "license": "ISC",
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "engines": {
+ "node": ">=10"
+ }
+}
diff --git a/node_modules/@pm2/io/node_modules/semver/LICENSE b/node_modules/@pm2/io/node_modules/semver/LICENSE
new file mode 100644
index 0000000..19129e3
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/@pm2/io/node_modules/semver/README.md b/node_modules/@pm2/io/node_modules/semver/README.md
new file mode 100644
index 0000000..53ea9b5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/README.md
@@ -0,0 +1,637 @@
+semver(1) -- The semantic versioner for npm
+===========================================
+
+## Install
+
+```bash
+npm install semver
+````
+
+## Usage
+
+As a node module:
+
+```js
+const semver = require('semver')
+
+semver.valid('1.2.3') // '1.2.3'
+semver.valid('a.b.c') // null
+semver.clean(' =v1.2.3 ') // '1.2.3'
+semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
+semver.gt('1.2.3', '9.8.7') // false
+semver.lt('1.2.3', '9.8.7') // true
+semver.minVersion('>=1.0.0') // '1.0.0'
+semver.valid(semver.coerce('v2')) // '2.0.0'
+semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
+```
+
+You can also just load the module for the function that you care about, if
+you'd like to minimize your footprint.
+
+```js
+// load the whole API at once in a single object
+const semver = require('semver')
+
+// or just load the bits you need
+// all of them listed here, just pick and choose what you want
+
+// classes
+const SemVer = require('semver/classes/semver')
+const Comparator = require('semver/classes/comparator')
+const Range = require('semver/classes/range')
+
+// functions for working with versions
+const semverParse = require('semver/functions/parse')
+const semverValid = require('semver/functions/valid')
+const semverClean = require('semver/functions/clean')
+const semverInc = require('semver/functions/inc')
+const semverDiff = require('semver/functions/diff')
+const semverMajor = require('semver/functions/major')
+const semverMinor = require('semver/functions/minor')
+const semverPatch = require('semver/functions/patch')
+const semverPrerelease = require('semver/functions/prerelease')
+const semverCompare = require('semver/functions/compare')
+const semverRcompare = require('semver/functions/rcompare')
+const semverCompareLoose = require('semver/functions/compare-loose')
+const semverCompareBuild = require('semver/functions/compare-build')
+const semverSort = require('semver/functions/sort')
+const semverRsort = require('semver/functions/rsort')
+
+// low-level comparators between versions
+const semverGt = require('semver/functions/gt')
+const semverLt = require('semver/functions/lt')
+const semverEq = require('semver/functions/eq')
+const semverNeq = require('semver/functions/neq')
+const semverGte = require('semver/functions/gte')
+const semverLte = require('semver/functions/lte')
+const semverCmp = require('semver/functions/cmp')
+const semverCoerce = require('semver/functions/coerce')
+
+// working with ranges
+const semverSatisfies = require('semver/functions/satisfies')
+const semverMaxSatisfying = require('semver/ranges/max-satisfying')
+const semverMinSatisfying = require('semver/ranges/min-satisfying')
+const semverToComparators = require('semver/ranges/to-comparators')
+const semverMinVersion = require('semver/ranges/min-version')
+const semverValidRange = require('semver/ranges/valid')
+const semverOutside = require('semver/ranges/outside')
+const semverGtr = require('semver/ranges/gtr')
+const semverLtr = require('semver/ranges/ltr')
+const semverIntersects = require('semver/ranges/intersects')
+const simplifyRange = require('semver/ranges/simplify')
+const rangeSubset = require('semver/ranges/subset')
+```
+
+As a command-line utility:
+
+```
+$ semver -h
+
+A JavaScript implementation of the https://semver.org/ specification
+Copyright Isaac Z. Schlueter
+
+Usage: semver [options] [ [...]]
+Prints valid versions sorted by SemVer precedence
+
+Options:
+-r --range
+ Print versions that match the specified range.
+
+-i --increment []
+ Increment a version by the specified level. Level can
+ be one of: major, minor, patch, premajor, preminor,
+ prepatch, or prerelease. Default level is 'patch'.
+ Only one version may be specified.
+
+--preid
+ Identifier to be used to prefix premajor, preminor,
+ prepatch or prerelease version increments.
+
+-l --loose
+ Interpret versions and ranges loosely
+
+-n <0|1>
+ This is the base to be used for the prerelease identifier.
+
+-p --include-prerelease
+ Always include prerelease versions in range matching
+
+-c --coerce
+ Coerce a string into SemVer if possible
+ (does not imply --loose)
+
+--rtl
+ Coerce version strings right to left
+
+--ltr
+ Coerce version strings left to right (default)
+
+Program exits successfully if any valid version satisfies
+all supplied ranges, and prints all satisfying versions.
+
+If no satisfying versions are found, then exits failure.
+
+Versions are printed in ascending order, so supplying
+multiple versions to the utility will just sort them.
+```
+
+## Versions
+
+A "version" is described by the `v2.0.0` specification found at
+.
+
+A leading `"="` or `"v"` character is stripped off and ignored.
+
+## Ranges
+
+A `version range` is a set of `comparators` which specify versions
+that satisfy the range.
+
+A `comparator` is composed of an `operator` and a `version`. The set
+of primitive `operators` is:
+
+* `<` Less than
+* `<=` Less than or equal to
+* `>` Greater than
+* `>=` Greater than or equal to
+* `=` Equal. If no operator is specified, then equality is assumed,
+ so this operator is optional, but MAY be included.
+
+For example, the comparator `>=1.2.7` would match the versions
+`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
+or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and
+would match the versions `2.0.0` and `3.1.0`, but not the versions
+`1.0.1` or `1.1.0`.
+
+Comparators can be joined by whitespace to form a `comparator set`,
+which is satisfied by the **intersection** of all of the comparators
+it includes.
+
+A range is composed of one or more comparator sets, joined by `||`. A
+version matches a range if and only if every comparator in at least
+one of the `||`-separated comparator sets is satisfied by the version.
+
+For example, the range `>=1.2.7 <1.3.0` would match the versions
+`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
+or `1.1.0`.
+
+The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
+`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
+
+### Prerelease Tags
+
+If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
+it will only be allowed to satisfy comparator sets if at least one
+comparator with the same `[major, minor, patch]` tuple also has a
+prerelease tag.
+
+For example, the range `>1.2.3-alpha.3` would be allowed to match the
+version `1.2.3-alpha.7`, but it would *not* be satisfied by
+`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
+than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
+range only accepts prerelease tags on the `1.2.3` version. The
+version `3.4.5` *would* satisfy the range, because it does not have a
+prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
+
+The purpose for this behavior is twofold. First, prerelease versions
+frequently are updated very quickly, and contain many breaking changes
+that are (by the author's design) not yet fit for public consumption.
+Therefore, by default, they are excluded from range matching
+semantics.
+
+Second, a user who has opted into using a prerelease version has
+clearly indicated the intent to use *that specific* set of
+alpha/beta/rc versions. By including a prerelease tag in the range,
+the user is indicating that they are aware of the risk. However, it
+is still not appropriate to assume that they have opted into taking a
+similar risk on the *next* set of prerelease versions.
+
+Note that this behavior can be suppressed (treating all prerelease
+versions as if they were normal versions, for the purpose of range
+matching) by setting the `includePrerelease` flag on the options
+object to any
+[functions](https://github.com/npm/node-semver#functions) that do
+range matching.
+
+#### Prerelease Identifiers
+
+The method `.inc` takes an additional `identifier` string argument that
+will append the value of the string as a prerelease identifier:
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta')
+// '1.2.4-beta.0'
+```
+
+command-line example:
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta
+1.2.4-beta.0
+```
+
+Which then can be used to increment further:
+
+```bash
+$ semver 1.2.4-beta.0 -i prerelease
+1.2.4-beta.1
+```
+
+#### Prerelease Identifier Base
+
+The method `.inc` takes an optional parameter 'identifierBase' string
+that will let you let your prerelease number as zero-based or one-based.
+Set to `false` to omit the prerelease number altogether.
+If you do not specify this parameter, it will default to zero-based.
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta', '1')
+// '1.2.4-beta.1'
+```
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta', false)
+// '1.2.4-beta'
+```
+
+command-line example:
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta -n 1
+1.2.4-beta.1
+```
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta -n false
+1.2.4-beta
+```
+
+### Advanced Range Syntax
+
+Advanced range syntax desugars to primitive comparators in
+deterministic ways.
+
+Advanced ranges may be combined in the same way as primitive
+comparators using white space or `||`.
+
+#### Hyphen Ranges `X.Y.Z - A.B.C`
+
+Specifies an inclusive set.
+
+* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
+
+If a partial version is provided as the first version in the inclusive
+range, then the missing pieces are replaced with zeroes.
+
+* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
+
+If a partial version is provided as the second version in the
+inclusive range, then all versions that start with the supplied parts
+of the tuple are accepted, but nothing that would be greater than the
+provided tuple parts.
+
+* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
+* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
+
+#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
+
+Any of `X`, `x`, or `*` may be used to "stand in" for one of the
+numeric values in the `[major, minor, patch]` tuple.
+
+* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless
+ `includePrerelease` is specified, in which case any version at all
+ satisfies)
+* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
+* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
+
+A partial version range is treated as an X-Range, so the special
+character is in fact optional.
+
+* `""` (empty string) := `*` := `>=0.0.0`
+* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
+* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
+
+#### Tilde Ranges `~1.2.3` `~1.2` `~1`
+
+Allows patch-level changes if a minor version is specified on the
+comparator. Allows minor-level changes if not.
+
+* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
+* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
+* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
+* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
+* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
+* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
+* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+
+#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
+
+Allows changes that do not modify the left-most non-zero element in the
+`[major, minor, patch]` tuple. In other words, this allows patch and
+minor updates for versions `1.0.0` and above, patch updates for
+versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
+
+Many authors treat a `0.x` version as if the `x` were the major
+"breaking-change" indicator.
+
+Caret ranges are ideal when an author may make breaking changes
+between `0.2.4` and `0.3.0` releases, which is a common practice.
+However, it presumes that there will *not* be breaking changes between
+`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
+additive (but non-breaking), according to commonly observed practices.
+
+* `^1.2.3` := `>=1.2.3 <2.0.0-0`
+* `^0.2.3` := `>=0.2.3 <0.3.0-0`
+* `^0.0.3` := `>=0.0.3 <0.0.4-0`
+* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
+ `0.0.3` version *only* will be allowed, if they are greater than or
+ equal to `beta`. So, `0.0.3-pr.2` would be allowed.
+
+When parsing caret ranges, a missing `patch` value desugars to the
+number `0`, but will allow flexibility within that value, even if the
+major and minor versions are both `0`.
+
+* `^1.2.x` := `>=1.2.0 <2.0.0-0`
+* `^0.0.x` := `>=0.0.0 <0.1.0-0`
+* `^0.0` := `>=0.0.0 <0.1.0-0`
+
+A missing `minor` and `patch` values will desugar to zero, but also
+allow flexibility within those values, even if the major version is
+zero.
+
+* `^1.x` := `>=1.0.0 <2.0.0-0`
+* `^0.x` := `>=0.0.0 <1.0.0-0`
+
+### Range Grammar
+
+Putting all this together, here is a Backus-Naur grammar for ranges,
+for the benefit of parser authors:
+
+```bnf
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
+```
+
+## Functions
+
+All methods and classes take a final `options` object argument. All
+options in this object are `false` by default. The options supported
+are:
+
+- `loose` Be more forgiving about not-quite-valid semver strings.
+ (Any resulting output will always be 100% strict compliant, of
+ course.) For backwards compatibility reasons, if the `options`
+ argument is a boolean value instead of an object, it is interpreted
+ to be the `loose` param.
+- `includePrerelease` Set to suppress the [default
+ behavior](https://github.com/npm/node-semver#prerelease-tags) of
+ excluding prerelease tagged versions from ranges unless they are
+ explicitly opted into.
+
+Strict-mode Comparators and Ranges will be strict about the SemVer
+strings that they parse.
+
+* `valid(v)`: Return the parsed version, or null if it's not valid.
+* `inc(v, release)`: Return the version incremented by the release
+ type (`major`, `premajor`, `minor`, `preminor`, `patch`,
+ `prepatch`, or `prerelease`), or null if it's not valid
+ * `premajor` in one call will bump the version up to the next major
+ version and down to a prerelease of that major version.
+ `preminor`, and `prepatch` work the same way.
+ * If called from a non-prerelease version, the `prerelease` will work the
+ same as `prepatch`. It increments the patch version, then makes a
+ prerelease. If the input version is already a prerelease it simply
+ increments it.
+* `prerelease(v)`: Returns an array of prerelease components, or null
+ if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
+* `major(v)`: Return the major version number.
+* `minor(v)`: Return the minor version number.
+* `patch(v)`: Return the patch version number.
+* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
+ or comparators intersect.
+* `parse(v)`: Attempt to parse a string as a semantic version, returning either
+ a `SemVer` object or `null`.
+
+### Comparison
+
+* `gt(v1, v2)`: `v1 > v2`
+* `gte(v1, v2)`: `v1 >= v2`
+* `lt(v1, v2)`: `v1 < v2`
+* `lte(v1, v2)`: `v1 <= v2`
+* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
+ even if they're not the exact same string. You already know how to
+ compare strings.
+* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
+* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
+ the corresponding function above. `"==="` and `"!=="` do simple
+ string comparison, but are included for completeness. Throws if an
+ invalid comparison string is provided.
+* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
+ `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
+* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
+ in descending order when passed to `Array.sort()`.
+* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
+ are equal. Sorts in ascending order if passed to `Array.sort()`.
+ `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
+* `diff(v1, v2)`: Returns difference between two versions by the release type
+ (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
+ or null if the versions are the same.
+
+### Comparators
+
+* `intersects(comparator)`: Return true if the comparators intersect
+
+### Ranges
+
+* `validRange(range)`: Return the valid range or null if it's not valid
+* `satisfies(version, range)`: Return true if the version satisfies the
+ range.
+* `maxSatisfying(versions, range)`: Return the highest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `minSatisfying(versions, range)`: Return the lowest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `minVersion(range)`: Return the lowest version that can possibly match
+ the given range.
+* `gtr(version, range)`: Return `true` if version is greater than all the
+ versions possible in the range.
+* `ltr(version, range)`: Return `true` if version is less than all the
+ versions possible in the range.
+* `outside(version, range, hilo)`: Return true if the version is outside
+ the bounds of the range in either the high or low direction. The
+ `hilo` argument must be either the string `'>'` or `'<'`. (This is
+ the function called by `gtr` and `ltr`.)
+* `intersects(range)`: Return true if any of the ranges comparators intersect
+* `simplifyRange(versions, range)`: Return a "simplified" range that
+ matches the same items in `versions` list as the range specified. Note
+ that it does *not* guarantee that it would match the same versions in all
+ cases, only for the set of versions provided. This is useful when
+ generating ranges by joining together multiple versions with `||`
+ programmatically, to provide the user with something a bit more
+ ergonomic. If the provided range is shorter in string-length than the
+ generated range, then that is returned.
+* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
+ entirely contained by the `superRange` range.
+
+Note that, since ranges may be non-contiguous, a version might not be
+greater than a range, less than a range, *or* satisfy a range! For
+example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
+until `2.0.0`, so the version `1.2.10` would not be greater than the
+range (because `2.0.1` satisfies, which is higher), nor less than the
+range (since `1.2.8` satisfies, which is lower), and it also does not
+satisfy the range.
+
+If you want to know if a version satisfies or does not satisfy a
+range, use the `satisfies(version, range)` function.
+
+### Coercion
+
+* `coerce(version, options)`: Coerces a string to semver if possible
+
+This aims to provide a very forgiving translation of a non-semver string to
+semver. It looks for the first digit in a string, and consumes all
+remaining characters which satisfy at least a partial semver (e.g., `1`,
+`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
+versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
+surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
+`3.4.0`). Only text which lacks digits will fail coercion (`version one`
+is not valid). The maximum length for any semver component considered for
+coercion is 16 characters; longer components will be ignored
+(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
+semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
+components are invalid (`9999999999999999.4.7.4` is likely invalid).
+
+If the `options.rtl` flag is set, then `coerce` will return the right-most
+coercible tuple that does not share an ending index with a longer coercible
+tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
+`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
+any other overlapping SemVer tuple.
+
+### Clean
+
+* `clean(version)`: Clean a string to be a valid semver if possible
+
+This will return a cleaned and trimmed semver version. If the provided
+version is not valid a null will be returned. This does not work for
+ranges.
+
+ex.
+* `s.clean(' = v 2.1.5foo')`: `null`
+* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
+* `s.clean(' = v 2.1.5-foo')`: `null`
+* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
+* `s.clean('=v2.1.5')`: `'2.1.5'`
+* `s.clean(' =v2.1.5')`: `2.1.5`
+* `s.clean(' 2.1.5 ')`: `'2.1.5'`
+* `s.clean('~1.0.0')`: `null`
+
+## Constants
+
+As a convenience, helper constants are exported to provide information about what `node-semver` supports:
+
+### `RELEASE_TYPES`
+
+- major
+- premajor
+- minor
+- preminor
+- patch
+- prepatch
+- prerelease
+
+```
+const semver = require('semver');
+
+if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
+ console.log('This is a valid release type!');
+} else {
+ console.warn('This is NOT a valid release type!');
+}
+```
+
+### `SEMVER_SPEC_VERSION`
+
+2.0.0
+
+```
+const semver = require('semver');
+
+console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION);
+```
+
+## Exported Modules
+
+
+
+You may pull in just the part of this semver utility that you need, if you
+are sensitive to packing and tree-shaking concerns. The main
+`require('semver')` export uses getter functions to lazily load the parts
+of the API that are used.
+
+The following modules are available:
+
+* `require('semver')`
+* `require('semver/classes')`
+* `require('semver/classes/comparator')`
+* `require('semver/classes/range')`
+* `require('semver/classes/semver')`
+* `require('semver/functions/clean')`
+* `require('semver/functions/cmp')`
+* `require('semver/functions/coerce')`
+* `require('semver/functions/compare')`
+* `require('semver/functions/compare-build')`
+* `require('semver/functions/compare-loose')`
+* `require('semver/functions/diff')`
+* `require('semver/functions/eq')`
+* `require('semver/functions/gt')`
+* `require('semver/functions/gte')`
+* `require('semver/functions/inc')`
+* `require('semver/functions/lt')`
+* `require('semver/functions/lte')`
+* `require('semver/functions/major')`
+* `require('semver/functions/minor')`
+* `require('semver/functions/neq')`
+* `require('semver/functions/parse')`
+* `require('semver/functions/patch')`
+* `require('semver/functions/prerelease')`
+* `require('semver/functions/rcompare')`
+* `require('semver/functions/rsort')`
+* `require('semver/functions/satisfies')`
+* `require('semver/functions/sort')`
+* `require('semver/functions/valid')`
+* `require('semver/ranges/gtr')`
+* `require('semver/ranges/intersects')`
+* `require('semver/ranges/ltr')`
+* `require('semver/ranges/max-satisfying')`
+* `require('semver/ranges/min-satisfying')`
+* `require('semver/ranges/min-version')`
+* `require('semver/ranges/outside')`
+* `require('semver/ranges/to-comparators')`
+* `require('semver/ranges/valid')`
+
diff --git a/node_modules/@pm2/io/node_modules/semver/bin/semver.js b/node_modules/@pm2/io/node_modules/semver/bin/semver.js
new file mode 100755
index 0000000..242b7ad
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/bin/semver.js
@@ -0,0 +1,197 @@
+#!/usr/bin/env node
+// Standalone semver comparison program.
+// Exits successfully and prints matching version(s) if
+// any supplied version is valid and passes all tests.
+
+const argv = process.argv.slice(2)
+
+let versions = []
+
+const range = []
+
+let inc = null
+
+const version = require('../package.json').version
+
+let loose = false
+
+let includePrerelease = false
+
+let coerce = false
+
+let rtl = false
+
+let identifier
+
+let identifierBase
+
+const semver = require('../')
+const parseOptions = require('../internal/parse-options')
+
+let reverse = false
+
+let options = {}
+
+const main = () => {
+ if (!argv.length) {
+ return help()
+ }
+ while (argv.length) {
+ let a = argv.shift()
+ const indexOfEqualSign = a.indexOf('=')
+ if (indexOfEqualSign !== -1) {
+ const value = a.slice(indexOfEqualSign + 1)
+ a = a.slice(0, indexOfEqualSign)
+ argv.unshift(value)
+ }
+ switch (a) {
+ case '-rv': case '-rev': case '--rev': case '--reverse':
+ reverse = true
+ break
+ case '-l': case '--loose':
+ loose = true
+ break
+ case '-p': case '--include-prerelease':
+ includePrerelease = true
+ break
+ case '-v': case '--version':
+ versions.push(argv.shift())
+ break
+ case '-i': case '--inc': case '--increment':
+ switch (argv[0]) {
+ case 'major': case 'minor': case 'patch': case 'prerelease':
+ case 'premajor': case 'preminor': case 'prepatch':
+ inc = argv.shift()
+ break
+ default:
+ inc = 'patch'
+ break
+ }
+ break
+ case '--preid':
+ identifier = argv.shift()
+ break
+ case '-r': case '--range':
+ range.push(argv.shift())
+ break
+ case '-n':
+ identifierBase = argv.shift()
+ if (identifierBase === 'false') {
+ identifierBase = false
+ }
+ break
+ case '-c': case '--coerce':
+ coerce = true
+ break
+ case '--rtl':
+ rtl = true
+ break
+ case '--ltr':
+ rtl = false
+ break
+ case '-h': case '--help': case '-?':
+ return help()
+ default:
+ versions.push(a)
+ break
+ }
+ }
+
+ options = parseOptions({ loose, includePrerelease, rtl })
+
+ versions = versions.map((v) => {
+ return coerce ? (semver.coerce(v, options) || { version: v }).version : v
+ }).filter((v) => {
+ return semver.valid(v)
+ })
+ if (!versions.length) {
+ return fail()
+ }
+ if (inc && (versions.length !== 1 || range.length)) {
+ return failInc()
+ }
+
+ for (let i = 0, l = range.length; i < l; i++) {
+ versions = versions.filter((v) => {
+ return semver.satisfies(v, range[i], options)
+ })
+ if (!versions.length) {
+ return fail()
+ }
+ }
+ return success(versions)
+}
+
+const failInc = () => {
+ console.error('--inc can only be used on a single version with no range')
+ fail()
+}
+
+const fail = () => process.exit(1)
+
+const success = () => {
+ const compare = reverse ? 'rcompare' : 'compare'
+ versions.sort((a, b) => {
+ return semver[compare](a, b, options)
+ }).map((v) => {
+ return semver.clean(v, options)
+ }).map((v) => {
+ return inc ? semver.inc(v, inc, options, identifier, identifierBase) : v
+ }).forEach((v, i, _) => {
+ console.log(v)
+ })
+}
+
+const help = () => console.log(
+`SemVer ${version}
+
+A JavaScript implementation of the https://semver.org/ specification
+Copyright Isaac Z. Schlueter
+
+Usage: semver [options] [ [...]]
+Prints valid versions sorted by SemVer precedence
+
+Options:
+-r --range
+ Print versions that match the specified range.
+
+-i --increment []
+ Increment a version by the specified level. Level can
+ be one of: major, minor, patch, premajor, preminor,
+ prepatch, or prerelease. Default level is 'patch'.
+ Only one version may be specified.
+
+--preid
+ Identifier to be used to prefix premajor, preminor,
+ prepatch or prerelease version increments.
+
+-l --loose
+ Interpret versions and ranges loosely
+
+-p --include-prerelease
+ Always include prerelease versions in range matching
+
+-c --coerce
+ Coerce a string into SemVer if possible
+ (does not imply --loose)
+
+--rtl
+ Coerce version strings right to left
+
+--ltr
+ Coerce version strings left to right (default)
+
+-n
+ Base number to be used for the prerelease identifier.
+ Can be either 0 or 1, or false to omit the number altogether.
+ Defaults to 0.
+
+Program exits successfully if any valid version satisfies
+all supplied ranges, and prints all satisfying versions.
+
+If no satisfying versions are found, then exits failure.
+
+Versions are printed in ascending order, so supplying
+multiple versions to the utility will just sort them.`)
+
+main()
diff --git a/node_modules/@pm2/io/node_modules/semver/classes/comparator.js b/node_modules/@pm2/io/node_modules/semver/classes/comparator.js
new file mode 100644
index 0000000..3d39c0e
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/classes/comparator.js
@@ -0,0 +1,141 @@
+const ANY = Symbol('SemVer ANY')
+// hoisted class for cyclic dependency
+class Comparator {
+ static get ANY () {
+ return ANY
+ }
+
+ constructor (comp, options) {
+ options = parseOptions(options)
+
+ if (comp instanceof Comparator) {
+ if (comp.loose === !!options.loose) {
+ return comp
+ } else {
+ comp = comp.value
+ }
+ }
+
+ comp = comp.trim().split(/\s+/).join(' ')
+ debug('comparator', comp, options)
+ this.options = options
+ this.loose = !!options.loose
+ this.parse(comp)
+
+ if (this.semver === ANY) {
+ this.value = ''
+ } else {
+ this.value = this.operator + this.semver.version
+ }
+
+ debug('comp', this)
+ }
+
+ parse (comp) {
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
+ const m = comp.match(r)
+
+ if (!m) {
+ throw new TypeError(`Invalid comparator: ${comp}`)
+ }
+
+ this.operator = m[1] !== undefined ? m[1] : ''
+ if (this.operator === '=') {
+ this.operator = ''
+ }
+
+ // if it literally is just '>' or '' then allow anything.
+ if (!m[2]) {
+ this.semver = ANY
+ } else {
+ this.semver = new SemVer(m[2], this.options.loose)
+ }
+ }
+
+ toString () {
+ return this.value
+ }
+
+ test (version) {
+ debug('Comparator.test', version, this.options.loose)
+
+ if (this.semver === ANY || version === ANY) {
+ return true
+ }
+
+ if (typeof version === 'string') {
+ try {
+ version = new SemVer(version, this.options)
+ } catch (er) {
+ return false
+ }
+ }
+
+ return cmp(version, this.operator, this.semver, this.options)
+ }
+
+ intersects (comp, options) {
+ if (!(comp instanceof Comparator)) {
+ throw new TypeError('a Comparator is required')
+ }
+
+ if (this.operator === '') {
+ if (this.value === '') {
+ return true
+ }
+ return new Range(comp.value, options).test(this.value)
+ } else if (comp.operator === '') {
+ if (comp.value === '') {
+ return true
+ }
+ return new Range(this.value, options).test(comp.semver)
+ }
+
+ options = parseOptions(options)
+
+ // Special cases where nothing can possibly be lower
+ if (options.includePrerelease &&
+ (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
+ return false
+ }
+ if (!options.includePrerelease &&
+ (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
+ return false
+ }
+
+ // Same direction increasing (> or >=)
+ if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
+ return true
+ }
+ // Same direction decreasing (< or <=)
+ if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
+ return true
+ }
+ // same SemVer and both sides are inclusive (<= or >=)
+ if (
+ (this.semver.version === comp.semver.version) &&
+ this.operator.includes('=') && comp.operator.includes('=')) {
+ return true
+ }
+ // opposite directions less than
+ if (cmp(this.semver, '<', comp.semver, options) &&
+ this.operator.startsWith('>') && comp.operator.startsWith('<')) {
+ return true
+ }
+ // opposite directions greater than
+ if (cmp(this.semver, '>', comp.semver, options) &&
+ this.operator.startsWith('<') && comp.operator.startsWith('>')) {
+ return true
+ }
+ return false
+ }
+}
+
+module.exports = Comparator
+
+const parseOptions = require('../internal/parse-options')
+const { safeRe: re, t } = require('../internal/re')
+const cmp = require('../functions/cmp')
+const debug = require('../internal/debug')
+const SemVer = require('./semver')
+const Range = require('./range')
diff --git a/node_modules/@pm2/io/node_modules/semver/classes/index.js b/node_modules/@pm2/io/node_modules/semver/classes/index.js
new file mode 100644
index 0000000..5e3f5c9
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/classes/index.js
@@ -0,0 +1,5 @@
+module.exports = {
+ SemVer: require('./semver.js'),
+ Range: require('./range.js'),
+ Comparator: require('./comparator.js'),
+}
diff --git a/node_modules/@pm2/io/node_modules/semver/classes/range.js b/node_modules/@pm2/io/node_modules/semver/classes/range.js
new file mode 100644
index 0000000..7e7c414
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/classes/range.js
@@ -0,0 +1,539 @@
+// hoisted class for cyclic dependency
+class Range {
+ constructor (range, options) {
+ options = parseOptions(options)
+
+ if (range instanceof Range) {
+ if (
+ range.loose === !!options.loose &&
+ range.includePrerelease === !!options.includePrerelease
+ ) {
+ return range
+ } else {
+ return new Range(range.raw, options)
+ }
+ }
+
+ if (range instanceof Comparator) {
+ // just put it in the set and return
+ this.raw = range.value
+ this.set = [[range]]
+ this.format()
+ return this
+ }
+
+ this.options = options
+ this.loose = !!options.loose
+ this.includePrerelease = !!options.includePrerelease
+
+ // First reduce all whitespace as much as possible so we do not have to rely
+ // on potentially slow regexes like \s*. This is then stored and used for
+ // future error messages as well.
+ this.raw = range
+ .trim()
+ .split(/\s+/)
+ .join(' ')
+
+ // First, split on ||
+ this.set = this.raw
+ .split('||')
+ // map the range to a 2d array of comparators
+ .map(r => this.parseRange(r.trim()))
+ // throw out any comparator lists that are empty
+ // this generally means that it was not a valid range, which is allowed
+ // in loose mode, but will still throw if the WHOLE range is invalid.
+ .filter(c => c.length)
+
+ if (!this.set.length) {
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
+ }
+
+ // if we have any that are not the null set, throw out null sets.
+ if (this.set.length > 1) {
+ // keep the first one, in case they're all null sets
+ const first = this.set[0]
+ this.set = this.set.filter(c => !isNullSet(c[0]))
+ if (this.set.length === 0) {
+ this.set = [first]
+ } else if (this.set.length > 1) {
+ // if we have any that are *, then the range is just *
+ for (const c of this.set) {
+ if (c.length === 1 && isAny(c[0])) {
+ this.set = [c]
+ break
+ }
+ }
+ }
+ }
+
+ this.format()
+ }
+
+ format () {
+ this.range = this.set
+ .map((comps) => comps.join(' ').trim())
+ .join('||')
+ .trim()
+ return this.range
+ }
+
+ toString () {
+ return this.range
+ }
+
+ parseRange (range) {
+ // memoize range parsing for performance.
+ // this is a very hot path, and fully deterministic.
+ const memoOpts =
+ (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
+ (this.options.loose && FLAG_LOOSE)
+ const memoKey = memoOpts + ':' + range
+ const cached = cache.get(memoKey)
+ if (cached) {
+ return cached
+ }
+
+ const loose = this.options.loose
+ // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
+ debug('hyphen replace', range)
+
+ // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
+ debug('comparator trim', range)
+
+ // `~ 1.2.3` => `~1.2.3`
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
+ debug('tilde trim', range)
+
+ // `^ 1.2.3` => `^1.2.3`
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace)
+ debug('caret trim', range)
+
+ // At this point, the range is completely trimmed and
+ // ready to be split into comparators.
+
+ let rangeList = range
+ .split(' ')
+ .map(comp => parseComparator(comp, this.options))
+ .join(' ')
+ .split(/\s+/)
+ // >=0.0.0 is equivalent to *
+ .map(comp => replaceGTE0(comp, this.options))
+
+ if (loose) {
+ // in loose mode, throw out any that are not valid comparators
+ rangeList = rangeList.filter(comp => {
+ debug('loose invalid filter', comp, this.options)
+ return !!comp.match(re[t.COMPARATORLOOSE])
+ })
+ }
+ debug('range list', rangeList)
+
+ // if any comparators are the null set, then replace with JUST null set
+ // if more than one comparator, remove any * comparators
+ // also, don't include the same comparator more than once
+ const rangeMap = new Map()
+ const comparators = rangeList.map(comp => new Comparator(comp, this.options))
+ for (const comp of comparators) {
+ if (isNullSet(comp)) {
+ return [comp]
+ }
+ rangeMap.set(comp.value, comp)
+ }
+ if (rangeMap.size > 1 && rangeMap.has('')) {
+ rangeMap.delete('')
+ }
+
+ const result = [...rangeMap.values()]
+ cache.set(memoKey, result)
+ return result
+ }
+
+ intersects (range, options) {
+ if (!(range instanceof Range)) {
+ throw new TypeError('a Range is required')
+ }
+
+ return this.set.some((thisComparators) => {
+ return (
+ isSatisfiable(thisComparators, options) &&
+ range.set.some((rangeComparators) => {
+ return (
+ isSatisfiable(rangeComparators, options) &&
+ thisComparators.every((thisComparator) => {
+ return rangeComparators.every((rangeComparator) => {
+ return thisComparator.intersects(rangeComparator, options)
+ })
+ })
+ )
+ })
+ )
+ })
+ }
+
+ // if ANY of the sets match ALL of its comparators, then pass
+ test (version) {
+ if (!version) {
+ return false
+ }
+
+ if (typeof version === 'string') {
+ try {
+ version = new SemVer(version, this.options)
+ } catch (er) {
+ return false
+ }
+ }
+
+ for (let i = 0; i < this.set.length; i++) {
+ if (testSet(this.set[i], version, this.options)) {
+ return true
+ }
+ }
+ return false
+ }
+}
+
+module.exports = Range
+
+const LRU = require('lru-cache')
+const cache = new LRU({ max: 1000 })
+
+const parseOptions = require('../internal/parse-options')
+const Comparator = require('./comparator')
+const debug = require('../internal/debug')
+const SemVer = require('./semver')
+const {
+ safeRe: re,
+ t,
+ comparatorTrimReplace,
+ tildeTrimReplace,
+ caretTrimReplace,
+} = require('../internal/re')
+const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')
+
+const isNullSet = c => c.value === '<0.0.0-0'
+const isAny = c => c.value === ''
+
+// take a set of comparators and determine whether there
+// exists a version which can satisfy it
+const isSatisfiable = (comparators, options) => {
+ let result = true
+ const remainingComparators = comparators.slice()
+ let testComparator = remainingComparators.pop()
+
+ while (result && remainingComparators.length) {
+ result = remainingComparators.every((otherComparator) => {
+ return testComparator.intersects(otherComparator, options)
+ })
+
+ testComparator = remainingComparators.pop()
+ }
+
+ return result
+}
+
+// comprised of xranges, tildes, stars, and gtlt's at this point.
+// already replaced the hyphen ranges
+// turn into a set of JUST comparators.
+const parseComparator = (comp, options) => {
+ debug('comp', comp, options)
+ comp = replaceCarets(comp, options)
+ debug('caret', comp)
+ comp = replaceTildes(comp, options)
+ debug('tildes', comp)
+ comp = replaceXRanges(comp, options)
+ debug('xrange', comp)
+ comp = replaceStars(comp, options)
+ debug('stars', comp)
+ return comp
+}
+
+const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
+
+// ~, ~> --> * (any, kinda silly)
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
+// ~0.0.1 --> >=0.0.1 <0.1.0-0
+const replaceTildes = (comp, options) => {
+ return comp
+ .trim()
+ .split(/\s+/)
+ .map((c) => replaceTilde(c, options))
+ .join(' ')
+}
+
+const replaceTilde = (comp, options) => {
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
+ return comp.replace(r, (_, M, m, p, pr) => {
+ debug('tilde', comp, _, M, m, p, pr)
+ let ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = `>=${M}.0.0 <${+M + 1}.0.0-0`
+ } else if (isX(p)) {
+ // ~1.2 == >=1.2.0 <1.3.0-0
+ ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`
+ } else if (pr) {
+ debug('replaceTilde pr', pr)
+ ret = `>=${M}.${m}.${p}-${pr
+ } <${M}.${+m + 1}.0-0`
+ } else {
+ // ~1.2.3 == >=1.2.3 <1.3.0-0
+ ret = `>=${M}.${m}.${p
+ } <${M}.${+m + 1}.0-0`
+ }
+
+ debug('tilde return', ret)
+ return ret
+ })
+}
+
+// ^ --> * (any, kinda silly)
+// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
+// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
+// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
+// ^1.2.3 --> >=1.2.3 <2.0.0-0
+// ^1.2.0 --> >=1.2.0 <2.0.0-0
+// ^0.0.1 --> >=0.0.1 <0.0.2-0
+// ^0.1.0 --> >=0.1.0 <0.2.0-0
+const replaceCarets = (comp, options) => {
+ return comp
+ .trim()
+ .split(/\s+/)
+ .map((c) => replaceCaret(c, options))
+ .join(' ')
+}
+
+const replaceCaret = (comp, options) => {
+ debug('caret', comp, options)
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
+ const z = options.includePrerelease ? '-0' : ''
+ return comp.replace(r, (_, M, m, p, pr) => {
+ debug('caret', comp, _, M, m, p, pr)
+ let ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
+ } else if (isX(p)) {
+ if (M === '0') {
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
+ } else {
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
+ }
+ } else if (pr) {
+ debug('replaceCaret pr', pr)
+ if (M === '0') {
+ if (m === '0') {
+ ret = `>=${M}.${m}.${p}-${pr
+ } <${M}.${m}.${+p + 1}-0`
+ } else {
+ ret = `>=${M}.${m}.${p}-${pr
+ } <${M}.${+m + 1}.0-0`
+ }
+ } else {
+ ret = `>=${M}.${m}.${p}-${pr
+ } <${+M + 1}.0.0-0`
+ }
+ } else {
+ debug('no pr')
+ if (M === '0') {
+ if (m === '0') {
+ ret = `>=${M}.${m}.${p
+ }${z} <${M}.${m}.${+p + 1}-0`
+ } else {
+ ret = `>=${M}.${m}.${p
+ }${z} <${M}.${+m + 1}.0-0`
+ }
+ } else {
+ ret = `>=${M}.${m}.${p
+ } <${+M + 1}.0.0-0`
+ }
+ }
+
+ debug('caret return', ret)
+ return ret
+ })
+}
+
+const replaceXRanges = (comp, options) => {
+ debug('replaceXRanges', comp, options)
+ return comp
+ .split(/\s+/)
+ .map((c) => replaceXRange(c, options))
+ .join(' ')
+}
+
+const replaceXRange = (comp, options) => {
+ comp = comp.trim()
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
+ debug('xRange', comp, ret, gtlt, M, m, p, pr)
+ const xM = isX(M)
+ const xm = xM || isX(m)
+ const xp = xm || isX(p)
+ const anyX = xp
+
+ if (gtlt === '=' && anyX) {
+ gtlt = ''
+ }
+
+ // if we're including prereleases in the match, then we need
+ // to fix this to -0, the lowest possible prerelease value
+ pr = options.includePrerelease ? '-0' : ''
+
+ if (xM) {
+ if (gtlt === '>' || gtlt === '<') {
+ // nothing is allowed
+ ret = '<0.0.0-0'
+ } else {
+ // nothing is forbidden
+ ret = '*'
+ }
+ } else if (gtlt && anyX) {
+ // we know patch is an x, because we have any x at all.
+ // replace X with 0
+ if (xm) {
+ m = 0
+ }
+ p = 0
+
+ if (gtlt === '>') {
+ // >1 => >=2.0.0
+ // >1.2 => >=1.3.0
+ gtlt = '>='
+ if (xm) {
+ M = +M + 1
+ m = 0
+ p = 0
+ } else {
+ m = +m + 1
+ p = 0
+ }
+ } else if (gtlt === '<=') {
+ // <=0.7.x is actually <0.8.0, since any 0.7.x should
+ // pass. Similarly, <=7.x is actually <8.0.0, etc.
+ gtlt = '<'
+ if (xm) {
+ M = +M + 1
+ } else {
+ m = +m + 1
+ }
+ }
+
+ if (gtlt === '<') {
+ pr = '-0'
+ }
+
+ ret = `${gtlt + M}.${m}.${p}${pr}`
+ } else if (xm) {
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
+ } else if (xp) {
+ ret = `>=${M}.${m}.0${pr
+ } <${M}.${+m + 1}.0-0`
+ }
+
+ debug('xRange return', ret)
+
+ return ret
+ })
+}
+
+// Because * is AND-ed with everything else in the comparator,
+// and '' means "any version", just remove the *s entirely.
+const replaceStars = (comp, options) => {
+ debug('replaceStars', comp, options)
+ // Looseness is ignored here. star is always as loose as it gets!
+ return comp
+ .trim()
+ .replace(re[t.STAR], '')
+}
+
+const replaceGTE0 = (comp, options) => {
+ debug('replaceGTE0', comp, options)
+ return comp
+ .trim()
+ .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
+}
+
+// This function is passed to string.replace(re[t.HYPHENRANGE])
+// M, m, patch, prerelease, build
+// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
+// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
+// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
+const hyphenReplace = incPr => ($0,
+ from, fM, fm, fp, fpr, fb,
+ to, tM, tm, tp, tpr, tb) => {
+ if (isX(fM)) {
+ from = ''
+ } else if (isX(fm)) {
+ from = `>=${fM}.0.0${incPr ? '-0' : ''}`
+ } else if (isX(fp)) {
+ from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
+ } else if (fpr) {
+ from = `>=${from}`
+ } else {
+ from = `>=${from}${incPr ? '-0' : ''}`
+ }
+
+ if (isX(tM)) {
+ to = ''
+ } else if (isX(tm)) {
+ to = `<${+tM + 1}.0.0-0`
+ } else if (isX(tp)) {
+ to = `<${tM}.${+tm + 1}.0-0`
+ } else if (tpr) {
+ to = `<=${tM}.${tm}.${tp}-${tpr}`
+ } else if (incPr) {
+ to = `<${tM}.${tm}.${+tp + 1}-0`
+ } else {
+ to = `<=${to}`
+ }
+
+ return `${from} ${to}`.trim()
+}
+
+const testSet = (set, version, options) => {
+ for (let i = 0; i < set.length; i++) {
+ if (!set[i].test(version)) {
+ return false
+ }
+ }
+
+ if (version.prerelease.length && !options.includePrerelease) {
+ // Find the set of versions that are allowed to have prereleases
+ // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
+ // That should allow `1.2.3-pr.2` to pass.
+ // However, `1.2.4-alpha.notready` should NOT be allowed,
+ // even though it's within the range set by the comparators.
+ for (let i = 0; i < set.length; i++) {
+ debug(set[i].semver)
+ if (set[i].semver === Comparator.ANY) {
+ continue
+ }
+
+ if (set[i].semver.prerelease.length > 0) {
+ const allowed = set[i].semver
+ if (allowed.major === version.major &&
+ allowed.minor === version.minor &&
+ allowed.patch === version.patch) {
+ return true
+ }
+ }
+ }
+
+ // Version has a -pre, but it's not one of the ones we like.
+ return false
+ }
+
+ return true
+}
diff --git a/node_modules/@pm2/io/node_modules/semver/classes/semver.js b/node_modules/@pm2/io/node_modules/semver/classes/semver.js
new file mode 100644
index 0000000..84e8459
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/classes/semver.js
@@ -0,0 +1,302 @@
+const debug = require('../internal/debug')
+const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
+const { safeRe: re, t } = require('../internal/re')
+
+const parseOptions = require('../internal/parse-options')
+const { compareIdentifiers } = require('../internal/identifiers')
+class SemVer {
+ constructor (version, options) {
+ options = parseOptions(options)
+
+ if (version instanceof SemVer) {
+ if (version.loose === !!options.loose &&
+ version.includePrerelease === !!options.includePrerelease) {
+ return version
+ } else {
+ version = version.version
+ }
+ } else if (typeof version !== 'string') {
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
+ }
+
+ if (version.length > MAX_LENGTH) {
+ throw new TypeError(
+ `version is longer than ${MAX_LENGTH} characters`
+ )
+ }
+
+ debug('SemVer', version, options)
+ this.options = options
+ this.loose = !!options.loose
+ // this isn't actually relevant for versions, but keep it so that we
+ // don't run into trouble passing this.options around.
+ this.includePrerelease = !!options.includePrerelease
+
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
+
+ if (!m) {
+ throw new TypeError(`Invalid Version: ${version}`)
+ }
+
+ this.raw = version
+
+ // these are actually numbers
+ this.major = +m[1]
+ this.minor = +m[2]
+ this.patch = +m[3]
+
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
+ throw new TypeError('Invalid major version')
+ }
+
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
+ throw new TypeError('Invalid minor version')
+ }
+
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
+ throw new TypeError('Invalid patch version')
+ }
+
+ // numberify any prerelease numeric ids
+ if (!m[4]) {
+ this.prerelease = []
+ } else {
+ this.prerelease = m[4].split('.').map((id) => {
+ if (/^[0-9]+$/.test(id)) {
+ const num = +id
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
+ return num
+ }
+ }
+ return id
+ })
+ }
+
+ this.build = m[5] ? m[5].split('.') : []
+ this.format()
+ }
+
+ format () {
+ this.version = `${this.major}.${this.minor}.${this.patch}`
+ if (this.prerelease.length) {
+ this.version += `-${this.prerelease.join('.')}`
+ }
+ return this.version
+ }
+
+ toString () {
+ return this.version
+ }
+
+ compare (other) {
+ debug('SemVer.compare', this.version, this.options, other)
+ if (!(other instanceof SemVer)) {
+ if (typeof other === 'string' && other === this.version) {
+ return 0
+ }
+ other = new SemVer(other, this.options)
+ }
+
+ if (other.version === this.version) {
+ return 0
+ }
+
+ return this.compareMain(other) || this.comparePre(other)
+ }
+
+ compareMain (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ return (
+ compareIdentifiers(this.major, other.major) ||
+ compareIdentifiers(this.minor, other.minor) ||
+ compareIdentifiers(this.patch, other.patch)
+ )
+ }
+
+ comparePre (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ // NOT having a prerelease is > having one
+ if (this.prerelease.length && !other.prerelease.length) {
+ return -1
+ } else if (!this.prerelease.length && other.prerelease.length) {
+ return 1
+ } else if (!this.prerelease.length && !other.prerelease.length) {
+ return 0
+ }
+
+ let i = 0
+ do {
+ const a = this.prerelease[i]
+ const b = other.prerelease[i]
+ debug('prerelease compare', i, a, b)
+ if (a === undefined && b === undefined) {
+ return 0
+ } else if (b === undefined) {
+ return 1
+ } else if (a === undefined) {
+ return -1
+ } else if (a === b) {
+ continue
+ } else {
+ return compareIdentifiers(a, b)
+ }
+ } while (++i)
+ }
+
+ compareBuild (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ let i = 0
+ do {
+ const a = this.build[i]
+ const b = other.build[i]
+ debug('prerelease compare', i, a, b)
+ if (a === undefined && b === undefined) {
+ return 0
+ } else if (b === undefined) {
+ return 1
+ } else if (a === undefined) {
+ return -1
+ } else if (a === b) {
+ continue
+ } else {
+ return compareIdentifiers(a, b)
+ }
+ } while (++i)
+ }
+
+ // preminor will bump the version up to the next minor release, and immediately
+ // down to pre-release. premajor and prepatch work the same way.
+ inc (release, identifier, identifierBase) {
+ switch (release) {
+ case 'premajor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor = 0
+ this.major++
+ this.inc('pre', identifier, identifierBase)
+ break
+ case 'preminor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor++
+ this.inc('pre', identifier, identifierBase)
+ break
+ case 'prepatch':
+ // If this is already a prerelease, it will bump to the next version
+ // drop any prereleases that might already exist, since they are not
+ // relevant at this point.
+ this.prerelease.length = 0
+ this.inc('patch', identifier, identifierBase)
+ this.inc('pre', identifier, identifierBase)
+ break
+ // If the input is a non-prerelease version, this acts the same as
+ // prepatch.
+ case 'prerelease':
+ if (this.prerelease.length === 0) {
+ this.inc('patch', identifier, identifierBase)
+ }
+ this.inc('pre', identifier, identifierBase)
+ break
+
+ case 'major':
+ // If this is a pre-major version, bump up to the same major version.
+ // Otherwise increment major.
+ // 1.0.0-5 bumps to 1.0.0
+ // 1.1.0 bumps to 2.0.0
+ if (
+ this.minor !== 0 ||
+ this.patch !== 0 ||
+ this.prerelease.length === 0
+ ) {
+ this.major++
+ }
+ this.minor = 0
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'minor':
+ // If this is a pre-minor version, bump up to the same minor version.
+ // Otherwise increment minor.
+ // 1.2.0-5 bumps to 1.2.0
+ // 1.2.1 bumps to 1.3.0
+ if (this.patch !== 0 || this.prerelease.length === 0) {
+ this.minor++
+ }
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'patch':
+ // If this is not a pre-release version, it will increment the patch.
+ // If it is a pre-release it will bump up to the same patch version.
+ // 1.2.0-5 patches to 1.2.0
+ // 1.2.0 patches to 1.2.1
+ if (this.prerelease.length === 0) {
+ this.patch++
+ }
+ this.prerelease = []
+ break
+ // This probably shouldn't be used publicly.
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
+ case 'pre': {
+ const base = Number(identifierBase) ? 1 : 0
+
+ if (!identifier && identifierBase === false) {
+ throw new Error('invalid increment argument: identifier is empty')
+ }
+
+ if (this.prerelease.length === 0) {
+ this.prerelease = [base]
+ } else {
+ let i = this.prerelease.length
+ while (--i >= 0) {
+ if (typeof this.prerelease[i] === 'number') {
+ this.prerelease[i]++
+ i = -2
+ }
+ }
+ if (i === -1) {
+ // didn't increment anything
+ if (identifier === this.prerelease.join('.') && identifierBase === false) {
+ throw new Error('invalid increment argument: identifier already exists')
+ }
+ this.prerelease.push(base)
+ }
+ }
+ if (identifier) {
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
+ let prerelease = [identifier, base]
+ if (identifierBase === false) {
+ prerelease = [identifier]
+ }
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
+ if (isNaN(this.prerelease[1])) {
+ this.prerelease = prerelease
+ }
+ } else {
+ this.prerelease = prerelease
+ }
+ }
+ break
+ }
+ default:
+ throw new Error(`invalid increment argument: ${release}`)
+ }
+ this.raw = this.format()
+ if (this.build.length) {
+ this.raw += `+${this.build.join('.')}`
+ }
+ return this
+ }
+}
+
+module.exports = SemVer
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/clean.js b/node_modules/@pm2/io/node_modules/semver/functions/clean.js
new file mode 100644
index 0000000..811fe6b
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/clean.js
@@ -0,0 +1,6 @@
+const parse = require('./parse')
+const clean = (version, options) => {
+ const s = parse(version.trim().replace(/^[=v]+/, ''), options)
+ return s ? s.version : null
+}
+module.exports = clean
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/cmp.js b/node_modules/@pm2/io/node_modules/semver/functions/cmp.js
new file mode 100644
index 0000000..4011909
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/cmp.js
@@ -0,0 +1,52 @@
+const eq = require('./eq')
+const neq = require('./neq')
+const gt = require('./gt')
+const gte = require('./gte')
+const lt = require('./lt')
+const lte = require('./lte')
+
+const cmp = (a, op, b, loose) => {
+ switch (op) {
+ case '===':
+ if (typeof a === 'object') {
+ a = a.version
+ }
+ if (typeof b === 'object') {
+ b = b.version
+ }
+ return a === b
+
+ case '!==':
+ if (typeof a === 'object') {
+ a = a.version
+ }
+ if (typeof b === 'object') {
+ b = b.version
+ }
+ return a !== b
+
+ case '':
+ case '=':
+ case '==':
+ return eq(a, b, loose)
+
+ case '!=':
+ return neq(a, b, loose)
+
+ case '>':
+ return gt(a, b, loose)
+
+ case '>=':
+ return gte(a, b, loose)
+
+ case '<':
+ return lt(a, b, loose)
+
+ case '<=':
+ return lte(a, b, loose)
+
+ default:
+ throw new TypeError(`Invalid operator: ${op}`)
+ }
+}
+module.exports = cmp
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/coerce.js b/node_modules/@pm2/io/node_modules/semver/functions/coerce.js
new file mode 100644
index 0000000..febbff9
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/coerce.js
@@ -0,0 +1,52 @@
+const SemVer = require('../classes/semver')
+const parse = require('./parse')
+const { safeRe: re, t } = require('../internal/re')
+
+const coerce = (version, options) => {
+ if (version instanceof SemVer) {
+ return version
+ }
+
+ if (typeof version === 'number') {
+ version = String(version)
+ }
+
+ if (typeof version !== 'string') {
+ return null
+ }
+
+ options = options || {}
+
+ let match = null
+ if (!options.rtl) {
+ match = version.match(re[t.COERCE])
+ } else {
+ // Find the right-most coercible string that does not share
+ // a terminus with a more left-ward coercible string.
+ // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
+ //
+ // Walk through the string checking with a /g regexp
+ // Manually set the index so as to pick up overlapping matches.
+ // Stop when we get a match that ends at the string end, since no
+ // coercible string can be more right-ward without the same terminus.
+ let next
+ while ((next = re[t.COERCERTL].exec(version)) &&
+ (!match || match.index + match[0].length !== version.length)
+ ) {
+ if (!match ||
+ next.index + next[0].length !== match.index + match[0].length) {
+ match = next
+ }
+ re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
+ }
+ // leave it in a clean state
+ re[t.COERCERTL].lastIndex = -1
+ }
+
+ if (match === null) {
+ return null
+ }
+
+ return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
+}
+module.exports = coerce
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/compare-build.js b/node_modules/@pm2/io/node_modules/semver/functions/compare-build.js
new file mode 100644
index 0000000..9eb881b
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/compare-build.js
@@ -0,0 +1,7 @@
+const SemVer = require('../classes/semver')
+const compareBuild = (a, b, loose) => {
+ const versionA = new SemVer(a, loose)
+ const versionB = new SemVer(b, loose)
+ return versionA.compare(versionB) || versionA.compareBuild(versionB)
+}
+module.exports = compareBuild
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/compare-loose.js b/node_modules/@pm2/io/node_modules/semver/functions/compare-loose.js
new file mode 100644
index 0000000..4881fbe
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/compare-loose.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const compareLoose = (a, b) => compare(a, b, true)
+module.exports = compareLoose
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/compare.js b/node_modules/@pm2/io/node_modules/semver/functions/compare.js
new file mode 100644
index 0000000..748b7af
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/compare.js
@@ -0,0 +1,5 @@
+const SemVer = require('../classes/semver')
+const compare = (a, b, loose) =>
+ new SemVer(a, loose).compare(new SemVer(b, loose))
+
+module.exports = compare
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/diff.js b/node_modules/@pm2/io/node_modules/semver/functions/diff.js
new file mode 100644
index 0000000..fc224e3
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/diff.js
@@ -0,0 +1,65 @@
+const parse = require('./parse.js')
+
+const diff = (version1, version2) => {
+ const v1 = parse(version1, null, true)
+ const v2 = parse(version2, null, true)
+ const comparison = v1.compare(v2)
+
+ if (comparison === 0) {
+ return null
+ }
+
+ const v1Higher = comparison > 0
+ const highVersion = v1Higher ? v1 : v2
+ const lowVersion = v1Higher ? v2 : v1
+ const highHasPre = !!highVersion.prerelease.length
+ const lowHasPre = !!lowVersion.prerelease.length
+
+ if (lowHasPre && !highHasPre) {
+ // Going from prerelease -> no prerelease requires some special casing
+
+ // If the low version has only a major, then it will always be a major
+ // Some examples:
+ // 1.0.0-1 -> 1.0.0
+ // 1.0.0-1 -> 1.1.1
+ // 1.0.0-1 -> 2.0.0
+ if (!lowVersion.patch && !lowVersion.minor) {
+ return 'major'
+ }
+
+ // Otherwise it can be determined by checking the high version
+
+ if (highVersion.patch) {
+ // anything higher than a patch bump would result in the wrong version
+ return 'patch'
+ }
+
+ if (highVersion.minor) {
+ // anything higher than a minor bump would result in the wrong version
+ return 'minor'
+ }
+
+ // bumping major/minor/patch all have same result
+ return 'major'
+ }
+
+ // add the `pre` prefix if we are going to a prerelease version
+ const prefix = highHasPre ? 'pre' : ''
+
+ if (v1.major !== v2.major) {
+ return prefix + 'major'
+ }
+
+ if (v1.minor !== v2.minor) {
+ return prefix + 'minor'
+ }
+
+ if (v1.patch !== v2.patch) {
+ return prefix + 'patch'
+ }
+
+ // high and low are preleases
+ return 'prerelease'
+}
+
+module.exports = diff
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/eq.js b/node_modules/@pm2/io/node_modules/semver/functions/eq.js
new file mode 100644
index 0000000..271fed9
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/eq.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const eq = (a, b, loose) => compare(a, b, loose) === 0
+module.exports = eq
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/gt.js b/node_modules/@pm2/io/node_modules/semver/functions/gt.js
new file mode 100644
index 0000000..d9b2156
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/gt.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const gt = (a, b, loose) => compare(a, b, loose) > 0
+module.exports = gt
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/gte.js b/node_modules/@pm2/io/node_modules/semver/functions/gte.js
new file mode 100644
index 0000000..5aeaa63
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/gte.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const gte = (a, b, loose) => compare(a, b, loose) >= 0
+module.exports = gte
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/inc.js b/node_modules/@pm2/io/node_modules/semver/functions/inc.js
new file mode 100644
index 0000000..7670b1b
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/inc.js
@@ -0,0 +1,19 @@
+const SemVer = require('../classes/semver')
+
+const inc = (version, release, options, identifier, identifierBase) => {
+ if (typeof (options) === 'string') {
+ identifierBase = identifier
+ identifier = options
+ options = undefined
+ }
+
+ try {
+ return new SemVer(
+ version instanceof SemVer ? version.version : version,
+ options
+ ).inc(release, identifier, identifierBase).version
+ } catch (er) {
+ return null
+ }
+}
+module.exports = inc
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/lt.js b/node_modules/@pm2/io/node_modules/semver/functions/lt.js
new file mode 100644
index 0000000..b440ab7
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/lt.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const lt = (a, b, loose) => compare(a, b, loose) < 0
+module.exports = lt
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/lte.js b/node_modules/@pm2/io/node_modules/semver/functions/lte.js
new file mode 100644
index 0000000..6dcc956
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/lte.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const lte = (a, b, loose) => compare(a, b, loose) <= 0
+module.exports = lte
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/major.js b/node_modules/@pm2/io/node_modules/semver/functions/major.js
new file mode 100644
index 0000000..4283165
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/major.js
@@ -0,0 +1,3 @@
+const SemVer = require('../classes/semver')
+const major = (a, loose) => new SemVer(a, loose).major
+module.exports = major
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/minor.js b/node_modules/@pm2/io/node_modules/semver/functions/minor.js
new file mode 100644
index 0000000..57b3455
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/minor.js
@@ -0,0 +1,3 @@
+const SemVer = require('../classes/semver')
+const minor = (a, loose) => new SemVer(a, loose).minor
+module.exports = minor
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/neq.js b/node_modules/@pm2/io/node_modules/semver/functions/neq.js
new file mode 100644
index 0000000..f944c01
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/neq.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const neq = (a, b, loose) => compare(a, b, loose) !== 0
+module.exports = neq
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/parse.js b/node_modules/@pm2/io/node_modules/semver/functions/parse.js
new file mode 100644
index 0000000..459b3b1
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/parse.js
@@ -0,0 +1,16 @@
+const SemVer = require('../classes/semver')
+const parse = (version, options, throwErrors = false) => {
+ if (version instanceof SemVer) {
+ return version
+ }
+ try {
+ return new SemVer(version, options)
+ } catch (er) {
+ if (!throwErrors) {
+ return null
+ }
+ throw er
+ }
+}
+
+module.exports = parse
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/patch.js b/node_modules/@pm2/io/node_modules/semver/functions/patch.js
new file mode 100644
index 0000000..63afca2
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/patch.js
@@ -0,0 +1,3 @@
+const SemVer = require('../classes/semver')
+const patch = (a, loose) => new SemVer(a, loose).patch
+module.exports = patch
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/prerelease.js b/node_modules/@pm2/io/node_modules/semver/functions/prerelease.js
new file mode 100644
index 0000000..06aa132
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/prerelease.js
@@ -0,0 +1,6 @@
+const parse = require('./parse')
+const prerelease = (version, options) => {
+ const parsed = parse(version, options)
+ return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
+}
+module.exports = prerelease
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/rcompare.js b/node_modules/@pm2/io/node_modules/semver/functions/rcompare.js
new file mode 100644
index 0000000..0ac509e
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/rcompare.js
@@ -0,0 +1,3 @@
+const compare = require('./compare')
+const rcompare = (a, b, loose) => compare(b, a, loose)
+module.exports = rcompare
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/rsort.js b/node_modules/@pm2/io/node_modules/semver/functions/rsort.js
new file mode 100644
index 0000000..82404c5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/rsort.js
@@ -0,0 +1,3 @@
+const compareBuild = require('./compare-build')
+const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
+module.exports = rsort
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/satisfies.js b/node_modules/@pm2/io/node_modules/semver/functions/satisfies.js
new file mode 100644
index 0000000..50af1c1
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/satisfies.js
@@ -0,0 +1,10 @@
+const Range = require('../classes/range')
+const satisfies = (version, range, options) => {
+ try {
+ range = new Range(range, options)
+ } catch (er) {
+ return false
+ }
+ return range.test(version)
+}
+module.exports = satisfies
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/sort.js b/node_modules/@pm2/io/node_modules/semver/functions/sort.js
new file mode 100644
index 0000000..4d10917
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/sort.js
@@ -0,0 +1,3 @@
+const compareBuild = require('./compare-build')
+const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
+module.exports = sort
diff --git a/node_modules/@pm2/io/node_modules/semver/functions/valid.js b/node_modules/@pm2/io/node_modules/semver/functions/valid.js
new file mode 100644
index 0000000..f27bae1
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/functions/valid.js
@@ -0,0 +1,6 @@
+const parse = require('./parse')
+const valid = (version, options) => {
+ const v = parse(version, options)
+ return v ? v.version : null
+}
+module.exports = valid
diff --git a/node_modules/@pm2/io/node_modules/semver/index.js b/node_modules/@pm2/io/node_modules/semver/index.js
new file mode 100644
index 0000000..86d42ac
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/index.js
@@ -0,0 +1,89 @@
+// just pre-load all the stuff that index.js lazily exports
+const internalRe = require('./internal/re')
+const constants = require('./internal/constants')
+const SemVer = require('./classes/semver')
+const identifiers = require('./internal/identifiers')
+const parse = require('./functions/parse')
+const valid = require('./functions/valid')
+const clean = require('./functions/clean')
+const inc = require('./functions/inc')
+const diff = require('./functions/diff')
+const major = require('./functions/major')
+const minor = require('./functions/minor')
+const patch = require('./functions/patch')
+const prerelease = require('./functions/prerelease')
+const compare = require('./functions/compare')
+const rcompare = require('./functions/rcompare')
+const compareLoose = require('./functions/compare-loose')
+const compareBuild = require('./functions/compare-build')
+const sort = require('./functions/sort')
+const rsort = require('./functions/rsort')
+const gt = require('./functions/gt')
+const lt = require('./functions/lt')
+const eq = require('./functions/eq')
+const neq = require('./functions/neq')
+const gte = require('./functions/gte')
+const lte = require('./functions/lte')
+const cmp = require('./functions/cmp')
+const coerce = require('./functions/coerce')
+const Comparator = require('./classes/comparator')
+const Range = require('./classes/range')
+const satisfies = require('./functions/satisfies')
+const toComparators = require('./ranges/to-comparators')
+const maxSatisfying = require('./ranges/max-satisfying')
+const minSatisfying = require('./ranges/min-satisfying')
+const minVersion = require('./ranges/min-version')
+const validRange = require('./ranges/valid')
+const outside = require('./ranges/outside')
+const gtr = require('./ranges/gtr')
+const ltr = require('./ranges/ltr')
+const intersects = require('./ranges/intersects')
+const simplifyRange = require('./ranges/simplify')
+const subset = require('./ranges/subset')
+module.exports = {
+ parse,
+ valid,
+ clean,
+ inc,
+ diff,
+ major,
+ minor,
+ patch,
+ prerelease,
+ compare,
+ rcompare,
+ compareLoose,
+ compareBuild,
+ sort,
+ rsort,
+ gt,
+ lt,
+ eq,
+ neq,
+ gte,
+ lte,
+ cmp,
+ coerce,
+ Comparator,
+ Range,
+ satisfies,
+ toComparators,
+ maxSatisfying,
+ minSatisfying,
+ minVersion,
+ validRange,
+ outside,
+ gtr,
+ ltr,
+ intersects,
+ simplifyRange,
+ subset,
+ SemVer,
+ re: internalRe.re,
+ src: internalRe.src,
+ tokens: internalRe.t,
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
+ RELEASE_TYPES: constants.RELEASE_TYPES,
+ compareIdentifiers: identifiers.compareIdentifiers,
+ rcompareIdentifiers: identifiers.rcompareIdentifiers,
+}
diff --git a/node_modules/@pm2/io/node_modules/semver/internal/constants.js b/node_modules/@pm2/io/node_modules/semver/internal/constants.js
new file mode 100644
index 0000000..94be1c5
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/internal/constants.js
@@ -0,0 +1,35 @@
+// Note: this is the semver.org version of the spec that it implements
+// Not necessarily the package version of this code.
+const SEMVER_SPEC_VERSION = '2.0.0'
+
+const MAX_LENGTH = 256
+const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
+/* istanbul ignore next */ 9007199254740991
+
+// Max safe segment length for coercion.
+const MAX_SAFE_COMPONENT_LENGTH = 16
+
+// Max safe length for a build identifier. The max length minus 6 characters for
+// the shortest version with a build 0.0.0+BUILD.
+const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
+
+const RELEASE_TYPES = [
+ 'major',
+ 'premajor',
+ 'minor',
+ 'preminor',
+ 'patch',
+ 'prepatch',
+ 'prerelease',
+]
+
+module.exports = {
+ MAX_LENGTH,
+ MAX_SAFE_COMPONENT_LENGTH,
+ MAX_SAFE_BUILD_LENGTH,
+ MAX_SAFE_INTEGER,
+ RELEASE_TYPES,
+ SEMVER_SPEC_VERSION,
+ FLAG_INCLUDE_PRERELEASE: 0b001,
+ FLAG_LOOSE: 0b010,
+}
diff --git a/node_modules/@pm2/io/node_modules/semver/internal/debug.js b/node_modules/@pm2/io/node_modules/semver/internal/debug.js
new file mode 100644
index 0000000..1c00e13
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/internal/debug.js
@@ -0,0 +1,9 @@
+const debug = (
+ typeof process === 'object' &&
+ process.env &&
+ process.env.NODE_DEBUG &&
+ /\bsemver\b/i.test(process.env.NODE_DEBUG)
+) ? (...args) => console.error('SEMVER', ...args)
+ : () => {}
+
+module.exports = debug
diff --git a/node_modules/@pm2/io/node_modules/semver/internal/identifiers.js b/node_modules/@pm2/io/node_modules/semver/internal/identifiers.js
new file mode 100644
index 0000000..e612d0a
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/internal/identifiers.js
@@ -0,0 +1,23 @@
+const numeric = /^[0-9]+$/
+const compareIdentifiers = (a, b) => {
+ const anum = numeric.test(a)
+ const bnum = numeric.test(b)
+
+ if (anum && bnum) {
+ a = +a
+ b = +b
+ }
+
+ return a === b ? 0
+ : (anum && !bnum) ? -1
+ : (bnum && !anum) ? 1
+ : a < b ? -1
+ : 1
+}
+
+const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
+
+module.exports = {
+ compareIdentifiers,
+ rcompareIdentifiers,
+}
diff --git a/node_modules/@pm2/io/node_modules/semver/internal/parse-options.js b/node_modules/@pm2/io/node_modules/semver/internal/parse-options.js
new file mode 100644
index 0000000..10d64ce
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/internal/parse-options.js
@@ -0,0 +1,15 @@
+// parse out just the options we care about
+const looseOption = Object.freeze({ loose: true })
+const emptyOpts = Object.freeze({ })
+const parseOptions = options => {
+ if (!options) {
+ return emptyOpts
+ }
+
+ if (typeof options !== 'object') {
+ return looseOption
+ }
+
+ return options
+}
+module.exports = parseOptions
diff --git a/node_modules/@pm2/io/node_modules/semver/internal/re.js b/node_modules/@pm2/io/node_modules/semver/internal/re.js
new file mode 100644
index 0000000..21150b3
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/internal/re.js
@@ -0,0 +1,212 @@
+const {
+ MAX_SAFE_COMPONENT_LENGTH,
+ MAX_SAFE_BUILD_LENGTH,
+ MAX_LENGTH,
+} = require('./constants')
+const debug = require('./debug')
+exports = module.exports = {}
+
+// The actual regexps go on exports.re
+const re = exports.re = []
+const safeRe = exports.safeRe = []
+const src = exports.src = []
+const t = exports.t = {}
+let R = 0
+
+const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
+
+// Replace some greedy regex tokens to prevent regex dos issues. These regex are
+// used internally via the safeRe object since all inputs in this library get
+// normalized first to trim and collapse all extra whitespace. The original
+// regexes are exported for userland consumption and lower level usage. A
+// future breaking change could export the safer regex only with a note that
+// all input should have extra whitespace removed.
+const safeRegexReplacements = [
+ ['\\s', 1],
+ ['\\d', MAX_LENGTH],
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
+]
+
+const makeSafeRegex = (value) => {
+ for (const [token, max] of safeRegexReplacements) {
+ value = value
+ .split(`${token}*`).join(`${token}{0,${max}}`)
+ .split(`${token}+`).join(`${token}{1,${max}}`)
+ }
+ return value
+}
+
+const createToken = (name, value, isGlobal) => {
+ const safe = makeSafeRegex(value)
+ const index = R++
+ debug(name, index, value)
+ t[name] = index
+ src[index] = value
+ re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
+}
+
+// The following Regular Expressions can be used for tokenizing,
+// validating, and parsing SemVer version strings.
+
+// ## Numeric Identifier
+// A single `0`, or a non-zero digit followed by zero or more digits.
+
+createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
+createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
+
+// ## Non-numeric Identifier
+// Zero or more digits, followed by a letter or hyphen, and then zero or
+// more letters, digits, or hyphens.
+
+createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
+
+// ## Main Version
+// Three dot-separated numeric identifiers.
+
+createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
+ `(${src[t.NUMERICIDENTIFIER]})\\.` +
+ `(${src[t.NUMERICIDENTIFIER]})`)
+
+createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
+ `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
+ `(${src[t.NUMERICIDENTIFIERLOOSE]})`)
+
+// ## Pre-release Version Identifier
+// A numeric identifier, or a non-numeric identifier.
+
+createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
+}|${src[t.NONNUMERICIDENTIFIER]})`)
+
+createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
+}|${src[t.NONNUMERICIDENTIFIER]})`)
+
+// ## Pre-release Version
+// Hyphen, followed by one or more dot-separated pre-release version
+// identifiers.
+
+createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
+}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)
+
+createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
+}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)
+
+// ## Build Metadata Identifier
+// Any combination of digits, letters, or hyphens.
+
+createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
+
+// ## Build Metadata
+// Plus sign, followed by one or more period-separated build metadata
+// identifiers.
+
+createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
+}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)
+
+// ## Full Version String
+// A main version, followed optionally by a pre-release version and
+// build metadata.
+
+// Note that the only major, minor, patch, and pre-release sections of
+// the version string are capturing groups. The build metadata is not a
+// capturing group, because it should not ever be used in version
+// comparison.
+
+createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
+}${src[t.PRERELEASE]}?${
+ src[t.BUILD]}?`)
+
+createToken('FULL', `^${src[t.FULLPLAIN]}$`)
+
+// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
+// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
+// common in the npm registry.
+createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
+}${src[t.PRERELEASELOOSE]}?${
+ src[t.BUILD]}?`)
+
+createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
+
+createToken('GTLT', '((?:<|>)?=?)')
+
+// Something like "2.*" or "1.2.x".
+// Note that "x.x" is a valid xRange identifer, meaning "any version"
+// Only the first item is strictly required.
+createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
+createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
+
+createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
+ `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
+ `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
+ `(?:${src[t.PRERELEASE]})?${
+ src[t.BUILD]}?` +
+ `)?)?`)
+
+createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
+ `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
+ `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
+ `(?:${src[t.PRERELEASELOOSE]})?${
+ src[t.BUILD]}?` +
+ `)?)?`)
+
+createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
+createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
+
+// Coercion.
+// Extract anything that could conceivably be a part of a valid semver
+createToken('COERCE', `${'(^|[^\\d])' +
+ '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
+ `(?:$|[^\\d])`)
+createToken('COERCERTL', src[t.COERCE], true)
+
+// Tilde ranges.
+// Meaning is "reasonably at or greater than"
+createToken('LONETILDE', '(?:~>?)')
+
+createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
+exports.tildeTrimReplace = '$1~'
+
+createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
+createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)
+
+// Caret ranges.
+// Meaning is "at least and backwards compatible with"
+createToken('LONECARET', '(?:\\^)')
+
+createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
+exports.caretTrimReplace = '$1^'
+
+createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
+createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)
+
+// A simple gt/lt/eq thing, or just "" to indicate "any version"
+createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
+createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)
+
+// An expression to strip any whitespace between the gtlt and the thing
+// it modifies, so that `> 1.2.3` ==> `>1.2.3`
+createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
+}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
+exports.comparatorTrimReplace = '$1$2$3'
+
+// Something like `1.2.3 - 1.2.4`
+// Note that these all use the loose form, because they'll be
+// checked against either the strict or loose comparator form
+// later.
+createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
+ `\\s+-\\s+` +
+ `(${src[t.XRANGEPLAIN]})` +
+ `\\s*$`)
+
+createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
+ `\\s+-\\s+` +
+ `(${src[t.XRANGEPLAINLOOSE]})` +
+ `\\s*$`)
+
+// Star ranges basically just allow anything at all.
+createToken('STAR', '(<|>)?=?\\s*\\*')
+// >=0.0.0 is like a star
+createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
+createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
diff --git a/node_modules/@pm2/io/node_modules/semver/package.json b/node_modules/@pm2/io/node_modules/semver/package.json
new file mode 100644
index 0000000..c145eca
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/package.json
@@ -0,0 +1,87 @@
+{
+ "name": "semver",
+ "version": "7.5.4",
+ "description": "The semantic version parser used by npm.",
+ "main": "index.js",
+ "scripts": {
+ "test": "tap",
+ "snap": "tap",
+ "lint": "eslint \"**/*.js\"",
+ "postlint": "template-oss-check",
+ "lintfix": "npm run lint -- --fix",
+ "posttest": "npm run lint",
+ "template-oss-apply": "template-oss-apply --force"
+ },
+ "devDependencies": {
+ "@npmcli/eslint-config": "^4.0.0",
+ "@npmcli/template-oss": "4.17.0",
+ "tap": "^16.0.0"
+ },
+ "license": "ISC",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/npm/node-semver.git"
+ },
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "files": [
+ "bin/",
+ "lib/",
+ "classes/",
+ "functions/",
+ "internal/",
+ "ranges/",
+ "index.js",
+ "preload.js",
+ "range.bnf"
+ ],
+ "tap": {
+ "timeout": 30,
+ "coverage-map": "map.js",
+ "nyc-arg": [
+ "--exclude",
+ "tap-snapshots/**"
+ ]
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "dependencies": {
+ "lru-cache": "^6.0.0"
+ },
+ "author": "GitHub Inc.",
+ "templateOSS": {
+ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
+ "version": "4.17.0",
+ "engines": ">=10",
+ "ciVersions": [
+ "10.0.0",
+ "10.x",
+ "12.x",
+ "14.x",
+ "16.x",
+ "18.x"
+ ],
+ "npmSpec": "8",
+ "distPaths": [
+ "classes/",
+ "functions/",
+ "internal/",
+ "ranges/",
+ "index.js",
+ "preload.js",
+ "range.bnf"
+ ],
+ "allowPaths": [
+ "/classes/",
+ "/functions/",
+ "/internal/",
+ "/ranges/",
+ "/index.js",
+ "/preload.js",
+ "/range.bnf"
+ ],
+ "publish": "true"
+ }
+}
diff --git a/node_modules/@pm2/io/node_modules/semver/preload.js b/node_modules/@pm2/io/node_modules/semver/preload.js
new file mode 100644
index 0000000..947cd4f
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/preload.js
@@ -0,0 +1,2 @@
+// XXX remove in v8 or beyond
+module.exports = require('./index.js')
diff --git a/node_modules/@pm2/io/node_modules/semver/range.bnf b/node_modules/@pm2/io/node_modules/semver/range.bnf
new file mode 100644
index 0000000..d4c6ae0
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/range.bnf
@@ -0,0 +1,16 @@
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | [1-9] ( [0-9] ) *
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/gtr.js b/node_modules/@pm2/io/node_modules/semver/ranges/gtr.js
new file mode 100644
index 0000000..db7e355
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/gtr.js
@@ -0,0 +1,4 @@
+// Determine if version is greater than all the versions possible in the range.
+const outside = require('./outside')
+const gtr = (version, range, options) => outside(version, range, '>', options)
+module.exports = gtr
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/intersects.js b/node_modules/@pm2/io/node_modules/semver/ranges/intersects.js
new file mode 100644
index 0000000..e0e9b7c
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/intersects.js
@@ -0,0 +1,7 @@
+const Range = require('../classes/range')
+const intersects = (r1, r2, options) => {
+ r1 = new Range(r1, options)
+ r2 = new Range(r2, options)
+ return r1.intersects(r2, options)
+}
+module.exports = intersects
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/ltr.js b/node_modules/@pm2/io/node_modules/semver/ranges/ltr.js
new file mode 100644
index 0000000..528a885
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/ltr.js
@@ -0,0 +1,4 @@
+const outside = require('./outside')
+// Determine if version is less than all the versions possible in the range
+const ltr = (version, range, options) => outside(version, range, '<', options)
+module.exports = ltr
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/max-satisfying.js b/node_modules/@pm2/io/node_modules/semver/ranges/max-satisfying.js
new file mode 100644
index 0000000..6e3d993
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/max-satisfying.js
@@ -0,0 +1,25 @@
+const SemVer = require('../classes/semver')
+const Range = require('../classes/range')
+
+const maxSatisfying = (versions, range, options) => {
+ let max = null
+ let maxSV = null
+ let rangeObj = null
+ try {
+ rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach((v) => {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!max || maxSV.compare(v) === -1) {
+ // compare(max, v, true)
+ max = v
+ maxSV = new SemVer(max, options)
+ }
+ }
+ })
+ return max
+}
+module.exports = maxSatisfying
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/min-satisfying.js b/node_modules/@pm2/io/node_modules/semver/ranges/min-satisfying.js
new file mode 100644
index 0000000..9b60974
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/min-satisfying.js
@@ -0,0 +1,24 @@
+const SemVer = require('../classes/semver')
+const Range = require('../classes/range')
+const minSatisfying = (versions, range, options) => {
+ let min = null
+ let minSV = null
+ let rangeObj = null
+ try {
+ rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach((v) => {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!min || minSV.compare(v) === 1) {
+ // compare(min, v, true)
+ min = v
+ minSV = new SemVer(min, options)
+ }
+ }
+ })
+ return min
+}
+module.exports = minSatisfying
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/min-version.js b/node_modules/@pm2/io/node_modules/semver/ranges/min-version.js
new file mode 100644
index 0000000..350e1f7
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/min-version.js
@@ -0,0 +1,61 @@
+const SemVer = require('../classes/semver')
+const Range = require('../classes/range')
+const gt = require('../functions/gt')
+
+const minVersion = (range, loose) => {
+ range = new Range(range, loose)
+
+ let minver = new SemVer('0.0.0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = new SemVer('0.0.0-0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = null
+ for (let i = 0; i < range.set.length; ++i) {
+ const comparators = range.set[i]
+
+ let setMin = null
+ comparators.forEach((comparator) => {
+ // Clone to avoid manipulating the comparator's semver object.
+ const compver = new SemVer(comparator.semver.version)
+ switch (comparator.operator) {
+ case '>':
+ if (compver.prerelease.length === 0) {
+ compver.patch++
+ } else {
+ compver.prerelease.push(0)
+ }
+ compver.raw = compver.format()
+ /* fallthrough */
+ case '':
+ case '>=':
+ if (!setMin || gt(compver, setMin)) {
+ setMin = compver
+ }
+ break
+ case '<':
+ case '<=':
+ /* Ignore maximum versions */
+ break
+ /* istanbul ignore next */
+ default:
+ throw new Error(`Unexpected operation: ${comparator.operator}`)
+ }
+ })
+ if (setMin && (!minver || gt(minver, setMin))) {
+ minver = setMin
+ }
+ }
+
+ if (minver && range.test(minver)) {
+ return minver
+ }
+
+ return null
+}
+module.exports = minVersion
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/outside.js b/node_modules/@pm2/io/node_modules/semver/ranges/outside.js
new file mode 100644
index 0000000..ae99b10
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/outside.js
@@ -0,0 +1,80 @@
+const SemVer = require('../classes/semver')
+const Comparator = require('../classes/comparator')
+const { ANY } = Comparator
+const Range = require('../classes/range')
+const satisfies = require('../functions/satisfies')
+const gt = require('../functions/gt')
+const lt = require('../functions/lt')
+const lte = require('../functions/lte')
+const gte = require('../functions/gte')
+
+const outside = (version, range, hilo, options) => {
+ version = new SemVer(version, options)
+ range = new Range(range, options)
+
+ let gtfn, ltefn, ltfn, comp, ecomp
+ switch (hilo) {
+ case '>':
+ gtfn = gt
+ ltefn = lte
+ ltfn = lt
+ comp = '>'
+ ecomp = '>='
+ break
+ case '<':
+ gtfn = lt
+ ltefn = gte
+ ltfn = gt
+ comp = '<'
+ ecomp = '<='
+ break
+ default:
+ throw new TypeError('Must provide a hilo val of "<" or ">"')
+ }
+
+ // If it satisfies the range it is not outside
+ if (satisfies(version, range, options)) {
+ return false
+ }
+
+ // From now on, variable terms are as if we're in "gtr" mode.
+ // but note that everything is flipped for the "ltr" function.
+
+ for (let i = 0; i < range.set.length; ++i) {
+ const comparators = range.set[i]
+
+ let high = null
+ let low = null
+
+ comparators.forEach((comparator) => {
+ if (comparator.semver === ANY) {
+ comparator = new Comparator('>=0.0.0')
+ }
+ high = high || comparator
+ low = low || comparator
+ if (gtfn(comparator.semver, high.semver, options)) {
+ high = comparator
+ } else if (ltfn(comparator.semver, low.semver, options)) {
+ low = comparator
+ }
+ })
+
+ // If the edge version comparator has a operator then our version
+ // isn't outside it
+ if (high.operator === comp || high.operator === ecomp) {
+ return false
+ }
+
+ // If the lowest version comparator has an operator and our version
+ // is less than it then it isn't higher than the range
+ if ((!low.operator || low.operator === comp) &&
+ ltefn(version, low.semver)) {
+ return false
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
+ return false
+ }
+ }
+ return true
+}
+
+module.exports = outside
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/simplify.js b/node_modules/@pm2/io/node_modules/semver/ranges/simplify.js
new file mode 100644
index 0000000..618d5b6
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/simplify.js
@@ -0,0 +1,47 @@
+// given a set of versions and a range, create a "simplified" range
+// that includes the same versions that the original range does
+// If the original range is shorter than the simplified one, return that.
+const satisfies = require('../functions/satisfies.js')
+const compare = require('../functions/compare.js')
+module.exports = (versions, range, options) => {
+ const set = []
+ let first = null
+ let prev = null
+ const v = versions.sort((a, b) => compare(a, b, options))
+ for (const version of v) {
+ const included = satisfies(version, range, options)
+ if (included) {
+ prev = version
+ if (!first) {
+ first = version
+ }
+ } else {
+ if (prev) {
+ set.push([first, prev])
+ }
+ prev = null
+ first = null
+ }
+ }
+ if (first) {
+ set.push([first, null])
+ }
+
+ const ranges = []
+ for (const [min, max] of set) {
+ if (min === max) {
+ ranges.push(min)
+ } else if (!max && min === v[0]) {
+ ranges.push('*')
+ } else if (!max) {
+ ranges.push(`>=${min}`)
+ } else if (min === v[0]) {
+ ranges.push(`<=${max}`)
+ } else {
+ ranges.push(`${min} - ${max}`)
+ }
+ }
+ const simplified = ranges.join(' || ')
+ const original = typeof range.raw === 'string' ? range.raw : String(range)
+ return simplified.length < original.length ? simplified : range
+}
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/subset.js b/node_modules/@pm2/io/node_modules/semver/ranges/subset.js
new file mode 100644
index 0000000..1e5c268
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/subset.js
@@ -0,0 +1,247 @@
+const Range = require('../classes/range.js')
+const Comparator = require('../classes/comparator.js')
+const { ANY } = Comparator
+const satisfies = require('../functions/satisfies.js')
+const compare = require('../functions/compare.js')
+
+// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
+// - Every simple range `r1, r2, ...` is a null set, OR
+// - Every simple range `r1, r2, ...` which is not a null set is a subset of
+// some `R1, R2, ...`
+//
+// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
+// - If c is only the ANY comparator
+// - If C is only the ANY comparator, return true
+// - Else if in prerelease mode, return false
+// - else replace c with `[>=0.0.0]`
+// - If C is only the ANY comparator
+// - if in prerelease mode, return true
+// - else replace C with `[>=0.0.0]`
+// - Let EQ be the set of = comparators in c
+// - If EQ is more than one, return true (null set)
+// - Let GT be the highest > or >= comparator in c
+// - Let LT be the lowest < or <= comparator in c
+// - If GT and LT, and GT.semver > LT.semver, return true (null set)
+// - If any C is a = range, and GT or LT are set, return false
+// - If EQ
+// - If GT, and EQ does not satisfy GT, return true (null set)
+// - If LT, and EQ does not satisfy LT, return true (null set)
+// - If EQ satisfies every C, return true
+// - Else return false
+// - If GT
+// - If GT.semver is lower than any > or >= comp in C, return false
+// - If GT is >=, and GT.semver does not satisfy every C, return false
+// - If GT.semver has a prerelease, and not in prerelease mode
+// - If no C has a prerelease and the GT.semver tuple, return false
+// - If LT
+// - If LT.semver is greater than any < or <= comp in C, return false
+// - If LT is <=, and LT.semver does not satisfy every C, return false
+// - If GT.semver has a prerelease, and not in prerelease mode
+// - If no C has a prerelease and the LT.semver tuple, return false
+// - Else return true
+
+const subset = (sub, dom, options = {}) => {
+ if (sub === dom) {
+ return true
+ }
+
+ sub = new Range(sub, options)
+ dom = new Range(dom, options)
+ let sawNonNull = false
+
+ OUTER: for (const simpleSub of sub.set) {
+ for (const simpleDom of dom.set) {
+ const isSub = simpleSubset(simpleSub, simpleDom, options)
+ sawNonNull = sawNonNull || isSub !== null
+ if (isSub) {
+ continue OUTER
+ }
+ }
+ // the null set is a subset of everything, but null simple ranges in
+ // a complex range should be ignored. so if we saw a non-null range,
+ // then we know this isn't a subset, but if EVERY simple range was null,
+ // then it is a subset.
+ if (sawNonNull) {
+ return false
+ }
+ }
+ return true
+}
+
+const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
+const minimumVersion = [new Comparator('>=0.0.0')]
+
+const simpleSubset = (sub, dom, options) => {
+ if (sub === dom) {
+ return true
+ }
+
+ if (sub.length === 1 && sub[0].semver === ANY) {
+ if (dom.length === 1 && dom[0].semver === ANY) {
+ return true
+ } else if (options.includePrerelease) {
+ sub = minimumVersionWithPreRelease
+ } else {
+ sub = minimumVersion
+ }
+ }
+
+ if (dom.length === 1 && dom[0].semver === ANY) {
+ if (options.includePrerelease) {
+ return true
+ } else {
+ dom = minimumVersion
+ }
+ }
+
+ const eqSet = new Set()
+ let gt, lt
+ for (const c of sub) {
+ if (c.operator === '>' || c.operator === '>=') {
+ gt = higherGT(gt, c, options)
+ } else if (c.operator === '<' || c.operator === '<=') {
+ lt = lowerLT(lt, c, options)
+ } else {
+ eqSet.add(c.semver)
+ }
+ }
+
+ if (eqSet.size > 1) {
+ return null
+ }
+
+ let gtltComp
+ if (gt && lt) {
+ gtltComp = compare(gt.semver, lt.semver, options)
+ if (gtltComp > 0) {
+ return null
+ } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
+ return null
+ }
+ }
+
+ // will iterate one or zero times
+ for (const eq of eqSet) {
+ if (gt && !satisfies(eq, String(gt), options)) {
+ return null
+ }
+
+ if (lt && !satisfies(eq, String(lt), options)) {
+ return null
+ }
+
+ for (const c of dom) {
+ if (!satisfies(eq, String(c), options)) {
+ return false
+ }
+ }
+
+ return true
+ }
+
+ let higher, lower
+ let hasDomLT, hasDomGT
+ // if the subset has a prerelease, we need a comparator in the superset
+ // with the same tuple and a prerelease, or it's not a subset
+ let needDomLTPre = lt &&
+ !options.includePrerelease &&
+ lt.semver.prerelease.length ? lt.semver : false
+ let needDomGTPre = gt &&
+ !options.includePrerelease &&
+ gt.semver.prerelease.length ? gt.semver : false
+ // exception: <1.2.3-0 is the same as <1.2.3
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
+ lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
+ needDomLTPre = false
+ }
+
+ for (const c of dom) {
+ hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
+ hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
+ if (gt) {
+ if (needDomGTPre) {
+ if (c.semver.prerelease && c.semver.prerelease.length &&
+ c.semver.major === needDomGTPre.major &&
+ c.semver.minor === needDomGTPre.minor &&
+ c.semver.patch === needDomGTPre.patch) {
+ needDomGTPre = false
+ }
+ }
+ if (c.operator === '>' || c.operator === '>=') {
+ higher = higherGT(gt, c, options)
+ if (higher === c && higher !== gt) {
+ return false
+ }
+ } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
+ return false
+ }
+ }
+ if (lt) {
+ if (needDomLTPre) {
+ if (c.semver.prerelease && c.semver.prerelease.length &&
+ c.semver.major === needDomLTPre.major &&
+ c.semver.minor === needDomLTPre.minor &&
+ c.semver.patch === needDomLTPre.patch) {
+ needDomLTPre = false
+ }
+ }
+ if (c.operator === '<' || c.operator === '<=') {
+ lower = lowerLT(lt, c, options)
+ if (lower === c && lower !== lt) {
+ return false
+ }
+ } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
+ return false
+ }
+ }
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
+ return false
+ }
+ }
+
+ // if there was a < or >, and nothing in the dom, then must be false
+ // UNLESS it was limited by another range in the other direction.
+ // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
+ return false
+ }
+
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
+ return false
+ }
+
+ // we needed a prerelease range in a specific tuple, but didn't get one
+ // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
+ // because it includes prereleases in the 1.2.3 tuple
+ if (needDomGTPre || needDomLTPre) {
+ return false
+ }
+
+ return true
+}
+
+// >=1.2.3 is lower than >1.2.3
+const higherGT = (a, b, options) => {
+ if (!a) {
+ return b
+ }
+ const comp = compare(a.semver, b.semver, options)
+ return comp > 0 ? a
+ : comp < 0 ? b
+ : b.operator === '>' && a.operator === '>=' ? b
+ : a
+}
+
+// <=1.2.3 is higher than <1.2.3
+const lowerLT = (a, b, options) => {
+ if (!a) {
+ return b
+ }
+ const comp = compare(a.semver, b.semver, options)
+ return comp < 0 ? a
+ : comp > 0 ? b
+ : b.operator === '<' && a.operator === '<=' ? b
+ : a
+}
+
+module.exports = subset
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/to-comparators.js b/node_modules/@pm2/io/node_modules/semver/ranges/to-comparators.js
new file mode 100644
index 0000000..6c8bc7e
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/to-comparators.js
@@ -0,0 +1,8 @@
+const Range = require('../classes/range')
+
+// Mostly just for testing and legacy API reasons
+const toComparators = (range, options) =>
+ new Range(range, options).set
+ .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))
+
+module.exports = toComparators
diff --git a/node_modules/@pm2/io/node_modules/semver/ranges/valid.js b/node_modules/@pm2/io/node_modules/semver/ranges/valid.js
new file mode 100644
index 0000000..365f356
--- /dev/null
+++ b/node_modules/@pm2/io/node_modules/semver/ranges/valid.js
@@ -0,0 +1,11 @@
+const Range = require('../classes/range')
+const validRange = (range, options) => {
+ try {
+ // Return '*' instead of '' so that truthiness works.
+ // This will throw if it's invalid anyway
+ return new Range(range, options).range || '*'
+ } catch (er) {
+ return null
+ }
+}
+module.exports = validRange
diff --git a/node_modules/@pm2/io/package.json b/node_modules/@pm2/io/package.json
new file mode 100644
index 0000000..d745219
--- /dev/null
+++ b/node_modules/@pm2/io/package.json
@@ -0,0 +1,94 @@
+{
+ "name": "@pm2/io",
+ "version": "6.0.1",
+ "description": "PM2.io NodeJS APM",
+ "main": "build/main/index.js",
+ "typings": "build/main/index.d.ts",
+ "types": "build/main/index.d.ts",
+ "module": "build/module/index.js",
+ "repository": "https://github.com/keymetrics/pm2-io-apm",
+ "author": {
+ "name": "PM2.io tech team",
+ "email": "tech@pm2.io",
+ "url": "https://pm2.io"
+ },
+ "contributors": [
+ {
+ "name": "Vincent Vallet",
+ "url": "https://github.com/wallet77"
+ }
+ ],
+ "license": "Apache-2",
+ "scripts": {
+ "build": "tsc -p tsconfig.json",
+ "build:module": "tsc -p config/exports/tsconfig.module.json",
+ "lint": "tslint --project . src/**/*.ts",
+ "unit": "npm run build && bash test.sh",
+ "mono": "mocha --exit --require ts-node/register",
+ "test": "npm run unit",
+ "watch": "tsc -w",
+ "prepublishOnly": "npm run build"
+ },
+ "scripts-info": {
+ "build": "(Trash and re)build the library",
+ "lint": "Lint all typescript source files",
+ "unit": "Build the library and run unit tests",
+ "test": "Lint, build, and test the library",
+ "watch": "Watch source files, rebuild library on changes, rerun relevant tests"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "devDependencies": {
+ "@types/chai": "4.1.4",
+ "@types/express": "~4.16.1",
+ "@types/ioredis": "~4.0.6",
+ "@types/mocha": "5.2.5",
+ "@types/mongodb": "~3.1.19",
+ "@types/node": "~10.12.21",
+ "@types/redis": "~2.8.10",
+ "chai": "4.1.2",
+ "express": "^4.17.1",
+ "ioredis": "^4.16.3",
+ "koa": "^2.11.0",
+ "mocha": "~7.1.0",
+ "mongodb-core": "^3.2.7",
+ "mysql": "~2.18.1",
+ "mysql2": "~2.1.0",
+ "nock": "~10.0.6",
+ "nyc": "~13.1.0",
+ "pg": "^7.18.2",
+ "redis": "^3.0.2",
+ "source-map-support": "~0.5.9",
+ "ts-node": "~7.0.1",
+ "tslint": "~5.11.0",
+ "tslint-config-standard": "~8.0.1",
+ "typescript": "^5.2.2",
+ "vue": "^2.6.11",
+ "vue-server-renderer": "^2.6.11"
+ },
+ "keywords": [],
+ "nyc": {
+ "extension": [
+ ".ts"
+ ],
+ "exclude": [
+ "build/",
+ "config/",
+ "examples/",
+ "test/"
+ ],
+ "cache": true,
+ "all": true
+ },
+ "dependencies": {
+ "async": "~2.6.1",
+ "debug": "~4.3.1",
+ "eventemitter2": "^6.3.1",
+ "require-in-the-middle": "^5.0.0",
+ "semver": "~7.5.4",
+ "shimmer": "^1.2.0",
+ "signal-exit": "^3.0.3",
+ "tslib": "1.9.3"
+ }
+}
diff --git a/node_modules/@pm2/io/pres/io-black.png b/node_modules/@pm2/io/pres/io-black.png
new file mode 100644
index 0000000000000000000000000000000000000000..4f157e60b1180be016ba4d2fd3d06070f8620cf3
GIT binary patch
literal 11535
zcmdUVWmFtdw`B)yoJK=8-UJN<2yQ_e2@pKEh2U<%LU0=C-~F>SwW7eAaF@LAlUA0c#+O^NAd-s((t0L4?QoE>pe3p)YssN5|NUf5koX;ln{;x2!
z$vjj6P8Xm6|FNg?(5Lb-Ci1cV3y-oTI`jVf7V7-p1#_mbcx(Q@ZM4aJ{J9eJ$^2)N
zx&I9Vl*0*!vjJt{fYNY4S=h6Q+`3&P$~DS3Jv{}KhMoNV^Z4|*dw+d=dc1hJ|NHmv`T4mrvO|2O>D$q=-PZ8UYY^XE|4beFdeEXtT
zJV`+&Dv;us@7YnE9ZtBlGBV{uPj+UK@byiJ#BOhDSYI5;Hg#&Z(3Leb3!n^TZ
zEN}JbPikDENlX!>8(E(omcA+!uUT_oNkw%Tl0<(Y=5vX&Nt>MxEw0)){v)yoAPjr=&_uXXf!&@hX5rC@ll93)*G_C5EZiFkp`3$?`KklD<>Y?Qa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#J77DUG
z%^+j+Az<6%7S6;Zf)WJw=J;YA0t2PDvgsm_nF+!+-Z!`sPZK=aY`o*@Hm+l2{3nCj^p!(fdU
z5jae!mKS6c%fx8FHVcI?#1MM#j>p9M!aBgXo3(GGAC)hR;LZLPmfn$M&E_tKGT5$>aJOe
z$s(QvxLHIZQV%f%rLSQYBo>a(LYhGTyedJGDz4nJ{Wt{7c3spfeFo{u7y^Ni96x9*
zlO_j4ABw^h3h1MZwqY(x8+-{5CO11^H21dT!W8U5M|An|#tGpvILdyNhnyR<*f@ih
z>#eKU2z1Jq>h#UA>SxV2U|zW(k6P1=Js;07W@f*&ouTLH`Sx$A{1W
literal 0
HcmV?d00001
diff --git a/node_modules/@pm2/io/pres/io-white.png b/node_modules/@pm2/io/pres/io-white.png
new file mode 100644
index 0000000000000000000000000000000000000000..fffa73de7c15b9d7a719de25e9be21f3e076c141
GIT binary patch
literal 11720
zcmYLv1yoes_x8|3Go&;!NQcybfRr$Rf^?T4&5)8JT_ZAd2_nPL-Q6K2DItw?OQ(R}
z_*1aD!UMmq3&=CLt0Adwo1uXyo7mT(WfmrCVp2DRN
z0KmM}P}NaHUxInW&?hSown8NAQ9pGu=K
ztY|hqaW+1QfBd{+PlTjpWo6M|v>$z<@ggGf=qQ>NP4&;i_w1j-{}tjClKM{-JHG@M
zuO!;Z&L?qyfB#P#x7gqR9cb`>2F6$p+5q!B18+3^r}jTTdi*a$F_DM%qc1W4hs6Dn
z|6d3l{SSckKR?dsKc4?W{~@u)^ZxVvH)4+E{^tiy78I^c|6d4e{9htEiaqiF@fc&M
z{{x^6{QuQLr(=!f{^uv2Dn=V<0ca=Ye+=U}Pk6-v#gTxL2=s`KqDSeD96;44KuKin
z)*@G9I-u$!dJ!;2|B)XZ9RZ3X4*y(l-Co>3Jlx&ipPZcB-rkg3bzRKV6ap!+j%d35H%g4}$Qz|R`4nJW6pQoy&2k&8n>L)_B!>E6xd`sGQ{
z@0GZ{nX;qR+{5MI?FqMy@20)x9q%8R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&Vghi_Sk=*vd-3V%1?b7RO?rnwUI{%wSHMqEbAdm1lk
zlY+8xK`_2YK~hqI8;p~b&M%bYvV(P7G3@T1|Xi2?(gfc?(CpD!hGG=eNSg#2gEOpZ5UxY+~U&ARvIim{0feai0Xo?qV=JBcbn2ql3Qr`5k2
z?7+zS(LPyN*d_l_-0lhc+uw>wW|fl3X_R`Epj%PaMm5e^+Rc9GPQ~UI)kt;PcP-5q
zoG^T#7C|LwUKI0_Hz9|fO
z@k~a5b)Up!VT6!)5}z_x24cJhRMJO4f2a7g2TFwW1ZxC}vqc&orMB-Vg?VQ^dG3)-
z6f*+K6^Z6*l)to5B}EFJ#S)Q
z2_`a`0{(JWQD#@#Sx@UafH4*C3F}jGJ&e>zh`guSz2aX7v@6(iC1c7T0v=Cyc^|_|3sHV0fl_{-xb1M
zImo>prm%8gnguS=SFsqUEdZ$?tV8|?K#1t!W7;eYKQ*!qjmHI$&jZ}p^x6L4xOEyE
z_7@)!PhBm*0Lr71S#ajO_Jj#hRF6oE6P@LaNF|8h4m+QKVon&@3sq>U1qJFt=X-vX
zyZYslQ&!yJH-!+nb8LhnTou83Wn?d|-y!?Zutreew5aalBL8N~v8j))Sk)b4(`J
zTNkaab6NoXY7F#EK+2hB08An2JN=3J_s_~I3o&sFytO%HZ0`9uNenl^hQ965sbV~F
zvAx&4osKit!&Hy+qCSM8KVyX4@bU(!Nt1q#J?APf-Q#sxrm>GYaO6KKEiT1-vPUXf
YWbgqtrqPW4C>5Zh_*$V{{!PgL1ACY{g#Z8m
literal 0
HcmV?d00001
diff --git a/node_modules/@pm2/io/test.sh b/node_modules/@pm2/io/test.sh
new file mode 100644
index 0000000..e421254
--- /dev/null
+++ b/node_modules/@pm2/io/test.sh
@@ -0,0 +1,67 @@
+
+
+NODE_ENV='test'
+MOCHA='npx mocha'
+
+trap "exit" INT
+set -e
+npm run build
+
+#### Unit tests
+
+$MOCHA ./test/autoExit.spec.ts
+$MOCHA ./test/api.spec.ts
+$MOCHA ./test/metrics/http.spec.ts
+$MOCHA ./test/metrics/runtime.spec.ts
+$MOCHA ./test/entrypoint.spec.ts
+# $MOCHA ./test/standalone/tracing.spec.ts
+# $MOCHA ./test/standalone/events.spec.ts
+$MOCHA ./test/features/events.spec.ts
+$MOCHA ./test/features/tracing.spec.ts
+$MOCHA ./test/metrics/eventloop.spec.ts
+$MOCHA ./test/metrics/network.spec.ts
+$MOCHA ./test/metrics/v8.spec.ts
+$MOCHA ./test/services/actions.spec.ts
+$MOCHA ./test/services/metrics.spec.ts
+
+#### Tracing tests
+
+# Enable tests
+export OPENCENSUS_MONGODB_TESTS="1"
+export OPENCENSUS_REDIS_TESTS="1"
+export OPENCENSUS_MYSQL_TESTS="1"
+export OPENCENSUS_PG_TESTS="1"
+
+if [ -z "$DRONE" ]
+then
+ export OPENCENSUS_REDIS_HOST="localhost"
+ export OPENCENSUS_MONGODB_HOST="localhost"
+ export OPENCENSUS_MYSQL_HOST="localhost"
+ export OPENCENSUS_PG_HOST="localhost"
+else
+ export OPENCENSUS_REDIS_HOST="redis"
+ export OPENCENSUS_MONGODB_HOST="mongodb"
+ export OPENCENSUS_MYSQL_HOST="mysql"
+ export OPENCENSUS_PG_HOST="postgres"
+fi
+
+$MOCHA src/census/plugins/__tests__/http.spec.ts
+$MOCHA src/census/plugins/__tests__/http2.spec.ts
+$MOCHA src/census/plugins/__tests__/https.spec.ts
+$MOCHA src/census/plugins/__tests__/mongodb.spec.ts
+$MOCHA src/census/plugins/__tests__/mysql.spec.ts
+$MOCHA src/census/plugins/__tests__/mysql2.spec.ts
+$MOCHA src/census/plugins/__tests__/ioredis.spec.ts
+$MOCHA src/census/plugins/__tests__/vue.spec.ts
+$MOCHA src/census/plugins/__tests__/express.spec.ts
+$MOCHA src/census/plugins/__tests__/net.spec.ts
+$MOCHA src/census/plugins/__tests__/redis.spec.ts
+
+SUPV14=`node -e "require('semver').gte(process.versions.node, '14.0.0') ? console.log('>=14') : console.log('>6')"`
+
+if [ $SUPV14 == '>=14' ]; then
+ exit
+fi
+
+$MOCHA src/census/plugins/__tests__/pg.spec.ts
+#$MOCHA ./test/features/profiling.spec.ts
diff --git a/node_modules/@pm2/js-api/.drone.jsonnet b/node_modules/@pm2/js-api/.drone.jsonnet
new file mode 100644
index 0000000..a0762c0
--- /dev/null
+++ b/node_modules/@pm2/js-api/.drone.jsonnet
@@ -0,0 +1,100 @@
+local pipeline(version) = {
+ kind: "pipeline",
+ name: "node-v" + version,
+ steps: [
+ {
+ name: "tests",
+ image: "node:" + version,
+ commands: [
+ "npm install",
+ "npm run test",
+ ],
+ environment: {
+ NODE_ENV: "test",
+ KEYMETRICS_TOKEN: {
+ from_secret: "keymetrics_token",
+ },
+ },
+ },
+ ],
+ trigger: {
+ event: ["push", "tag"]
+ },
+};
+
+[
+ pipeline("10"),
+ pipeline("12"),
+ pipeline("14"),
+ {
+ kind: "pipeline",
+ name: "build & publish",
+ trigger: {
+ event: "tag"
+ },
+ depends_on: [
+ "node-v10",
+ "node-v12",
+ "node-v14"
+ ],
+ steps: [
+ {
+ name: "build",
+ image: "node:12",
+ commands: [
+ "npm install 2> /dev/null",
+ "mkdir -p dist",
+ "npm run build",
+ "npm run dist",
+ ],
+ },
+ {
+ name: "publish",
+ image: "plugins/npm",
+ settings: {
+ username: {
+ from_secret: "npm_username"
+ },
+ password: {
+ from_secret: "npm_password"
+ },
+ email: {
+ from_secret: "npm_email"
+ },
+ },
+ },
+ ],
+ },
+ {
+ kind: "secret",
+ name: "npm_username",
+ get: {
+ path: "secret/drone/npm",
+ name: "username",
+ },
+ },
+ {
+ kind: "secret",
+ name: "npm_email",
+ get: {
+ path: "secret/drone/npm",
+ name: "email",
+ },
+ },
+ {
+ kind: "secret",
+ name: "npm_password",
+ get: {
+ path: "secret/drone/npm",
+ name: "password",
+ },
+ },
+ {
+ kind: "secret",
+ name: "keymetrics_token",
+ get: {
+ path: "secret/drone/keymetrics",
+ name: "token",
+ },
+ },
+]
diff --git a/node_modules/@pm2/js-api/LICENSE b/node_modules/@pm2/js-api/LICENSE
new file mode 100644
index 0000000..8dada3e
--- /dev/null
+++ b/node_modules/@pm2/js-api/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/node_modules/@pm2/js-api/README.md b/node_modules/@pm2/js-api/README.md
new file mode 100644
index 0000000..825ba1b
--- /dev/null
+++ b/node_modules/@pm2/js-api/README.md
@@ -0,0 +1,375 @@
+# PM2.io API Client for Javascript
+
+This module lets you implement a fully customizable PM2.io client, receiving live data from the PM2.io API.
+
+## Install
+
+With NPM:
+
+```bash
+$ npm install @pm2/js-api --save
+```
+
+Or get the raw library for browser here:
+
+[https://unpkg.com/@pm2/js-api](https://unpkg.com/@pm2/js-api)
+
+## Usage
+
+To use this client you need to first requiring it into your code and creating a new instance :
+
+```javascript
+const PM2IO = require('@pm2/js-api')
+
+let client = new PM2IO()
+```
+
+Then you'll to tell the client how you want to authenticate, you have the choice :
+
+- First the `standalone` flow, you just need to enter a refresh token and it will works
+```javascript
+client.use('standalone', {
+ refresh_token: 'token'
+})
+```
+
+- Secondly, the `browser` flow, you have a custom keymetrics application and you want to authenticate of the behalf for any user (in this flow you need to be inside a browser) :
+```javascript
+client.use('browser', {
+ client_id: 'my-oauth-client-id'
+})
+```
+
+- Thirdly, the `embed` flow, you have a custom keymetrics application and you want to authenticate of the behalf of any user (you need to be in a nodejs process, for example a CLI) :
+```javascript
+client.use('embed', {
+ client_id: 'my-oauth-client-id'
+})
+```
+
+After that, you can do whatever call you want just keep in mind each call return a Promise (the client will handle authentication) :
+```javascript
+client.user.retrieve()
+ .then((response) => {
+ // see https://github.com/mzabriskie/axios#response-schema
+ // for the content of response
+ }).catch((err) => {
+ // see https://github.com/mzabriskie/axios#handling-errors
+ // for the content of err
+ })
+```
+
+## Example
+
+```javascript
+const PM2IO = require('@pm2/js-api')
+
+let client = new PM2IO().use('standalone', {
+ refresh_token: 'token'
+})
+
+// retrieve our buckets
+client.bucket.retrieveAll()
+ .then((res) => {
+ // find our bucket
+ let bucket = res.data.find(bucket => bucket.name === 'Keymetrics')
+
+ // connect to realtime data of a bucket
+ client.realtime.subscribe(bucket._id).catch(console.error)
+
+ // attach handler on specific realtime data
+ client.realtime.on(`${bucket.public_id}:connected`, () => console.log('connected to realtime'))
+ client.realtime.on(`${bucket.public_id}:*:status`, (data) => console.log(data.server_name))
+
+ // we can also unsubscribe from a bucket realtime data
+ setTimeout(() => {
+ client.realtime.unsubscribe(bucket._id).catch(console.error)
+ }, 5000)
+ })
+ .catch(console.error)
+```
+
+### Realtime
+
+All realtime data are broadcasted with the following pattern :
+
+```
+bucket_public_id:server_name:data_method
+```
+
+For example :
+
+```javascript
+// here i listen on the status data for
+// the server "my_server" on the bucket with
+// the public id 4398545
+client.realtime.on(`4398545:my_server:status`, (data) => {
+ console.log(data.server_name))
+}
+```
+
+#### Events available
+
+| Event | Description |
+|-------|-------------|
+| mediator:blacklist | Used to broadcast updated process blacklisted |
+| human:event | Events sent via pmx.emit() |
+| process:exception | Issues from pm2 or apm |
+| logs | Logs |
+| status | Status sent by apm or pm2 |
+| metric | Metric sent by apm/collectors |
+| axm:transaction:outlier | Outlier for transaction tracing |
+| process:event | Event from pm2 (restart...) |
+| profiling | Profiling packet with profiling link |
+| axm:scoped_action:stream | Stream from scoped action |
+| axm:scoped_action:end | End of scoped action |
+| axm:scoped_action:error | Error for a scoped action |
+| pm2:scoped:end | End for pm2 scoped |
+| pm2:scoped:stream | Stream from pm2 scoped |
+| pm2:scoped:error | Error from pm2 scoped |
+| trace-span | Span for distributed tracing |
+| axm:transaction | Transaction for transaction tracing |
+| trigger:pm2:result | Result from a pm2 action |
+| trigger:action:success | Success from a custom action |
+| trigger:action:failure | Error from a customer action |
+| axm:reply | Reply from a custom action |
+
+## Route definition
+
+```
+client.actions.triggerAction -> POST /api/bucket/:id/actions/trigger
+client.actions.triggerPM2Action -> POST /api/bucket/:id/actions/triggerPM2
+client.actions.triggerScopedAction -> POST /api/bucket/:id/actions/triggerScopedAction
+client.bucket.sendFeedback -> PUT /api/bucket/:id/feedback
+client.bucket.retrieveUsers -> GET /api/bucket/:id/users_authorized
+client.bucket.currentRole -> GET /api/bucket/:id/current_role
+client.bucket.setNotificationState -> POST /api/bucket/:id/manage_notif
+client.bucket.inviteUser -> POST /api/bucket/:id/add_user
+client.bucket.removeInvitation -> DELETE /api/bucket/:id/invitation
+client.bucket.removeUser -> POST /api/bucket/:id/remove_user
+client.bucket.setUserRole -> POST /api/bucket/:id/promote_user
+client.bucket.retrieveAll -> GET /api/bucket/
+client.bucket.create -> POST /api/bucket/create_classic
+client.bucket.claimTrial -> PUT /api/bucket/:id/start_trial
+client.bucket.upgrade -> POST /api/bucket/:id/upgrade
+client.bucket.retrieve -> GET /api/bucket/:id
+client.bucket.update -> PUT /api/bucket/:id
+client.bucket.retrieveServers -> GET /api/bucket/:id/meta_servers
+client.bucket.getSubscription -> GET /api/bucket/:id/subscription
+client.bucket.destroy -> DELETE /api/bucket/:id
+client.bucket.transferOwnership -> POST /api/bucket/:id/transfer_ownership
+client.bucket.retrieveCharges -> GET /api/bucket/:id/payment/charges
+client.bucket.updateUserOptions -> PUT /api/bucket/:id/user_options
+client.bucket.alert.update -> POST /api/bucket/:id/alerts/update
+client.bucket.alert.updateSlack -> POST /api/bucket/:id/alerts/updateSlack
+client.bucket.alert.updateWebhooks -> POST /api/bucket/:id/alerts/updateWebhooks
+client.bucket.alert.create -> POST /api/bucket/:id/alerts
+client.bucket.alert.delete -> DELETE /api/bucket/:id/alerts/:alert
+client.bucket.alert.list -> GET /api/bucket/:id/alerts/
+client.bucket.alert.updateAlert -> PUT /api/bucket/:id/alerts/:alert
+client.bucket.alert.get -> GET /api/bucket/:id/alerts/:alert
+client.bucket.alert.triggerSample -> POST /api/bucket/:id/alerts/:alert/sample
+client.bucket.alert.analyzer.list -> POST /api/bucket/:id/alerts/analyzer
+client.bucket.alert.analyzer.editState -> PUT /api/bucket/:id/alerts/analyzer/:alert
+client.bucket.alert.analyzer.updateConfig -> PUT /api/bucket/:id/alerts/analyzer/:analyzer/config
+client.bucket.billing.subscribe -> POST /api/bucket/:id/payment/subscribe
+client.bucket.billing.startTrial -> PUT /api/bucket/:id/payment/trial
+client.bucket.billing.getInvoices -> GET /api/bucket/:id/payment/invoices
+client.bucket.billing.getReceipts -> GET /api/bucket/:id/payment/receipts
+client.bucket.billing.getSubcription -> GET /api/bucket/:id/payment/subscription
+client.bucket.billing.getSubcriptionState -> GET /api/bucket/:id/payment/subscription/state
+client.bucket.billing.attachCreditCard -> POST /api/bucket/:id/payment/cards
+client.bucket.billing.fetchCreditCards -> GET /api/bucket/:id/payment/cards
+client.bucket.billing.fetchCreditCard -> GET /api/bucket/:id/payment/card/:card_id
+client.bucket.billing.fetchDefaultCreditCard -> GET /api/bucket/:id/payment/card
+client.bucket.billing.updateCreditCard -> PUT /api/bucket/:id/payment/card
+client.bucket.billing.deleteCreditCard -> DELETE /api/bucket/:id/payment/card/:card_id
+client.bucket.billing.setDefaultCard -> POST /api/bucket/:id/payment/card/:card_id/default
+client.bucket.billing.fetchMetadata -> GET /api/bucket/:id/payment
+client.bucket.billing.updateMetadata -> PUT /api/bucket/:id/payment
+client.bucket.billing.attachBankAccount -> POST /api/bucket/:id/payment/banks
+client.bucket.billing.fetchBankAccount -> GET /api/bucket/:id/payment/banks
+client.bucket.billing.deleteBankAccount -> DELETE /api/bucket/:id/payment/banks
+client.data.dependencies.retrieve -> POST /api/bucket/:id/data/dependencies/
+client.data.events.retrieve -> POST /api/bucket/:id/data/events
+client.data.events.retrieveMetadatas -> GET /api/bucket/:id/data/eventsKeysByApp
+client.data.events.retrieveHistogram -> POST /api/bucket/:id/data/events/stats
+client.data.events.deleteAll -> DELETE /api/bucket/:id/data/events/delete_all
+client.data.exceptions.retrieve -> POST /api/bucket/:id/data/exceptions
+client.data.exceptions.retrieveSummary -> GET /api/bucket/:id/data/exceptions/summary
+client.data.exceptions.deleteAll -> POST /api/bucket/:id/data/exceptions/delete_all
+client.data.exceptions.delete -> POST /api/bucket/:id/data/exceptions/delete
+client.data.issues.list -> POST /api/bucket/:id/data/issues/list
+client.data.issues.listOccurencesForIdentifier -> GET /api/bucket/:id/data/issues/occurrences/:identifier
+client.data.issues.getReplay -> GET /api/bucket/:id/data/issues/replay/:uuid
+client.data.issues.retrieveHistogram -> POST /api/bucket/:id/data/issues/histogram
+client.data.issues.findOccurences -> POST /api/bucket/:id/data/issues/ocurrences
+client.data.issues.search -> POST /api/bucket/:id/data/issues/search
+client.data.issues.summary -> GET /api/bucket/:id/data/issues/summary/:aggregateBy
+client.data.issues.deleteAll -> DELETE /api/bucket/:id/data/issues
+client.data.issues.delete -> DELETE /api/bucket/:id/data/issues/:identifier
+client.data.logs.retrieve -> POST /api/bucket/:id/data/logs
+client.data.logs.retrieveHistogram -> POST /api/bucket/:id/data/logs/histogram
+client.data.metrics.retrieveAggregations -> POST /api/bucket/:id/data/metrics/aggregations
+client.data.metrics.retrieveHistogram -> POST /api/bucket/:id/data/metrics/histogram
+client.data.metrics.retrieveList -> POST /api/bucket/:id/data/metrics/list
+client.data.metrics.retrieveMetadatas -> POST /api/bucket/:id/data/metrics
+client.data.outliers.retrieve -> POST /api/bucket/:id/data/outliers/
+client.data.processes.retrieveEvents -> POST /api/bucket/:id/data/processEvents
+client.data.processes.retrieveDeployments -> POST /api/bucket/:id/data/processEvents/deployments
+client.data.profiling.retrieve -> GET /api/bucket/:id/data/profilings/:filename
+client.data.profiling.download -> GET /api/bucket/:id/data/profilings/:filename/download
+client.data.profiling.list -> POST /api/bucket/:id/data/profilings
+client.data.profiling.delete -> DELETE /api/bucket/:id/data/profilings/:filename
+client.data.status.retrieve -> GET /api/bucket/:id/data/status
+client.data.status.retrieveBlacklisted -> GET /api/bucket/:id/data/status/blacklisted
+client.data.transactions.retrieveHistogram -> POST /api/bucket/:id/data/transactions/v2/histogram
+client.data.transactions.retrieveSummary -> POST /api/bucket/:id/data/transactions/v2/summary
+client.data.transactions.delete -> POST /api/bucket/:id/data/transactions/v2/delete
+client.dashboard.retrieveAll -> GET /api/bucket/:id/dashboard/
+client.dashboard.retrieve -> GET /api/bucket/:id/dashboard/:dashid
+client.dashboard.remove -> DELETE /api/bucket/:id/dashboard/:dashid
+client.dashboard.update -> POST /api/bucket/:id/dashboard/:dashId
+client.dashboard.create -> PUT /api/bucket/:id/dashboard/
+client.misc.listChangelogArticles -> GET /api/misc/changelog
+client.misc.retrievePM2Version -> GET /api/misc/release/pm2
+client.misc.retrieveNodeRelease -> GET /api/misc/release/nodejs/:version
+client.misc.retrievePlans -> GET /api/misc/plans
+client.misc.retrieveCoupon -> POST /api/misc/stripe/retrieveCoupon
+client.misc.retrieveCompany -> POST /api/misc/stripe/retrieveCompany
+client.misc.retrieveVAT -> POST /api/misc/stripe/retrieveVat
+client.orchestration.selfSend -> POST /api/bucket/:id/balance
+client.bucket.server.deleteServer -> POST /api/bucket/:id/data/deleteServer
+client.tokens.retrieve -> GET /api/users/token/
+client.tokens.remove -> DELETE /api/users/token/:id
+client.tokens.create -> PUT /api/users/token/
+client.user.retrieve -> GET /api/users/isLogged
+client.user.show -> GET /api/users/show/:id
+client.user.update -> POST /api/users/update
+client.user.delete -> DELETE /api/users/delete
+client.user.attachCreditCard -> POST /api/users/payment/
+client.user.listSubscriptions -> GET /api/users/payment/subcriptions
+client.user.listCharges -> GET /api/users/payment/charges
+client.user.fetchCreditCard -> GET /api/users/payment/card/:card_id
+client.user.fetchDefaultCreditCard -> GET /api/users/payment/card
+client.user.updateCreditCard -> PUT /api/users/payment/card
+client.user.deleteCreditCard -> DELETE /api/users/payment/card/:card_id
+client.user.setDefaultCard -> POST /api/users/payment/card/:card_id/default
+client.user.fetchMetadata -> GET /api/users/payment/card/stripe_metadata
+client.user.updateMetadata -> PUT /api/users/payment/stripe_metadata
+client.user.otp.retrieve -> GET /api/users/otp
+client.user.otp.enable -> POST /api/users/otp
+client.user.otp.disable -> DELETE /api/users/otp
+client.user.providers.retrieve -> GET /api/users/integrations
+client.user.providers.add -> POST /api/users/integrations
+client.user.providers.remove -> DELETE /api/users/integrations/:name
+client.bucket.webcheck.listMetrics -> GET /api/bucket/:id/webchecks/metrics
+client.bucket.webcheck.listRegions -> GET /api/bucket/:id/webchecks/regions
+client.bucket.webcheck.getMetrics -> POST /api/bucket/:id/webchecks/:webcheck/metrics
+client.bucket.webcheck.list -> GET /api/bucket/:id/webchecks
+client.bucket.webcheck.get -> GET /api/bucket/:id/webchecks/:webcheck
+client.bucket.webcheck.create -> POST /api/bucket/:id/webchecks
+client.bucket.webcheck.update -> PUT /api/bucket/:id/webchecks/:webcheck
+client.bucket.webcheck.delete -> DELETE /api/bucket/:id/webchecks/:webcheck
+client.auth.retrieveToken -> POST /api/oauth/token
+client.auth.requestNewPassword -> POST /api/oauth/reset_password
+client.auth.sendEmailLink -> POST /api/oauth/send_email_link
+client.auth.validEmail -> GET /api/oauth/valid_email/:token
+client.auth.register -> GET /api/oauth/register
+client.auth.revoke -> POST /api/oauth/revoke
+client.data.traces.list -> POST /api/bucket/:id/data/traces
+client.data.traces.retrieve -> GET /api/bucket/:id/data/traces/:trace
+client.data.traces.getServices -> GET /api/bucket/:id/data/traces/services
+client.data.traces.getTags -> GET /api/bucket/:id/data/traces/tags
+client.data.traces.getHistogramByTag -> POST /api/bucket/:id/data/traces/histogram/tag
+client.data.notifications.list -> POST /api/bucket/:id/data/notifications
+client.data.notifications.retrieve -> GET /api/bucket/:id/data/notifications/:notification
+client.bucket.application.list -> GET /api/bucket/:id/applications
+client.bucket.application.get -> GET /api/bucket/:id/applications/:application
+client.bucket.application.create -> POST /api/bucket/:id/applications
+client.bucket.application.update -> PUT /api/bucket/:id/applications/:application
+client.bucket.application.delete -> DELETE /api/bucket/:id/applications/:application
+client.bucket.application.getPreview -> GET /api/bucket/:id/applications/:application/preview
+client.bucket.application.getReports -> GET /api/bucket/:id/applications/:application/report
+```
+
+## Local Backend
+
+- Create token in user setting then:
+
+### Standalone logging
+
+```javascript
+const PM2IO = require('@pm2/js-api')
+
+let io = new PM2IO({
+ services: {
+ API: 'http://cl1.km.io:3000',
+ OAUTH: 'http://cl1.km.io:3100'
+ }
+}).use('standalone', {
+ refresh_token: 'refresh-token'
+})
+```
+
+### Browser logging
+
+```javascript
+const PM2IO = require('@pm2/js-api')
+
+let io = new PM2IO({
+ OAUTH_CLIENT_ID: '5413907556',
+ services: {
+ API: 'http://cl1.km.io:3000',
+ OAUTH: 'http://cl1.km.io:3100'
+ }
+}).use('standalone', {
+ refresh_token: 'refresh-token'
+})
+```
+
+## Tasks
+
+```
+# Browserify + Babelify to ES5 (output to ./dist/keymetrics.es5.js)
+$ npm run build
+# Browserify + Babelify + Uglify (output to ./dist/keymetrics.min.js)
+$ npm run dist
+# Generate documentation
+$ npm run doc
+```
+
+## License
+
+Apache 2.0
+
+## Release
+
+## Release
+
+To release a new version, first install [gren](https://github.com/github-tools/github-release-notes) :
+```bash
+yarn global add github-release-notes
+```
+
+Push a commit in github with the new version you want to release :
+```
+git commit -am "version: major|minor|patch bump to X.X.X"
+```
+
+Care for the **versionning**, we use the [semver versioning](https://semver.org/) currently. Please be careful about the version when pushing a new package.
+
+Then tag a version with git :
+```bash
+git tag -s vX.X.X
+```
+
+Push the tag into github (this will trigger the publish to npm) :
+```
+git push origin vX.X.X
+```
+
+To finish update the changelog of the release on github with `gren` (be sure that gren has selected the right tags):
+```
+gren release -o -D commits -u keymetrics -r pm2-io-js-api
+```
diff --git a/node_modules/@pm2/js-api/constants.js b/node_modules/@pm2/js-api/constants.js
new file mode 100644
index 0000000..22d9473
--- /dev/null
+++ b/node_modules/@pm2/js-api/constants.js
@@ -0,0 +1,21 @@
+
+const pkg = require('./package.json')
+
+const config = {
+ headers: {
+ 'X-JS-API-Version': pkg.version
+ },
+ services: {
+ API: 'https://api.keymetrics.io',
+ OAUTH: 'https://id.keymetrics.io'
+ },
+ OAUTH_AUTHORIZE_ENDPOINT: '/api/oauth/authorize',
+ OAUTH_CLIENT_ID: '795984050',
+ ENVIRONNEMENT: process && process.versions && process.versions.node ? 'node' : 'browser',
+ VERSION: pkg.version,
+ // put in debug when using km.io with browser OR when DEBUG=true with nodejs
+ IS_DEBUG: (typeof window !== 'undefined' && window.location.host.match(/km.(io|local)/)) ||
+ (typeof process !== 'undefined' && (process.env.DEBUG === 'true'))
+}
+
+module.exports = Object.assign({}, config)
diff --git a/node_modules/@pm2/js-api/dist/keymetrics.es5.js b/node_modules/@pm2/js-api/dist/keymetrics.es5.js
new file mode 100644
index 0000000..af617fa
--- /dev/null
+++ b/node_modules/@pm2/js-api/dist/keymetrics.es5.js
@@ -0,0 +1,11530 @@
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Keymetrics = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i var fn = async.apply(sys.puts, 'one');
+ * node> fn('two', 'three');
+ * one
+ * two
+ * three
+ */
+var apply = function(fn/*, ...args*/) {
+ var args = slice(arguments, 1);
+ return function(/*callArgs*/) {
+ var callArgs = slice(arguments);
+ return fn.apply(null, args.concat(callArgs));
+ };
+};
+
+var initialParams = function (fn) {
+ return function (/*...args, callback*/) {
+ var args = slice(arguments);
+ var callback = args.pop();
+ fn.call(this, args, callback);
+ };
+};
+
+/**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return value != null && (type == 'object' || type == 'function');
+}
+
+var hasSetImmediate = typeof setImmediate === 'function' && setImmediate;
+var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';
+
+function fallback(fn) {
+ setTimeout(fn, 0);
+}
+
+function wrap(defer) {
+ return function (fn/*, ...args*/) {
+ var args = slice(arguments, 1);
+ defer(function () {
+ fn.apply(null, args);
+ });
+ };
+}
+
+var _defer;
+
+if (hasSetImmediate) {
+ _defer = setImmediate;
+} else if (hasNextTick) {
+ _defer = process.nextTick;
+} else {
+ _defer = fallback;
+}
+
+var setImmediate$1 = wrap(_defer);
+
+/**
+ * Take a sync function and make it async, passing its return value to a
+ * callback. This is useful for plugging sync functions into a waterfall,
+ * series, or other async functions. Any arguments passed to the generated
+ * function will be passed to the wrapped function (except for the final
+ * callback argument). Errors thrown will be passed to the callback.
+ *
+ * If the function passed to `asyncify` returns a Promise, that promises's
+ * resolved/rejected state will be used to call the callback, rather than simply
+ * the synchronous return value.
+ *
+ * This also means you can asyncify ES2017 `async` functions.
+ *
+ * @name asyncify
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @alias wrapSync
+ * @category Util
+ * @param {Function} func - The synchronous function, or Promise-returning
+ * function to convert to an {@link AsyncFunction}.
+ * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be
+ * invoked with `(args..., callback)`.
+ * @example
+ *
+ * // passing a regular synchronous function
+ * async.waterfall([
+ * async.apply(fs.readFile, filename, "utf8"),
+ * async.asyncify(JSON.parse),
+ * function (data, next) {
+ * // data is the result of parsing the text.
+ * // If there was a parsing error, it would have been caught.
+ * }
+ * ], callback);
+ *
+ * // passing a function returning a promise
+ * async.waterfall([
+ * async.apply(fs.readFile, filename, "utf8"),
+ * async.asyncify(function (contents) {
+ * return db.model.create(contents);
+ * }),
+ * function (model, next) {
+ * // `model` is the instantiated model object.
+ * // If there was an error, this function would be skipped.
+ * }
+ * ], callback);
+ *
+ * // es2017 example, though `asyncify` is not needed if your JS environment
+ * // supports async functions out of the box
+ * var q = async.queue(async.asyncify(async function(file) {
+ * var intermediateStep = await processFile(file);
+ * return await somePromise(intermediateStep)
+ * }));
+ *
+ * q.push(files);
+ */
+function asyncify(func) {
+ return initialParams(function (args, callback) {
+ var result;
+ try {
+ result = func.apply(this, args);
+ } catch (e) {
+ return callback(e);
+ }
+ // if result is Promise object
+ if (isObject(result) && typeof result.then === 'function') {
+ result.then(function(value) {
+ invokeCallback(callback, null, value);
+ }, function(err) {
+ invokeCallback(callback, err.message ? err : new Error(err));
+ });
+ } else {
+ callback(null, result);
+ }
+ });
+}
+
+function invokeCallback(callback, error, value) {
+ try {
+ callback(error, value);
+ } catch (e) {
+ setImmediate$1(rethrow, e);
+ }
+}
+
+function rethrow(error) {
+ throw error;
+}
+
+var supportsSymbol = typeof Symbol === 'function';
+
+function isAsync(fn) {
+ return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';
+}
+
+function wrapAsync(asyncFn) {
+ return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn;
+}
+
+function applyEach$1(eachfn) {
+ return function(fns/*, ...args*/) {
+ var args = slice(arguments, 1);
+ var go = initialParams(function(args, callback) {
+ var that = this;
+ return eachfn(fns, function (fn, cb) {
+ wrapAsync(fn).apply(that, args.concat(cb));
+ }, callback);
+ });
+ if (args.length) {
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ };
+}
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
+
+/** Detect free variable `self`. */
+var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+
+/** Used as a reference to the global object. */
+var root = freeGlobal || freeSelf || Function('return this')();
+
+/** Built-in value references. */
+var Symbol$1 = root.Symbol;
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString = objectProto.toString;
+
+/** Built-in value references. */
+var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
+
+/**
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the raw `toStringTag`.
+ */
+function getRawTag(value) {
+ var isOwn = hasOwnProperty.call(value, symToStringTag$1),
+ tag = value[symToStringTag$1];
+
+ try {
+ value[symToStringTag$1] = undefined;
+ var unmasked = true;
+ } catch (e) {}
+
+ var result = nativeObjectToString.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag$1] = tag;
+ } else {
+ delete value[symToStringTag$1];
+ }
+ }
+ return result;
+}
+
+/** Used for built-in method references. */
+var objectProto$1 = Object.prototype;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString$1 = objectProto$1.toString;
+
+/**
+ * Converts `value` to a string using `Object.prototype.toString`.
+ *
+ * @private
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ */
+function objectToString(value) {
+ return nativeObjectToString$1.call(value);
+}
+
+/** `Object#toString` result references. */
+var nullTag = '[object Null]';
+var undefinedTag = '[object Undefined]';
+
+/** Built-in value references. */
+var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
+
+/**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return (symToStringTag && symToStringTag in Object(value))
+ ? getRawTag(value)
+ : objectToString(value);
+}
+
+/** `Object#toString` result references. */
+var asyncTag = '[object AsyncFunction]';
+var funcTag = '[object Function]';
+var genTag = '[object GeneratorFunction]';
+var proxyTag = '[object Proxy]';
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ if (!isObject(value)) {
+ return false;
+ }
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
+ var tag = baseGetTag(value);
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
+}
+
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @example
+ *
+ * _.isLength(3);
+ * // => true
+ *
+ * _.isLength(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isLength(Infinity);
+ * // => false
+ *
+ * _.isLength('3');
+ * // => false
+ */
+function isLength(value) {
+ return typeof value == 'number' &&
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+/**
+ * Checks if `value` is array-like. A value is considered array-like if it's
+ * not a function and has a `value.length` that's an integer greater than or
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ * @example
+ *
+ * _.isArrayLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLike(document.body.children);
+ * // => true
+ *
+ * _.isArrayLike('abc');
+ * // => true
+ *
+ * _.isArrayLike(_.noop);
+ * // => false
+ */
+function isArrayLike(value) {
+ return value != null && isLength(value.length) && !isFunction(value);
+}
+
+// A temporary value used to identify if the loop should be broken.
+// See #1064, #1293
+var breakLoop = {};
+
+/**
+ * This method returns `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.3.0
+ * @category Util
+ * @example
+ *
+ * _.times(2, _.noop);
+ * // => [undefined, undefined]
+ */
+function noop() {
+ // No operation performed.
+}
+
+function once(fn) {
+ return function () {
+ if (fn === null) return;
+ var callFn = fn;
+ fn = null;
+ callFn.apply(this, arguments);
+ };
+}
+
+var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;
+
+var getIterator = function (coll) {
+ return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();
+};
+
+/**
+ * The base implementation of `_.times` without support for iteratee shorthands
+ * or max array length checks.
+ *
+ * @private
+ * @param {number} n The number of times to invoke `iteratee`.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the array of results.
+ */
+function baseTimes(n, iteratee) {
+ var index = -1,
+ result = Array(n);
+
+ while (++index < n) {
+ result[index] = iteratee(index);
+ }
+ return result;
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return value != null && typeof value == 'object';
+}
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]';
+
+/**
+ * The base implementation of `_.isArguments`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ */
+function baseIsArguments(value) {
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
+}
+
+/** Used for built-in method references. */
+var objectProto$3 = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
+
+/** Built-in value references. */
+var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
+
+/**
+ * Checks if `value` is likely an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ * else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
+ return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&
+ !propertyIsEnumerable.call(value, 'callee');
+};
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(document.body.children);
+ * // => false
+ *
+ * _.isArray('abc');
+ * // => false
+ *
+ * _.isArray(_.noop);
+ * // => false
+ */
+var isArray = Array.isArray;
+
+/**
+ * This method returns `false`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.13.0
+ * @category Util
+ * @returns {boolean} Returns `false`.
+ * @example
+ *
+ * _.times(2, _.stubFalse);
+ * // => [false, false]
+ */
+function stubFalse() {
+ return false;
+}
+
+/** Detect free variable `exports`. */
+var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
+
+/** Detect free variable `module`. */
+var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
+
+/** Detect the popular CommonJS extension `module.exports`. */
+var moduleExports = freeModule && freeModule.exports === freeExports;
+
+/** Built-in value references. */
+var Buffer = moduleExports ? root.Buffer : undefined;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
+
+/**
+ * Checks if `value` is a buffer.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
+ * @example
+ *
+ * _.isBuffer(new Buffer(2));
+ * // => true
+ *
+ * _.isBuffer(new Uint8Array(2));
+ * // => false
+ */
+var isBuffer = nativeIsBuffer || stubFalse;
+
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER$1 = 9007199254740991;
+
+/** Used to detect unsigned integer values. */
+var reIsUint = /^(?:0|[1-9]\d*)$/;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ var type = typeof value;
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
+
+ return !!length &&
+ (type == 'number' ||
+ (type != 'symbol' && reIsUint.test(value))) &&
+ (value > -1 && value % 1 == 0 && value < length);
+}
+
+/** `Object#toString` result references. */
+var argsTag$1 = '[object Arguments]';
+var arrayTag = '[object Array]';
+var boolTag = '[object Boolean]';
+var dateTag = '[object Date]';
+var errorTag = '[object Error]';
+var funcTag$1 = '[object Function]';
+var mapTag = '[object Map]';
+var numberTag = '[object Number]';
+var objectTag = '[object Object]';
+var regexpTag = '[object RegExp]';
+var setTag = '[object Set]';
+var stringTag = '[object String]';
+var weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]';
+var dataViewTag = '[object DataView]';
+var float32Tag = '[object Float32Array]';
+var float64Tag = '[object Float64Array]';
+var int8Tag = '[object Int8Array]';
+var int16Tag = '[object Int16Array]';
+var int32Tag = '[object Int32Array]';
+var uint8Tag = '[object Uint8Array]';
+var uint8ClampedTag = '[object Uint8ClampedArray]';
+var uint16Tag = '[object Uint16Array]';
+var uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values of typed arrays. */
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =
+typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
+typedArrayTags[errorTag] = typedArrayTags[funcTag$1] =
+typedArrayTags[mapTag] = typedArrayTags[numberTag] =
+typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
+typedArrayTags[setTag] = typedArrayTags[stringTag] =
+typedArrayTags[weakMapTag] = false;
+
+/**
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ */
+function baseIsTypedArray(value) {
+ return isObjectLike(value) &&
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
+}
+
+/**
+ * The base implementation of `_.unary` without support for storing metadata.
+ *
+ * @private
+ * @param {Function} func The function to cap arguments for.
+ * @returns {Function} Returns the new capped function.
+ */
+function baseUnary(func) {
+ return function(value) {
+ return func(value);
+ };
+}
+
+/** Detect free variable `exports`. */
+var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
+
+/** Detect free variable `module`. */
+var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
+
+/** Detect the popular CommonJS extension `module.exports`. */
+var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
+
+/** Detect free variable `process` from Node.js. */
+var freeProcess = moduleExports$1 && freeGlobal.process;
+
+/** Used to access faster Node.js helpers. */
+var nodeUtil = (function() {
+ try {
+ // Use `util.types` for Node.js 10+.
+ var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;
+
+ if (types) {
+ return types;
+ }
+
+ // Legacy `process.binding('util')` for Node.js < 10.
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
+ } catch (e) {}
+}());
+
+/* Node.js helper references. */
+var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
+
+/** Used for built-in method references. */
+var objectProto$2 = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
+
+/**
+ * Creates an array of the enumerable property names of the array-like `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @param {boolean} inherited Specify returning inherited property names.
+ * @returns {Array} Returns the array of property names.
+ */
+function arrayLikeKeys(value, inherited) {
+ var isArr = isArray(value),
+ isArg = !isArr && isArguments(value),
+ isBuff = !isArr && !isArg && isBuffer(value),
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
+ skipIndexes = isArr || isArg || isBuff || isType,
+ result = skipIndexes ? baseTimes(value.length, String) : [],
+ length = result.length;
+
+ for (var key in value) {
+ if ((inherited || hasOwnProperty$1.call(value, key)) &&
+ !(skipIndexes && (
+ // Safari 9 has enumerable `arguments.length` in strict mode.
+ key == 'length' ||
+ // Node.js 0.10 has enumerable non-index properties on buffers.
+ (isBuff && (key == 'offset' || key == 'parent')) ||
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
+ // Skip index properties.
+ isIndex(key, length)
+ ))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+/** Used for built-in method references. */
+var objectProto$5 = Object.prototype;
+
+/**
+ * Checks if `value` is likely a prototype object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
+ */
+function isPrototype(value) {
+ var Ctor = value && value.constructor,
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;
+
+ return value === proto;
+}
+
+/**
+ * Creates a unary function that invokes `func` with its argument transformed.
+ *
+ * @private
+ * @param {Function} func The function to wrap.
+ * @param {Function} transform The argument transform.
+ * @returns {Function} Returns the new function.
+ */
+function overArg(func, transform) {
+ return function(arg) {
+ return func(transform(arg));
+ };
+}
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeKeys = overArg(Object.keys, Object);
+
+/** Used for built-in method references. */
+var objectProto$4 = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
+
+/**
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function baseKeys(object) {
+ if (!isPrototype(object)) {
+ return nativeKeys(object);
+ }
+ var result = [];
+ for (var key in Object(object)) {
+ if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+function keys(object) {
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
+}
+
+function createArrayIterator(coll) {
+ var i = -1;
+ var len = coll.length;
+ return function next() {
+ return ++i < len ? {value: coll[i], key: i} : null;
+ }
+}
+
+function createES2015Iterator(iterator) {
+ var i = -1;
+ return function next() {
+ var item = iterator.next();
+ if (item.done)
+ return null;
+ i++;
+ return {value: item.value, key: i};
+ }
+}
+
+function createObjectIterator(obj) {
+ var okeys = keys(obj);
+ var i = -1;
+ var len = okeys.length;
+ return function next() {
+ var key = okeys[++i];
+ if (key === '__proto__') {
+ return next();
+ }
+ return i < len ? {value: obj[key], key: key} : null;
+ };
+}
+
+function iterator(coll) {
+ if (isArrayLike(coll)) {
+ return createArrayIterator(coll);
+ }
+
+ var iterator = getIterator(coll);
+ return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);
+}
+
+function onlyOnce(fn) {
+ return function() {
+ if (fn === null) throw new Error("Callback was already called.");
+ var callFn = fn;
+ fn = null;
+ callFn.apply(this, arguments);
+ };
+}
+
+function _eachOfLimit(limit) {
+ return function (obj, iteratee, callback) {
+ callback = once(callback || noop);
+ if (limit <= 0 || !obj) {
+ return callback(null);
+ }
+ var nextElem = iterator(obj);
+ var done = false;
+ var running = 0;
+ var looping = false;
+
+ function iterateeCallback(err, value) {
+ running -= 1;
+ if (err) {
+ done = true;
+ callback(err);
+ }
+ else if (value === breakLoop || (done && running <= 0)) {
+ done = true;
+ return callback(null);
+ }
+ else if (!looping) {
+ replenish();
+ }
+ }
+
+ function replenish () {
+ looping = true;
+ while (running < limit && !done) {
+ var elem = nextElem();
+ if (elem === null) {
+ done = true;
+ if (running <= 0) {
+ callback(null);
+ }
+ return;
+ }
+ running += 1;
+ iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));
+ }
+ looping = false;
+ }
+
+ replenish();
+ };
+}
+
+/**
+ * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name eachOfLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.eachOf]{@link module:Collections.eachOf}
+ * @alias forEachOfLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`. The `key` is the item's key, or index in the case of an
+ * array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachOfLimit(coll, limit, iteratee, callback) {
+ _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback);
+}
+
+function doLimit(fn, limit) {
+ return function (iterable, iteratee, callback) {
+ return fn(iterable, limit, iteratee, callback);
+ };
+}
+
+// eachOf implementation optimized for array-likes
+function eachOfArrayLike(coll, iteratee, callback) {
+ callback = once(callback || noop);
+ var index = 0,
+ completed = 0,
+ length = coll.length;
+ if (length === 0) {
+ callback(null);
+ }
+
+ function iteratorCallback(err, value) {
+ if (err) {
+ callback(err);
+ } else if ((++completed === length) || value === breakLoop) {
+ callback(null);
+ }
+ }
+
+ for (; index < length; index++) {
+ iteratee(coll[index], index, onlyOnce(iteratorCallback));
+ }
+}
+
+// a generic version of eachOf which can handle array, object, and iterator cases.
+var eachOfGeneric = doLimit(eachOfLimit, Infinity);
+
+/**
+ * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument
+ * to the iteratee.
+ *
+ * @name eachOf
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEachOf
+ * @category Collection
+ * @see [async.each]{@link module:Collections.each}
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each
+ * item in `coll`.
+ * The `key` is the item's key, or index in the case of an array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+ * var configs = {};
+ *
+ * async.forEachOf(obj, function (value, key, callback) {
+ * fs.readFile(__dirname + value, "utf8", function (err, data) {
+ * if (err) return callback(err);
+ * try {
+ * configs[key] = JSON.parse(data);
+ * } catch (e) {
+ * return callback(e);
+ * }
+ * callback();
+ * });
+ * }, function (err) {
+ * if (err) console.error(err.message);
+ * // configs is now a map of JSON data
+ * doSomethingWith(configs);
+ * });
+ */
+var eachOf = function(coll, iteratee, callback) {
+ var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;
+ eachOfImplementation(coll, wrapAsync(iteratee), callback);
+};
+
+function doParallel(fn) {
+ return function (obj, iteratee, callback) {
+ return fn(eachOf, obj, wrapAsync(iteratee), callback);
+ };
+}
+
+function _asyncMap(eachfn, arr, iteratee, callback) {
+ callback = callback || noop;
+ arr = arr || [];
+ var results = [];
+ var counter = 0;
+ var _iteratee = wrapAsync(iteratee);
+
+ eachfn(arr, function (value, _, callback) {
+ var index = counter++;
+ _iteratee(value, function (err, v) {
+ results[index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+}
+
+/**
+ * Produces a new collection of values by mapping each value in `coll` through
+ * the `iteratee` function. The `iteratee` is called with an item from `coll`
+ * and a callback for when it has finished processing. Each of these callback
+ * takes 2 arguments: an `error`, and the transformed item from `coll`. If
+ * `iteratee` passes an error to its callback, the main `callback` (for the
+ * `map` function) is immediately called with the error.
+ *
+ * Note, that since this function applies the `iteratee` to each item in
+ * parallel, there is no guarantee that the `iteratee` functions will complete
+ * in order. However, the results array will be in the same order as the
+ * original `coll`.
+ *
+ * If `map` is passed an Object, the results will be an Array. The results
+ * will roughly be in the order of the original Objects' keys (but this can
+ * vary across JavaScript engines).
+ *
+ * @name map
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with the transformed item.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Results is an Array of the
+ * transformed items from the `coll`. Invoked with (err, results).
+ * @example
+ *
+ * async.map(['file1','file2','file3'], fs.stat, function(err, results) {
+ * // results is now an array of stats for each file
+ * });
+ */
+var map = doParallel(_asyncMap);
+
+/**
+ * Applies the provided arguments to each function in the array, calling
+ * `callback` after all functions have completed. If you only provide the first
+ * argument, `fns`, then it will return a function which lets you pass in the
+ * arguments as if it were a single function call. If more arguments are
+ * provided, `callback` is required while `args` is still optional.
+ *
+ * @name applyEach
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s
+ * to all call with the same arguments
+ * @param {...*} [args] - any number of separate arguments to pass to the
+ * function.
+ * @param {Function} [callback] - the final argument should be the callback,
+ * called when all functions have completed processing.
+ * @returns {Function} - If only the first argument, `fns`, is provided, it will
+ * return a function which lets you pass in the arguments as if it were a single
+ * function call. The signature is `(..args, callback)`. If invoked with any
+ * arguments, `callback` is required.
+ * @example
+ *
+ * async.applyEach([enableSearch, updateSchema], 'bucket', callback);
+ *
+ * // partial application example:
+ * async.each(
+ * buckets,
+ * async.applyEach([enableSearch, updateSchema]),
+ * callback
+ * );
+ */
+var applyEach = applyEach$1(map);
+
+function doParallelLimit(fn) {
+ return function (obj, limit, iteratee, callback) {
+ return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback);
+ };
+}
+
+/**
+ * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name mapLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.map]{@link module:Collections.map}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with the transformed item.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Results is an array of the
+ * transformed items from the `coll`. Invoked with (err, results).
+ */
+var mapLimit = doParallelLimit(_asyncMap);
+
+/**
+ * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.
+ *
+ * @name mapSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.map]{@link module:Collections.map}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with the transformed item.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Results is an array of the
+ * transformed items from the `coll`. Invoked with (err, results).
+ */
+var mapSeries = doLimit(mapLimit, 1);
+
+/**
+ * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.
+ *
+ * @name applyEachSeries
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.applyEach]{@link module:ControlFlow.applyEach}
+ * @category Control Flow
+ * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all
+ * call with the same arguments
+ * @param {...*} [args] - any number of separate arguments to pass to the
+ * function.
+ * @param {Function} [callback] - the final argument should be the callback,
+ * called when all functions have completed processing.
+ * @returns {Function} - If only the first argument is provided, it will return
+ * a function which lets you pass in the arguments as if it were a single
+ * function call.
+ */
+var applyEachSeries = applyEach$1(mapSeries);
+
+/**
+ * A specialized version of `_.forEach` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+}
+
+/**
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var index = -1,
+ iterable = Object(object),
+ props = keysFunc(object),
+ length = props.length;
+
+ while (length--) {
+ var key = props[fromRight ? length : ++index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+
+/**
+ * The base implementation of `baseForOwn` which iterates over `object`
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseFor = createBaseFor();
+
+/**
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwn(object, iteratee) {
+ return object && baseFor(object, iteratee, keys);
+}
+
+/**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseFindIndex(array, predicate, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 1 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+/**
+ * The base implementation of `_.isNaN` without support for number objects.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
+ */
+function baseIsNaN(value) {
+ return value !== value;
+}
+
+/**
+ * A specialized version of `_.indexOf` which performs strict equality
+ * comparisons of values, i.e. `===`.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function strictIndexOf(array, value, fromIndex) {
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+/**
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOf(array, value, fromIndex) {
+ return value === value
+ ? strictIndexOf(array, value, fromIndex)
+ : baseFindIndex(array, baseIsNaN, fromIndex);
+}
+
+/**
+ * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on
+ * their requirements. Each function can optionally depend on other functions
+ * being completed first, and each function is run as soon as its requirements
+ * are satisfied.
+ *
+ * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence
+ * will stop. Further tasks will not execute (so any other functions depending
+ * on it will not run), and the main `callback` is immediately called with the
+ * error.
+ *
+ * {@link AsyncFunction}s also receive an object containing the results of functions which
+ * have completed so far as the first argument, if they have dependencies. If a
+ * task function has no dependencies, it will only be passed a callback.
+ *
+ * @name auto
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Object} tasks - An object. Each of its properties is either a
+ * function or an array of requirements, with the {@link AsyncFunction} itself the last item
+ * in the array. The object's key of a property serves as the name of the task
+ * defined by that property, i.e. can be used when specifying requirements for
+ * other tasks. The function receives one or two arguments:
+ * * a `results` object, containing the results of the previously executed
+ * functions, only passed if the task has any dependencies,
+ * * a `callback(err, result)` function, which must be called when finished,
+ * passing an `error` (which can be `null`) and the result of the function's
+ * execution.
+ * @param {number} [concurrency=Infinity] - An optional `integer` for
+ * determining the maximum number of tasks that can be run in parallel. By
+ * default, as many as possible.
+ * @param {Function} [callback] - An optional callback which is called when all
+ * the tasks have been completed. It receives the `err` argument if any `tasks`
+ * pass an error to their callback. Results are always returned; however, if an
+ * error occurs, no further `tasks` will be performed, and the results object
+ * will only contain partial results. Invoked with (err, results).
+ * @returns undefined
+ * @example
+ *
+ * async.auto({
+ * // this function will just be passed a callback
+ * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),
+ * showData: ['readData', function(results, cb) {
+ * // results.readData is the file's contents
+ * // ...
+ * }]
+ * }, callback);
+ *
+ * async.auto({
+ * get_data: function(callback) {
+ * console.log('in get_data');
+ * // async code to get some data
+ * callback(null, 'data', 'converted to array');
+ * },
+ * make_folder: function(callback) {
+ * console.log('in make_folder');
+ * // async code to create a directory to store a file in
+ * // this is run at the same time as getting the data
+ * callback(null, 'folder');
+ * },
+ * write_file: ['get_data', 'make_folder', function(results, callback) {
+ * console.log('in write_file', JSON.stringify(results));
+ * // once there is some data and the directory exists,
+ * // write the data to a file in the directory
+ * callback(null, 'filename');
+ * }],
+ * email_link: ['write_file', function(results, callback) {
+ * console.log('in email_link', JSON.stringify(results));
+ * // once the file is written let's email a link to it...
+ * // results.write_file contains the filename returned by write_file.
+ * callback(null, {'file':results.write_file, 'email':'user@example.com'});
+ * }]
+ * }, function(err, results) {
+ * console.log('err = ', err);
+ * console.log('results = ', results);
+ * });
+ */
+var auto = function (tasks, concurrency, callback) {
+ if (typeof concurrency === 'function') {
+ // concurrency is optional, shift the args.
+ callback = concurrency;
+ concurrency = null;
+ }
+ callback = once(callback || noop);
+ var keys$$1 = keys(tasks);
+ var numTasks = keys$$1.length;
+ if (!numTasks) {
+ return callback(null);
+ }
+ if (!concurrency) {
+ concurrency = numTasks;
+ }
+
+ var results = {};
+ var runningTasks = 0;
+ var hasError = false;
+
+ var listeners = Object.create(null);
+
+ var readyTasks = [];
+
+ // for cycle detection:
+ var readyToCheck = []; // tasks that have been identified as reachable
+ // without the possibility of returning to an ancestor task
+ var uncheckedDependencies = {};
+
+ baseForOwn(tasks, function (task, key) {
+ if (!isArray(task)) {
+ // no dependencies
+ enqueueTask(key, [task]);
+ readyToCheck.push(key);
+ return;
+ }
+
+ var dependencies = task.slice(0, task.length - 1);
+ var remainingDependencies = dependencies.length;
+ if (remainingDependencies === 0) {
+ enqueueTask(key, task);
+ readyToCheck.push(key);
+ return;
+ }
+ uncheckedDependencies[key] = remainingDependencies;
+
+ arrayEach(dependencies, function (dependencyName) {
+ if (!tasks[dependencyName]) {
+ throw new Error('async.auto task `' + key +
+ '` has a non-existent dependency `' +
+ dependencyName + '` in ' +
+ dependencies.join(', '));
+ }
+ addListener(dependencyName, function () {
+ remainingDependencies--;
+ if (remainingDependencies === 0) {
+ enqueueTask(key, task);
+ }
+ });
+ });
+ });
+
+ checkForDeadlocks();
+ processQueue();
+
+ function enqueueTask(key, task) {
+ readyTasks.push(function () {
+ runTask(key, task);
+ });
+ }
+
+ function processQueue() {
+ if (readyTasks.length === 0 && runningTasks === 0) {
+ return callback(null, results);
+ }
+ while(readyTasks.length && runningTasks < concurrency) {
+ var run = readyTasks.shift();
+ run();
+ }
+
+ }
+
+ function addListener(taskName, fn) {
+ var taskListeners = listeners[taskName];
+ if (!taskListeners) {
+ taskListeners = listeners[taskName] = [];
+ }
+
+ taskListeners.push(fn);
+ }
+
+ function taskComplete(taskName) {
+ var taskListeners = listeners[taskName] || [];
+ arrayEach(taskListeners, function (fn) {
+ fn();
+ });
+ processQueue();
+ }
+
+
+ function runTask(key, task) {
+ if (hasError) return;
+
+ var taskCallback = onlyOnce(function(err, result) {
+ runningTasks--;
+ if (arguments.length > 2) {
+ result = slice(arguments, 1);
+ }
+ if (err) {
+ var safeResults = {};
+ baseForOwn(results, function(val, rkey) {
+ safeResults[rkey] = val;
+ });
+ safeResults[key] = result;
+ hasError = true;
+ listeners = Object.create(null);
+
+ callback(err, safeResults);
+ } else {
+ results[key] = result;
+ taskComplete(key);
+ }
+ });
+
+ runningTasks++;
+ var taskFn = wrapAsync(task[task.length - 1]);
+ if (task.length > 1) {
+ taskFn(results, taskCallback);
+ } else {
+ taskFn(taskCallback);
+ }
+ }
+
+ function checkForDeadlocks() {
+ // Kahn's algorithm
+ // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm
+ // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html
+ var currentTask;
+ var counter = 0;
+ while (readyToCheck.length) {
+ currentTask = readyToCheck.pop();
+ counter++;
+ arrayEach(getDependents(currentTask), function (dependent) {
+ if (--uncheckedDependencies[dependent] === 0) {
+ readyToCheck.push(dependent);
+ }
+ });
+ }
+
+ if (counter !== numTasks) {
+ throw new Error(
+ 'async.auto cannot execute tasks due to a recursive dependency'
+ );
+ }
+ }
+
+ function getDependents(taskName) {
+ var result = [];
+ baseForOwn(tasks, function (task, key) {
+ if (isArray(task) && baseIndexOf(task, taskName, 0) >= 0) {
+ result.push(key);
+ }
+ });
+ return result;
+ }
+};
+
+/**
+ * A specialized version of `_.map` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+/** `Object#toString` result references. */
+var symbolTag = '[object Symbol]';
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
+}
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined;
+var symbolToString = symbolProto ? symbolProto.toString : undefined;
+
+/**
+ * The base implementation of `_.toString` which doesn't convert nullish
+ * values to empty strings.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+ if (isArray(value)) {
+ // Recursively convert values (susceptible to call stack limits).
+ return arrayMap(value, baseToString) + '';
+ }
+ if (isSymbol(value)) {
+ return symbolToString ? symbolToString.call(value) : '';
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
+
+/**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = end > length ? length : end;
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : ((end - start) >>> 0);
+ start >>>= 0;
+
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+}
+
+/**
+ * Casts `array` to a slice if it's needed.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {number} start The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the cast slice.
+ */
+function castSlice(array, start, end) {
+ var length = array.length;
+ end = end === undefined ? length : end;
+ return (!start && end >= length) ? array : baseSlice(array, start, end);
+}
+
+/**
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
+ * that is not found in the character symbols.
+ *
+ * @private
+ * @param {Array} strSymbols The string symbols to inspect.
+ * @param {Array} chrSymbols The character symbols to find.
+ * @returns {number} Returns the index of the last unmatched string symbol.
+ */
+function charsEndIndex(strSymbols, chrSymbols) {
+ var index = strSymbols.length;
+
+ while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
+ return index;
+}
+
+/**
+ * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
+ * that is not found in the character symbols.
+ *
+ * @private
+ * @param {Array} strSymbols The string symbols to inspect.
+ * @param {Array} chrSymbols The character symbols to find.
+ * @returns {number} Returns the index of the first unmatched string symbol.
+ */
+function charsStartIndex(strSymbols, chrSymbols) {
+ var index = -1,
+ length = strSymbols.length;
+
+ while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
+ return index;
+}
+
+/**
+ * Converts an ASCII `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */
+function asciiToArray(string) {
+ return string.split('');
+}
+
+/** Used to compose unicode character classes. */
+var rsAstralRange = '\\ud800-\\udfff';
+var rsComboMarksRange = '\\u0300-\\u036f';
+var reComboHalfMarksRange = '\\ufe20-\\ufe2f';
+var rsComboSymbolsRange = '\\u20d0-\\u20ff';
+var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
+var rsVarRange = '\\ufe0e\\ufe0f';
+
+/** Used to compose unicode capture groups. */
+var rsZWJ = '\\u200d';
+
+/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
+var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
+
+/**
+ * Checks if `string` contains Unicode symbols.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {boolean} Returns `true` if a symbol is found, else `false`.
+ */
+function hasUnicode(string) {
+ return reHasUnicode.test(string);
+}
+
+/** Used to compose unicode character classes. */
+var rsAstralRange$1 = '\\ud800-\\udfff';
+var rsComboMarksRange$1 = '\\u0300-\\u036f';
+var reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f';
+var rsComboSymbolsRange$1 = '\\u20d0-\\u20ff';
+var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
+var rsVarRange$1 = '\\ufe0e\\ufe0f';
+
+/** Used to compose unicode capture groups. */
+var rsAstral = '[' + rsAstralRange$1 + ']';
+var rsCombo = '[' + rsComboRange$1 + ']';
+var rsFitz = '\\ud83c[\\udffb-\\udfff]';
+var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')';
+var rsNonAstral = '[^' + rsAstralRange$1 + ']';
+var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}';
+var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]';
+var rsZWJ$1 = '\\u200d';
+
+/** Used to compose unicode regexes. */
+var reOptMod = rsModifier + '?';
+var rsOptVar = '[' + rsVarRange$1 + ']?';
+var rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*';
+var rsSeq = rsOptVar + reOptMod + rsOptJoin;
+var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
+
+/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
+var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
+
+/**
+ * Converts a Unicode `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */
+function unicodeToArray(string) {
+ return string.match(reUnicode) || [];
+}
+
+/**
+ * Converts `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */
+function stringToArray(string) {
+ return hasUnicode(string)
+ ? unicodeToArray(string)
+ : asciiToArray(string);
+}
+
+/**
+ * Converts `value` to a string. An empty string is returned for `null`
+ * and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+ return value == null ? '' : baseToString(value);
+}
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/**
+ * Removes leading and trailing whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trim(' abc ');
+ * // => 'abc'
+ *
+ * _.trim('-_-abc-_-', '_-');
+ * // => 'abc'
+ *
+ * _.map([' foo ', ' bar '], _.trim);
+ * // => ['foo', 'bar']
+ */
+function trim(string, chars, guard) {
+ string = toString(string);
+ if (string && (guard || chars === undefined)) {
+ return string.replace(reTrim, '');
+ }
+ if (!string || !(chars = baseToString(chars))) {
+ return string;
+ }
+ var strSymbols = stringToArray(string),
+ chrSymbols = stringToArray(chars),
+ start = charsStartIndex(strSymbols, chrSymbols),
+ end = charsEndIndex(strSymbols, chrSymbols) + 1;
+
+ return castSlice(strSymbols, start, end).join('');
+}
+
+var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m;
+var FN_ARG_SPLIT = /,/;
+var FN_ARG = /(=.+)?(\s*)$/;
+var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
+
+function parseParams(func) {
+ func = func.toString().replace(STRIP_COMMENTS, '');
+ func = func.match(FN_ARGS)[2].replace(' ', '');
+ func = func ? func.split(FN_ARG_SPLIT) : [];
+ func = func.map(function (arg){
+ return trim(arg.replace(FN_ARG, ''));
+ });
+ return func;
+}
+
+/**
+ * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent
+ * tasks are specified as parameters to the function, after the usual callback
+ * parameter, with the parameter names matching the names of the tasks it
+ * depends on. This can provide even more readable task graphs which can be
+ * easier to maintain.
+ *
+ * If a final callback is specified, the task results are similarly injected,
+ * specified as named parameters after the initial error parameter.
+ *
+ * The autoInject function is purely syntactic sugar and its semantics are
+ * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.
+ *
+ * @name autoInject
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.auto]{@link module:ControlFlow.auto}
+ * @category Control Flow
+ * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of
+ * the form 'func([dependencies...], callback). The object's key of a property
+ * serves as the name of the task defined by that property, i.e. can be used
+ * when specifying requirements for other tasks.
+ * * The `callback` parameter is a `callback(err, result)` which must be called
+ * when finished, passing an `error` (which can be `null`) and the result of
+ * the function's execution. The remaining parameters name other tasks on
+ * which the task is dependent, and the results from those tasks are the
+ * arguments of those parameters.
+ * @param {Function} [callback] - An optional callback which is called when all
+ * the tasks have been completed. It receives the `err` argument if any `tasks`
+ * pass an error to their callback, and a `results` object with any completed
+ * task results, similar to `auto`.
+ * @example
+ *
+ * // The example from `auto` can be rewritten as follows:
+ * async.autoInject({
+ * get_data: function(callback) {
+ * // async code to get some data
+ * callback(null, 'data', 'converted to array');
+ * },
+ * make_folder: function(callback) {
+ * // async code to create a directory to store a file in
+ * // this is run at the same time as getting the data
+ * callback(null, 'folder');
+ * },
+ * write_file: function(get_data, make_folder, callback) {
+ * // once there is some data and the directory exists,
+ * // write the data to a file in the directory
+ * callback(null, 'filename');
+ * },
+ * email_link: function(write_file, callback) {
+ * // once the file is written let's email a link to it...
+ * // write_file contains the filename returned by write_file.
+ * callback(null, {'file':write_file, 'email':'user@example.com'});
+ * }
+ * }, function(err, results) {
+ * console.log('err = ', err);
+ * console.log('email_link = ', results.email_link);
+ * });
+ *
+ * // If you are using a JS minifier that mangles parameter names, `autoInject`
+ * // will not work with plain functions, since the parameter names will be
+ * // collapsed to a single letter identifier. To work around this, you can
+ * // explicitly specify the names of the parameters your task function needs
+ * // in an array, similar to Angular.js dependency injection.
+ *
+ * // This still has an advantage over plain `auto`, since the results a task
+ * // depends on are still spread into arguments.
+ * async.autoInject({
+ * //...
+ * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {
+ * callback(null, 'filename');
+ * }],
+ * email_link: ['write_file', function(write_file, callback) {
+ * callback(null, {'file':write_file, 'email':'user@example.com'});
+ * }]
+ * //...
+ * }, function(err, results) {
+ * console.log('err = ', err);
+ * console.log('email_link = ', results.email_link);
+ * });
+ */
+function autoInject(tasks, callback) {
+ var newTasks = {};
+
+ baseForOwn(tasks, function (taskFn, key) {
+ var params;
+ var fnIsAsync = isAsync(taskFn);
+ var hasNoDeps =
+ (!fnIsAsync && taskFn.length === 1) ||
+ (fnIsAsync && taskFn.length === 0);
+
+ if (isArray(taskFn)) {
+ params = taskFn.slice(0, -1);
+ taskFn = taskFn[taskFn.length - 1];
+
+ newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);
+ } else if (hasNoDeps) {
+ // no dependencies, use the function as-is
+ newTasks[key] = taskFn;
+ } else {
+ params = parseParams(taskFn);
+ if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {
+ throw new Error("autoInject task functions require explicit parameters.");
+ }
+
+ // remove callback param
+ if (!fnIsAsync) params.pop();
+
+ newTasks[key] = params.concat(newTask);
+ }
+
+ function newTask(results, taskCb) {
+ var newArgs = arrayMap(params, function (name) {
+ return results[name];
+ });
+ newArgs.push(taskCb);
+ wrapAsync(taskFn).apply(null, newArgs);
+ }
+ });
+
+ auto(newTasks, callback);
+}
+
+// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation
+// used for queues. This implementation assumes that the node provided by the user can be modified
+// to adjust the next and last properties. We implement only the minimal functionality
+// for queue support.
+function DLL() {
+ this.head = this.tail = null;
+ this.length = 0;
+}
+
+function setInitial(dll, node) {
+ dll.length = 1;
+ dll.head = dll.tail = node;
+}
+
+DLL.prototype.removeLink = function(node) {
+ if (node.prev) node.prev.next = node.next;
+ else this.head = node.next;
+ if (node.next) node.next.prev = node.prev;
+ else this.tail = node.prev;
+
+ node.prev = node.next = null;
+ this.length -= 1;
+ return node;
+};
+
+DLL.prototype.empty = function () {
+ while(this.head) this.shift();
+ return this;
+};
+
+DLL.prototype.insertAfter = function(node, newNode) {
+ newNode.prev = node;
+ newNode.next = node.next;
+ if (node.next) node.next.prev = newNode;
+ else this.tail = newNode;
+ node.next = newNode;
+ this.length += 1;
+};
+
+DLL.prototype.insertBefore = function(node, newNode) {
+ newNode.prev = node.prev;
+ newNode.next = node;
+ if (node.prev) node.prev.next = newNode;
+ else this.head = newNode;
+ node.prev = newNode;
+ this.length += 1;
+};
+
+DLL.prototype.unshift = function(node) {
+ if (this.head) this.insertBefore(this.head, node);
+ else setInitial(this, node);
+};
+
+DLL.prototype.push = function(node) {
+ if (this.tail) this.insertAfter(this.tail, node);
+ else setInitial(this, node);
+};
+
+DLL.prototype.shift = function() {
+ return this.head && this.removeLink(this.head);
+};
+
+DLL.prototype.pop = function() {
+ return this.tail && this.removeLink(this.tail);
+};
+
+DLL.prototype.toArray = function () {
+ var arr = Array(this.length);
+ var curr = this.head;
+ for(var idx = 0; idx < this.length; idx++) {
+ arr[idx] = curr.data;
+ curr = curr.next;
+ }
+ return arr;
+};
+
+DLL.prototype.remove = function (testFn) {
+ var curr = this.head;
+ while(!!curr) {
+ var next = curr.next;
+ if (testFn(curr)) {
+ this.removeLink(curr);
+ }
+ curr = next;
+ }
+ return this;
+};
+
+function queue(worker, concurrency, payload) {
+ if (concurrency == null) {
+ concurrency = 1;
+ }
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+
+ var _worker = wrapAsync(worker);
+ var numRunning = 0;
+ var workersList = [];
+
+ var processingScheduled = false;
+ function _insert(data, insertAtFront, callback) {
+ if (callback != null && typeof callback !== 'function') {
+ throw new Error('task callback must be a function');
+ }
+ q.started = true;
+ if (!isArray(data)) {
+ data = [data];
+ }
+ if (data.length === 0 && q.idle()) {
+ // call drain immediately if there are no tasks
+ return setImmediate$1(function() {
+ q.drain();
+ });
+ }
+
+ for (var i = 0, l = data.length; i < l; i++) {
+ var item = {
+ data: data[i],
+ callback: callback || noop
+ };
+
+ if (insertAtFront) {
+ q._tasks.unshift(item);
+ } else {
+ q._tasks.push(item);
+ }
+ }
+
+ if (!processingScheduled) {
+ processingScheduled = true;
+ setImmediate$1(function() {
+ processingScheduled = false;
+ q.process();
+ });
+ }
+ }
+
+ function _next(tasks) {
+ return function(err){
+ numRunning -= 1;
+
+ for (var i = 0, l = tasks.length; i < l; i++) {
+ var task = tasks[i];
+
+ var index = baseIndexOf(workersList, task, 0);
+ if (index === 0) {
+ workersList.shift();
+ } else if (index > 0) {
+ workersList.splice(index, 1);
+ }
+
+ task.callback.apply(task, arguments);
+
+ if (err != null) {
+ q.error(err, task.data);
+ }
+ }
+
+ if (numRunning <= (q.concurrency - q.buffer) ) {
+ q.unsaturated();
+ }
+
+ if (q.idle()) {
+ q.drain();
+ }
+ q.process();
+ };
+ }
+
+ var isProcessing = false;
+ var q = {
+ _tasks: new DLL(),
+ concurrency: concurrency,
+ payload: payload,
+ saturated: noop,
+ unsaturated:noop,
+ buffer: concurrency / 4,
+ empty: noop,
+ drain: noop,
+ error: noop,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(data, false, callback);
+ },
+ kill: function () {
+ q.drain = noop;
+ q._tasks.empty();
+ },
+ unshift: function (data, callback) {
+ _insert(data, true, callback);
+ },
+ remove: function (testFn) {
+ q._tasks.remove(testFn);
+ },
+ process: function () {
+ // Avoid trying to start too many processing operations. This can occur
+ // when callbacks resolve synchronously (#1267).
+ if (isProcessing) {
+ return;
+ }
+ isProcessing = true;
+ while(!q.paused && numRunning < q.concurrency && q._tasks.length){
+ var tasks = [], data = [];
+ var l = q._tasks.length;
+ if (q.payload) l = Math.min(l, q.payload);
+ for (var i = 0; i < l; i++) {
+ var node = q._tasks.shift();
+ tasks.push(node);
+ workersList.push(node);
+ data.push(node.data);
+ }
+
+ numRunning += 1;
+
+ if (q._tasks.length === 0) {
+ q.empty();
+ }
+
+ if (numRunning === q.concurrency) {
+ q.saturated();
+ }
+
+ var cb = onlyOnce(_next(tasks));
+ _worker(data, cb);
+ }
+ isProcessing = false;
+ },
+ length: function () {
+ return q._tasks.length;
+ },
+ running: function () {
+ return numRunning;
+ },
+ workersList: function () {
+ return workersList;
+ },
+ idle: function() {
+ return q._tasks.length + numRunning === 0;
+ },
+ pause: function () {
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ setImmediate$1(q.process);
+ }
+ };
+ return q;
+}
+
+/**
+ * A cargo of tasks for the worker function to complete. Cargo inherits all of
+ * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}.
+ * @typedef {Object} CargoObject
+ * @memberOf module:ControlFlow
+ * @property {Function} length - A function returning the number of items
+ * waiting to be processed. Invoke like `cargo.length()`.
+ * @property {number} payload - An `integer` for determining how many tasks
+ * should be process per round. This property can be changed after a `cargo` is
+ * created to alter the payload on-the-fly.
+ * @property {Function} push - Adds `task` to the `queue`. The callback is
+ * called once the `worker` has finished processing the task. Instead of a
+ * single task, an array of `tasks` can be submitted. The respective callback is
+ * used for every task in the list. Invoke like `cargo.push(task, [callback])`.
+ * @property {Function} saturated - A callback that is called when the
+ * `queue.length()` hits the concurrency and further tasks will be queued.
+ * @property {Function} empty - A callback that is called when the last item
+ * from the `queue` is given to a `worker`.
+ * @property {Function} drain - A callback that is called when the last item
+ * from the `queue` has returned from the `worker`.
+ * @property {Function} idle - a function returning false if there are items
+ * waiting or being processed, or true if not. Invoke like `cargo.idle()`.
+ * @property {Function} pause - a function that pauses the processing of tasks
+ * until `resume()` is called. Invoke like `cargo.pause()`.
+ * @property {Function} resume - a function that resumes the processing of
+ * queued tasks when the queue is paused. Invoke like `cargo.resume()`.
+ * @property {Function} kill - a function that removes the `drain` callback and
+ * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`.
+ */
+
+/**
+ * Creates a `cargo` object with the specified payload. Tasks added to the
+ * cargo will be processed altogether (up to the `payload` limit). If the
+ * `worker` is in progress, the task is queued until it becomes available. Once
+ * the `worker` has completed some tasks, each callback of those tasks is
+ * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)
+ * for how `cargo` and `queue` work.
+ *
+ * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers
+ * at a time, cargo passes an array of tasks to a single worker, repeating
+ * when the worker is finished.
+ *
+ * @name cargo
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.queue]{@link module:ControlFlow.queue}
+ * @category Control Flow
+ * @param {AsyncFunction} worker - An asynchronous function for processing an array
+ * of queued tasks. Invoked with `(tasks, callback)`.
+ * @param {number} [payload=Infinity] - An optional `integer` for determining
+ * how many tasks should be processed per round; if omitted, the default is
+ * unlimited.
+ * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can
+ * attached as certain properties to listen for specific events during the
+ * lifecycle of the cargo and inner queue.
+ * @example
+ *
+ * // create a cargo object with payload 2
+ * var cargo = async.cargo(function(tasks, callback) {
+ * for (var i=0; i true
+ */
+function identity(value) {
+ return value;
+}
+
+function _createTester(check, getResult) {
+ return function(eachfn, arr, iteratee, cb) {
+ cb = cb || noop;
+ var testPassed = false;
+ var testResult;
+ eachfn(arr, function(value, _, callback) {
+ iteratee(value, function(err, result) {
+ if (err) {
+ callback(err);
+ } else if (check(result) && !testResult) {
+ testPassed = true;
+ testResult = getResult(true, value);
+ callback(null, breakLoop);
+ } else {
+ callback();
+ }
+ });
+ }, function(err) {
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, testPassed ? testResult : getResult(false));
+ }
+ });
+ };
+}
+
+function _findGetResult(v, x) {
+ return x;
+}
+
+/**
+ * Returns the first value in `coll` that passes an async truth test. The
+ * `iteratee` is applied in parallel, meaning the first iteratee to return
+ * `true` will fire the detect `callback` with that result. That means the
+ * result might not be the first item in the original `coll` (in terms of order)
+ * that passes the test.
+
+ * If order within the original `coll` is important, then look at
+ * [`detectSeries`]{@link module:Collections.detectSeries}.
+ *
+ * @name detect
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias find
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ * @example
+ *
+ * async.detect(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // result now equals the first file in the list that exists
+ * });
+ */
+var detect = doParallel(_createTester(identity, _findGetResult));
+
+/**
+ * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name detectLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.detect]{@link module:Collections.detect}
+ * @alias findLimit
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ */
+var detectLimit = doParallelLimit(_createTester(identity, _findGetResult));
+
+/**
+ * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.
+ *
+ * @name detectSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.detect]{@link module:Collections.detect}
+ * @alias findSeries
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ */
+var detectSeries = doLimit(detectLimit, 1);
+
+function consoleFunc(name) {
+ return function (fn/*, ...args*/) {
+ var args = slice(arguments, 1);
+ args.push(function (err/*, ...args*/) {
+ var args = slice(arguments, 1);
+ if (typeof console === 'object') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ } else if (console[name]) {
+ arrayEach(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ });
+ wrapAsync(fn).apply(null, args);
+ };
+}
+
+/**
+ * Logs the result of an [`async` function]{@link AsyncFunction} to the
+ * `console` using `console.dir` to display the properties of the resulting object.
+ * Only works in Node.js or in browsers that support `console.dir` and
+ * `console.error` (such as FF and Chrome).
+ * If multiple arguments are returned from the async function,
+ * `console.dir` is called on each argument in order.
+ *
+ * @name dir
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} function - The function you want to eventually apply
+ * all arguments to.
+ * @param {...*} arguments... - Any number of arguments to apply to the function.
+ * @example
+ *
+ * // in a module
+ * var hello = function(name, callback) {
+ * setTimeout(function() {
+ * callback(null, {hello: name});
+ * }, 1000);
+ * };
+ *
+ * // in the node repl
+ * node> async.dir(hello, 'world');
+ * {hello: 'world'}
+ */
+var dir = consoleFunc('dir');
+
+/**
+ * The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in
+ * the order of operations, the arguments `test` and `fn` are switched.
+ *
+ * Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function.
+ * @name doDuring
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.during]{@link module:ControlFlow.during}
+ * @category Control Flow
+ * @param {AsyncFunction} fn - An async function which is called each time
+ * `test` passes. Invoked with (callback).
+ * @param {AsyncFunction} test - asynchronous truth test to perform before each
+ * execution of `fn`. Invoked with (...args, callback), where `...args` are the
+ * non-error args from the previous callback of `fn`.
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `fn` has stopped. `callback`
+ * will be passed an error if one occurred, otherwise `null`.
+ */
+function doDuring(fn, test, callback) {
+ callback = onlyOnce(callback || noop);
+ var _fn = wrapAsync(fn);
+ var _test = wrapAsync(test);
+
+ function next(err/*, ...args*/) {
+ if (err) return callback(err);
+ var args = slice(arguments, 1);
+ args.push(check);
+ _test.apply(this, args);
+ }
+
+ function check(err, truth) {
+ if (err) return callback(err);
+ if (!truth) return callback(null);
+ _fn(next);
+ }
+
+ check(null, true);
+
+}
+
+/**
+ * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in
+ * the order of operations, the arguments `test` and `iteratee` are switched.
+ *
+ * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
+ *
+ * @name doWhilst
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.whilst]{@link module:ControlFlow.whilst}
+ * @category Control Flow
+ * @param {AsyncFunction} iteratee - A function which is called each time `test`
+ * passes. Invoked with (callback).
+ * @param {Function} test - synchronous truth test to perform after each
+ * execution of `iteratee`. Invoked with any non-error callback results of
+ * `iteratee`.
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `iteratee` has stopped.
+ * `callback` will be passed an error and any arguments passed to the final
+ * `iteratee`'s callback. Invoked with (err, [results]);
+ */
+function doWhilst(iteratee, test, callback) {
+ callback = onlyOnce(callback || noop);
+ var _iteratee = wrapAsync(iteratee);
+ var next = function(err/*, ...args*/) {
+ if (err) return callback(err);
+ var args = slice(arguments, 1);
+ if (test.apply(this, args)) return _iteratee(next);
+ callback.apply(null, [null].concat(args));
+ };
+ _iteratee(next);
+}
+
+/**
+ * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the
+ * argument ordering differs from `until`.
+ *
+ * @name doUntil
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}
+ * @category Control Flow
+ * @param {AsyncFunction} iteratee - An async function which is called each time
+ * `test` fails. Invoked with (callback).
+ * @param {Function} test - synchronous truth test to perform after each
+ * execution of `iteratee`. Invoked with any non-error callback results of
+ * `iteratee`.
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has passed and repeated execution of `iteratee` has stopped. `callback`
+ * will be passed an error and any arguments passed to the final `iteratee`'s
+ * callback. Invoked with (err, [results]);
+ */
+function doUntil(iteratee, test, callback) {
+ doWhilst(iteratee, function() {
+ return !test.apply(this, arguments);
+ }, callback);
+}
+
+/**
+ * Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that
+ * is passed a callback in the form of `function (err, truth)`. If error is
+ * passed to `test` or `fn`, the main callback is immediately called with the
+ * value of the error.
+ *
+ * @name during
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.whilst]{@link module:ControlFlow.whilst}
+ * @category Control Flow
+ * @param {AsyncFunction} test - asynchronous truth test to perform before each
+ * execution of `fn`. Invoked with (callback).
+ * @param {AsyncFunction} fn - An async function which is called each time
+ * `test` passes. Invoked with (callback).
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `fn` has stopped. `callback`
+ * will be passed an error, if one occurred, otherwise `null`.
+ * @example
+ *
+ * var count = 0;
+ *
+ * async.during(
+ * function (callback) {
+ * return callback(null, count < 5);
+ * },
+ * function (callback) {
+ * count++;
+ * setTimeout(callback, 1000);
+ * },
+ * function (err) {
+ * // 5 seconds have passed
+ * }
+ * );
+ */
+function during(test, fn, callback) {
+ callback = onlyOnce(callback || noop);
+ var _fn = wrapAsync(fn);
+ var _test = wrapAsync(test);
+
+ function next(err) {
+ if (err) return callback(err);
+ _test(check);
+ }
+
+ function check(err, truth) {
+ if (err) return callback(err);
+ if (!truth) return callback(null);
+ _fn(next);
+ }
+
+ _test(check);
+}
+
+function _withoutIndex(iteratee) {
+ return function (value, index, callback) {
+ return iteratee(value, callback);
+ };
+}
+
+/**
+ * Applies the function `iteratee` to each item in `coll`, in parallel.
+ * The `iteratee` is called with an item from the list, and a callback for when
+ * it has finished. If the `iteratee` passes an error to its `callback`, the
+ * main `callback` (for the `each` function) is immediately called with the
+ * error.
+ *
+ * Note, that since this function applies `iteratee` to each item in parallel,
+ * there is no guarantee that the iteratee functions will complete in order.
+ *
+ * @name each
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEach
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to
+ * each item in `coll`. Invoked with (item, callback).
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOf`.
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * // assuming openFiles is an array of file names and saveFile is a function
+ * // to save the modified contents of that file:
+ *
+ * async.each(openFiles, saveFile, function(err){
+ * // if any of the saves produced an error, err would equal that error
+ * });
+ *
+ * // assuming openFiles is an array of file names
+ * async.each(openFiles, function(file, callback) {
+ *
+ * // Perform operation on file here.
+ * console.log('Processing file ' + file);
+ *
+ * if( file.length > 32 ) {
+ * console.log('This file name is too long');
+ * callback('File name too long');
+ * } else {
+ * // Do work to process file here
+ * console.log('File processed');
+ * callback();
+ * }
+ * }, function(err) {
+ * // if any of the file processing produced an error, err would equal that error
+ * if( err ) {
+ * // One of the iterations produced an error.
+ * // All processing will now stop.
+ * console.log('A file failed to process');
+ * } else {
+ * console.log('All files have been processed successfully');
+ * }
+ * });
+ */
+function eachLimit(coll, iteratee, callback) {
+ eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback);
+}
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name eachLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfLimit`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachLimit$1(coll, limit, iteratee, callback) {
+ _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback);
+}
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.
+ *
+ * @name eachSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfSeries`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+var eachSeries = doLimit(eachLimit$1, 1);
+
+/**
+ * Wrap an async function and ensure it calls its callback on a later tick of
+ * the event loop. If the function already calls its callback on a next tick,
+ * no extra deferral is added. This is useful for preventing stack overflows
+ * (`RangeError: Maximum call stack size exceeded`) and generally keeping
+ * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)
+ * contained. ES2017 `async` functions are returned as-is -- they are immune
+ * to Zalgo's corrupting influences, as they always resolve on a later tick.
+ *
+ * @name ensureAsync
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} fn - an async function, one that expects a node-style
+ * callback as its last argument.
+ * @returns {AsyncFunction} Returns a wrapped function with the exact same call
+ * signature as the function passed in.
+ * @example
+ *
+ * function sometimesAsync(arg, callback) {
+ * if (cache[arg]) {
+ * return callback(null, cache[arg]); // this would be synchronous!!
+ * } else {
+ * doSomeIO(arg, callback); // this IO would be asynchronous
+ * }
+ * }
+ *
+ * // this has a risk of stack overflows if many results are cached in a row
+ * async.mapSeries(args, sometimesAsync, done);
+ *
+ * // this will defer sometimesAsync's callback if necessary,
+ * // preventing stack overflows
+ * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);
+ */
+function ensureAsync(fn) {
+ if (isAsync(fn)) return fn;
+ return initialParams(function (args, callback) {
+ var sync = true;
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ setImmediate$1(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ fn.apply(this, args);
+ sync = false;
+ });
+}
+
+function notId(v) {
+ return !v;
+}
+
+/**
+ * Returns `true` if every element in `coll` satisfies an async test. If any
+ * iteratee call returns `false`, the main `callback` is immediately called.
+ *
+ * @name every
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias all
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ * @example
+ *
+ * async.every(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // if result is true then every file exists
+ * });
+ */
+var every = doParallel(_createTester(notId, notId));
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name everyLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+var everyLimit = doParallelLimit(_createTester(notId, notId));
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.
+ *
+ * @name everySeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in series.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+var everySeries = doLimit(everyLimit, 1);
+
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+function filterArray(eachfn, arr, iteratee, callback) {
+ var truthValues = new Array(arr.length);
+ eachfn(arr, function (x, index, callback) {
+ iteratee(x, function (err, v) {
+ truthValues[index] = !!v;
+ callback(err);
+ });
+ }, function (err) {
+ if (err) return callback(err);
+ var results = [];
+ for (var i = 0; i < arr.length; i++) {
+ if (truthValues[i]) results.push(arr[i]);
+ }
+ callback(null, results);
+ });
+}
+
+function filterGeneric(eachfn, coll, iteratee, callback) {
+ var results = [];
+ eachfn(coll, function (x, index, callback) {
+ iteratee(x, function (err, v) {
+ if (err) {
+ callback(err);
+ } else {
+ if (v) {
+ results.push({index: index, value: x});
+ }
+ callback();
+ }
+ });
+ }, function (err) {
+ if (err) {
+ callback(err);
+ } else {
+ callback(null, arrayMap(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), baseProperty('value')));
+ }
+ });
+}
+
+function _filter(eachfn, coll, iteratee, callback) {
+ var filter = isArrayLike(coll) ? filterArray : filterGeneric;
+ filter(eachfn, coll, wrapAsync(iteratee), callback || noop);
+}
+
+/**
+ * Returns a new array of all the values in `coll` which pass an async truth
+ * test. This operation is performed in parallel, but the results array will be
+ * in the same order as the original.
+ *
+ * @name filter
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias select
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ * @example
+ *
+ * async.filter(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, results) {
+ * // results now equals an array of the existing files
+ * });
+ */
+var filter = doParallel(_filter);
+
+/**
+ * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name filterLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @alias selectLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+var filterLimit = doParallelLimit(_filter);
+
+/**
+ * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.
+ *
+ * @name filterSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @alias selectSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results)
+ */
+var filterSeries = doLimit(filterLimit, 1);
+
+/**
+ * Calls the asynchronous function `fn` with a callback parameter that allows it
+ * to call itself again, in series, indefinitely.
+
+ * If an error is passed to the callback then `errback` is called with the
+ * error, and execution stops, otherwise it will never be called.
+ *
+ * @name forever
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {AsyncFunction} fn - an async function to call repeatedly.
+ * Invoked with (next).
+ * @param {Function} [errback] - when `fn` passes an error to it's callback,
+ * this function will be called, and execution stops. Invoked with (err).
+ * @example
+ *
+ * async.forever(
+ * function(next) {
+ * // next is suitable for passing to things that need a callback(err [, whatever]);
+ * // it will result in this function being called again.
+ * },
+ * function(err) {
+ * // if next is called with a value in its first parameter, it will appear
+ * // in here as 'err', and execution will stop.
+ * }
+ * );
+ */
+function forever(fn, errback) {
+ var done = onlyOnce(errback || noop);
+ var task = wrapAsync(ensureAsync(fn));
+
+ function next(err) {
+ if (err) return done(err);
+ task(next);
+ }
+ next();
+}
+
+/**
+ * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name groupByLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.groupBy]{@link module:Collections.groupBy}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a `key` to group the value under.
+ * Invoked with (value, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Result is an `Object` whoses
+ * properties are arrays of values which returned the corresponding key.
+ */
+var groupByLimit = function(coll, limit, iteratee, callback) {
+ callback = callback || noop;
+ var _iteratee = wrapAsync(iteratee);
+ mapLimit(coll, limit, function(val, callback) {
+ _iteratee(val, function(err, key) {
+ if (err) return callback(err);
+ return callback(null, {key: key, val: val});
+ });
+ }, function(err, mapResults) {
+ var result = {};
+ // from MDN, handle object having an `hasOwnProperty` prop
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+
+ for (var i = 0; i < mapResults.length; i++) {
+ if (mapResults[i]) {
+ var key = mapResults[i].key;
+ var val = mapResults[i].val;
+
+ if (hasOwnProperty.call(result, key)) {
+ result[key].push(val);
+ } else {
+ result[key] = [val];
+ }
+ }
+ }
+
+ return callback(err, result);
+ });
+};
+
+/**
+ * Returns a new object, where each value corresponds to an array of items, from
+ * `coll`, that returned the corresponding key. That is, the keys of the object
+ * correspond to the values passed to the `iteratee` callback.
+ *
+ * Note: Since this function applies the `iteratee` to each item in parallel,
+ * there is no guarantee that the `iteratee` functions will complete in order.
+ * However, the values for each key in the `result` will be in the same order as
+ * the original `coll`. For Objects, the values will roughly be in the order of
+ * the original Objects' keys (but this can vary across JavaScript engines).
+ *
+ * @name groupBy
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a `key` to group the value under.
+ * Invoked with (value, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Result is an `Object` whoses
+ * properties are arrays of values which returned the corresponding key.
+ * @example
+ *
+ * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) {
+ * db.findById(userId, function(err, user) {
+ * if (err) return callback(err);
+ * return callback(null, user.age);
+ * });
+ * }, function(err, result) {
+ * // result is object containing the userIds grouped by age
+ * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']};
+ * });
+ */
+var groupBy = doLimit(groupByLimit, Infinity);
+
+/**
+ * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.
+ *
+ * @name groupBySeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.groupBy]{@link module:Collections.groupBy}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a `key` to group the value under.
+ * Invoked with (value, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Result is an `Object` whoses
+ * properties are arrays of values which returned the corresponding key.
+ */
+var groupBySeries = doLimit(groupByLimit, 1);
+
+/**
+ * Logs the result of an `async` function to the `console`. Only works in
+ * Node.js or in browsers that support `console.log` and `console.error` (such
+ * as FF and Chrome). If multiple arguments are returned from the async
+ * function, `console.log` is called on each argument in order.
+ *
+ * @name log
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} function - The function you want to eventually apply
+ * all arguments to.
+ * @param {...*} arguments... - Any number of arguments to apply to the function.
+ * @example
+ *
+ * // in a module
+ * var hello = function(name, callback) {
+ * setTimeout(function() {
+ * callback(null, 'hello ' + name);
+ * }, 1000);
+ * };
+ *
+ * // in the node repl
+ * node> async.log(hello, 'world');
+ * 'hello world'
+ */
+var log = consoleFunc('log');
+
+/**
+ * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name mapValuesLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.mapValues]{@link module:Collections.mapValues}
+ * @category Collection
+ * @param {Object} obj - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - A function to apply to each value and key
+ * in `coll`.
+ * The iteratee should complete with the transformed value as its result.
+ * Invoked with (value, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. `result` is a new object consisting
+ * of each key from `obj`, with each transformed value on the right-hand side.
+ * Invoked with (err, result).
+ */
+function mapValuesLimit(obj, limit, iteratee, callback) {
+ callback = once(callback || noop);
+ var newObj = {};
+ var _iteratee = wrapAsync(iteratee);
+ eachOfLimit(obj, limit, function(val, key, next) {
+ _iteratee(val, key, function (err, result) {
+ if (err) return next(err);
+ newObj[key] = result;
+ next();
+ });
+ }, function (err) {
+ callback(err, newObj);
+ });
+}
+
+/**
+ * A relative of [`map`]{@link module:Collections.map}, designed for use with objects.
+ *
+ * Produces a new Object by mapping each value of `obj` through the `iteratee`
+ * function. The `iteratee` is called each `value` and `key` from `obj` and a
+ * callback for when it has finished processing. Each of these callbacks takes
+ * two arguments: an `error`, and the transformed item from `obj`. If `iteratee`
+ * passes an error to its callback, the main `callback` (for the `mapValues`
+ * function) is immediately called with the error.
+ *
+ * Note, the order of the keys in the result is not guaranteed. The keys will
+ * be roughly in the order they complete, (but this is very engine-specific)
+ *
+ * @name mapValues
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Object} obj - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each value and key
+ * in `coll`.
+ * The iteratee should complete with the transformed value as its result.
+ * Invoked with (value, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. `result` is a new object consisting
+ * of each key from `obj`, with each transformed value on the right-hand side.
+ * Invoked with (err, result).
+ * @example
+ *
+ * async.mapValues({
+ * f1: 'file1',
+ * f2: 'file2',
+ * f3: 'file3'
+ * }, function (file, key, callback) {
+ * fs.stat(file, callback);
+ * }, function(err, result) {
+ * // result is now a map of stats for each file, e.g.
+ * // {
+ * // f1: [stats for file1],
+ * // f2: [stats for file2],
+ * // f3: [stats for file3]
+ * // }
+ * });
+ */
+
+var mapValues = doLimit(mapValuesLimit, Infinity);
+
+/**
+ * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.
+ *
+ * @name mapValuesSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.mapValues]{@link module:Collections.mapValues}
+ * @category Collection
+ * @param {Object} obj - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each value and key
+ * in `coll`.
+ * The iteratee should complete with the transformed value as its result.
+ * Invoked with (value, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. `result` is a new object consisting
+ * of each key from `obj`, with each transformed value on the right-hand side.
+ * Invoked with (err, result).
+ */
+var mapValuesSeries = doLimit(mapValuesLimit, 1);
+
+function has(obj, key) {
+ return key in obj;
+}
+
+/**
+ * Caches the results of an async function. When creating a hash to store
+ * function results against, the callback is omitted from the hash and an
+ * optional hash function can be used.
+ *
+ * If no hash function is specified, the first argument is used as a hash key,
+ * which may work reasonably if it is a string or a data type that converts to a
+ * distinct string. Note that objects and arrays will not behave reasonably.
+ * Neither will cases where the other arguments are significant. In such cases,
+ * specify your own hash function.
+ *
+ * The cache of results is exposed as the `memo` property of the function
+ * returned by `memoize`.
+ *
+ * @name memoize
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} fn - The async function to proxy and cache results from.
+ * @param {Function} hasher - An optional function for generating a custom hash
+ * for storing results. It has all the arguments applied to it apart from the
+ * callback, and must be synchronous.
+ * @returns {AsyncFunction} a memoized version of `fn`
+ * @example
+ *
+ * var slow_fn = function(name, callback) {
+ * // do something
+ * callback(null, result);
+ * };
+ * var fn = async.memoize(slow_fn);
+ *
+ * // fn can now be used as if it were slow_fn
+ * fn('some name', function() {
+ * // callback
+ * });
+ */
+function memoize(fn, hasher) {
+ var memo = Object.create(null);
+ var queues = Object.create(null);
+ hasher = hasher || identity;
+ var _fn = wrapAsync(fn);
+ var memoized = initialParams(function memoized(args, callback) {
+ var key = hasher.apply(null, args);
+ if (has(memo, key)) {
+ setImmediate$1(function() {
+ callback.apply(null, memo[key]);
+ });
+ } else if (has(queues, key)) {
+ queues[key].push(callback);
+ } else {
+ queues[key] = [callback];
+ _fn.apply(null, args.concat(function(/*args*/) {
+ var args = slice(arguments);
+ memo[key] = args;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, args);
+ }
+ }));
+ }
+ });
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+}
+
+/**
+ * Calls `callback` on a later loop around the event loop. In Node.js this just
+ * calls `process.nextTick`. In the browser it will use `setImmediate` if
+ * available, otherwise `setTimeout(callback, 0)`, which means other higher
+ * priority events may precede the execution of `callback`.
+ *
+ * This is used internally for browser-compatibility purposes.
+ *
+ * @name nextTick
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @see [async.setImmediate]{@link module:Utils.setImmediate}
+ * @category Util
+ * @param {Function} callback - The function to call on a later loop around
+ * the event loop. Invoked with (args...).
+ * @param {...*} args... - any number of additional arguments to pass to the
+ * callback on the next tick.
+ * @example
+ *
+ * var call_order = [];
+ * async.nextTick(function() {
+ * call_order.push('two');
+ * // call_order now equals ['one','two']
+ * });
+ * call_order.push('one');
+ *
+ * async.setImmediate(function (a, b, c) {
+ * // a, b, and c equal 1, 2, and 3
+ * }, 1, 2, 3);
+ */
+var _defer$1;
+
+if (hasNextTick) {
+ _defer$1 = process.nextTick;
+} else if (hasSetImmediate) {
+ _defer$1 = setImmediate;
+} else {
+ _defer$1 = fallback;
+}
+
+var nextTick = wrap(_defer$1);
+
+function _parallel(eachfn, tasks, callback) {
+ callback = callback || noop;
+ var results = isArrayLike(tasks) ? [] : {};
+
+ eachfn(tasks, function (task, key, callback) {
+ wrapAsync(task)(function (err, result) {
+ if (arguments.length > 2) {
+ result = slice(arguments, 1);
+ }
+ results[key] = result;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+}
+
+/**
+ * Run the `tasks` collection of functions in parallel, without waiting until
+ * the previous function has completed. If any of the functions pass an error to
+ * its callback, the main `callback` is immediately called with the value of the
+ * error. Once the `tasks` have completed, the results are passed to the final
+ * `callback` as an array.
+ *
+ * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about
+ * parallel execution of code. If your tasks do not use any timers or perform
+ * any I/O, they will actually be executed in series. Any synchronous setup
+ * sections for each task will happen one after the other. JavaScript remains
+ * single-threaded.
+ *
+ * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the
+ * execution of other tasks when a task fails.
+ *
+ * It is also possible to use an object instead of an array. Each property will
+ * be run as a function and the results will be passed to the final `callback`
+ * as an object instead of an array. This can be a more readable way of handling
+ * results from {@link async.parallel}.
+ *
+ * @name parallel
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection of
+ * [async functions]{@link AsyncFunction} to run.
+ * Each async function can complete with any number of optional `result` values.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed successfully. This function gets a results array
+ * (or object) containing all the result arguments passed to the task callbacks.
+ * Invoked with (err, results).
+ *
+ * @example
+ * async.parallel([
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'two');
+ * }, 100);
+ * }
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * // the results array will equal ['one','two'] even though
+ * // the second function had a shorter timeout.
+ * });
+ *
+ * // an example using an object instead of an array
+ * async.parallel({
+ * one: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 1);
+ * }, 200);
+ * },
+ * two: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 2);
+ * }, 100);
+ * }
+ * }, function(err, results) {
+ * // results is now equals to: {one: 1, two: 2}
+ * });
+ */
+function parallelLimit(tasks, callback) {
+ _parallel(eachOf, tasks, callback);
+}
+
+/**
+ * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name parallelLimit
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.parallel]{@link module:ControlFlow.parallel}
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection of
+ * [async functions]{@link AsyncFunction} to run.
+ * Each async function can complete with any number of optional `result` values.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed successfully. This function gets a results array
+ * (or object) containing all the result arguments passed to the task callbacks.
+ * Invoked with (err, results).
+ */
+function parallelLimit$1(tasks, limit, callback) {
+ _parallel(_eachOfLimit(limit), tasks, callback);
+}
+
+/**
+ * A queue of tasks for the worker function to complete.
+ * @typedef {Object} QueueObject
+ * @memberOf module:ControlFlow
+ * @property {Function} length - a function returning the number of items
+ * waiting to be processed. Invoke with `queue.length()`.
+ * @property {boolean} started - a boolean indicating whether or not any
+ * items have been pushed and processed by the queue.
+ * @property {Function} running - a function returning the number of items
+ * currently being processed. Invoke with `queue.running()`.
+ * @property {Function} workersList - a function returning the array of items
+ * currently being processed. Invoke with `queue.workersList()`.
+ * @property {Function} idle - a function returning false if there are items
+ * waiting or being processed, or true if not. Invoke with `queue.idle()`.
+ * @property {number} concurrency - an integer for determining how many `worker`
+ * functions should be run in parallel. This property can be changed after a
+ * `queue` is created to alter the concurrency on-the-fly.
+ * @property {Function} push - add a new task to the `queue`. Calls `callback`
+ * once the `worker` has finished processing the task. Instead of a single task,
+ * a `tasks` array can be submitted. The respective callback is used for every
+ * task in the list. Invoke with `queue.push(task, [callback])`,
+ * @property {Function} unshift - add a new task to the front of the `queue`.
+ * Invoke with `queue.unshift(task, [callback])`.
+ * @property {Function} remove - remove items from the queue that match a test
+ * function. The test function will be passed an object with a `data` property,
+ * and a `priority` property, if this is a
+ * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.
+ * Invoked with `queue.remove(testFn)`, where `testFn` is of the form
+ * `function ({data, priority}) {}` and returns a Boolean.
+ * @property {Function} saturated - a callback that is called when the number of
+ * running workers hits the `concurrency` limit, and further tasks will be
+ * queued.
+ * @property {Function} unsaturated - a callback that is called when the number
+ * of running workers is less than the `concurrency` & `buffer` limits, and
+ * further tasks will not be queued.
+ * @property {number} buffer - A minimum threshold buffer in order to say that
+ * the `queue` is `unsaturated`.
+ * @property {Function} empty - a callback that is called when the last item
+ * from the `queue` is given to a `worker`.
+ * @property {Function} drain - a callback that is called when the last item
+ * from the `queue` has returned from the `worker`.
+ * @property {Function} error - a callback that is called when a task errors.
+ * Has the signature `function(error, task)`.
+ * @property {boolean} paused - a boolean for determining whether the queue is
+ * in a paused state.
+ * @property {Function} pause - a function that pauses the processing of tasks
+ * until `resume()` is called. Invoke with `queue.pause()`.
+ * @property {Function} resume - a function that resumes the processing of
+ * queued tasks when the queue is paused. Invoke with `queue.resume()`.
+ * @property {Function} kill - a function that removes the `drain` callback and
+ * empties remaining tasks from the queue forcing it to go idle. No more tasks
+ * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.
+ */
+
+/**
+ * Creates a `queue` object with the specified `concurrency`. Tasks added to the
+ * `queue` are processed in parallel (up to the `concurrency` limit). If all
+ * `worker`s are in progress, the task is queued until one becomes available.
+ * Once a `worker` completes a `task`, that `task`'s callback is called.
+ *
+ * @name queue
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {AsyncFunction} worker - An async function for processing a queued task.
+ * If you want to handle errors from an individual task, pass a callback to
+ * `q.push()`. Invoked with (task, callback).
+ * @param {number} [concurrency=1] - An `integer` for determining how many
+ * `worker` functions should be run in parallel. If omitted, the concurrency
+ * defaults to `1`. If the concurrency is `0`, an error is thrown.
+ * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can
+ * attached as certain properties to listen for specific events during the
+ * lifecycle of the queue.
+ * @example
+ *
+ * // create a queue object with concurrency 2
+ * var q = async.queue(function(task, callback) {
+ * console.log('hello ' + task.name);
+ * callback();
+ * }, 2);
+ *
+ * // assign a callback
+ * q.drain = function() {
+ * console.log('all items have been processed');
+ * };
+ *
+ * // add some items to the queue
+ * q.push({name: 'foo'}, function(err) {
+ * console.log('finished processing foo');
+ * });
+ * q.push({name: 'bar'}, function (err) {
+ * console.log('finished processing bar');
+ * });
+ *
+ * // add some items to the queue (batch-wise)
+ * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {
+ * console.log('finished processing item');
+ * });
+ *
+ * // add some items to the front of the queue
+ * q.unshift({name: 'bar'}, function (err) {
+ * console.log('finished processing bar');
+ * });
+ */
+var queue$1 = function (worker, concurrency) {
+ var _worker = wrapAsync(worker);
+ return queue(function (items, cb) {
+ _worker(items[0], cb);
+ }, concurrency, 1);
+};
+
+/**
+ * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and
+ * completed in ascending priority order.
+ *
+ * @name priorityQueue
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.queue]{@link module:ControlFlow.queue}
+ * @category Control Flow
+ * @param {AsyncFunction} worker - An async function for processing a queued task.
+ * If you want to handle errors from an individual task, pass a callback to
+ * `q.push()`.
+ * Invoked with (task, callback).
+ * @param {number} concurrency - An `integer` for determining how many `worker`
+ * functions should be run in parallel. If omitted, the concurrency defaults to
+ * `1`. If the concurrency is `0`, an error is thrown.
+ * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two
+ * differences between `queue` and `priorityQueue` objects:
+ * * `push(task, priority, [callback])` - `priority` should be a number. If an
+ * array of `tasks` is given, all tasks will be assigned the same priority.
+ * * The `unshift` method was removed.
+ */
+var priorityQueue = function(worker, concurrency) {
+ // Start with a normal queue
+ var q = queue$1(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function(data, priority, callback) {
+ if (callback == null) callback = noop;
+ if (typeof callback !== 'function') {
+ throw new Error('task callback must be a function');
+ }
+ q.started = true;
+ if (!isArray(data)) {
+ data = [data];
+ }
+ if (data.length === 0) {
+ // call drain immediately if there are no tasks
+ return setImmediate$1(function() {
+ q.drain();
+ });
+ }
+
+ priority = priority || 0;
+ var nextNode = q._tasks.head;
+ while (nextNode && priority >= nextNode.priority) {
+ nextNode = nextNode.next;
+ }
+
+ for (var i = 0, l = data.length; i < l; i++) {
+ var item = {
+ data: data[i],
+ priority: priority,
+ callback: callback
+ };
+
+ if (nextNode) {
+ q._tasks.insertBefore(nextNode, item);
+ } else {
+ q._tasks.push(item);
+ }
+ }
+ setImmediate$1(q.process);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+};
+
+/**
+ * Runs the `tasks` array of functions in parallel, without waiting until the
+ * previous function has completed. Once any of the `tasks` complete or pass an
+ * error to its callback, the main `callback` is immediately called. It's
+ * equivalent to `Promise.race()`.
+ *
+ * @name race
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}
+ * to run. Each function can complete with an optional `result` value.
+ * @param {Function} callback - A callback to run once any of the functions have
+ * completed. This function gets an error or result from the first function that
+ * completed. Invoked with (err, result).
+ * @returns undefined
+ * @example
+ *
+ * async.race([
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'two');
+ * }, 100);
+ * }
+ * ],
+ * // main callback
+ * function(err, result) {
+ * // the result will be equal to 'two' as it finishes earlier
+ * });
+ */
+function race(tasks, callback) {
+ callback = once(callback || noop);
+ if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));
+ if (!tasks.length) return callback();
+ for (var i = 0, l = tasks.length; i < l; i++) {
+ wrapAsync(tasks[i])(callback);
+ }
+}
+
+/**
+ * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.
+ *
+ * @name reduceRight
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reduce]{@link module:Collections.reduce}
+ * @alias foldr
+ * @category Collection
+ * @param {Array} array - A collection to iterate over.
+ * @param {*} memo - The initial state of the reduction.
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * array to produce the next step in the reduction.
+ * The `iteratee` should complete with the next state of the reduction.
+ * If the iteratee complete with an error, the reduction is stopped and the
+ * main `callback` is immediately called with the error.
+ * Invoked with (memo, item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the reduced value. Invoked with
+ * (err, result).
+ */
+function reduceRight (array, memo, iteratee, callback) {
+ var reversed = slice(array).reverse();
+ reduce(reversed, memo, iteratee, callback);
+}
+
+/**
+ * Wraps the async function in another function that always completes with a
+ * result object, even when it errors.
+ *
+ * The result object has either the property `error` or `value`.
+ *
+ * @name reflect
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} fn - The async function you want to wrap
+ * @returns {Function} - A function that always passes null to it's callback as
+ * the error. The second argument to the callback will be an `object` with
+ * either an `error` or a `value` property.
+ * @example
+ *
+ * async.parallel([
+ * async.reflect(function(callback) {
+ * // do some stuff ...
+ * callback(null, 'one');
+ * }),
+ * async.reflect(function(callback) {
+ * // do some more stuff but error ...
+ * callback('bad stuff happened');
+ * }),
+ * async.reflect(function(callback) {
+ * // do some more stuff ...
+ * callback(null, 'two');
+ * })
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * // values
+ * // results[0].value = 'one'
+ * // results[1].error = 'bad stuff happened'
+ * // results[2].value = 'two'
+ * });
+ */
+function reflect(fn) {
+ var _fn = wrapAsync(fn);
+ return initialParams(function reflectOn(args, reflectCallback) {
+ args.push(function callback(error, cbArg) {
+ if (error) {
+ reflectCallback(null, { error: error });
+ } else {
+ var value;
+ if (arguments.length <= 2) {
+ value = cbArg;
+ } else {
+ value = slice(arguments, 1);
+ }
+ reflectCallback(null, { value: value });
+ }
+ });
+
+ return _fn.apply(this, args);
+ });
+}
+
+/**
+ * A helper function that wraps an array or an object of functions with `reflect`.
+ *
+ * @name reflectAll
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @see [async.reflect]{@link module:Utils.reflect}
+ * @category Util
+ * @param {Array|Object|Iterable} tasks - The collection of
+ * [async functions]{@link AsyncFunction} to wrap in `async.reflect`.
+ * @returns {Array} Returns an array of async functions, each wrapped in
+ * `async.reflect`
+ * @example
+ *
+ * let tasks = [
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * function(callback) {
+ * // do some more stuff but error ...
+ * callback(new Error('bad stuff happened'));
+ * },
+ * function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'two');
+ * }, 100);
+ * }
+ * ];
+ *
+ * async.parallel(async.reflectAll(tasks),
+ * // optional callback
+ * function(err, results) {
+ * // values
+ * // results[0].value = 'one'
+ * // results[1].error = Error('bad stuff happened')
+ * // results[2].value = 'two'
+ * });
+ *
+ * // an example using an object instead of an array
+ * let tasks = {
+ * one: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'one');
+ * }, 200);
+ * },
+ * two: function(callback) {
+ * callback('two');
+ * },
+ * three: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 'three');
+ * }, 100);
+ * }
+ * };
+ *
+ * async.parallel(async.reflectAll(tasks),
+ * // optional callback
+ * function(err, results) {
+ * // values
+ * // results.one.value = 'one'
+ * // results.two.error = 'two'
+ * // results.three.value = 'three'
+ * });
+ */
+function reflectAll(tasks) {
+ var results;
+ if (isArray(tasks)) {
+ results = arrayMap(tasks, reflect);
+ } else {
+ results = {};
+ baseForOwn(tasks, function(task, key) {
+ results[key] = reflect.call(this, task);
+ });
+ }
+ return results;
+}
+
+function reject$1(eachfn, arr, iteratee, callback) {
+ _filter(eachfn, arr, function(value, cb) {
+ iteratee(value, function(err, v) {
+ cb(err, !v);
+ });
+ }, callback);
+}
+
+/**
+ * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.
+ *
+ * @name reject
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - An async truth test to apply to each item in
+ * `coll`.
+ * The should complete with a boolean value as its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ * @example
+ *
+ * async.reject(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, results) {
+ * // results now equals an array of missing files
+ * createFiles(results);
+ * });
+ */
+var reject = doParallel(reject$1);
+
+/**
+ * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name rejectLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reject]{@link module:Collections.reject}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} iteratee - An async truth test to apply to each item in
+ * `coll`.
+ * The should complete with a boolean value as its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+var rejectLimit = doParallelLimit(reject$1);
+
+/**
+ * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.
+ *
+ * @name rejectSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reject]{@link module:Collections.reject}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - An async truth test to apply to each item in
+ * `coll`.
+ * The should complete with a boolean value as its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+var rejectSeries = doLimit(rejectLimit, 1);
+
+/**
+ * Creates a function that returns `value`.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.4.0
+ * @category Util
+ * @param {*} value The value to return from the new function.
+ * @returns {Function} Returns the new constant function.
+ * @example
+ *
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
+ *
+ * console.log(objects);
+ * // => [{ 'a': 1 }, { 'a': 1 }]
+ *
+ * console.log(objects[0] === objects[1]);
+ * // => true
+ */
+function constant$1(value) {
+ return function() {
+ return value;
+ };
+}
+
+/**
+ * Attempts to get a successful response from `task` no more than `times` times
+ * before returning an error. If the task is successful, the `callback` will be
+ * passed the result of the successful task. If all attempts fail, the callback
+ * will be passed the error and result (if any) of the final attempt.
+ *
+ * @name retry
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @see [async.retryable]{@link module:ControlFlow.retryable}
+ * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an
+ * object with `times` and `interval` or a number.
+ * * `times` - The number of attempts to make before giving up. The default
+ * is `5`.
+ * * `interval` - The time to wait between retries, in milliseconds. The
+ * default is `0`. The interval may also be specified as a function of the
+ * retry count (see example).
+ * * `errorFilter` - An optional synchronous function that is invoked on
+ * erroneous result. If it returns `true` the retry attempts will continue;
+ * if the function returns `false` the retry flow is aborted with the current
+ * attempt's error and result being returned to the final callback.
+ * Invoked with (err).
+ * * If `opts` is a number, the number specifies the number of times to retry,
+ * with the default interval of `0`.
+ * @param {AsyncFunction} task - An async function to retry.
+ * Invoked with (callback).
+ * @param {Function} [callback] - An optional callback which is called when the
+ * task has succeeded, or after the final failed attempt. It receives the `err`
+ * and `result` arguments of the last attempt at completing the `task`. Invoked
+ * with (err, results).
+ *
+ * @example
+ *
+ * // The `retry` function can be used as a stand-alone control flow by passing
+ * // a callback, as shown below:
+ *
+ * // try calling apiMethod 3 times
+ * async.retry(3, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod 3 times, waiting 200 ms between each retry
+ * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod 10 times with exponential backoff
+ * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)
+ * async.retry({
+ * times: 10,
+ * interval: function(retryCount) {
+ * return 50 * Math.pow(2, retryCount);
+ * }
+ * }, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod the default 5 times no delay between each retry
+ * async.retry(apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // try calling apiMethod only when error condition satisfies, all other
+ * // errors will abort the retry control flow and return to final callback
+ * async.retry({
+ * errorFilter: function(err) {
+ * return err.message === 'Temporary error'; // only retry on a specific error
+ * }
+ * }, apiMethod, function(err, result) {
+ * // do something with the result
+ * });
+ *
+ * // to retry individual methods that are not as reliable within other
+ * // control flow functions, use the `retryable` wrapper:
+ * async.auto({
+ * users: api.getUsers.bind(api),
+ * payments: async.retryable(3, api.getPayments.bind(api))
+ * }, function(err, results) {
+ * // do something with the results
+ * });
+ *
+ */
+function retry(opts, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var DEFAULT_INTERVAL = 0;
+
+ var options = {
+ times: DEFAULT_TIMES,
+ intervalFunc: constant$1(DEFAULT_INTERVAL)
+ };
+
+ function parseTimes(acc, t) {
+ if (typeof t === 'object') {
+ acc.times = +t.times || DEFAULT_TIMES;
+
+ acc.intervalFunc = typeof t.interval === 'function' ?
+ t.interval :
+ constant$1(+t.interval || DEFAULT_INTERVAL);
+
+ acc.errorFilter = t.errorFilter;
+ } else if (typeof t === 'number' || typeof t === 'string') {
+ acc.times = +t || DEFAULT_TIMES;
+ } else {
+ throw new Error("Invalid arguments for async.retry");
+ }
+ }
+
+ if (arguments.length < 3 && typeof opts === 'function') {
+ callback = task || noop;
+ task = opts;
+ } else {
+ parseTimes(options, opts);
+ callback = callback || noop;
+ }
+
+ if (typeof task !== 'function') {
+ throw new Error("Invalid arguments for async.retry");
+ }
+
+ var _task = wrapAsync(task);
+
+ var attempt = 1;
+ function retryAttempt() {
+ _task(function(err) {
+ if (err && attempt++ < options.times &&
+ (typeof options.errorFilter != 'function' ||
+ options.errorFilter(err))) {
+ setTimeout(retryAttempt, options.intervalFunc(attempt));
+ } else {
+ callback.apply(null, arguments);
+ }
+ });
+ }
+
+ retryAttempt();
+}
+
+/**
+ * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method
+ * wraps a task and makes it retryable, rather than immediately calling it
+ * with retries.
+ *
+ * @name retryable
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.retry]{@link module:ControlFlow.retry}
+ * @category Control Flow
+ * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional
+ * options, exactly the same as from `retry`
+ * @param {AsyncFunction} task - the asynchronous function to wrap.
+ * This function will be passed any arguments passed to the returned wrapper.
+ * Invoked with (...args, callback).
+ * @returns {AsyncFunction} The wrapped function, which when invoked, will
+ * retry on an error, based on the parameters specified in `opts`.
+ * This function will accept the same parameters as `task`.
+ * @example
+ *
+ * async.auto({
+ * dep1: async.retryable(3, getFromFlakyService),
+ * process: ["dep1", async.retryable(3, function (results, cb) {
+ * maybeProcessData(results.dep1, cb);
+ * })]
+ * }, callback);
+ */
+var retryable = function (opts, task) {
+ if (!task) {
+ task = opts;
+ opts = null;
+ }
+ var _task = wrapAsync(task);
+ return initialParams(function (args, callback) {
+ function taskFn(cb) {
+ _task.apply(null, args.concat(cb));
+ }
+
+ if (opts) retry(opts, taskFn, callback);
+ else retry(taskFn, callback);
+
+ });
+};
+
+/**
+ * Run the functions in the `tasks` collection in series, each one running once
+ * the previous function has completed. If any functions in the series pass an
+ * error to its callback, no more functions are run, and `callback` is
+ * immediately called with the value of the error. Otherwise, `callback`
+ * receives an array of results when `tasks` have completed.
+ *
+ * It is also possible to use an object instead of an array. Each property will
+ * be run as a function, and the results will be passed to the final `callback`
+ * as an object instead of an array. This can be a more readable way of handling
+ * results from {@link async.series}.
+ *
+ * **Note** that while many implementations preserve the order of object
+ * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+ * explicitly states that
+ *
+ * > The mechanics and order of enumerating the properties is not specified.
+ *
+ * So if you rely on the order in which your series of functions are executed,
+ * and want this to work on all platforms, consider using an array.
+ *
+ * @name series
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection containing
+ * [async functions]{@link AsyncFunction} to run in series.
+ * Each function can complete with any number of optional `result` values.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed. This function gets a results array (or object)
+ * containing all the result arguments passed to the `task` callbacks. Invoked
+ * with (err, result).
+ * @example
+ * async.series([
+ * function(callback) {
+ * // do some stuff ...
+ * callback(null, 'one');
+ * },
+ * function(callback) {
+ * // do some more stuff ...
+ * callback(null, 'two');
+ * }
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * // results is now equal to ['one', 'two']
+ * });
+ *
+ * async.series({
+ * one: function(callback) {
+ * setTimeout(function() {
+ * callback(null, 1);
+ * }, 200);
+ * },
+ * two: function(callback){
+ * setTimeout(function() {
+ * callback(null, 2);
+ * }, 100);
+ * }
+ * }, function(err, results) {
+ * // results is now equal to: {one: 1, two: 2}
+ * });
+ */
+function series(tasks, callback) {
+ _parallel(eachOfSeries, tasks, callback);
+}
+
+/**
+ * Returns `true` if at least one element in the `coll` satisfies an async test.
+ * If any iteratee call returns `true`, the main `callback` is immediately
+ * called.
+ *
+ * @name some
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias any
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in parallel.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ * @example
+ *
+ * async.some(['file1','file2','file3'], function(filePath, callback) {
+ * fs.access(filePath, function(err) {
+ * callback(null, !err)
+ * });
+ * }, function(err, result) {
+ * // if result is true then at least one of the files exists
+ * });
+ */
+var some = doParallel(_createTester(Boolean, identity));
+
+/**
+ * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name someLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.some]{@link module:Collections.some}
+ * @alias anyLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in parallel.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ */
+var someLimit = doParallelLimit(_createTester(Boolean, identity));
+
+/**
+ * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.
+ *
+ * @name someSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.some]{@link module:Collections.some}
+ * @alias anySeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in series.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ */
+var someSeries = doLimit(someLimit, 1);
+
+/**
+ * Sorts a list by the results of running each `coll` value through an async
+ * `iteratee`.
+ *
+ * @name sortBy
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The iteratee should complete with a value to use as the sort criteria as
+ * its `result`.
+ * Invoked with (item, callback).
+ * @param {Function} callback - A callback which is called after all the
+ * `iteratee` functions have finished, or an error occurs. Results is the items
+ * from the original `coll` sorted by the values returned by the `iteratee`
+ * calls. Invoked with (err, results).
+ * @example
+ *
+ * async.sortBy(['file1','file2','file3'], function(file, callback) {
+ * fs.stat(file, function(err, stats) {
+ * callback(err, stats.mtime);
+ * });
+ * }, function(err, results) {
+ * // results is now the original array of files sorted by
+ * // modified date
+ * });
+ *
+ * // By modifying the callback parameter the
+ * // sorting order can be influenced:
+ *
+ * // ascending order
+ * async.sortBy([1,9,3,5], function(x, callback) {
+ * callback(null, x);
+ * }, function(err,result) {
+ * // result callback
+ * });
+ *
+ * // descending order
+ * async.sortBy([1,9,3,5], function(x, callback) {
+ * callback(null, x*-1); //<- x*-1 instead of x, turns the order around
+ * }, function(err,result) {
+ * // result callback
+ * });
+ */
+function sortBy (coll, iteratee, callback) {
+ var _iteratee = wrapAsync(iteratee);
+ map(coll, function (x, callback) {
+ _iteratee(x, function (err, criteria) {
+ if (err) return callback(err);
+ callback(null, {value: x, criteria: criteria});
+ });
+ }, function (err, results) {
+ if (err) return callback(err);
+ callback(null, arrayMap(results.sort(comparator), baseProperty('value')));
+ });
+
+ function comparator(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }
+}
+
+/**
+ * Sets a time limit on an asynchronous function. If the function does not call
+ * its callback within the specified milliseconds, it will be called with a
+ * timeout error. The code property for the error object will be `'ETIMEDOUT'`.
+ *
+ * @name timeout
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} asyncFn - The async function to limit in time.
+ * @param {number} milliseconds - The specified time limit.
+ * @param {*} [info] - Any variable you want attached (`string`, `object`, etc)
+ * to timeout Error for more information..
+ * @returns {AsyncFunction} Returns a wrapped function that can be used with any
+ * of the control flow functions.
+ * Invoke this function with the same parameters as you would `asyncFunc`.
+ * @example
+ *
+ * function myFunction(foo, callback) {
+ * doAsyncTask(foo, function(err, data) {
+ * // handle errors
+ * if (err) return callback(err);
+ *
+ * // do some stuff ...
+ *
+ * // return processed data
+ * return callback(null, data);
+ * });
+ * }
+ *
+ * var wrapped = async.timeout(myFunction, 1000);
+ *
+ * // call `wrapped` as you would `myFunction`
+ * wrapped({ bar: 'bar' }, function(err, data) {
+ * // if `myFunction` takes < 1000 ms to execute, `err`
+ * // and `data` will have their expected values
+ *
+ * // else `err` will be an Error with the code 'ETIMEDOUT'
+ * });
+ */
+function timeout(asyncFn, milliseconds, info) {
+ var fn = wrapAsync(asyncFn);
+
+ return initialParams(function (args, callback) {
+ var timedOut = false;
+ var timer;
+
+ function timeoutCallback() {
+ var name = asyncFn.name || 'anonymous';
+ var error = new Error('Callback function "' + name + '" timed out.');
+ error.code = 'ETIMEDOUT';
+ if (info) {
+ error.info = info;
+ }
+ timedOut = true;
+ callback(error);
+ }
+
+ args.push(function () {
+ if (!timedOut) {
+ callback.apply(null, arguments);
+ clearTimeout(timer);
+ }
+ });
+
+ // setup timer and call original function
+ timer = setTimeout(timeoutCallback, milliseconds);
+ fn.apply(null, args);
+ });
+}
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeCeil = Math.ceil;
+var nativeMax = Math.max;
+
+/**
+ * The base implementation of `_.range` and `_.rangeRight` which doesn't
+ * coerce arguments.
+ *
+ * @private
+ * @param {number} start The start of the range.
+ * @param {number} end The end of the range.
+ * @param {number} step The value to increment or decrement by.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Array} Returns the range of numbers.
+ */
+function baseRange(start, end, step, fromRight) {
+ var index = -1,
+ length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
+ result = Array(length);
+
+ while (length--) {
+ result[fromRight ? length : ++index] = start;
+ start += step;
+ }
+ return result;
+}
+
+/**
+ * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name timesLimit
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.times]{@link module:ControlFlow.times}
+ * @category Control Flow
+ * @param {number} count - The number of times to run the function.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - The async function to call `n` times.
+ * Invoked with the iteration index and a callback: (n, next).
+ * @param {Function} callback - see [async.map]{@link module:Collections.map}.
+ */
+function timeLimit(count, limit, iteratee, callback) {
+ var _iteratee = wrapAsync(iteratee);
+ mapLimit(baseRange(0, count, 1), limit, _iteratee, callback);
+}
+
+/**
+ * Calls the `iteratee` function `n` times, and accumulates results in the same
+ * manner you would use with [map]{@link module:Collections.map}.
+ *
+ * @name times
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.map]{@link module:Collections.map}
+ * @category Control Flow
+ * @param {number} n - The number of times to run the function.
+ * @param {AsyncFunction} iteratee - The async function to call `n` times.
+ * Invoked with the iteration index and a callback: (n, next).
+ * @param {Function} callback - see {@link module:Collections.map}.
+ * @example
+ *
+ * // Pretend this is some complicated async factory
+ * var createUser = function(id, callback) {
+ * callback(null, {
+ * id: 'user' + id
+ * });
+ * };
+ *
+ * // generate 5 users
+ * async.times(5, function(n, next) {
+ * createUser(n, function(err, user) {
+ * next(err, user);
+ * });
+ * }, function(err, users) {
+ * // we should now have 5 users
+ * });
+ */
+var times = doLimit(timeLimit, Infinity);
+
+/**
+ * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.
+ *
+ * @name timesSeries
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.times]{@link module:ControlFlow.times}
+ * @category Control Flow
+ * @param {number} n - The number of times to run the function.
+ * @param {AsyncFunction} iteratee - The async function to call `n` times.
+ * Invoked with the iteration index and a callback: (n, next).
+ * @param {Function} callback - see {@link module:Collections.map}.
+ */
+var timesSeries = doLimit(timeLimit, 1);
+
+/**
+ * A relative of `reduce`. Takes an Object or Array, and iterates over each
+ * element in series, each step potentially mutating an `accumulator` value.
+ * The type of the accumulator defaults to the type of collection passed in.
+ *
+ * @name transform
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {*} [accumulator] - The initial state of the transform. If omitted,
+ * it will default to an empty Object or Array, depending on the type of `coll`
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * collection that potentially modifies the accumulator.
+ * Invoked with (accumulator, item, key, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the transformed accumulator.
+ * Invoked with (err, result).
+ * @example
+ *
+ * async.transform([1,2,3], function(acc, item, index, callback) {
+ * // pointless async:
+ * process.nextTick(function() {
+ * acc.push(item * 2)
+ * callback(null)
+ * });
+ * }, function(err, result) {
+ * // result is now equal to [2, 4, 6]
+ * });
+ *
+ * @example
+ *
+ * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) {
+ * setImmediate(function () {
+ * obj[key] = val * 2;
+ * callback();
+ * })
+ * }, function (err, result) {
+ * // result is equal to {a: 2, b: 4, c: 6}
+ * })
+ */
+function transform (coll, accumulator, iteratee, callback) {
+ if (arguments.length <= 3) {
+ callback = iteratee;
+ iteratee = accumulator;
+ accumulator = isArray(coll) ? [] : {};
+ }
+ callback = once(callback || noop);
+ var _iteratee = wrapAsync(iteratee);
+
+ eachOf(coll, function(v, k, cb) {
+ _iteratee(accumulator, v, k, cb);
+ }, function(err) {
+ callback(err, accumulator);
+ });
+}
+
+/**
+ * It runs each task in series but stops whenever any of the functions were
+ * successful. If one of the tasks were successful, the `callback` will be
+ * passed the result of the successful task. If all tasks fail, the callback
+ * will be passed the error and result (if any) of the final attempt.
+ *
+ * @name tryEach
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} tasks - A collection containing functions to
+ * run, each function is passed a `callback(err, result)` it must call on
+ * completion with an error `err` (which can be `null`) and an optional `result`
+ * value.
+ * @param {Function} [callback] - An optional callback which is called when one
+ * of the tasks has succeeded, or all have failed. It receives the `err` and
+ * `result` arguments of the last attempt at completing the `task`. Invoked with
+ * (err, results).
+ * @example
+ * async.tryEach([
+ * function getDataFromFirstWebsite(callback) {
+ * // Try getting the data from the first website
+ * callback(err, data);
+ * },
+ * function getDataFromSecondWebsite(callback) {
+ * // First website failed,
+ * // Try getting the data from the backup website
+ * callback(err, data);
+ * }
+ * ],
+ * // optional callback
+ * function(err, results) {
+ * Now do something with the data.
+ * });
+ *
+ */
+function tryEach(tasks, callback) {
+ var error = null;
+ var result;
+ callback = callback || noop;
+ eachSeries(tasks, function(task, callback) {
+ wrapAsync(task)(function (err, res/*, ...args*/) {
+ if (arguments.length > 2) {
+ result = slice(arguments, 1);
+ } else {
+ result = res;
+ }
+ error = err;
+ callback(!err);
+ });
+ }, function () {
+ callback(error, result);
+ });
+}
+
+/**
+ * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,
+ * unmemoized form. Handy for testing.
+ *
+ * @name unmemoize
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @see [async.memoize]{@link module:Utils.memoize}
+ * @category Util
+ * @param {AsyncFunction} fn - the memoized function
+ * @returns {AsyncFunction} a function that calls the original unmemoized function
+ */
+function unmemoize(fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+}
+
+/**
+ * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when
+ * stopped, or an error occurs.
+ *
+ * @name whilst
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Function} test - synchronous truth test to perform before each
+ * execution of `iteratee`. Invoked with ().
+ * @param {AsyncFunction} iteratee - An async function which is called each time
+ * `test` passes. Invoked with (callback).
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `iteratee` has stopped. `callback`
+ * will be passed an error and any arguments passed to the final `iteratee`'s
+ * callback. Invoked with (err, [results]);
+ * @returns undefined
+ * @example
+ *
+ * var count = 0;
+ * async.whilst(
+ * function() { return count < 5; },
+ * function(callback) {
+ * count++;
+ * setTimeout(function() {
+ * callback(null, count);
+ * }, 1000);
+ * },
+ * function (err, n) {
+ * // 5 seconds have passed, n = 5
+ * }
+ * );
+ */
+function whilst(test, iteratee, callback) {
+ callback = onlyOnce(callback || noop);
+ var _iteratee = wrapAsync(iteratee);
+ if (!test()) return callback(null);
+ var next = function(err/*, ...args*/) {
+ if (err) return callback(err);
+ if (test()) return _iteratee(next);
+ var args = slice(arguments, 1);
+ callback.apply(null, [null].concat(args));
+ };
+ _iteratee(next);
+}
+
+/**
+ * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when
+ * stopped, or an error occurs. `callback` will be passed an error and any
+ * arguments passed to the final `iteratee`'s callback.
+ *
+ * The inverse of [whilst]{@link module:ControlFlow.whilst}.
+ *
+ * @name until
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.whilst]{@link module:ControlFlow.whilst}
+ * @category Control Flow
+ * @param {Function} test - synchronous truth test to perform before each
+ * execution of `iteratee`. Invoked with ().
+ * @param {AsyncFunction} iteratee - An async function which is called each time
+ * `test` fails. Invoked with (callback).
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has passed and repeated execution of `iteratee` has stopped. `callback`
+ * will be passed an error and any arguments passed to the final `iteratee`'s
+ * callback. Invoked with (err, [results]);
+ */
+function until(test, iteratee, callback) {
+ whilst(function() {
+ return !test.apply(this, arguments);
+ }, iteratee, callback);
+}
+
+/**
+ * Runs the `tasks` array of functions in series, each passing their results to
+ * the next in the array. However, if any of the `tasks` pass an error to their
+ * own callback, the next function is not executed, and the main `callback` is
+ * immediately called with the error.
+ *
+ * @name waterfall
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}
+ * to run.
+ * Each function should complete with any number of `result` values.
+ * The `result` values will be passed as arguments, in order, to the next task.
+ * @param {Function} [callback] - An optional callback to run once all the
+ * functions have completed. This will be passed the results of the last task's
+ * callback. Invoked with (err, [results]).
+ * @returns undefined
+ * @example
+ *
+ * async.waterfall([
+ * function(callback) {
+ * callback(null, 'one', 'two');
+ * },
+ * function(arg1, arg2, callback) {
+ * // arg1 now equals 'one' and arg2 now equals 'two'
+ * callback(null, 'three');
+ * },
+ * function(arg1, callback) {
+ * // arg1 now equals 'three'
+ * callback(null, 'done');
+ * }
+ * ], function (err, result) {
+ * // result now equals 'done'
+ * });
+ *
+ * // Or, with named functions:
+ * async.waterfall([
+ * myFirstFunction,
+ * mySecondFunction,
+ * myLastFunction,
+ * ], function (err, result) {
+ * // result now equals 'done'
+ * });
+ * function myFirstFunction(callback) {
+ * callback(null, 'one', 'two');
+ * }
+ * function mySecondFunction(arg1, arg2, callback) {
+ * // arg1 now equals 'one' and arg2 now equals 'two'
+ * callback(null, 'three');
+ * }
+ * function myLastFunction(arg1, callback) {
+ * // arg1 now equals 'three'
+ * callback(null, 'done');
+ * }
+ */
+var waterfall = function(tasks, callback) {
+ callback = once(callback || noop);
+ if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));
+ if (!tasks.length) return callback();
+ var taskIndex = 0;
+
+ function nextTask(args) {
+ var task = wrapAsync(tasks[taskIndex++]);
+ args.push(onlyOnce(next));
+ task.apply(null, args);
+ }
+
+ function next(err/*, ...args*/) {
+ if (err || taskIndex === tasks.length) {
+ return callback.apply(null, arguments);
+ }
+ nextTask(slice(arguments, 1));
+ }
+
+ nextTask([]);
+};
+
+/**
+ * An "async function" in the context of Async is an asynchronous function with
+ * a variable number of parameters, with the final parameter being a callback.
+ * (`function (arg1, arg2, ..., callback) {}`)
+ * The final callback is of the form `callback(err, results...)`, which must be
+ * called once the function is completed. The callback should be called with a
+ * Error as its first argument to signal that an error occurred.
+ * Otherwise, if no error occurred, it should be called with `null` as the first
+ * argument, and any additional `result` arguments that may apply, to signal
+ * successful completion.
+ * The callback must be called exactly once, ideally on a later tick of the
+ * JavaScript event loop.
+ *
+ * This type of function is also referred to as a "Node-style async function",
+ * or a "continuation passing-style function" (CPS). Most of the methods of this
+ * library are themselves CPS/Node-style async functions, or functions that
+ * return CPS/Node-style async functions.
+ *
+ * Wherever we accept a Node-style async function, we also directly accept an
+ * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.
+ * In this case, the `async` function will not be passed a final callback
+ * argument, and any thrown error will be used as the `err` argument of the
+ * implicit callback, and the return value will be used as the `result` value.
+ * (i.e. a `rejected` of the returned Promise becomes the `err` callback
+ * argument, and a `resolved` value becomes the `result`.)
+ *
+ * Note, due to JavaScript limitations, we can only detect native `async`
+ * functions and not transpilied implementations.
+ * Your environment must have `async`/`await` support for this to work.
+ * (e.g. Node > v7.6, or a recent version of a modern browser).
+ * If you are using `async` functions through a transpiler (e.g. Babel), you
+ * must still wrap the function with [asyncify]{@link module:Utils.asyncify},
+ * because the `async function` will be compiled to an ordinary function that
+ * returns a promise.
+ *
+ * @typedef {Function} AsyncFunction
+ * @static
+ */
+
+/**
+ * Async is a utility module which provides straight-forward, powerful functions
+ * for working with asynchronous JavaScript. Although originally designed for
+ * use with [Node.js](http://nodejs.org) and installable via
+ * `npm install --save async`, it can also be used directly in the browser.
+ * @module async
+ * @see AsyncFunction
+ */
+
+
+/**
+ * A collection of `async` functions for manipulating collections, such as
+ * arrays and objects.
+ * @module Collections
+ */
+
+/**
+ * A collection of `async` functions for controlling the flow through a script.
+ * @module ControlFlow
+ */
+
+/**
+ * A collection of `async` utility functions.
+ * @module Utils
+ */
+
+var index = {
+ apply: apply,
+ applyEach: applyEach,
+ applyEachSeries: applyEachSeries,
+ asyncify: asyncify,
+ auto: auto,
+ autoInject: autoInject,
+ cargo: cargo,
+ compose: compose,
+ concat: concat,
+ concatLimit: concatLimit,
+ concatSeries: concatSeries,
+ constant: constant,
+ detect: detect,
+ detectLimit: detectLimit,
+ detectSeries: detectSeries,
+ dir: dir,
+ doDuring: doDuring,
+ doUntil: doUntil,
+ doWhilst: doWhilst,
+ during: during,
+ each: eachLimit,
+ eachLimit: eachLimit$1,
+ eachOf: eachOf,
+ eachOfLimit: eachOfLimit,
+ eachOfSeries: eachOfSeries,
+ eachSeries: eachSeries,
+ ensureAsync: ensureAsync,
+ every: every,
+ everyLimit: everyLimit,
+ everySeries: everySeries,
+ filter: filter,
+ filterLimit: filterLimit,
+ filterSeries: filterSeries,
+ forever: forever,
+ groupBy: groupBy,
+ groupByLimit: groupByLimit,
+ groupBySeries: groupBySeries,
+ log: log,
+ map: map,
+ mapLimit: mapLimit,
+ mapSeries: mapSeries,
+ mapValues: mapValues,
+ mapValuesLimit: mapValuesLimit,
+ mapValuesSeries: mapValuesSeries,
+ memoize: memoize,
+ nextTick: nextTick,
+ parallel: parallelLimit,
+ parallelLimit: parallelLimit$1,
+ priorityQueue: priorityQueue,
+ queue: queue$1,
+ race: race,
+ reduce: reduce,
+ reduceRight: reduceRight,
+ reflect: reflect,
+ reflectAll: reflectAll,
+ reject: reject,
+ rejectLimit: rejectLimit,
+ rejectSeries: rejectSeries,
+ retry: retry,
+ retryable: retryable,
+ seq: seq,
+ series: series,
+ setImmediate: setImmediate$1,
+ some: some,
+ someLimit: someLimit,
+ someSeries: someSeries,
+ sortBy: sortBy,
+ timeout: timeout,
+ times: times,
+ timesLimit: timeLimit,
+ timesSeries: timesSeries,
+ transform: transform,
+ tryEach: tryEach,
+ unmemoize: unmemoize,
+ until: until,
+ waterfall: waterfall,
+ whilst: whilst,
+
+ // aliases
+ all: every,
+ allLimit: everyLimit,
+ allSeries: everySeries,
+ any: some,
+ anyLimit: someLimit,
+ anySeries: someSeries,
+ find: detect,
+ findLimit: detectLimit,
+ findSeries: detectSeries,
+ forEach: eachLimit,
+ forEachSeries: eachSeries,
+ forEachLimit: eachLimit$1,
+ forEachOf: eachOf,
+ forEachOfSeries: eachOfSeries,
+ forEachOfLimit: eachOfLimit,
+ inject: reduce,
+ foldl: reduce,
+ foldr: reduceRight,
+ select: filter,
+ selectLimit: filterLimit,
+ selectSeries: filterSeries,
+ wrapSync: asyncify
+};
+
+exports['default'] = index;
+exports.apply = apply;
+exports.applyEach = applyEach;
+exports.applyEachSeries = applyEachSeries;
+exports.asyncify = asyncify;
+exports.auto = auto;
+exports.autoInject = autoInject;
+exports.cargo = cargo;
+exports.compose = compose;
+exports.concat = concat;
+exports.concatLimit = concatLimit;
+exports.concatSeries = concatSeries;
+exports.constant = constant;
+exports.detect = detect;
+exports.detectLimit = detectLimit;
+exports.detectSeries = detectSeries;
+exports.dir = dir;
+exports.doDuring = doDuring;
+exports.doUntil = doUntil;
+exports.doWhilst = doWhilst;
+exports.during = during;
+exports.each = eachLimit;
+exports.eachLimit = eachLimit$1;
+exports.eachOf = eachOf;
+exports.eachOfLimit = eachOfLimit;
+exports.eachOfSeries = eachOfSeries;
+exports.eachSeries = eachSeries;
+exports.ensureAsync = ensureAsync;
+exports.every = every;
+exports.everyLimit = everyLimit;
+exports.everySeries = everySeries;
+exports.filter = filter;
+exports.filterLimit = filterLimit;
+exports.filterSeries = filterSeries;
+exports.forever = forever;
+exports.groupBy = groupBy;
+exports.groupByLimit = groupByLimit;
+exports.groupBySeries = groupBySeries;
+exports.log = log;
+exports.map = map;
+exports.mapLimit = mapLimit;
+exports.mapSeries = mapSeries;
+exports.mapValues = mapValues;
+exports.mapValuesLimit = mapValuesLimit;
+exports.mapValuesSeries = mapValuesSeries;
+exports.memoize = memoize;
+exports.nextTick = nextTick;
+exports.parallel = parallelLimit;
+exports.parallelLimit = parallelLimit$1;
+exports.priorityQueue = priorityQueue;
+exports.queue = queue$1;
+exports.race = race;
+exports.reduce = reduce;
+exports.reduceRight = reduceRight;
+exports.reflect = reflect;
+exports.reflectAll = reflectAll;
+exports.reject = reject;
+exports.rejectLimit = rejectLimit;
+exports.rejectSeries = rejectSeries;
+exports.retry = retry;
+exports.retryable = retryable;
+exports.seq = seq;
+exports.series = series;
+exports.setImmediate = setImmediate$1;
+exports.some = some;
+exports.someLimit = someLimit;
+exports.someSeries = someSeries;
+exports.sortBy = sortBy;
+exports.timeout = timeout;
+exports.times = times;
+exports.timesLimit = timeLimit;
+exports.timesSeries = timesSeries;
+exports.transform = transform;
+exports.tryEach = tryEach;
+exports.unmemoize = unmemoize;
+exports.until = until;
+exports.waterfall = waterfall;
+exports.whilst = whilst;
+exports.all = every;
+exports.allLimit = everyLimit;
+exports.allSeries = everySeries;
+exports.any = some;
+exports.anyLimit = someLimit;
+exports.anySeries = someSeries;
+exports.find = detect;
+exports.findLimit = detectLimit;
+exports.findSeries = detectSeries;
+exports.forEach = eachLimit;
+exports.forEachSeries = eachSeries;
+exports.forEachLimit = eachLimit$1;
+exports.forEachOf = eachOf;
+exports.forEachOfSeries = eachOfSeries;
+exports.forEachOfLimit = eachOfLimit;
+exports.inject = reduce;
+exports.foldl = reduce;
+exports.foldr = reduceRight;
+exports.select = filter;
+exports.selectLimit = filterLimit;
+exports.selectSeries = filterSeries;
+exports.wrapSync = asyncify;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+})));
+
+}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
+},{"_process":37,"timers":38}],3:[function(require,module,exports){
+
+},{}],4:[function(require,module,exports){
+(function (process){(function (){
+/* eslint-env browser */
+
+/**
+ * This is the web browser implementation of `debug()`.
+ */
+
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = localstorage();
+exports.destroy = (() => {
+ let warned = false;
+
+ return () => {
+ if (!warned) {
+ warned = true;
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+ };
+})();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+ '#0000CC',
+ '#0000FF',
+ '#0033CC',
+ '#0033FF',
+ '#0066CC',
+ '#0066FF',
+ '#0099CC',
+ '#0099FF',
+ '#00CC00',
+ '#00CC33',
+ '#00CC66',
+ '#00CC99',
+ '#00CCCC',
+ '#00CCFF',
+ '#3300CC',
+ '#3300FF',
+ '#3333CC',
+ '#3333FF',
+ '#3366CC',
+ '#3366FF',
+ '#3399CC',
+ '#3399FF',
+ '#33CC00',
+ '#33CC33',
+ '#33CC66',
+ '#33CC99',
+ '#33CCCC',
+ '#33CCFF',
+ '#6600CC',
+ '#6600FF',
+ '#6633CC',
+ '#6633FF',
+ '#66CC00',
+ '#66CC33',
+ '#9900CC',
+ '#9900FF',
+ '#9933CC',
+ '#9933FF',
+ '#99CC00',
+ '#99CC33',
+ '#CC0000',
+ '#CC0033',
+ '#CC0066',
+ '#CC0099',
+ '#CC00CC',
+ '#CC00FF',
+ '#CC3300',
+ '#CC3333',
+ '#CC3366',
+ '#CC3399',
+ '#CC33CC',
+ '#CC33FF',
+ '#CC6600',
+ '#CC6633',
+ '#CC9900',
+ '#CC9933',
+ '#CCCC00',
+ '#CCCC33',
+ '#FF0000',
+ '#FF0033',
+ '#FF0066',
+ '#FF0099',
+ '#FF00CC',
+ '#FF00FF',
+ '#FF3300',
+ '#FF3333',
+ '#FF3366',
+ '#FF3399',
+ '#FF33CC',
+ '#FF33FF',
+ '#FF6600',
+ '#FF6633',
+ '#FF9900',
+ '#FF9933',
+ '#FFCC00',
+ '#FFCC33'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+// eslint-disable-next-line complexity
+function useColors() {
+ // NB: In an Electron preload script, document will be defined but not fully
+ // initialized. Since we know we're in Chrome, we'll just detect this case
+ // explicitly
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
+ return true;
+ }
+
+ // Internet Explorer and Edge do not support colors.
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
+ return false;
+ }
+
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+ // Is firebug? http://stackoverflow.com/a/398120/376773
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+ // Is firefox >= v31?
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+ // Double check webkit in userAgent just in case we are in a worker
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ args[0] = (this.useColors ? '%c' : '') +
+ this.namespace +
+ (this.useColors ? ' %c' : ' ') +
+ args[0] +
+ (this.useColors ? '%c ' : ' ') +
+ '+' + module.exports.humanize(this.diff);
+
+ if (!this.useColors) {
+ return;
+ }
+
+ const c = 'color: ' + this.color;
+ args.splice(1, 0, c, 'color: inherit');
+
+ // The final "%c" is somewhat tricky, because there could be other
+ // arguments passed either before or after the %c, so we need to
+ // figure out the correct index to insert the CSS into
+ let index = 0;
+ let lastC = 0;
+ args[0].replace(/%[a-zA-Z%]/g, match => {
+ if (match === '%%') {
+ return;
+ }
+ index++;
+ if (match === '%c') {
+ // We only are interested in the *last* %c
+ // (the user may have provided their own)
+ lastC = index;
+ }
+ });
+
+ args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.debug()` when available.
+ * No-op when `console.debug` is not a "function".
+ * If `console.debug` is not available, falls back
+ * to `console.log`.
+ *
+ * @api public
+ */
+exports.log = console.debug || console.log || (() => {});
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ try {
+ if (namespaces) {
+ exports.storage.setItem('debug', namespaces);
+ } else {
+ exports.storage.removeItem('debug');
+ }
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+function load() {
+ let r;
+ try {
+ r = exports.storage.getItem('debug');
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
+ r = process.env.DEBUG;
+ }
+
+ return r;
+}
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+ try {
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
+ // The Browser also has localStorage in the global context.
+ return localStorage;
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+module.exports = require('./common')(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+formatters.j = function (v) {
+ try {
+ return JSON.stringify(v);
+ } catch (error) {
+ return '[UnexpectedJSONParseError]: ' + error.message;
+ }
+};
+
+}).call(this)}).call(this,require('_process'))
+},{"./common":5,"_process":37}],5:[function(require,module,exports){
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ */
+
+function setup(env) {
+ createDebug.debug = createDebug;
+ createDebug.default = createDebug;
+ createDebug.coerce = coerce;
+ createDebug.disable = disable;
+ createDebug.enable = enable;
+ createDebug.enabled = enabled;
+ createDebug.humanize = require('ms');
+ createDebug.destroy = destroy;
+
+ Object.keys(env).forEach(key => {
+ createDebug[key] = env[key];
+ });
+
+ /**
+ * The currently active debug mode names, and names to skip.
+ */
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ /**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+ createDebug.formatters = {};
+
+ /**
+ * Selects a color for a debug namespace
+ * @param {String} namespace The namespace string for the debug instance to be colored
+ * @return {Number|String} An ANSI color code for the given namespace
+ * @api private
+ */
+ function selectColor(namespace) {
+ let hash = 0;
+
+ for (let i = 0; i < namespace.length; i++) {
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
+ hash |= 0; // Convert to 32bit integer
+ }
+
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
+ }
+ createDebug.selectColor = selectColor;
+
+ /**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+ function createDebug(namespace) {
+ let prevTime;
+ let enableOverride = null;
+ let namespacesCache;
+ let enabledCache;
+
+ function debug(...args) {
+ // Disabled?
+ if (!debug.enabled) {
+ return;
+ }
+
+ const self = debug;
+
+ // Set `diff` timestamp
+ const curr = Number(new Date());
+ const ms = curr - (prevTime || curr);
+ self.diff = ms;
+ self.prev = prevTime;
+ self.curr = curr;
+ prevTime = curr;
+
+ args[0] = createDebug.coerce(args[0]);
+
+ if (typeof args[0] !== 'string') {
+ // Anything else let's inspect with %O
+ args.unshift('%O');
+ }
+
+ // Apply any `formatters` transformations
+ let index = 0;
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
+ // If we encounter an escaped % then don't increase the array index
+ if (match === '%%') {
+ return '%';
+ }
+ index++;
+ const formatter = createDebug.formatters[format];
+ if (typeof formatter === 'function') {
+ const val = args[index];
+ match = formatter.call(self, val);
+
+ // Now we need to remove `args[index]` since it's inlined in the `format`
+ args.splice(index, 1);
+ index--;
+ }
+ return match;
+ });
+
+ // Apply env-specific formatting (colors, etc.)
+ createDebug.formatArgs.call(self, args);
+
+ const logFn = self.log || createDebug.log;
+ logFn.apply(self, args);
+ }
+
+ debug.namespace = namespace;
+ debug.useColors = createDebug.useColors();
+ debug.color = createDebug.selectColor(namespace);
+ debug.extend = extend;
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
+
+ Object.defineProperty(debug, 'enabled', {
+ enumerable: true,
+ configurable: false,
+ get: () => {
+ if (enableOverride !== null) {
+ return enableOverride;
+ }
+ if (namespacesCache !== createDebug.namespaces) {
+ namespacesCache = createDebug.namespaces;
+ enabledCache = createDebug.enabled(namespace);
+ }
+
+ return enabledCache;
+ },
+ set: v => {
+ enableOverride = v;
+ }
+ });
+
+ // Env-specific initialization logic for debug instances
+ if (typeof createDebug.init === 'function') {
+ createDebug.init(debug);
+ }
+
+ return debug;
+ }
+
+ function extend(namespace, delimiter) {
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
+ newDebug.log = this.log;
+ return newDebug;
+ }
+
+ /**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+ function enable(namespaces) {
+ createDebug.save(namespaces);
+ createDebug.namespaces = namespaces;
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ let i;
+ const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+ const len = split.length;
+
+ for (i = 0; i < len; i++) {
+ if (!split[i]) {
+ // ignore empty strings
+ continue;
+ }
+
+ namespaces = split[i].replace(/\*/g, '.*?');
+
+ if (namespaces[0] === '-') {
+ createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
+ } else {
+ createDebug.names.push(new RegExp('^' + namespaces + '$'));
+ }
+ }
+ }
+
+ /**
+ * Disable debug output.
+ *
+ * @return {String} namespaces
+ * @api public
+ */
+ function disable() {
+ const namespaces = [
+ ...createDebug.names.map(toNamespace),
+ ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
+ ].join(',');
+ createDebug.enable('');
+ return namespaces;
+ }
+
+ /**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+ function enabled(name) {
+ if (name[name.length - 1] === '*') {
+ return true;
+ }
+
+ let i;
+ let len;
+
+ for (i = 0, len = createDebug.skips.length; i < len; i++) {
+ if (createDebug.skips[i].test(name)) {
+ return false;
+ }
+ }
+
+ for (i = 0, len = createDebug.names.length; i < len; i++) {
+ if (createDebug.names[i].test(name)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Convert regexp to namespace
+ *
+ * @param {RegExp} regxep
+ * @return {String} namespace
+ * @api private
+ */
+ function toNamespace(regexp) {
+ return regexp.toString()
+ .substring(2, regexp.toString().length - 2)
+ .replace(/\.\*\?$/, '*');
+ }
+
+ /**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+ function coerce(val) {
+ if (val instanceof Error) {
+ return val.stack || val.message;
+ }
+ return val;
+ }
+
+ /**
+ * XXX DO NOT USE. This is a temporary stub function.
+ * XXX It WILL be removed in the next major release.
+ */
+ function destroy() {
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+
+ createDebug.enable(createDebug.load());
+
+ return createDebug;
+}
+
+module.exports = setup;
+
+},{"ms":36}],6:[function(require,module,exports){
+(function (process,setImmediate){(function (){
+/*!
+ * EventEmitter2
+ * https://github.com/hij1nx/EventEmitter2
+ *
+ * Copyright (c) 2013 hij1nx
+ * Licensed under the MIT license.
+ */
+;!function(undefined) {
+ var hasOwnProperty= Object.hasOwnProperty;
+ var isArray = Array.isArray ? Array.isArray : function _isArray(obj) {
+ return Object.prototype.toString.call(obj) === "[object Array]";
+ };
+ var defaultMaxListeners = 10;
+ var nextTickSupported= typeof process=='object' && typeof process.nextTick=='function';
+ var symbolsSupported= typeof Symbol==='function';
+ var reflectSupported= typeof Reflect === 'object';
+ var setImmediateSupported= typeof setImmediate === 'function';
+ var _setImmediate= setImmediateSupported ? setImmediate : setTimeout;
+ var ownKeys= symbolsSupported? (reflectSupported && typeof Reflect.ownKeys==='function'? Reflect.ownKeys : function(obj){
+ var arr= Object.getOwnPropertyNames(obj);
+ arr.push.apply(arr, Object.getOwnPropertySymbols(obj));
+ return arr;
+ }) : Object.keys;
+
+ function init() {
+ this._events = {};
+ if (this._conf) {
+ configure.call(this, this._conf);
+ }
+ }
+
+ function configure(conf) {
+ if (conf) {
+ this._conf = conf;
+
+ conf.delimiter && (this.delimiter = conf.delimiter);
+
+ if(conf.maxListeners!==undefined){
+ this._maxListeners= conf.maxListeners;
+ }
+
+ conf.wildcard && (this.wildcard = conf.wildcard);
+ conf.newListener && (this._newListener = conf.newListener);
+ conf.removeListener && (this._removeListener = conf.removeListener);
+ conf.verboseMemoryLeak && (this.verboseMemoryLeak = conf.verboseMemoryLeak);
+ conf.ignoreErrors && (this.ignoreErrors = conf.ignoreErrors);
+
+ if (this.wildcard) {
+ this.listenerTree = {};
+ }
+ }
+ }
+
+ function logPossibleMemoryLeak(count, eventName) {
+ var errorMsg = '(node) warning: possible EventEmitter memory ' +
+ 'leak detected. ' + count + ' listeners added. ' +
+ 'Use emitter.setMaxListeners() to increase limit.';
+
+ if(this.verboseMemoryLeak){
+ errorMsg += ' Event name: ' + eventName + '.';
+ }
+
+ if(typeof process !== 'undefined' && process.emitWarning){
+ var e = new Error(errorMsg);
+ e.name = 'MaxListenersExceededWarning';
+ e.emitter = this;
+ e.count = count;
+ process.emitWarning(e);
+ } else {
+ console.error(errorMsg);
+
+ if (console.trace){
+ console.trace();
+ }
+ }
+ }
+
+ var toArray = function (a, b, c) {
+ var n = arguments.length;
+ switch (n) {
+ case 0:
+ return [];
+ case 1:
+ return [a];
+ case 2:
+ return [a, b];
+ case 3:
+ return [a, b, c];
+ default:
+ var arr = new Array(n);
+ while (n--) {
+ arr[n] = arguments[n];
+ }
+ return arr;
+ }
+ };
+
+ function toObject(keys, values) {
+ var obj = {};
+ var key;
+ var len = keys.length;
+ var valuesCount = values ? values.length : 0;
+ for (var i = 0; i < len; i++) {
+ key = keys[i];
+ obj[key] = i < valuesCount ? values[i] : undefined;
+ }
+ return obj;
+ }
+
+ function TargetObserver(emitter, target, options) {
+ this._emitter = emitter;
+ this._target = target;
+ this._listeners = {};
+ this._listenersCount = 0;
+
+ var on, off;
+
+ if (options.on || options.off) {
+ on = options.on;
+ off = options.off;
+ }
+
+ if (target.addEventListener) {
+ on = target.addEventListener;
+ off = target.removeEventListener;
+ } else if (target.addListener) {
+ on = target.addListener;
+ off = target.removeListener;
+ } else if (target.on) {
+ on = target.on;
+ off = target.off;
+ }
+
+ if (!on && !off) {
+ throw Error('target does not implement any known event API');
+ }
+
+ if (typeof on !== 'function') {
+ throw TypeError('on method must be a function');
+ }
+
+ if (typeof off !== 'function') {
+ throw TypeError('off method must be a function');
+ }
+
+ this._on = on;
+ this._off = off;
+
+ var _observers= emitter._observers;
+ if(_observers){
+ _observers.push(this);
+ }else{
+ emitter._observers= [this];
+ }
+ }
+
+ Object.assign(TargetObserver.prototype, {
+ subscribe: function(event, localEvent, reducer){
+ var observer= this;
+ var target= this._target;
+ var emitter= this._emitter;
+ var listeners= this._listeners;
+ var handler= function(){
+ var args= toArray.apply(null, arguments);
+ var eventObj= {
+ data: args,
+ name: localEvent,
+ original: event
+ };
+ if(reducer){
+ var result= reducer.call(target, eventObj);
+ if(result!==false){
+ emitter.emit.apply(emitter, [eventObj.name].concat(args))
+ }
+ return;
+ }
+ emitter.emit.apply(emitter, [localEvent].concat(args));
+ };
+
+
+ if(listeners[event]){
+ throw Error('Event \'' + event + '\' is already listening');
+ }
+
+ this._listenersCount++;
+
+ if(emitter._newListener && emitter._removeListener && !observer._onNewListener){
+
+ this._onNewListener = function (_event) {
+ if (_event === localEvent && listeners[event] === null) {
+ listeners[event] = handler;
+ observer._on.call(target, event, handler);
+ }
+ };
+
+ emitter.on('newListener', this._onNewListener);
+
+ this._onRemoveListener= function(_event){
+ if(_event === localEvent && !emitter.hasListeners(_event) && listeners[event]){
+ listeners[event]= null;
+ observer._off.call(target, event, handler);
+ }
+ };
+
+ listeners[event]= null;
+
+ emitter.on('removeListener', this._onRemoveListener);
+ }else{
+ listeners[event]= handler;
+ observer._on.call(target, event, handler);
+ }
+ },
+
+ unsubscribe: function(event){
+ var observer= this;
+ var listeners= this._listeners;
+ var emitter= this._emitter;
+ var handler;
+ var events;
+ var off= this._off;
+ var target= this._target;
+ var i;
+
+ if(event && typeof event!=='string'){
+ throw TypeError('event must be a string');
+ }
+
+ function clearRefs(){
+ if(observer._onNewListener){
+ emitter.off('newListener', observer._onNewListener);
+ emitter.off('removeListener', observer._onRemoveListener);
+ observer._onNewListener= null;
+ observer._onRemoveListener= null;
+ }
+ var index= findTargetIndex.call(emitter, observer);
+ emitter._observers.splice(index, 1);
+ }
+
+ if(event){
+ handler= listeners[event];
+ if(!handler) return;
+ off.call(target, event, handler);
+ delete listeners[event];
+ if(!--this._listenersCount){
+ clearRefs();
+ }
+ }else{
+ events= ownKeys(listeners);
+ i= events.length;
+ while(i-->0){
+ event= events[i];
+ off.call(target, event, listeners[event]);
+ }
+ this._listeners= {};
+ this._listenersCount= 0;
+ clearRefs();
+ }
+ }
+ });
+
+ function resolveOptions(options, schema, reducers, allowUnknown) {
+ var computedOptions = Object.assign({}, schema);
+
+ if (!options) return computedOptions;
+
+ if (typeof options !== 'object') {
+ throw TypeError('options must be an object')
+ }
+
+ var keys = Object.keys(options);
+ var length = keys.length;
+ var option, value;
+ var reducer;
+
+ function reject(reason) {
+ throw Error('Invalid "' + option + '" option value' + (reason ? '. Reason: ' + reason : ''))
+ }
+
+ for (var i = 0; i < length; i++) {
+ option = keys[i];
+ if (!allowUnknown && !hasOwnProperty.call(schema, option)) {
+ throw Error('Unknown "' + option + '" option');
+ }
+ value = options[option];
+ if (value !== undefined) {
+ reducer = reducers[option];
+ computedOptions[option] = reducer ? reducer(value, reject) : value;
+ }
+ }
+ return computedOptions;
+ }
+
+ function constructorReducer(value, reject) {
+ if (typeof value !== 'function' || !value.hasOwnProperty('prototype')) {
+ reject('value must be a constructor');
+ }
+ return value;
+ }
+
+ function makeTypeReducer(types) {
+ var message= 'value must be type of ' + types.join('|');
+ var len= types.length;
+ var firstType= types[0];
+ var secondType= types[1];
+
+ if (len === 1) {
+ return function (v, reject) {
+ if (typeof v === firstType) {
+ return v;
+ }
+ reject(message);
+ }
+ }
+
+ if (len === 2) {
+ return function (v, reject) {
+ var kind= typeof v;
+ if (kind === firstType || kind === secondType) return v;
+ reject(message);
+ }
+ }
+
+ return function (v, reject) {
+ var kind = typeof v;
+ var i = len;
+ while (i-- > 0) {
+ if (kind === types[i]) return v;
+ }
+ reject(message);
+ }
+ }
+
+ var functionReducer= makeTypeReducer(['function']);
+
+ var objectFunctionReducer= makeTypeReducer(['object', 'function']);
+
+ function makeCancelablePromise(Promise, executor, options) {
+ var isCancelable;
+ var callbacks;
+ var timer= 0;
+ var subscriptionClosed;
+
+ var promise = new Promise(function (resolve, reject, onCancel) {
+ options= resolveOptions(options, {
+ timeout: 0,
+ overload: false
+ }, {
+ timeout: function(value, reject){
+ value*= 1;
+ if (typeof value !== 'number' || value < 0 || !Number.isFinite(value)) {
+ reject('timeout must be a positive number');
+ }
+ return value;
+ }
+ });
+
+ isCancelable = !options.overload && typeof Promise.prototype.cancel === 'function' && typeof onCancel === 'function';
+
+ function cleanup() {
+ if (callbacks) {
+ callbacks = null;
+ }
+ if (timer) {
+ clearTimeout(timer);
+ timer = 0;
+ }
+ }
+
+ var _resolve= function(value){
+ cleanup();
+ resolve(value);
+ };
+
+ var _reject= function(err){
+ cleanup();
+ reject(err);
+ };
+
+ if (isCancelable) {
+ executor(_resolve, _reject, onCancel);
+ } else {
+ callbacks = [function(reason){
+ _reject(reason || Error('canceled'));
+ }];
+ executor(_resolve, _reject, function (cb) {
+ if (subscriptionClosed) {
+ throw Error('Unable to subscribe on cancel event asynchronously')
+ }
+ if (typeof cb !== 'function') {
+ throw TypeError('onCancel callback must be a function');
+ }
+ callbacks.push(cb);
+ });
+ subscriptionClosed= true;
+ }
+
+ if (options.timeout > 0) {
+ timer= setTimeout(function(){
+ var reason= Error('timeout');
+ reason.code = 'ETIMEDOUT'
+ timer= 0;
+ promise.cancel(reason);
+ reject(reason);
+ }, options.timeout);
+ }
+ });
+
+ if (!isCancelable) {
+ promise.cancel = function (reason) {
+ if (!callbacks) {
+ return;
+ }
+ var length = callbacks.length;
+ for (var i = 1; i < length; i++) {
+ callbacks[i](reason);
+ }
+ // internal callback to reject the promise
+ callbacks[0](reason);
+ callbacks = null;
+ };
+ }
+
+ return promise;
+ }
+
+ function findTargetIndex(observer) {
+ var observers = this._observers;
+ if(!observers){
+ return -1;
+ }
+ var len = observers.length;
+ for (var i = 0; i < len; i++) {
+ if (observers[i]._target === observer) return i;
+ }
+ return -1;
+ }
+
+ // Attention, function return type now is array, always !
+ // It has zero elements if no any matches found and one or more
+ // elements (leafs) if there are matches
+ //
+ function searchListenerTree(handlers, type, tree, i, typeLength) {
+ if (!tree) {
+ return null;
+ }
+
+ if (i === 0) {
+ var kind = typeof type;
+ if (kind === 'string') {
+ var ns, n, l = 0, j = 0, delimiter = this.delimiter, dl = delimiter.length;
+ if ((n = type.indexOf(delimiter)) !== -1) {
+ ns = new Array(5);
+ do {
+ ns[l++] = type.slice(j, n);
+ j = n + dl;
+ } while ((n = type.indexOf(delimiter, j)) !== -1);
+
+ ns[l++] = type.slice(j);
+ type = ns;
+ typeLength = l;
+ } else {
+ type = [type];
+ typeLength = 1;
+ }
+ } else if (kind === 'object') {
+ typeLength = type.length;
+ } else {
+ type = [type];
+ typeLength = 1;
+ }
+ }
+
+ var listeners= null, branch, xTree, xxTree, isolatedBranch, endReached, currentType = type[i],
+ nextType = type[i + 1], branches, _listeners;
+
+ if (i === typeLength) {
+ //
+ // If at the end of the event(s) list and the tree has listeners
+ // invoke those listeners.
+ //
+
+ if(tree._listeners) {
+ if (typeof tree._listeners === 'function') {
+ handlers && handlers.push(tree._listeners);
+ listeners = [tree];
+ } else {
+ handlers && handlers.push.apply(handlers, tree._listeners);
+ listeners = [tree];
+ }
+ }
+ } else {
+
+ if (currentType === '*') {
+ //
+ // If the event emitted is '*' at this part
+ // or there is a concrete match at this patch
+ //
+ branches = ownKeys(tree);
+ n = branches.length;
+ while (n-- > 0) {
+ branch = branches[n];
+ if (branch !== '_listeners') {
+ _listeners = searchListenerTree(handlers, type, tree[branch], i + 1, typeLength);
+ if (_listeners) {
+ if (listeners) {
+ listeners.push.apply(listeners, _listeners);
+ } else {
+ listeners = _listeners;
+ }
+ }
+ }
+ }
+ return listeners;
+ } else if (currentType === '**') {
+ endReached = (i + 1 === typeLength || (i + 2 === typeLength && nextType === '*'));
+ if (endReached && tree._listeners) {
+ // The next element has a _listeners, add it to the handlers.
+ listeners = searchListenerTree(handlers, type, tree, typeLength, typeLength);
+ }
+
+ branches = ownKeys(tree);
+ n = branches.length;
+ while (n-- > 0) {
+ branch = branches[n];
+ if (branch !== '_listeners') {
+ if (branch === '*' || branch === '**') {
+ if (tree[branch]._listeners && !endReached) {
+ _listeners = searchListenerTree(handlers, type, tree[branch], typeLength, typeLength);
+ if (_listeners) {
+ if (listeners) {
+ listeners.push.apply(listeners, _listeners);
+ } else {
+ listeners = _listeners;
+ }
+ }
+ }
+ _listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);
+ } else if (branch === nextType) {
+ _listeners = searchListenerTree(handlers, type, tree[branch], i + 2, typeLength);
+ } else {
+ // No match on this one, shift into the tree but not in the type array.
+ _listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);
+ }
+ if (_listeners) {
+ if (listeners) {
+ listeners.push.apply(listeners, _listeners);
+ } else {
+ listeners = _listeners;
+ }
+ }
+ }
+ }
+ return listeners;
+ } else if (tree[currentType]) {
+ listeners = searchListenerTree(handlers, type, tree[currentType], i + 1, typeLength);
+ }
+ }
+
+ xTree = tree['*'];
+ if (xTree) {
+ //
+ // If the listener tree will allow any match for this part,
+ // then recursively explore all branches of the tree
+ //
+ searchListenerTree(handlers, type, xTree, i + 1, typeLength);
+ }
+
+ xxTree = tree['**'];
+ if (xxTree) {
+ if (i < typeLength) {
+ if (xxTree._listeners) {
+ // If we have a listener on a '**', it will catch all, so add its handler.
+ searchListenerTree(handlers, type, xxTree, typeLength, typeLength);
+ }
+
+ // Build arrays of matching next branches and others.
+ branches= ownKeys(xxTree);
+ n= branches.length;
+ while(n-->0){
+ branch= branches[n];
+ if (branch !== '_listeners') {
+ if (branch === nextType) {
+ // We know the next element will match, so jump twice.
+ searchListenerTree(handlers, type, xxTree[branch], i + 2, typeLength);
+ } else if (branch === currentType) {
+ // Current node matches, move into the tree.
+ searchListenerTree(handlers, type, xxTree[branch], i + 1, typeLength);
+ } else {
+ isolatedBranch = {};
+ isolatedBranch[branch] = xxTree[branch];
+ searchListenerTree(handlers, type, {'**': isolatedBranch}, i + 1, typeLength);
+ }
+ }
+ }
+ } else if (xxTree._listeners) {
+ // We have reached the end and still on a '**'
+ searchListenerTree(handlers, type, xxTree, typeLength, typeLength);
+ } else if (xxTree['*'] && xxTree['*']._listeners) {
+ searchListenerTree(handlers, type, xxTree['*'], typeLength, typeLength);
+ }
+ }
+
+ return listeners;
+ }
+
+ function growListenerTree(type, listener, prepend) {
+ var len = 0, j = 0, i, delimiter = this.delimiter, dl= delimiter.length, ns;
+
+ if(typeof type==='string') {
+ if ((i = type.indexOf(delimiter)) !== -1) {
+ ns = new Array(5);
+ do {
+ ns[len++] = type.slice(j, i);
+ j = i + dl;
+ } while ((i = type.indexOf(delimiter, j)) !== -1);
+
+ ns[len++] = type.slice(j);
+ }else{
+ ns= [type];
+ len= 1;
+ }
+ }else{
+ ns= type;
+ len= type.length;
+ }
+
+ //
+ // Looks for two consecutive '**', if so, don't add the event at all.
+ //
+ if (len > 1) {
+ for (i = 0; i + 1 < len; i++) {
+ if (ns[i] === '**' && ns[i + 1] === '**') {
+ return;
+ }
+ }
+ }
+
+
+
+ var tree = this.listenerTree, name;
+
+ for (i = 0; i < len; i++) {
+ name = ns[i];
+
+ tree = tree[name] || (tree[name] = {});
+
+ if (i === len - 1) {
+ if (!tree._listeners) {
+ tree._listeners = listener;
+ } else {
+ if (typeof tree._listeners === 'function') {
+ tree._listeners = [tree._listeners];
+ }
+
+ if (prepend) {
+ tree._listeners.unshift(listener);
+ } else {
+ tree._listeners.push(listener);
+ }
+
+ if (
+ !tree._listeners.warned &&
+ this._maxListeners > 0 &&
+ tree._listeners.length > this._maxListeners
+ ) {
+ tree._listeners.warned = true;
+ logPossibleMemoryLeak.call(this, tree._listeners.length, name);
+ }
+ }
+ return true;
+ }
+ }
+
+ return true;
+ }
+
+ function collectTreeEvents(tree, events, root, asArray){
+ var branches= ownKeys(tree);
+ var i= branches.length;
+ var branch, branchName, path;
+ var hasListeners= tree['_listeners'];
+ var isArrayPath;
+
+ while(i-->0){
+ branchName= branches[i];
+
+ branch= tree[branchName];
+
+ if(branchName==='_listeners'){
+ path= root;
+ }else {
+ path = root ? root.concat(branchName) : [branchName];
+ }
+
+ isArrayPath= asArray || typeof branchName==='symbol';
+
+ hasListeners && events.push(isArrayPath? path : path.join(this.delimiter));
+
+ if(typeof branch==='object'){
+ collectTreeEvents.call(this, branch, events, path, isArrayPath);
+ }
+ }
+
+ return events;
+ }
+
+ function recursivelyGarbageCollect(root) {
+ var keys = ownKeys(root);
+ var i= keys.length;
+ var obj, key, flag;
+ while(i-->0){
+ key = keys[i];
+ obj = root[key];
+
+ if(obj){
+ flag= true;
+ if(key !== '_listeners' && !recursivelyGarbageCollect(obj)){
+ delete root[key];
+ }
+ }
+ }
+
+ return flag;
+ }
+
+ function Listener(emitter, event, listener){
+ this.emitter= emitter;
+ this.event= event;
+ this.listener= listener;
+ }
+
+ Listener.prototype.off= function(){
+ this.emitter.off(this.event, this.listener);
+ return this;
+ };
+
+ function setupListener(event, listener, options){
+ if (options === true) {
+ promisify = true;
+ } else if (options === false) {
+ async = true;
+ } else {
+ if (!options || typeof options !== 'object') {
+ throw TypeError('options should be an object or true');
+ }
+ var async = options.async;
+ var promisify = options.promisify;
+ var nextTick = options.nextTick;
+ var objectify = options.objectify;
+ }
+
+ if (async || nextTick || promisify) {
+ var _listener = listener;
+ var _origin = listener._origin || listener;
+
+ if (nextTick && !nextTickSupported) {
+ throw Error('process.nextTick is not supported');
+ }
+
+ if (promisify === undefined) {
+ promisify = listener.constructor.name === 'AsyncFunction';
+ }
+
+ listener = function () {
+ var args = arguments;
+ var context = this;
+ var event = this.event;
+
+ return promisify ? (nextTick ? Promise.resolve() : new Promise(function (resolve) {
+ _setImmediate(resolve);
+ }).then(function () {
+ context.event = event;
+ return _listener.apply(context, args)
+ })) : (nextTick ? process.nextTick : _setImmediate)(function () {
+ context.event = event;
+ _listener.apply(context, args)
+ });
+ };
+
+ listener._async = true;
+ listener._origin = _origin;
+ }
+
+ return [listener, objectify? new Listener(this, event, listener): this];
+ }
+
+ function EventEmitter(conf) {
+ this._events = {};
+ this._newListener = false;
+ this._removeListener = false;
+ this.verboseMemoryLeak = false;
+ configure.call(this, conf);
+ }
+
+ EventEmitter.EventEmitter2 = EventEmitter; // backwards compatibility for exporting EventEmitter property
+
+ EventEmitter.prototype.listenTo= function(target, events, options){
+ if(typeof target!=='object'){
+ throw TypeError('target musts be an object');
+ }
+
+ var emitter= this;
+
+ options = resolveOptions(options, {
+ on: undefined,
+ off: undefined,
+ reducers: undefined
+ }, {
+ on: functionReducer,
+ off: functionReducer,
+ reducers: objectFunctionReducer
+ });
+
+ function listen(events){
+ if(typeof events!=='object'){
+ throw TypeError('events must be an object');
+ }
+
+ var reducers= options.reducers;
+ var index= findTargetIndex.call(emitter, target);
+ var observer;
+
+ if(index===-1){
+ observer= new TargetObserver(emitter, target, options);
+ }else{
+ observer= emitter._observers[index];
+ }
+
+ var keys= ownKeys(events);
+ var len= keys.length;
+ var event;
+ var isSingleReducer= typeof reducers==='function';
+
+ for(var i=0; i 0) {
+ observer = observers[i];
+ if (!target || observer._target === target) {
+ observer.unsubscribe(event);
+ matched= true;
+ }
+ }
+
+ return matched;
+ };
+
+ // By default EventEmitters will print a warning if more than
+ // 10 listeners are added to it. This is a useful default which
+ // helps finding memory leaks.
+ //
+ // Obviously not all Emitters should be limited to 10. This function allows
+ // that to be increased. Set to zero for unlimited.
+
+ EventEmitter.prototype.delimiter = '.';
+
+ EventEmitter.prototype.setMaxListeners = function(n) {
+ if (n !== undefined) {
+ this._maxListeners = n;
+ if (!this._conf) this._conf = {};
+ this._conf.maxListeners = n;
+ }
+ };
+
+ EventEmitter.prototype.getMaxListeners = function() {
+ return this._maxListeners;
+ };
+
+ EventEmitter.prototype.event = '';
+
+ EventEmitter.prototype.once = function(event, fn, options) {
+ return this._once(event, fn, false, options);
+ };
+
+ EventEmitter.prototype.prependOnceListener = function(event, fn, options) {
+ return this._once(event, fn, true, options);
+ };
+
+ EventEmitter.prototype._once = function(event, fn, prepend, options) {
+ return this._many(event, 1, fn, prepend, options);
+ };
+
+ EventEmitter.prototype.many = function(event, ttl, fn, options) {
+ return this._many(event, ttl, fn, false, options);
+ };
+
+ EventEmitter.prototype.prependMany = function(event, ttl, fn, options) {
+ return this._many(event, ttl, fn, true, options);
+ };
+
+ EventEmitter.prototype._many = function(event, ttl, fn, prepend, options) {
+ var self = this;
+
+ if (typeof fn !== 'function') {
+ throw new Error('many only accepts instances of Function');
+ }
+
+ function listener() {
+ if (--ttl === 0) {
+ self.off(event, listener);
+ }
+ return fn.apply(this, arguments);
+ }
+
+ listener._origin = fn;
+
+ return this._on(event, listener, prepend, options);
+ };
+
+ EventEmitter.prototype.emit = function() {
+ if (!this._events && !this._all) {
+ return false;
+ }
+
+ this._events || init.call(this);
+
+ var type = arguments[0], ns, wildcard= this.wildcard;
+ var args,l,i,j, containsSymbol;
+
+ if (type === 'newListener' && !this._newListener) {
+ if (!this._events.newListener) {
+ return false;
+ }
+ }
+
+ if (wildcard) {
+ ns= type;
+ if(type!=='newListener' && type!=='removeListener'){
+ if (typeof type === 'object') {
+ l = type.length;
+ if (symbolsSupported) {
+ for (i = 0; i < l; i++) {
+ if (typeof type[i] === 'symbol') {
+ containsSymbol = true;
+ break;
+ }
+ }
+ }
+ if (!containsSymbol) {
+ type = type.join(this.delimiter);
+ }
+ }
+ }
+ }
+
+ var al = arguments.length;
+ var handler;
+
+ if (this._all && this._all.length) {
+ handler = this._all.slice();
+
+ for (i = 0, l = handler.length; i < l; i++) {
+ this.event = type;
+ switch (al) {
+ case 1:
+ handler[i].call(this, type);
+ break;
+ case 2:
+ handler[i].call(this, type, arguments[1]);
+ break;
+ case 3:
+ handler[i].call(this, type, arguments[1], arguments[2]);
+ break;
+ default:
+ handler[i].apply(this, arguments);
+ }
+ }
+ }
+
+ if (wildcard) {
+ handler = [];
+ searchListenerTree.call(this, handler, ns, this.listenerTree, 0, l);
+ } else {
+ handler = this._events[type];
+ if (typeof handler === 'function') {
+ this.event = type;
+ switch (al) {
+ case 1:
+ handler.call(this);
+ break;
+ case 2:
+ handler.call(this, arguments[1]);
+ break;
+ case 3:
+ handler.call(this, arguments[1], arguments[2]);
+ break;
+ default:
+ args = new Array(al - 1);
+ for (j = 1; j < al; j++) args[j - 1] = arguments[j];
+ handler.apply(this, args);
+ }
+ return true;
+ } else if (handler) {
+ // need to make copy of handlers because list can change in the middle
+ // of emit call
+ handler = handler.slice();
+ }
+ }
+
+ if (handler && handler.length) {
+ if (al > 3) {
+ args = new Array(al - 1);
+ for (j = 1; j < al; j++) args[j - 1] = arguments[j];
+ }
+ for (i = 0, l = handler.length; i < l; i++) {
+ this.event = type;
+ switch (al) {
+ case 1:
+ handler[i].call(this);
+ break;
+ case 2:
+ handler[i].call(this, arguments[1]);
+ break;
+ case 3:
+ handler[i].call(this, arguments[1], arguments[2]);
+ break;
+ default:
+ handler[i].apply(this, args);
+ }
+ }
+ return true;
+ } else if (!this.ignoreErrors && !this._all && type === 'error') {
+ if (arguments[1] instanceof Error) {
+ throw arguments[1]; // Unhandled 'error' event
+ } else {
+ throw new Error("Uncaught, unspecified 'error' event.");
+ }
+ }
+
+ return !!this._all;
+ };
+
+ EventEmitter.prototype.emitAsync = function() {
+ if (!this._events && !this._all) {
+ return false;
+ }
+
+ this._events || init.call(this);
+
+ var type = arguments[0], wildcard= this.wildcard, ns, containsSymbol;
+ var args,l,i,j;
+
+ if (type === 'newListener' && !this._newListener) {
+ if (!this._events.newListener) { return Promise.resolve([false]); }
+ }
+
+ if (wildcard) {
+ ns= type;
+ if(type!=='newListener' && type!=='removeListener'){
+ if (typeof type === 'object') {
+ l = type.length;
+ if (symbolsSupported) {
+ for (i = 0; i < l; i++) {
+ if (typeof type[i] === 'symbol') {
+ containsSymbol = true;
+ break;
+ }
+ }
+ }
+ if (!containsSymbol) {
+ type = type.join(this.delimiter);
+ }
+ }
+ }
+ }
+
+ var promises= [];
+
+ var al = arguments.length;
+ var handler;
+
+ if (this._all) {
+ for (i = 0, l = this._all.length; i < l; i++) {
+ this.event = type;
+ switch (al) {
+ case 1:
+ promises.push(this._all[i].call(this, type));
+ break;
+ case 2:
+ promises.push(this._all[i].call(this, type, arguments[1]));
+ break;
+ case 3:
+ promises.push(this._all[i].call(this, type, arguments[1], arguments[2]));
+ break;
+ default:
+ promises.push(this._all[i].apply(this, arguments));
+ }
+ }
+ }
+
+ if (wildcard) {
+ handler = [];
+ searchListenerTree.call(this, handler, ns, this.listenerTree, 0);
+ } else {
+ handler = this._events[type];
+ }
+
+ if (typeof handler === 'function') {
+ this.event = type;
+ switch (al) {
+ case 1:
+ promises.push(handler.call(this));
+ break;
+ case 2:
+ promises.push(handler.call(this, arguments[1]));
+ break;
+ case 3:
+ promises.push(handler.call(this, arguments[1], arguments[2]));
+ break;
+ default:
+ args = new Array(al - 1);
+ for (j = 1; j < al; j++) args[j - 1] = arguments[j];
+ promises.push(handler.apply(this, args));
+ }
+ } else if (handler && handler.length) {
+ handler = handler.slice();
+ if (al > 3) {
+ args = new Array(al - 1);
+ for (j = 1; j < al; j++) args[j - 1] = arguments[j];
+ }
+ for (i = 0, l = handler.length; i < l; i++) {
+ this.event = type;
+ switch (al) {
+ case 1:
+ promises.push(handler[i].call(this));
+ break;
+ case 2:
+ promises.push(handler[i].call(this, arguments[1]));
+ break;
+ case 3:
+ promises.push(handler[i].call(this, arguments[1], arguments[2]));
+ break;
+ default:
+ promises.push(handler[i].apply(this, args));
+ }
+ }
+ } else if (!this.ignoreErrors && !this._all && type === 'error') {
+ if (arguments[1] instanceof Error) {
+ return Promise.reject(arguments[1]); // Unhandled 'error' event
+ } else {
+ return Promise.reject("Uncaught, unspecified 'error' event.");
+ }
+ }
+
+ return Promise.all(promises);
+ };
+
+ EventEmitter.prototype.on = function(type, listener, options) {
+ return this._on(type, listener, false, options);
+ };
+
+ EventEmitter.prototype.prependListener = function(type, listener, options) {
+ return this._on(type, listener, true, options);
+ };
+
+ EventEmitter.prototype.onAny = function(fn) {
+ return this._onAny(fn, false);
+ };
+
+ EventEmitter.prototype.prependAny = function(fn) {
+ return this._onAny(fn, true);
+ };
+
+ EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+ EventEmitter.prototype._onAny = function(fn, prepend){
+ if (typeof fn !== 'function') {
+ throw new Error('onAny only accepts instances of Function');
+ }
+
+ if (!this._all) {
+ this._all = [];
+ }
+
+ // Add the function to the event listener collection.
+ if(prepend){
+ this._all.unshift(fn);
+ }else{
+ this._all.push(fn);
+ }
+
+ return this;
+ };
+
+ EventEmitter.prototype._on = function(type, listener, prepend, options) {
+ if (typeof type === 'function') {
+ this._onAny(type, listener);
+ return this;
+ }
+
+ if (typeof listener !== 'function') {
+ throw new Error('on only accepts instances of Function');
+ }
+ this._events || init.call(this);
+
+ var returnValue= this, temp;
+
+ if (options !== undefined) {
+ temp = setupListener.call(this, type, listener, options);
+ listener = temp[0];
+ returnValue = temp[1];
+ }
+
+ // To avoid recursion in the case that type == "newListeners"! Before
+ // adding it to the listeners, first emit "newListeners".
+ if (this._newListener) {
+ this.emit('newListener', type, listener);
+ }
+
+ if (this.wildcard) {
+ growListenerTree.call(this, type, listener, prepend);
+ return returnValue;
+ }
+
+ if (!this._events[type]) {
+ // Optimize the case of one listener. Don't need the extra array object.
+ this._events[type] = listener;
+ } else {
+ if (typeof this._events[type] === 'function') {
+ // Change to array.
+ this._events[type] = [this._events[type]];
+ }
+
+ // If we've already got an array, just add
+ if(prepend){
+ this._events[type].unshift(listener);
+ }else{
+ this._events[type].push(listener);
+ }
+
+ // Check for listener leak
+ if (
+ !this._events[type].warned &&
+ this._maxListeners > 0 &&
+ this._events[type].length > this._maxListeners
+ ) {
+ this._events[type].warned = true;
+ logPossibleMemoryLeak.call(this, this._events[type].length, type);
+ }
+ }
+
+ return returnValue;
+ };
+
+ EventEmitter.prototype.off = function(type, listener) {
+ if (typeof listener !== 'function') {
+ throw new Error('removeListener only takes instances of Function');
+ }
+
+ var handlers,leafs=[];
+
+ if(this.wildcard) {
+ var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice();
+ leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0);
+ if(!leafs) return this;
+ } else {
+ // does not use listeners(), so no side effect of creating _events[type]
+ if (!this._events[type]) return this;
+ handlers = this._events[type];
+ leafs.push({_listeners:handlers});
+ }
+
+ for (var iLeaf=0; iLeaf 0) {
+ fns = this._all;
+ for(i = 0, l = fns.length; i < l; i++) {
+ if(fn === fns[i]) {
+ fns.splice(i, 1);
+ if (this._removeListener)
+ this.emit("removeListenerAny", fn);
+ return this;
+ }
+ }
+ } else {
+ fns = this._all;
+ if (this._removeListener) {
+ for(i = 0, l = fns.length; i < l; i++)
+ this.emit("removeListenerAny", fns[i]);
+ }
+ this._all = [];
+ }
+ return this;
+ };
+
+ EventEmitter.prototype.removeListener = EventEmitter.prototype.off;
+
+ EventEmitter.prototype.removeAllListeners = function (type) {
+ if (type === undefined) {
+ !this._events || init.call(this);
+ return this;
+ }
+
+ if (this.wildcard) {
+ var leafs = searchListenerTree.call(this, null, type, this.listenerTree, 0), leaf, i;
+ if (!leafs) return this;
+ for (i = 0; i < leafs.length; i++) {
+ leaf = leafs[i];
+ leaf._listeners = null;
+ }
+ this.listenerTree && recursivelyGarbageCollect(this.listenerTree);
+ } else if (this._events) {
+ this._events[type] = null;
+ }
+ return this;
+ };
+
+ EventEmitter.prototype.listeners = function (type) {
+ var _events = this._events;
+ var keys, listeners, allListeners;
+ var i;
+ var listenerTree;
+
+ if (type === undefined) {
+ if (this.wildcard) {
+ throw Error('event name required for wildcard emitter');
+ }
+
+ if (!_events) {
+ return [];
+ }
+
+ keys = ownKeys(_events);
+ i = keys.length;
+ allListeners = [];
+ while (i-- > 0) {
+ listeners = _events[keys[i]];
+ if (typeof listeners === 'function') {
+ allListeners.push(listeners);
+ } else {
+ allListeners.push.apply(allListeners, listeners);
+ }
+ }
+ return allListeners;
+ } else {
+ if (this.wildcard) {
+ listenerTree= this.listenerTree;
+ if(!listenerTree) return [];
+ var handlers = [];
+ var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice();
+ searchListenerTree.call(this, handlers, ns, listenerTree, 0);
+ return handlers;
+ }
+
+ if (!_events) {
+ return [];
+ }
+
+ listeners = _events[type];
+
+ if (!listeners) {
+ return [];
+ }
+ return typeof listeners === 'function' ? [listeners] : listeners;
+ }
+ };
+
+ EventEmitter.prototype.eventNames = function(nsAsArray){
+ var _events= this._events;
+ return this.wildcard? collectTreeEvents.call(this, this.listenerTree, [], null, nsAsArray) : (_events? ownKeys(_events) : []);
+ };
+
+ EventEmitter.prototype.listenerCount = function(type) {
+ return this.listeners(type).length;
+ };
+
+ EventEmitter.prototype.hasListeners = function (type) {
+ if (this.wildcard) {
+ var handlers = [];
+ var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice();
+ searchListenerTree.call(this, handlers, ns, this.listenerTree, 0);
+ return handlers.length > 0;
+ }
+
+ var _events = this._events;
+ var _all = this._all;
+
+ return !!(_all && _all.length || _events && (type === undefined ? ownKeys(_events).length : _events[type]));
+ };
+
+ EventEmitter.prototype.listenersAny = function() {
+
+ if(this._all) {
+ return this._all;
+ }
+ else {
+ return [];
+ }
+
+ };
+
+ EventEmitter.prototype.waitFor = function (event, options) {
+ var self = this;
+ var type = typeof options;
+ if (type === 'number') {
+ options = {timeout: options};
+ } else if (type === 'function') {
+ options = {filter: options};
+ }
+
+ options= resolveOptions(options, {
+ timeout: 0,
+ filter: undefined,
+ handleError: false,
+ Promise: Promise,
+ overload: false
+ }, {
+ filter: functionReducer,
+ Promise: constructorReducer
+ });
+
+ return makeCancelablePromise(options.Promise, function (resolve, reject, onCancel) {
+ function listener() {
+ var filter= options.filter;
+ if (filter && !filter.apply(self, arguments)) {
+ return;
+ }
+ self.off(event, listener);
+ if (options.handleError) {
+ var err = arguments[0];
+ err ? reject(err) : resolve(toArray.apply(null, arguments).slice(1));
+ } else {
+ resolve(toArray.apply(null, arguments));
+ }
+ }
+
+ onCancel(function(){
+ self.off(event, listener);
+ });
+
+ self._on(event, listener, false);
+ }, {
+ timeout: options.timeout,
+ overload: options.overload
+ })
+ };
+
+ function once(emitter, name, options) {
+ options= resolveOptions(options, {
+ Promise: Promise,
+ timeout: 0,
+ overload: false
+ }, {
+ Promise: constructorReducer
+ });
+
+ var _Promise= options.Promise;
+
+ return makeCancelablePromise(_Promise, function(resolve, reject, onCancel){
+ var handler;
+ if (typeof emitter.addEventListener === 'function') {
+ handler= function () {
+ resolve(toArray.apply(null, arguments));
+ };
+
+ onCancel(function(){
+ emitter.removeEventListener(name, handler);
+ });
+
+ emitter.addEventListener(
+ name,
+ handler,
+ {once: true}
+ );
+ return;
+ }
+
+ var eventListener = function(){
+ errorListener && emitter.removeListener('error', errorListener);
+ resolve(toArray.apply(null, arguments));
+ };
+
+ var errorListener;
+
+ if (name !== 'error') {
+ errorListener = function (err){
+ emitter.removeListener(name, eventListener);
+ reject(err);
+ };
+
+ emitter.once('error', errorListener);
+ }
+
+ onCancel(function(){
+ errorListener && emitter.removeListener('error', errorListener);
+ emitter.removeListener(name, eventListener);
+ });
+
+ emitter.once(name, eventListener);
+ }, {
+ timeout: options.timeout,
+ overload: options.overload
+ });
+ }
+
+ var prototype= EventEmitter.prototype;
+
+ Object.defineProperties(EventEmitter, {
+ defaultMaxListeners: {
+ get: function () {
+ return prototype._maxListeners;
+ },
+ set: function (n) {
+ if (typeof n !== 'number' || n < 0 || Number.isNaN(n)) {
+ throw TypeError('n must be a non-negative number')
+ }
+ prototype._maxListeners = n;
+ },
+ enumerable: true
+ },
+ once: {
+ value: once,
+ writable: true,
+ configurable: true
+ }
+ });
+
+ Object.defineProperties(prototype, {
+ _maxListeners: {
+ value: defaultMaxListeners,
+ writable: true,
+ configurable: true
+ },
+ _observers: {value: null, writable: true, configurable: true}
+ });
+
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(function() {
+ return EventEmitter;
+ });
+ } else if (typeof exports === 'object') {
+ // CommonJS
+ module.exports = EventEmitter;
+ }
+ else {
+ // global for any kind of environment.
+ var _global= new Function('','return this')();
+ _global.EventEmitter2 = EventEmitter;
+ }
+}();
+
+}).call(this)}).call(this,require('_process'),require("timers").setImmediate)
+},{"_process":37,"timers":38}],7:[function(require,module,exports){
+module.exports = require('./lib/axios');
+},{"./lib/axios":9}],8:[function(require,module,exports){
+'use strict';
+
+var utils = require('./../utils');
+var settle = require('./../core/settle');
+var cookies = require('./../helpers/cookies');
+var buildURL = require('./../helpers/buildURL');
+var buildFullPath = require('../core/buildFullPath');
+var parseHeaders = require('./../helpers/parseHeaders');
+var isURLSameOrigin = require('./../helpers/isURLSameOrigin');
+var createError = require('../core/createError');
+
+module.exports = function xhrAdapter(config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ var requestData = config.data;
+ var requestHeaders = config.headers;
+ var responseType = config.responseType;
+
+ if (utils.isFormData(requestData)) {
+ delete requestHeaders['Content-Type']; // Let the browser set it
+ }
+
+ var request = new XMLHttpRequest();
+
+ // HTTP basic authentication
+ if (config.auth) {
+ var username = config.auth.username || '';
+ var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
+ requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
+ }
+
+ var fullPath = buildFullPath(config.baseURL, config.url);
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
+
+ // Set the request timeout in MS
+ request.timeout = config.timeout;
+
+ function onloadend() {
+ if (!request) {
+ return;
+ }
+ // Prepare the response
+ var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
+ var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
+ request.responseText : request.response;
+ var response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config: config,
+ request: request
+ };
+
+ settle(resolve, reject, response);
+
+ // Clean up request
+ request = null;
+ }
+
+ if ('onloadend' in request) {
+ // Use onloadend if available
+ request.onloadend = onloadend;
+ } else {
+ // Listen for ready state to emulate onloadend
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
+
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
+ return;
+ }
+ // readystate handler is calling before onerror or ontimeout handlers,
+ // so we should call onloadend on the next 'tick'
+ setTimeout(onloadend);
+ };
+ }
+
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
+
+ reject(createError('Request aborted', config, 'ECONNABORTED', request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle low level network errors
+ request.onerror = function handleError() {
+ // Real errors are hidden from us by the browser
+ // onerror should only fire if it's a network error
+ reject(createError('Network Error', config, null, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
+ }
+ reject(createError(
+ timeoutErrorMessage,
+ config,
+ config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
+ request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
+ if (utils.isStandardBrowserEnv()) {
+ // Add xsrf header
+ var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
+ cookies.read(config.xsrfCookieName) :
+ undefined;
+
+ if (xsrfValue) {
+ requestHeaders[config.xsrfHeaderName] = xsrfValue;
+ }
+ }
+
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils.forEach(requestHeaders, function setRequestHeader(val, key) {
+ if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
+ // Remove Content-Type if data is undefined
+ delete requestHeaders[key];
+ } else {
+ // Otherwise add header to the request
+ request.setRequestHeader(key, val);
+ }
+ });
+ }
+
+ // Add withCredentials to request if needed
+ if (!utils.isUndefined(config.withCredentials)) {
+ request.withCredentials = !!config.withCredentials;
+ }
+
+ // Add responseType to request if needed
+ if (responseType && responseType !== 'json') {
+ request.responseType = config.responseType;
+ }
+
+ // Handle progress if needed
+ if (typeof config.onDownloadProgress === 'function') {
+ request.addEventListener('progress', config.onDownloadProgress);
+ }
+
+ // Not all browsers support upload events
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
+ request.upload.addEventListener('progress', config.onUploadProgress);
+ }
+
+ if (config.cancelToken) {
+ // Handle cancellation
+ config.cancelToken.promise.then(function onCanceled(cancel) {
+ if (!request) {
+ return;
+ }
+
+ request.abort();
+ reject(cancel);
+ // Clean up request
+ request = null;
+ });
+ }
+
+ if (!requestData) {
+ requestData = null;
+ }
+
+ // Send the request
+ request.send(requestData);
+ });
+};
+
+},{"../core/buildFullPath":15,"../core/createError":16,"./../core/settle":20,"./../helpers/buildURL":24,"./../helpers/cookies":26,"./../helpers/isURLSameOrigin":29,"./../helpers/parseHeaders":31,"./../utils":34}],9:[function(require,module,exports){
+'use strict';
+
+var utils = require('./utils');
+var bind = require('./helpers/bind');
+var Axios = require('./core/Axios');
+var mergeConfig = require('./core/mergeConfig');
+var defaults = require('./defaults');
+
+/**
+ * Create an instance of Axios
+ *
+ * @param {Object} defaultConfig The default config for the instance
+ * @return {Axios} A new instance of Axios
+ */
+function createInstance(defaultConfig) {
+ var context = new Axios(defaultConfig);
+ var instance = bind(Axios.prototype.request, context);
+
+ // Copy axios.prototype to instance
+ utils.extend(instance, Axios.prototype, context);
+
+ // Copy context to instance
+ utils.extend(instance, context);
+
+ return instance;
+}
+
+// Create the default instance to be exported
+var axios = createInstance(defaults);
+
+// Expose Axios class to allow class inheritance
+axios.Axios = Axios;
+
+// Factory for creating new instances
+axios.create = function create(instanceConfig) {
+ return createInstance(mergeConfig(axios.defaults, instanceConfig));
+};
+
+// Expose Cancel & CancelToken
+axios.Cancel = require('./cancel/Cancel');
+axios.CancelToken = require('./cancel/CancelToken');
+axios.isCancel = require('./cancel/isCancel');
+
+// Expose all/spread
+axios.all = function all(promises) {
+ return Promise.all(promises);
+};
+axios.spread = require('./helpers/spread');
+
+// Expose isAxiosError
+axios.isAxiosError = require('./helpers/isAxiosError');
+
+module.exports = axios;
+
+// Allow use of default import syntax in TypeScript
+module.exports.default = axios;
+
+},{"./cancel/Cancel":10,"./cancel/CancelToken":11,"./cancel/isCancel":12,"./core/Axios":13,"./core/mergeConfig":19,"./defaults":22,"./helpers/bind":23,"./helpers/isAxiosError":28,"./helpers/spread":32,"./utils":34}],10:[function(require,module,exports){
+'use strict';
+
+/**
+ * A `Cancel` is an object that is thrown when an operation is canceled.
+ *
+ * @class
+ * @param {string=} message The message.
+ */
+function Cancel(message) {
+ this.message = message;
+}
+
+Cancel.prototype.toString = function toString() {
+ return 'Cancel' + (this.message ? ': ' + this.message : '');
+};
+
+Cancel.prototype.__CANCEL__ = true;
+
+module.exports = Cancel;
+
+},{}],11:[function(require,module,exports){
+'use strict';
+
+var Cancel = require('./Cancel');
+
+/**
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
+ *
+ * @class
+ * @param {Function} executor The executor function.
+ */
+function CancelToken(executor) {
+ if (typeof executor !== 'function') {
+ throw new TypeError('executor must be a function.');
+ }
+
+ var resolvePromise;
+ this.promise = new Promise(function promiseExecutor(resolve) {
+ resolvePromise = resolve;
+ });
+
+ var token = this;
+ executor(function cancel(message) {
+ if (token.reason) {
+ // Cancellation has already been requested
+ return;
+ }
+
+ token.reason = new Cancel(message);
+ resolvePromise(token.reason);
+ });
+}
+
+/**
+ * Throws a `Cancel` if cancellation has been requested.
+ */
+CancelToken.prototype.throwIfRequested = function throwIfRequested() {
+ if (this.reason) {
+ throw this.reason;
+ }
+};
+
+/**
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
+ * cancels the `CancelToken`.
+ */
+CancelToken.source = function source() {
+ var cancel;
+ var token = new CancelToken(function executor(c) {
+ cancel = c;
+ });
+ return {
+ token: token,
+ cancel: cancel
+ };
+};
+
+module.exports = CancelToken;
+
+},{"./Cancel":10}],12:[function(require,module,exports){
+'use strict';
+
+module.exports = function isCancel(value) {
+ return !!(value && value.__CANCEL__);
+};
+
+},{}],13:[function(require,module,exports){
+'use strict';
+
+var utils = require('./../utils');
+var buildURL = require('../helpers/buildURL');
+var InterceptorManager = require('./InterceptorManager');
+var dispatchRequest = require('./dispatchRequest');
+var mergeConfig = require('./mergeConfig');
+var validator = require('../helpers/validator');
+
+var validators = validator.validators;
+/**
+ * Create a new instance of Axios
+ *
+ * @param {Object} instanceConfig The default config for the instance
+ */
+function Axios(instanceConfig) {
+ this.defaults = instanceConfig;
+ this.interceptors = {
+ request: new InterceptorManager(),
+ response: new InterceptorManager()
+ };
+}
+
+/**
+ * Dispatch a request
+ *
+ * @param {Object} config The config specific for this request (merged with this.defaults)
+ */
+Axios.prototype.request = function request(config) {
+ /*eslint no-param-reassign:0*/
+ // Allow for axios('example/url'[, config]) a la fetch API
+ if (typeof config === 'string') {
+ config = arguments[1] || {};
+ config.url = arguments[0];
+ } else {
+ config = config || {};
+ }
+
+ config = mergeConfig(this.defaults, config);
+
+ // Set config.method
+ if (config.method) {
+ config.method = config.method.toLowerCase();
+ } else if (this.defaults.method) {
+ config.method = this.defaults.method.toLowerCase();
+ } else {
+ config.method = 'get';
+ }
+
+ var transitional = config.transitional;
+
+ if (transitional !== undefined) {
+ validator.assertOptions(transitional, {
+ silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),
+ forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),
+ clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')
+ }, false);
+ }
+
+ // filter out skipped interceptors
+ var requestInterceptorChain = [];
+ var synchronousRequestInterceptors = true;
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
+ return;
+ }
+
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
+
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ var responseInterceptorChain = [];
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ var promise;
+
+ if (!synchronousRequestInterceptors) {
+ var chain = [dispatchRequest, undefined];
+
+ Array.prototype.unshift.apply(chain, requestInterceptorChain);
+ chain = chain.concat(responseInterceptorChain);
+
+ promise = Promise.resolve(config);
+ while (chain.length) {
+ promise = promise.then(chain.shift(), chain.shift());
+ }
+
+ return promise;
+ }
+
+
+ var newConfig = config;
+ while (requestInterceptorChain.length) {
+ var onFulfilled = requestInterceptorChain.shift();
+ var onRejected = requestInterceptorChain.shift();
+ try {
+ newConfig = onFulfilled(newConfig);
+ } catch (error) {
+ onRejected(error);
+ break;
+ }
+ }
+
+ try {
+ promise = dispatchRequest(newConfig);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ while (responseInterceptorChain.length) {
+ promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
+ }
+
+ return promise;
+};
+
+Axios.prototype.getUri = function getUri(config) {
+ config = mergeConfig(this.defaults, config);
+ return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
+};
+
+// Provide aliases for supported request methods
+utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function(url, config) {
+ return this.request(mergeConfig(config || {}, {
+ method: method,
+ url: url,
+ data: (config || {}).data
+ }));
+ };
+});
+
+utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function(url, data, config) {
+ return this.request(mergeConfig(config || {}, {
+ method: method,
+ url: url,
+ data: data
+ }));
+ };
+});
+
+module.exports = Axios;
+
+},{"../helpers/buildURL":24,"../helpers/validator":33,"./../utils":34,"./InterceptorManager":14,"./dispatchRequest":17,"./mergeConfig":19}],14:[function(require,module,exports){
+'use strict';
+
+var utils = require('./../utils');
+
+function InterceptorManager() {
+ this.handlers = [];
+}
+
+/**
+ * Add a new interceptor to the stack
+ *
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
+ *
+ * @return {Number} An ID used to remove interceptor later
+ */
+InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
+ this.handlers.push({
+ fulfilled: fulfilled,
+ rejected: rejected,
+ synchronous: options ? options.synchronous : false,
+ runWhen: options ? options.runWhen : null
+ });
+ return this.handlers.length - 1;
+};
+
+/**
+ * Remove an interceptor from the stack
+ *
+ * @param {Number} id The ID that was returned by `use`
+ */
+InterceptorManager.prototype.eject = function eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
+ }
+};
+
+/**
+ * Iterate over all the registered interceptors
+ *
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
+ */
+InterceptorManager.prototype.forEach = function forEach(fn) {
+ utils.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+};
+
+module.exports = InterceptorManager;
+
+},{"./../utils":34}],15:[function(require,module,exports){
+'use strict';
+
+var isAbsoluteURL = require('../helpers/isAbsoluteURL');
+var combineURLs = require('../helpers/combineURLs');
+
+/**
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ * @returns {string} The combined full path
+ */
+module.exports = function buildFullPath(baseURL, requestedURL) {
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+};
+
+},{"../helpers/combineURLs":25,"../helpers/isAbsoluteURL":27}],16:[function(require,module,exports){
+'use strict';
+
+var enhanceError = require('./enhanceError');
+
+/**
+ * Create an Error with the specified message, config, error code, request and response.
+ *
+ * @param {string} message The error message.
+ * @param {Object} config The config.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ * @returns {Error} The created error.
+ */
+module.exports = function createError(message, config, code, request, response) {
+ var error = new Error(message);
+ return enhanceError(error, config, code, request, response);
+};
+
+},{"./enhanceError":18}],17:[function(require,module,exports){
+'use strict';
+
+var utils = require('./../utils');
+var transformData = require('./transformData');
+var isCancel = require('../cancel/isCancel');
+var defaults = require('../defaults');
+
+/**
+ * Throws a `Cancel` if cancellation has been requested.
+ */
+function throwIfCancellationRequested(config) {
+ if (config.cancelToken) {
+ config.cancelToken.throwIfRequested();
+ }
+}
+
+/**
+ * Dispatch a request to the server using the configured adapter.
+ *
+ * @param {object} config The config that is to be used for the request
+ * @returns {Promise} The Promise to be fulfilled
+ */
+module.exports = function dispatchRequest(config) {
+ throwIfCancellationRequested(config);
+
+ // Ensure headers exist
+ config.headers = config.headers || {};
+
+ // Transform request data
+ config.data = transformData.call(
+ config,
+ config.data,
+ config.headers,
+ config.transformRequest
+ );
+
+ // Flatten headers
+ config.headers = utils.merge(
+ config.headers.common || {},
+ config.headers[config.method] || {},
+ config.headers
+ );
+
+ utils.forEach(
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
+ function cleanHeaderConfig(method) {
+ delete config.headers[method];
+ }
+ );
+
+ var adapter = config.adapter || defaults.adapter;
+
+ return adapter(config).then(function onAdapterResolution(response) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ response.data = transformData.call(
+ config,
+ response.data,
+ response.headers,
+ config.transformResponse
+ );
+
+ return response;
+ }, function onAdapterRejection(reason) {
+ if (!isCancel(reason)) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ if (reason && reason.response) {
+ reason.response.data = transformData.call(
+ config,
+ reason.response.data,
+ reason.response.headers,
+ config.transformResponse
+ );
+ }
+ }
+
+ return Promise.reject(reason);
+ });
+};
+
+},{"../cancel/isCancel":12,"../defaults":22,"./../utils":34,"./transformData":21}],18:[function(require,module,exports){
+'use strict';
+
+/**
+ * Update an Error with the specified config, error code, and response.
+ *
+ * @param {Error} error The error to update.
+ * @param {Object} config The config.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ * @returns {Error} The error.
+ */
+module.exports = function enhanceError(error, config, code, request, response) {
+ error.config = config;
+ if (code) {
+ error.code = code;
+ }
+
+ error.request = request;
+ error.response = response;
+ error.isAxiosError = true;
+
+ error.toJSON = function toJSON() {
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: this.config,
+ code: this.code
+ };
+ };
+ return error;
+};
+
+},{}],19:[function(require,module,exports){
+'use strict';
+
+var utils = require('../utils');
+
+/**
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
+ *
+ * @param {Object} config1
+ * @param {Object} config2
+ * @returns {Object} New object resulting from merging config2 to config1
+ */
+module.exports = function mergeConfig(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config2 = config2 || {};
+ var config = {};
+
+ var valueFromConfig2Keys = ['url', 'method', 'data'];
+ var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
+ var defaultToConfig2Keys = [
+ 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
+ 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
+ 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
+ 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
+ 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
+ ];
+ var directMergeKeys = ['validateStatus'];
+
+ function getMergedValue(target, source) {
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
+ return utils.merge(target, source);
+ } else if (utils.isPlainObject(source)) {
+ return utils.merge({}, source);
+ } else if (utils.isArray(source)) {
+ return source.slice();
+ }
+ return source;
+ }
+
+ function mergeDeepProperties(prop) {
+ if (!utils.isUndefined(config2[prop])) {
+ config[prop] = getMergedValue(config1[prop], config2[prop]);
+ } else if (!utils.isUndefined(config1[prop])) {
+ config[prop] = getMergedValue(undefined, config1[prop]);
+ }
+ }
+
+ utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
+ if (!utils.isUndefined(config2[prop])) {
+ config[prop] = getMergedValue(undefined, config2[prop]);
+ }
+ });
+
+ utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
+
+ utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
+ if (!utils.isUndefined(config2[prop])) {
+ config[prop] = getMergedValue(undefined, config2[prop]);
+ } else if (!utils.isUndefined(config1[prop])) {
+ config[prop] = getMergedValue(undefined, config1[prop]);
+ }
+ });
+
+ utils.forEach(directMergeKeys, function merge(prop) {
+ if (prop in config2) {
+ config[prop] = getMergedValue(config1[prop], config2[prop]);
+ } else if (prop in config1) {
+ config[prop] = getMergedValue(undefined, config1[prop]);
+ }
+ });
+
+ var axiosKeys = valueFromConfig2Keys
+ .concat(mergeDeepPropertiesKeys)
+ .concat(defaultToConfig2Keys)
+ .concat(directMergeKeys);
+
+ var otherKeys = Object
+ .keys(config1)
+ .concat(Object.keys(config2))
+ .filter(function filterAxiosKeys(key) {
+ return axiosKeys.indexOf(key) === -1;
+ });
+
+ utils.forEach(otherKeys, mergeDeepProperties);
+
+ return config;
+};
+
+},{"../utils":34}],20:[function(require,module,exports){
+'use strict';
+
+var createError = require('./createError');
+
+/**
+ * Resolve or reject a Promise based on response status.
+ *
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
+ */
+module.exports = function settle(resolve, reject, response) {
+ var validateStatus = response.config.validateStatus;
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(createError(
+ 'Request failed with status code ' + response.status,
+ response.config,
+ null,
+ response.request,
+ response
+ ));
+ }
+};
+
+},{"./createError":16}],21:[function(require,module,exports){
+'use strict';
+
+var utils = require('./../utils');
+var defaults = require('./../defaults');
+
+/**
+ * Transform the data for a request or a response
+ *
+ * @param {Object|String} data The data to be transformed
+ * @param {Array} headers The headers for the request or response
+ * @param {Array|Function} fns A single function or Array of functions
+ * @returns {*} The resulting transformed data
+ */
+module.exports = function transformData(data, headers, fns) {
+ var context = this || defaults;
+ /*eslint no-param-reassign:0*/
+ utils.forEach(fns, function transform(fn) {
+ data = fn.call(context, data, headers);
+ });
+
+ return data;
+};
+
+},{"./../defaults":22,"./../utils":34}],22:[function(require,module,exports){
+(function (process){(function (){
+'use strict';
+
+var utils = require('./utils');
+var normalizeHeaderName = require('./helpers/normalizeHeaderName');
+var enhanceError = require('./core/enhanceError');
+
+var DEFAULT_CONTENT_TYPE = {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+};
+
+function setContentTypeIfUnset(headers, value) {
+ if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
+ headers['Content-Type'] = value;
+ }
+}
+
+function getDefaultAdapter() {
+ var adapter;
+ if (typeof XMLHttpRequest !== 'undefined') {
+ // For browsers use XHR adapter
+ adapter = require('./adapters/xhr');
+ } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
+ // For node use HTTP adapter
+ adapter = require('./adapters/http');
+ }
+ return adapter;
+}
+
+function stringifySafely(rawValue, parser, encoder) {
+ if (utils.isString(rawValue)) {
+ try {
+ (parser || JSON.parse)(rawValue);
+ return utils.trim(rawValue);
+ } catch (e) {
+ if (e.name !== 'SyntaxError') {
+ throw e;
+ }
+ }
+ }
+
+ return (encoder || JSON.stringify)(rawValue);
+}
+
+var defaults = {
+
+ transitional: {
+ silentJSONParsing: true,
+ forcedJSONParsing: true,
+ clarifyTimeoutError: false
+ },
+
+ adapter: getDefaultAdapter(),
+
+ transformRequest: [function transformRequest(data, headers) {
+ normalizeHeaderName(headers, 'Accept');
+ normalizeHeaderName(headers, 'Content-Type');
+
+ if (utils.isFormData(data) ||
+ utils.isArrayBuffer(data) ||
+ utils.isBuffer(data) ||
+ utils.isStream(data) ||
+ utils.isFile(data) ||
+ utils.isBlob(data)
+ ) {
+ return data;
+ }
+ if (utils.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils.isURLSearchParams(data)) {
+ setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
+ return data.toString();
+ }
+ if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {
+ setContentTypeIfUnset(headers, 'application/json');
+ return stringifySafely(data);
+ }
+ return data;
+ }],
+
+ transformResponse: [function transformResponse(data) {
+ var transitional = this.transitional;
+ var silentJSONParsing = transitional && transitional.silentJSONParsing;
+ var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+ var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
+
+ if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
+ try {
+ return JSON.parse(data);
+ } catch (e) {
+ if (strictJSONParsing) {
+ if (e.name === 'SyntaxError') {
+ throw enhanceError(e, this, 'E_JSON_PARSE');
+ }
+ throw e;
+ }
+ }
+ }
+
+ return data;
+ }],
+
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
+
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
+
+ maxContentLength: -1,
+ maxBodyLength: -1,
+
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ }
+};
+
+defaults.headers = {
+ common: {
+ 'Accept': 'application/json, text/plain, */*'
+ }
+};
+
+utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
+ defaults.headers[method] = {};
+});
+
+utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
+});
+
+module.exports = defaults;
+
+}).call(this)}).call(this,require('_process'))
+},{"./adapters/http":8,"./adapters/xhr":8,"./core/enhanceError":18,"./helpers/normalizeHeaderName":30,"./utils":34,"_process":37}],23:[function(require,module,exports){
+'use strict';
+
+module.exports = function bind(fn, thisArg) {
+ return function wrap() {
+ var args = new Array(arguments.length);
+ for (var i = 0; i < args.length; i++) {
+ args[i] = arguments[i];
+ }
+ return fn.apply(thisArg, args);
+ };
+};
+
+},{}],24:[function(require,module,exports){
+'use strict';
+
+var utils = require('./../utils');
+
+function encode(val) {
+ return encodeURIComponent(val).
+ replace(/%3A/gi, ':').
+ replace(/%24/g, '$').
+ replace(/%2C/gi, ',').
+ replace(/%20/g, '+').
+ replace(/%5B/gi, '[').
+ replace(/%5D/gi, ']');
+}
+
+/**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @returns {string} The formatted url
+ */
+module.exports = function buildURL(url, params, paramsSerializer) {
+ /*eslint no-param-reassign:0*/
+ if (!params) {
+ return url;
+ }
+
+ var serializedParams;
+ if (paramsSerializer) {
+ serializedParams = paramsSerializer(params);
+ } else if (utils.isURLSearchParams(params)) {
+ serializedParams = params.toString();
+ } else {
+ var parts = [];
+
+ utils.forEach(params, function serialize(val, key) {
+ if (val === null || typeof val === 'undefined') {
+ return;
+ }
+
+ if (utils.isArray(val)) {
+ key = key + '[]';
+ } else {
+ val = [val];
+ }
+
+ utils.forEach(val, function parseValue(v) {
+ if (utils.isDate(v)) {
+ v = v.toISOString();
+ } else if (utils.isObject(v)) {
+ v = JSON.stringify(v);
+ }
+ parts.push(encode(key) + '=' + encode(v));
+ });
+ });
+
+ serializedParams = parts.join('&');
+ }
+
+ if (serializedParams) {
+ var hashmarkIndex = url.indexOf('#');
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
+
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
+
+ return url;
+};
+
+},{"./../utils":34}],25:[function(require,module,exports){
+'use strict';
+
+/**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ * @returns {string} The combined URL
+ */
+module.exports = function combineURLs(baseURL, relativeURL) {
+ return relativeURL
+ ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
+ : baseURL;
+};
+
+},{}],26:[function(require,module,exports){
+'use strict';
+
+var utils = require('./../utils');
+
+module.exports = (
+ utils.isStandardBrowserEnv() ?
+
+ // Standard browser envs support document.cookie
+ (function standardBrowserEnv() {
+ return {
+ write: function write(name, value, expires, path, domain, secure) {
+ var cookie = [];
+ cookie.push(name + '=' + encodeURIComponent(value));
+
+ if (utils.isNumber(expires)) {
+ cookie.push('expires=' + new Date(expires).toGMTString());
+ }
+
+ if (utils.isString(path)) {
+ cookie.push('path=' + path);
+ }
+
+ if (utils.isString(domain)) {
+ cookie.push('domain=' + domain);
+ }
+
+ if (secure === true) {
+ cookie.push('secure');
+ }
+
+ document.cookie = cookie.join('; ');
+ },
+
+ read: function read(name) {
+ var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
+ return (match ? decodeURIComponent(match[3]) : null);
+ },
+
+ remove: function remove(name) {
+ this.write(name, '', Date.now() - 86400000);
+ }
+ };
+ })() :
+
+ // Non standard browser env (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return {
+ write: function write() {},
+ read: function read() { return null; },
+ remove: function remove() {}
+ };
+ })()
+);
+
+},{"./../utils":34}],27:[function(require,module,exports){
+'use strict';
+
+/**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+module.exports = function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
+};
+
+},{}],28:[function(require,module,exports){
+'use strict';
+
+/**
+ * Determines whether the payload is an error thrown by Axios
+ *
+ * @param {*} payload The value to test
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
+ */
+module.exports = function isAxiosError(payload) {
+ return (typeof payload === 'object') && (payload.isAxiosError === true);
+};
+
+},{}],29:[function(require,module,exports){
+'use strict';
+
+var utils = require('./../utils');
+
+module.exports = (
+ utils.isStandardBrowserEnv() ?
+
+ // Standard browser envs have full support of the APIs needed to test
+ // whether the request URL is of the same origin as current location.
+ (function standardBrowserEnv() {
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
+ var urlParsingNode = document.createElement('a');
+ var originURL;
+
+ /**
+ * Parse a URL to discover it's components
+ *
+ * @param {String} url The URL to be parsed
+ * @returns {Object}
+ */
+ function resolveURL(url) {
+ var href = url;
+
+ if (msie) {
+ // IE needs attribute set twice to normalize properties
+ urlParsingNode.setAttribute('href', href);
+ href = urlParsingNode.href;
+ }
+
+ urlParsingNode.setAttribute('href', href);
+
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
+ return {
+ href: urlParsingNode.href,
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
+ host: urlParsingNode.host,
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
+ hostname: urlParsingNode.hostname,
+ port: urlParsingNode.port,
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
+ urlParsingNode.pathname :
+ '/' + urlParsingNode.pathname
+ };
+ }
+
+ originURL = resolveURL(window.location.href);
+
+ /**
+ * Determine if a URL shares the same origin as the current location
+ *
+ * @param {String} requestURL The URL to test
+ * @returns {boolean} True if URL shares the same origin, otherwise false
+ */
+ return function isURLSameOrigin(requestURL) {
+ var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
+ return (parsed.protocol === originURL.protocol &&
+ parsed.host === originURL.host);
+ };
+ })() :
+
+ // Non standard browser envs (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return function isURLSameOrigin() {
+ return true;
+ };
+ })()
+);
+
+},{"./../utils":34}],30:[function(require,module,exports){
+'use strict';
+
+var utils = require('../utils');
+
+module.exports = function normalizeHeaderName(headers, normalizedName) {
+ utils.forEach(headers, function processHeader(value, name) {
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
+ headers[normalizedName] = value;
+ delete headers[name];
+ }
+ });
+};
+
+},{"../utils":34}],31:[function(require,module,exports){
+'use strict';
+
+var utils = require('./../utils');
+
+// Headers whose duplicates are ignored by node
+// c.f. https://nodejs.org/api/http.html#http_message_headers
+var ignoreDuplicateOf = [
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
+ 'referer', 'retry-after', 'user-agent'
+];
+
+/**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} headers Headers needing to be parsed
+ * @returns {Object} Headers parsed into an object
+ */
+module.exports = function parseHeaders(headers) {
+ var parsed = {};
+ var key;
+ var val;
+ var i;
+
+ if (!headers) { return parsed; }
+
+ utils.forEach(headers.split('\n'), function parser(line) {
+ i = line.indexOf(':');
+ key = utils.trim(line.substr(0, i)).toLowerCase();
+ val = utils.trim(line.substr(i + 1));
+
+ if (key) {
+ if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
+ return;
+ }
+ if (key === 'set-cookie') {
+ parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ }
+ });
+
+ return parsed;
+};
+
+},{"./../utils":34}],32:[function(require,module,exports){
+'use strict';
+
+/**
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
+ *
+ * Common use case would be to use `Function.prototype.apply`.
+ *
+ * ```js
+ * function f(x, y, z) {}
+ * var args = [1, 2, 3];
+ * f.apply(null, args);
+ * ```
+ *
+ * With `spread` this example can be re-written.
+ *
+ * ```js
+ * spread(function(x, y, z) {})([1, 2, 3]);
+ * ```
+ *
+ * @param {Function} callback
+ * @returns {Function}
+ */
+module.exports = function spread(callback) {
+ return function wrap(arr) {
+ return callback.apply(null, arr);
+ };
+};
+
+},{}],33:[function(require,module,exports){
+'use strict';
+
+var pkg = require('./../../package.json');
+
+var validators = {};
+
+// eslint-disable-next-line func-names
+['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
+ validators[type] = function validator(thing) {
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
+ };
+});
+
+var deprecatedWarnings = {};
+var currentVerArr = pkg.version.split('.');
+
+/**
+ * Compare package versions
+ * @param {string} version
+ * @param {string?} thanVersion
+ * @returns {boolean}
+ */
+function isOlderVersion(version, thanVersion) {
+ var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;
+ var destVer = version.split('.');
+ for (var i = 0; i < 3; i++) {
+ if (pkgVersionArr[i] > destVer[i]) {
+ return true;
+ } else if (pkgVersionArr[i] < destVer[i]) {
+ return false;
+ }
+ }
+ return false;
+}
+
+/**
+ * Transitional option validator
+ * @param {function|boolean?} validator
+ * @param {string?} version
+ * @param {string} message
+ * @returns {function}
+ */
+validators.transitional = function transitional(validator, version, message) {
+ var isDeprecated = version && isOlderVersion(version);
+
+ function formatMessage(opt, desc) {
+ return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
+ }
+
+ // eslint-disable-next-line func-names
+ return function(value, opt, opts) {
+ if (validator === false) {
+ throw new Error(formatMessage(opt, ' has been removed in ' + version));
+ }
+
+ if (isDeprecated && !deprecatedWarnings[opt]) {
+ deprecatedWarnings[opt] = true;
+ // eslint-disable-next-line no-console
+ console.warn(
+ formatMessage(
+ opt,
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
+ )
+ );
+ }
+
+ return validator ? validator(value, opt, opts) : true;
+ };
+};
+
+/**
+ * Assert object's properties type
+ * @param {object} options
+ * @param {object} schema
+ * @param {boolean?} allowUnknown
+ */
+
+function assertOptions(options, schema, allowUnknown) {
+ if (typeof options !== 'object') {
+ throw new TypeError('options must be an object');
+ }
+ var keys = Object.keys(options);
+ var i = keys.length;
+ while (i-- > 0) {
+ var opt = keys[i];
+ var validator = schema[opt];
+ if (validator) {
+ var value = options[opt];
+ var result = value === undefined || validator(value, opt, options);
+ if (result !== true) {
+ throw new TypeError('option ' + opt + ' must be ' + result);
+ }
+ continue;
+ }
+ if (allowUnknown !== true) {
+ throw Error('Unknown option ' + opt);
+ }
+ }
+}
+
+module.exports = {
+ isOlderVersion: isOlderVersion,
+ assertOptions: assertOptions,
+ validators: validators
+};
+
+},{"./../../package.json":35}],34:[function(require,module,exports){
+'use strict';
+
+var bind = require('./helpers/bind');
+
+// utils is a library of generic helper functions non-specific to axios
+
+var toString = Object.prototype.toString;
+
+/**
+ * Determine if a value is an Array
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+function isArray(val) {
+ return toString.call(val) === '[object Array]';
+}
+
+/**
+ * Determine if a value is undefined
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+function isUndefined(val) {
+ return typeof val === 'undefined';
+}
+
+/**
+ * Determine if a value is a Buffer
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Buffer, otherwise false
+ */
+function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
+ && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
+}
+
+/**
+ * Determine if a value is an ArrayBuffer
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
+ */
+function isArrayBuffer(val) {
+ return toString.call(val) === '[object ArrayBuffer]';
+}
+
+/**
+ * Determine if a value is a FormData
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an FormData, otherwise false
+ */
+function isFormData(val) {
+ return (typeof FormData !== 'undefined') && (val instanceof FormData);
+}
+
+/**
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
+ */
+function isArrayBufferView(val) {
+ var result;
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
+ }
+ return result;
+}
+
+/**
+ * Determine if a value is a String
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a String, otherwise false
+ */
+function isString(val) {
+ return typeof val === 'string';
+}
+
+/**
+ * Determine if a value is a Number
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+function isNumber(val) {
+ return typeof val === 'number';
+}
+
+/**
+ * Determine if a value is an Object
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an Object, otherwise false
+ */
+function isObject(val) {
+ return val !== null && typeof val === 'object';
+}
+
+/**
+ * Determine if a value is a plain Object
+ *
+ * @param {Object} val The value to test
+ * @return {boolean} True if value is a plain Object, otherwise false
+ */
+function isPlainObject(val) {
+ if (toString.call(val) !== '[object Object]') {
+ return false;
+ }
+
+ var prototype = Object.getPrototypeOf(val);
+ return prototype === null || prototype === Object.prototype;
+}
+
+/**
+ * Determine if a value is a Date
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+function isDate(val) {
+ return toString.call(val) === '[object Date]';
+}
+
+/**
+ * Determine if a value is a File
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+function isFile(val) {
+ return toString.call(val) === '[object File]';
+}
+
+/**
+ * Determine if a value is a Blob
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+function isBlob(val) {
+ return toString.call(val) === '[object Blob]';
+}
+
+/**
+ * Determine if a value is a Function
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+function isFunction(val) {
+ return toString.call(val) === '[object Function]';
+}
+
+/**
+ * Determine if a value is a Stream
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+function isStream(val) {
+ return isObject(val) && isFunction(val.pipe);
+}
+
+/**
+ * Determine if a value is a URLSearchParams object
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+function isURLSearchParams(val) {
+ return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
+}
+
+/**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ * @returns {String} The String freed of excess whitespace
+ */
+function trim(str) {
+ return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
+}
+
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ */
+function isStandardBrowserEnv() {
+ if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
+ navigator.product === 'NativeScript' ||
+ navigator.product === 'NS')) {
+ return false;
+ }
+ return (
+ typeof window !== 'undefined' &&
+ typeof document !== 'undefined'
+ );
+}
+
+/**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ */
+function forEach(obj, fn) {
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
+ }
+
+ // Force an array if not already something iterable
+ if (typeof obj !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
+ }
+
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (var i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
+ }
+ } else {
+ // Iterate over object keys
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ fn.call(null, obj[key], key, obj);
+ }
+ }
+ }
+}
+
+/**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * var result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ * @returns {Object} Result of all merge properties
+ */
+function merge(/* obj1, obj2, obj3, ... */) {
+ var result = {};
+ function assignValue(val, key) {
+ if (isPlainObject(result[key]) && isPlainObject(val)) {
+ result[key] = merge(result[key], val);
+ } else if (isPlainObject(val)) {
+ result[key] = merge({}, val);
+ } else if (isArray(val)) {
+ result[key] = val.slice();
+ } else {
+ result[key] = val;
+ }
+ }
+
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ forEach(arguments[i], assignValue);
+ }
+ return result;
+}
+
+/**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ * @return {Object} The resulting value of object a
+ */
+function extend(a, b, thisArg) {
+ forEach(b, function assignValue(val, key) {
+ if (thisArg && typeof val === 'function') {
+ a[key] = bind(val, thisArg);
+ } else {
+ a[key] = val;
+ }
+ });
+ return a;
+}
+
+/**
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ *
+ * @param {string} content with BOM
+ * @return {string} content value without BOM
+ */
+function stripBOM(content) {
+ if (content.charCodeAt(0) === 0xFEFF) {
+ content = content.slice(1);
+ }
+ return content;
+}
+
+module.exports = {
+ isArray: isArray,
+ isArrayBuffer: isArrayBuffer,
+ isBuffer: isBuffer,
+ isFormData: isFormData,
+ isArrayBufferView: isArrayBufferView,
+ isString: isString,
+ isNumber: isNumber,
+ isObject: isObject,
+ isPlainObject: isPlainObject,
+ isUndefined: isUndefined,
+ isDate: isDate,
+ isFile: isFile,
+ isBlob: isBlob,
+ isFunction: isFunction,
+ isStream: isStream,
+ isURLSearchParams: isURLSearchParams,
+ isStandardBrowserEnv: isStandardBrowserEnv,
+ forEach: forEach,
+ merge: merge,
+ extend: extend,
+ trim: trim,
+ stripBOM: stripBOM
+};
+
+},{"./helpers/bind":23}],35:[function(require,module,exports){
+module.exports={
+ "name": "extrareqp2",
+ "version": "1.0.0",
+ "description": "Promise based HTTP client for the browser and node.js",
+ "main": "index.js",
+ "scripts": {
+ "test": "grunt test",
+ "start": "node ./sandbox/server.js",
+ "build": "NODE_ENV=production grunt build",
+ "preversion": "npm test",
+ "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",
+ "postversion": "git push && git push --tags",
+ "examples": "node ./examples/server.js",
+ "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
+ "fix": "eslint --fix lib/**/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/keymetrics/extrareqp2"
+ },
+ "keywords": [
+ "xhr",
+ "http",
+ "ajax",
+ "promise",
+ "node"
+ ],
+ "author": "Matt Zabriskie",
+ "license": "MIT",
+ "homepage": "https://axios-http.com",
+ "devDependencies": {
+ "coveralls": "^3.0.0",
+ "es6-promise": "^4.2.4",
+ "grunt": "^1.3.0",
+ "grunt-banner": "^0.6.0",
+ "grunt-cli": "^1.2.0",
+ "grunt-contrib-clean": "^1.1.0",
+ "grunt-contrib-watch": "^1.0.0",
+ "grunt-eslint": "^23.0.0",
+ "grunt-karma": "^4.0.0",
+ "grunt-mocha-test": "^0.13.3",
+ "grunt-ts": "^6.0.0-beta.19",
+ "grunt-webpack": "^4.0.2",
+ "istanbul-instrumenter-loader": "^1.0.0",
+ "jasmine-core": "^2.4.1",
+ "karma": "^6.3.2",
+ "karma-chrome-launcher": "^3.1.0",
+ "karma-firefox-launcher": "^2.1.0",
+ "karma-jasmine": "^1.1.1",
+ "karma-jasmine-ajax": "^0.1.13",
+ "karma-safari-launcher": "^1.0.0",
+ "karma-sauce-launcher": "^4.3.6",
+ "karma-sinon": "^1.0.5",
+ "karma-sourcemap-loader": "^0.3.8",
+ "karma-webpack": "^4.0.2",
+ "load-grunt-tasks": "^3.5.2",
+ "minimist": "^1.2.0",
+ "mocha": "^8.2.1",
+ "sinon": "^4.5.0",
+ "terser-webpack-plugin": "^4.2.3",
+ "typescript": "^4.0.5",
+ "url-search-params": "^0.10.0",
+ "webpack": "^4.44.2",
+ "webpack-dev-server": "^3.11.0"
+ },
+ "browser": {
+ "./lib/adapters/http.js": "./lib/adapters/xhr.js"
+ },
+ "jsdelivr": "dist/axios.min.js",
+ "unpkg": "dist/axios.min.js",
+ "typings": "./index.d.ts",
+ "dependencies": {
+ "follow-redirects": "^1.14.0"
+ },
+ "bundlesize": [
+ {
+ "path": "./dist/axios.min.js",
+ "threshold": "5kB"
+ }
+ ]
+}
+
+},{}],36:[function(require,module,exports){
+/**
+ * Helpers.
+ */
+
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var w = d * 7;
+var y = d * 365.25;
+
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ * - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+module.exports = function(val, options) {
+ options = options || {};
+ var type = typeof val;
+ if (type === 'string' && val.length > 0) {
+ return parse(val);
+ } else if (type === 'number' && isFinite(val)) {
+ return options.long ? fmtLong(val) : fmtShort(val);
+ }
+ throw new Error(
+ 'val is not a non-empty string or a valid number. val=' +
+ JSON.stringify(val)
+ );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse(str) {
+ str = String(str);
+ if (str.length > 100) {
+ return;
+ }
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
+ str
+ );
+ if (!match) {
+ return;
+ }
+ var n = parseFloat(match[1]);
+ var type = (match[2] || 'ms').toLowerCase();
+ switch (type) {
+ case 'years':
+ case 'year':
+ case 'yrs':
+ case 'yr':
+ case 'y':
+ return n * y;
+ case 'weeks':
+ case 'week':
+ case 'w':
+ return n * w;
+ case 'days':
+ case 'day':
+ case 'd':
+ return n * d;
+ case 'hours':
+ case 'hour':
+ case 'hrs':
+ case 'hr':
+ case 'h':
+ return n * h;
+ case 'minutes':
+ case 'minute':
+ case 'mins':
+ case 'min':
+ case 'm':
+ return n * m;
+ case 'seconds':
+ case 'second':
+ case 'secs':
+ case 'sec':
+ case 's':
+ return n * s;
+ case 'milliseconds':
+ case 'millisecond':
+ case 'msecs':
+ case 'msec':
+ case 'ms':
+ return n;
+ default:
+ return undefined;
+ }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+ var msAbs = Math.abs(ms);
+ if (msAbs >= d) {
+ return Math.round(ms / d) + 'd';
+ }
+ if (msAbs >= h) {
+ return Math.round(ms / h) + 'h';
+ }
+ if (msAbs >= m) {
+ return Math.round(ms / m) + 'm';
+ }
+ if (msAbs >= s) {
+ return Math.round(ms / s) + 's';
+ }
+ return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+ var msAbs = Math.abs(ms);
+ if (msAbs >= d) {
+ return plural(ms, msAbs, d, 'day');
+ }
+ if (msAbs >= h) {
+ return plural(ms, msAbs, h, 'hour');
+ }
+ if (msAbs >= m) {
+ return plural(ms, msAbs, m, 'minute');
+ }
+ if (msAbs >= s) {
+ return plural(ms, msAbs, s, 'second');
+ }
+ return ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, msAbs, n, name) {
+ var isPlural = msAbs >= n * 1.5;
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+}
+
+},{}],37:[function(require,module,exports){
+// shim for using process in browser
+var process = module.exports = {};
+
+// cached from whatever global is present so that test runners that stub it
+// don't break things. But we need to wrap it in a try catch in case it is
+// wrapped in strict mode code which doesn't define any globals. It's inside a
+// function because try/catches deoptimize in certain engines.
+
+var cachedSetTimeout;
+var cachedClearTimeout;
+
+function defaultSetTimout() {
+ throw new Error('setTimeout has not been defined');
+}
+function defaultClearTimeout () {
+ throw new Error('clearTimeout has not been defined');
+}
+(function () {
+ try {
+ if (typeof setTimeout === 'function') {
+ cachedSetTimeout = setTimeout;
+ } else {
+ cachedSetTimeout = defaultSetTimout;
+ }
+ } catch (e) {
+ cachedSetTimeout = defaultSetTimout;
+ }
+ try {
+ if (typeof clearTimeout === 'function') {
+ cachedClearTimeout = clearTimeout;
+ } else {
+ cachedClearTimeout = defaultClearTimeout;
+ }
+ } catch (e) {
+ cachedClearTimeout = defaultClearTimeout;
+ }
+} ())
+function runTimeout(fun) {
+ if (cachedSetTimeout === setTimeout) {
+ //normal enviroments in sane situations
+ return setTimeout(fun, 0);
+ }
+ // if setTimeout wasn't available but was latter defined
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
+ cachedSetTimeout = setTimeout;
+ return setTimeout(fun, 0);
+ }
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedSetTimeout(fun, 0);
+ } catch(e){
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedSetTimeout.call(null, fun, 0);
+ } catch(e){
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
+ return cachedSetTimeout.call(this, fun, 0);
+ }
+ }
+
+
+}
+function runClearTimeout(marker) {
+ if (cachedClearTimeout === clearTimeout) {
+ //normal enviroments in sane situations
+ return clearTimeout(marker);
+ }
+ // if clearTimeout wasn't available but was latter defined
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
+ cachedClearTimeout = clearTimeout;
+ return clearTimeout(marker);
+ }
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedClearTimeout(marker);
+ } catch (e){
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedClearTimeout.call(null, marker);
+ } catch (e){
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
+ return cachedClearTimeout.call(this, marker);
+ }
+ }
+
+
+
+}
+var queue = [];
+var draining = false;
+var currentQueue;
+var queueIndex = -1;
+
+function cleanUpNextTick() {
+ if (!draining || !currentQueue) {
+ return;
+ }
+ draining = false;
+ if (currentQueue.length) {
+ queue = currentQueue.concat(queue);
+ } else {
+ queueIndex = -1;
+ }
+ if (queue.length) {
+ drainQueue();
+ }
+}
+
+function drainQueue() {
+ if (draining) {
+ return;
+ }
+ var timeout = runTimeout(cleanUpNextTick);
+ draining = true;
+
+ var len = queue.length;
+ while(len) {
+ currentQueue = queue;
+ queue = [];
+ while (++queueIndex < len) {
+ if (currentQueue) {
+ currentQueue[queueIndex].run();
+ }
+ }
+ queueIndex = -1;
+ len = queue.length;
+ }
+ currentQueue = null;
+ draining = false;
+ runClearTimeout(timeout);
+}
+
+process.nextTick = function (fun) {
+ var args = new Array(arguments.length - 1);
+ if (arguments.length > 1) {
+ for (var i = 1; i < arguments.length; i++) {
+ args[i - 1] = arguments[i];
+ }
+ }
+ queue.push(new Item(fun, args));
+ if (queue.length === 1 && !draining) {
+ runTimeout(drainQueue);
+ }
+};
+
+// v8 likes predictible objects
+function Item(fun, array) {
+ this.fun = fun;
+ this.array = array;
+}
+Item.prototype.run = function () {
+ this.fun.apply(null, this.array);
+};
+process.title = 'browser';
+process.browser = true;
+process.env = {};
+process.argv = [];
+process.version = ''; // empty string to avoid regexp issues
+process.versions = {};
+
+function noop() {}
+
+process.on = noop;
+process.addListener = noop;
+process.once = noop;
+process.off = noop;
+process.removeListener = noop;
+process.removeAllListeners = noop;
+process.emit = noop;
+process.prependListener = noop;
+process.prependOnceListener = noop;
+
+process.listeners = function (name) { return [] }
+
+process.binding = function (name) {
+ throw new Error('process.binding is not supported');
+};
+
+process.cwd = function () { return '/' };
+process.chdir = function (dir) {
+ throw new Error('process.chdir is not supported');
+};
+process.umask = function() { return 0; };
+
+},{}],38:[function(require,module,exports){
+(function (setImmediate,clearImmediate){(function (){
+var nextTick = require('process/browser.js').nextTick;
+var apply = Function.prototype.apply;
+var slice = Array.prototype.slice;
+var immediateIds = {};
+var nextImmediateId = 0;
+
+// DOM APIs, for completeness
+
+exports.setTimeout = function() {
+ return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
+};
+exports.setInterval = function() {
+ return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
+};
+exports.clearTimeout =
+exports.clearInterval = function(timeout) { timeout.close(); };
+
+function Timeout(id, clearFn) {
+ this._id = id;
+ this._clearFn = clearFn;
+}
+Timeout.prototype.unref = Timeout.prototype.ref = function() {};
+Timeout.prototype.close = function() {
+ this._clearFn.call(window, this._id);
+};
+
+// Does not start the time, just sets up the members needed.
+exports.enroll = function(item, msecs) {
+ clearTimeout(item._idleTimeoutId);
+ item._idleTimeout = msecs;
+};
+
+exports.unenroll = function(item) {
+ clearTimeout(item._idleTimeoutId);
+ item._idleTimeout = -1;
+};
+
+exports._unrefActive = exports.active = function(item) {
+ clearTimeout(item._idleTimeoutId);
+
+ var msecs = item._idleTimeout;
+ if (msecs >= 0) {
+ item._idleTimeoutId = setTimeout(function onTimeout() {
+ if (item._onTimeout)
+ item._onTimeout();
+ }, msecs);
+ }
+};
+
+// That's not how node.js implements it but the exposed api is the same.
+exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
+ var id = nextImmediateId++;
+ var args = arguments.length < 2 ? false : slice.call(arguments, 1);
+
+ immediateIds[id] = true;
+
+ nextTick(function onNextTick() {
+ if (immediateIds[id]) {
+ // fn.call() is faster so we optimize for the common use-case
+ // @see http://jsperf.com/call-apply-segu
+ if (args) {
+ fn.apply(null, args);
+ } else {
+ fn.call(null);
+ }
+ // Prevent ids from leaking
+ exports.clearImmediate(id);
+ }
+ });
+
+ return id;
+};
+
+exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
+ delete immediateIds[id];
+};
+}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
+},{"process/browser.js":37,"timers":38}],39:[function(require,module,exports){
+module.exports={
+ "name": "@pm2/js-api",
+ "version": "0.8.0",
+ "description": "PM2.io API Client for Javascript",
+ "main": "index.js",
+ "unpkg": "dist/keymetrics.es5.min.js",
+ "engines": {
+ "node": ">=4.0"
+ },
+ "scripts": {
+ "test": "mocha test/*",
+ "build": "mkdir -p dist; browserify -s Keymetrics -r ./ > ./dist/keymetrics.es5.js",
+ "dist": "mkdir -p dist; browserify -s Keymetrics -r ./ | uglifyjs -c warnings=false -m > ./dist/keymetrics.es5.min.js",
+ "doc": "jsdoc -r ./src --readme ./README.md -d doc -t ./node_modules/minami",
+ "clean": "rm dist/*",
+ "prepare": "npm run build && npm run dist"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/keymetrics/km.js.git"
+ },
+ "keywords": [
+ "keymetrics",
+ "api",
+ "dashboard",
+ "monitoring",
+ "wrapper"
+ ],
+ "author": "Keymetrics Team",
+ "license": "Apache-2",
+ "bugs": {
+ "url": "https://github.com/keymetrics/km.js/issues"
+ },
+ "homepage": "https://github.com/keymetrics/km.js#readme",
+ "dependencies": {
+ "async": "^2.6.3",
+ "extrareqp2": "^1.0.0",
+ "debug": "~4.3.1",
+ "eventemitter2": "^6.3.1",
+ "ws": "^7.0.0"
+ },
+ "devDependencies": {
+ "@babel/core": "^7.0.0",
+ "@babel/preset-env": "^7.0.0",
+ "babelify": "10.0.0",
+ "browserify": "^17.0.0",
+ "jsdoc": "^3.4.2",
+ "minami": "^1.1.1",
+ "mocha": "^7.0.0",
+ "should": "*",
+ "uglify-es": "~3.3.9"
+ },
+ "browserify": {
+ "debug": true,
+ "transform": [
+ [
+ "babelify",
+ {
+ "presets": [
+ [
+ "@babel/preset-env",
+ {
+ "debug": false,
+ "forceAllTransforms": true
+ }
+ ]
+ ],
+ "sourceMaps": true
+ }
+ ]
+ ]
+ },
+ "browser": {
+ "./src/auth_strategies/embed_strategy.js": false,
+ "ws": false
+ }
+}
+
+},{}],40:[function(require,module,exports){
+module.exports={"actions":[{"route":{"name":"/api/bucket/:id/actions/trigger","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"server_name","type":"string","description":"the name of the server","optional":false,"defaultvalue":null},{"name":"process_id","type":"number","description":"the id of the process","optional":true,"defaultvalue":null},{"name":"app_name","type":"number","description":"the name of the process","optional":true,"defaultvalue":null},{"name":"action_name","type":"string","description":"the name of the action to trigger","optional":false,"defaultvalue":null},{"name":"opts","type":"object","description":"any specific options to be passed to the function","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully run the action","optional":false}],"response":[{"name":"success","type":"boolean","description":"succesully sended the action to PM2","optional":false,"defaultvalue":null}],"name":"triggerAction","longname":"Actions.triggerAction","scope":"route"},{"route":{"name":"/api/bucket/:id/actions/triggerPM2","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"server_name","type":"string","description":"the name of the server","optional":false,"defaultvalue":null},{"name":"method_name","type":"string","description":"the name of the pm2 method to trigger","optional":false,"defaultvalue":null},{"name":"app_name","type":"string","description":"the name of the application","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"failed action","optional":false},{"type":"200","description":"succesfully run the action","optional":false}],"response":[{"name":"success","type":"boolean","description":"succesully sended the action to PM2","optional":false,"defaultvalue":null}],"name":"triggerPM2Action","longname":"Actions.triggerPM2Action","scope":"route"},{"route":{"name":"/api/bucket/:id/actions/triggerScopedAction","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"server_name","type":"string","description":"the name of the server","optional":false,"defaultvalue":null},{"name":"action_name","type":"string","description":"the name of the pm2 method to trigger","optional":false,"defaultvalue":null},{"name":"app_name","type":"string","description":"the name of the application","optional":false,"defaultvalue":null},{"name":"pm_id","type":"number","description":"the id of the process","optional":false,"defaultvalue":null},{"name":"opts","type":"object","description":"custom parameters to give to the action","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully run the action","optional":false}],"response":[{"name":".","type":"object","description":"the action sended to the process","optional":false,"defaultvalue":null}],"name":"triggerScopedAction","longname":"Actions.triggerScopedAction","scope":"route"}],"bucket":{"alert":{"analyzer":[{"route":{"name":"/api/bucket/:id/alerts/analyzer","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"size","type":"integer","description":"line limit, default to 20","optional":true,"defaultvalue":null},{"name":"from","type":"integer","description":"offset limit","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"list all alerts","optional":false}],"name":"list","longname":"Bucket.alert.analyzer.list","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/alerts/analyzer/:alert","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":alert","type":"string","description":"alert id","optional":false}],"body":[{"name":"useful","type":"boolean","description":"","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"content modified","optional":false}],"name":"editState","longname":"Bucket.alert.analyzer.editState","scope":"route"},{"route":{"name":"/api/bucket/:id/alerts/analyzer/:analyzer/config","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":analyzer","type":"string","description":"analyzer name","optional":false}],"body":[{"name":"blacklist","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"blacklist.apps","type":"array","description":"","optional":true,"defaultvalue":null},{"name":"blacklist.servers","type":"array","description":"","optional":true,"defaultvalue":null},{"name":"blacklist.metrics","type":"array","description":"","optional":true,"defaultvalue":null},{"name":"threshold","type":"number","description":"","optional":false,"defaultvalue":null},{"name":"window","type":"number","description":"","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"content modified","optional":false}],"name":"updateConfig","longname":"Bucket.alert.analyzer.updateConfig","scope":"route"}],"default":[{"route":{"name":"/api/bucket/:id/alerts","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"name","type":"string","description":"Alert name","optional":false,"defaultvalue":null},{"name":"enabled","type":"boolean","description":"Alert's state","optional":true,"defaultvalue":null},{"name":"type","type":"string","description":"Should be `metric`, `event` or `webcheck`","optional":false,"defaultvalue":null},{"name":"initiator","type":"string","description":"Should be metric name or event name","optional":false,"defaultvalue":null},{"name":"options","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"options.operator","type":"string","description":"Should be `>`, `<`, `=`, `>=` or `<=`","optional":true,"defaultvalue":null},{"name":"options.threshold","type":"number","description":"Value to reach to send an alert","optional":true,"defaultvalue":null},{"name":"options.act","type":"string","description":"Should be `always`, `opposite`, `first` or `diff`","optional":true,"defaultvalue":null},{"name":"options.timerange","type":"number","description":"Timerange to check, in seconds","optional":true,"defaultvalue":null},{"name":"scope","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"scope.apps","type":"object","description":"Array of strings with apps name (can be empty)","optional":true,"defaultvalue":null},{"name":"scope.servers","type":"object","description":"Array of strings with servers name (can be empty)","optional":true,"defaultvalue":null},{"name":"scope.initiators","type":"object","description":"Array of strings with initiators name (need to be set if no apps or servers)","optional":true,"defaultvalue":null},{"name":"scope.sources","type":"object","description":"Array of strings with sources name (can be empty)","optional":true,"defaultvalue":null},{"name":"actions","type":"object","description":"List of actions to trigger","optional":false,"defaultvalue":null},{"name":"actions[].type","type":"string","description":"Type of action","optional":true,"defaultvalue":null},{"name":"actions[].params","type":"object","description":"Params for action","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing parameters","optional":false},{"type":"200","description":"successfuly created alert","optional":false}],"name":"create","longname":"Bucket.alert.create","scope":"route"},{"route":{"name":"/api/bucket/:id/alerts/:alert","type":"DELETE"},"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":alert","type":"string","description":"alert id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"204","description":"successfuly deleted alert","optional":false}],"name":"delete","longname":"Bucket.alert.delete","scope":"route","authentication":false},{"route":{"name":"/api/bucket/:id/alerts/","type":"GET"},"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"list all alerts","optional":false}],"name":"list","longname":"Bucket.alert.list","scope":"route","authentication":false},{"route":{"name":"/api/bucket/:id/alerts/:alert","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":alert","type":"string","description":"alert id","optional":false}],"body":[{"name":"name","type":"string","description":"Alert name","optional":true,"defaultvalue":null},{"name":"enabled","type":"boolean","description":"Alert's state","optional":true,"defaultvalue":null},{"name":"type","type":"string","description":"Should be `metric`, `event` or `webcheck`","optional":true,"defaultvalue":null},{"name":"initiator","type":"string","description":"Should be metric name or event name","optional":true,"defaultvalue":null},{"name":"options","type":"object","description":"","optional":true,"defaultvalue":null},{"name":"options.operator","type":"string","description":"Should be `>`, `<`, `=`, `<=` or `>=`","optional":true,"defaultvalue":null},{"name":"options.threshold","type":"number","description":"Value to reach to send an alert","optional":true,"defaultvalue":null},{"name":"options.act","type":"string","description":"Should be `always`, `opposite`, `first` or `diff`","optional":true,"defaultvalue":null},{"name":"options.timerange","type":"number","description":"Timerange to check, in seconds","optional":true,"defaultvalue":null},{"name":"scope","type":"object","description":"","optional":true,"defaultvalue":null},{"name":"scope.apps","type":"array","description":"Array of strings with apps name (can be empty)","optional":true,"defaultvalue":null},{"name":"scope.servers","type":"array","description":"Array of strings with servers name (can be empty)","optional":true,"defaultvalue":null},{"name":"scope.initiators","type":"object","description":"Array of strings with initiators name (need to be set if no apps or servers)","optional":true,"defaultvalue":null},{"name":"scope.sources","type":"object","description":"Array of strings with sources name (can be empty)","optional":true,"defaultvalue":null},{"name":"actions","type":"array","description":"List of actions to trigger","optional":true,"defaultvalue":null},{"name":"actions[].type","type":"string","description":"Type of action","optional":true,"defaultvalue":null},{"name":"actions[].params","type":"object","description":"Params for action","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing parameters","optional":false},{"type":"404","description":"alert not found","optional":false},{"type":"200","description":"successfuly created alert","optional":false}],"name":"updateAlert","longname":"Bucket.alert.updateAlert","scope":"route"},{"route":{"name":"/api/bucket/:id/alerts/:alert","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":alert","type":"string","description":"alert id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"404","description":"alert not found","optional":false},{"type":"200","description":"successfuly returned alert","optional":false}],"name":"get","longname":"Bucket.alert.get","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/alerts/:alert/sample","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":alert","type":"string","description":"alert id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"404","description":"alert not found","optional":false},{"type":"202","description":"successfuly sended alert actions","optional":false}],"name":"triggerSample","longname":"Bucket.alert.triggerSample","scope":"route"},{"route":{"name":"/api/bucket/:id/alerts/update","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"triggers","type":"object","description":"","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing triggers parameter","optional":false},{"type":"200","description":"succesfully update triggers","optional":false}],"response":[{"name":"triggers","type":"object","description":"new triggers object","optional":false,"defaultvalue":null}],"name":"update","longname":"Bucket.alert.update","scope":"route"},{"route":{"name":"/api/bucket/:id/alerts/updateSlack","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"slack","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"slack.active","type":"boolean","description":"","optional":true,"defaultvalue":null},{"name":"slack.url","type":"boolean","description":"needed if active is set to true","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing triggers parameter","optional":false},{"type":"200","description":"succesfully update triggers","optional":false}],"response":[{"name":"bucket","type":"object","description":"","optional":false,"defaultvalue":null}],"name":"updateSlack","longname":"Bucket.alert.updateSlack","scope":"route"},{"route":{"name":"/api/bucket/:id/alerts/updateWebhooks","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"webhooks","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"webhooks.active","type":"boolean","description":"","optional":true,"defaultvalue":null},{"name":"webhooks.url","type":"boolean","description":"needed if active is set to true","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing triggers parameter","optional":false},{"type":"200","description":"succesfully update triggers","optional":false}],"response":[{"name":"bucket","type":"object","description":"","optional":false,"defaultvalue":null}],"name":"updateWebhooks","longname":"Bucket.alert.updateWebhooks","scope":"route"}]},"application":[{"route":{"name":"/api/bucket/:id/applications","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"successfuly retrieved applications","optional":false}],"name":"list","longname":"Bucket.application.list","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/applications/:application","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":application","type":"string","description":"application id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"404","description":"application not found","optional":false},{"type":"200","description":"successfuly retrieved application","optional":false}],"name":"get","longname":"Bucket.application.get","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/applications","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"name","type":"string","description":"","optional":false,"defaultvalue":null},{"name":"domains","type":"object","description":"Array of string with domains","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing parameters","optional":false},{"type":"200","description":"successfuly created application","optional":false}],"name":"create","longname":"Bucket.application.create","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/applications/:application","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":application","type":"string","description":"application id","optional":false}],"body":[{"name":"name","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"domains","type":"object","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing parameters","optional":false},{"type":"200","description":"successfuly updated application","optional":false}],"name":"update","longname":"Bucket.application.update","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/applications/:application","type":"DELETE"},"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":application","type":"string","description":"application id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"204","description":"successfuly deleted application","optional":false}],"name":"delete","longname":"Bucket.application.delete","scope":"route","async":true,"authentication":false},{"route":{"name":"/api/bucket/:id/applications/:application/preview","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":application","type":"string","description":"application id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"404","description":"preview not found","optional":false},{"type":"200","description":"successfuly retrieved application screenshot","optional":false}],"name":"getPreview","longname":"Bucket.application.getPreview","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/applications/:application/report","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":application","type":"string","description":"application id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"404","description":"report not found","optional":false},{"type":"200","description":"successfuly retrieved application report","optional":false}],"name":"getReports","longname":"Bucket.application.getReports","scope":"route","async":true}],"billing":[{"route":{"name":"/api/bucket/:id/payment/subscribe","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"plan","type":"string","description":"name of the plan to upgrade to","optional":false,"defaultvalue":null},{"name":"stripe_token","type":"string","description":"a card token created by stripe","optional":true,"defaultvalue":null},{"name":"coupon_id","type":"string","description":"the id of the stripe coupon","optional":true,"defaultvalue":null}],"code":[{"type":"400","description":"missing/invalid parameters","optional":false},{"type":"403","description":"need a credit card OR not allowed to subscribe to the plan","optional":false},{"type":"500","description":"stripe/database error","optional":false},{"type":"200","description":"succesfully upgraded","optional":false}],"response":[{"name":"bucket","type":"object","description":"the bucket object","optional":false,"defaultvalue":null},{"name":"subscription","type":"object","description":"the subscription object attached to the subscription","optional":false,"defaultvalue":null}],"name":"subscribe","longname":"Bucket.billing.subscribe","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/payment/subscribe/:paymentIntent","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":paymentIntent","type":"string","description":"paymentIntent id","optional":false}],"body":[{"name":"plan","type":"string","description":"name of the plan to upgrade to","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"missing/invalid parameters","optional":false},{"type":"500","description":"stripe/database error","optional":false},{"type":"200","description":"succesfully upgraded","optional":false}],"response":[{"name":"bucket","type":"object","description":"the bucket object","optional":false,"defaultvalue":null}],"name":"paymentIntentSucceed","longname":"Bucket.billing.paymentIntentSucceed","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/payment/trial","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"plan","type":"string","description":"Plan to trial","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"can't claim trial","optional":false},{"type":"200","description":"trial launched","optional":false}],"response":[{"name":"duration","type":"string","description":"the duration of the trial","optional":false,"defaultvalue":null},{"name":"plan","type":"string","description":"the plan of the trial","optional":false,"defaultvalue":null}],"name":"startTrial","longname":"Bucket.billing.startTrial","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/payment/invoices","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"400","description":"Missing/invalid parameters","optional":false},{"type":"404","description":"This bucket hasn't invoices","optional":false},{"type":"200","description":"succesfully returns invoices","optional":false}],"response":[{"name":".","type":"array","description":"array of invoices","optional":false,"defaultvalue":null}],"name":"getInvoices","longname":"Bucket.billing.getInvoices","scope":"route"},{"route":{"name":"/api/bucket/:id/payment/receipts","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"400","description":"Missing/invalid parameters","optional":false},{"type":"404","description":"This bucket hasn't receipts","optional":false},{"type":"200","description":"succesfully returns receipts","optional":false}],"response":[{"name":".","type":"array","description":"array of receipts","optional":false,"defaultvalue":null}],"name":"getReceipts","longname":"Bucket.billing.getReceipts","scope":"route"},{"route":{"name":"/api/bucket/:id/payment/subscription","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"404","description":"the bucket doesnt have any subscription","optional":false},{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved the subscription","optional":false}],"response":[{"name":".","type":"object","description":"subscription object","optional":false,"defaultvalue":null}],"name":"getSubcription","longname":"Bucket.billing.getSubcription","scope":"route"},{"route":{"name":"/api/bucket/:id/payment/subscription/state","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"404","description":"the bucket doesnt have any subscription","optional":false},{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved the subscription","optional":false}],"response":[{"name":"status","type":"string","description":"stripe state of the subscription","optional":false,"defaultvalue":null},{"name":"plan","type":"string","description":"stripe plan name of the subscription","optional":false,"defaultvalue":null},{"name":"canceled_at","type":"string","description":"if he sub has been cancelled, add the date","optional":false,"defaultvalue":null}],"name":"getSubcriptionState","longname":"Bucket.billing.getSubcriptionState","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/payment/cards","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"token","type":"string","description":"card token generated by stripe","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"missing parameters","optional":false},{"type":"500","description":"stripe error","optional":false},{"type":"200","description":"succesfully added the card","optional":false}],"response":[{"name":"data","type":"object","description":"stripe credit card Object","optional":false,"defaultvalue":null}],"name":"attachCreditCard","longname":"Bucket.billing.attachCreditCard","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/payment/cards","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"404","description":"the user doesn't have any default card","optional":false},{"type":"200","description":"succesfully retieved the charges","optional":false}],"response":[{"name":"data","type":"array","description":"list of stripe cards object","optional":false,"defaultvalue":null}],"name":"fetchCreditCards","longname":"Bucket.billing.fetchCreditCards","scope":"route"},{"route":{"name":"/api/bucket/:id/payment/card/:card_id","type":"GET"},"authentication":true,"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":card_id","type":"string","description":"the stripe id of the card","optional":false}],"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"400","description":"missing parameters card_id","optional":false},{"type":"404","description":"the user doesn't have any default card","optional":false},{"type":"200","description":"succesfully retieved the card","optional":false}],"response":[{"name":"data","type":"array","description":"stripe card object","optional":false,"defaultvalue":null}],"name":"fetchCreditCard","longname":"Bucket.billing.fetchCreditCard","scope":"route"},{"route":{"name":"/api/bucket/:id/payment/card","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"404","description":"the user doesn't have any default card","optional":false},{"type":"200","description":"succesfully retieved the card","optional":false}],"response":[{"name":"data","type":"array","description":"stripe card object","optional":false,"defaultvalue":null}],"name":"fetchDefaultCreditCard","longname":"Bucket.billing.fetchDefaultCreditCard","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/payment/card","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"id","type":"string","description":"stripe card id","optional":false,"defaultvalue":null},{"name":"address_line1","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"address_country","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"address_zip","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"address_city","type":"string","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"400","description":"missing parameters, you need to specify a card","optional":false},{"type":"200","description":"succesfully updated the card","optional":false}],"response":[{"name":"data","type":"array","description":"stripe card object","optional":false,"defaultvalue":null}],"name":"updateCreditCard","longname":"Bucket.billing.updateCreditCard","scope":"route"},{"route":{"name":"/api/bucket/:id/payment/card/:card_id","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":card_id","type":"string","description":"the stripe id of the card","optional":false}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"400","description":"missing parameters card_id","optional":false},{"type":"200","description":"succesfully retieved the card","optional":false},{"type":"403","description":"the user must have one card active when having a subscription","optional":false}],"response":[{"name":".","type":"object","description":"stripe card object","optional":false,"defaultvalue":null}],"name":"deleteCreditCard","longname":"Bucket.billing.deleteCreditCard","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/payment/card/:card_id/default","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":card_id","type":"string","description":"the stripe id of the card","optional":false}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"400","description":"missing parameters card_id","optional":false},{"type":"200","description":"succesfully set the card as default","optional":false}],"response":[{"name":"data","type":"object","description":"stripe card object","optional":false,"defaultvalue":null}],"name":"setDefaultCard","longname":"Bucket.billing.setDefaultCard","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/payment","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"400","description":"missing parameters card_id","optional":false},{"type":"200","description":"succesfully retrieved the metadata","optional":false}],"response":[{"name":".","type":"object","description":"stripe metadata object","optional":false,"defaultvalue":null}],"name":"fetchMetadata","longname":"Bucket.billing.fetchMetadata","scope":"route"},{"route":{"name":"/api/bucket/:id/payment","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"metadata","type":"object","description":"the metadata you can update","optional":false,"defaultvalue":null},{"name":"metadata.vat_number","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"metadata.company_name","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"metadata.receipt_email","type":"string","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"400","description":"missing parameters, you need to specify a card","optional":false},{"type":"200","description":"succesfully updated the card","optional":false}],"response":[{"name":"data","type":"array","description":"stripe customer metadata object","optional":false,"defaultvalue":null}],"name":"updateMetadata","longname":"Bucket.billing.updateMetadata","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/payment/banks","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"iban","type":"string","description":"the iban used to recognize the account","optional":true,"defaultvalue":null},{"name":"type","type":"string","description":"the type of the bank account (currently only sepa is available)","optional":false,"defaultvalue":null},{"name":"name","type":"string","description":"name of the bank account owner","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"missing parameters","optional":false},{"type":"500","description":"stripe error","optional":false},{"type":"200","description":"succesfully added the account","optional":false}],"response":[{"name":"data","type":"object","description":"stripe credit card Object","optional":false,"defaultvalue":null}],"name":"attachBankAccount","longname":"Bucket.billing.attachBankAccount","scope":"route"},{"route":{"name":"/api/bucket/:id/payment/banks","type":"GET"},"authentication":true,"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"404","description":"the user doesn't have any default account","optional":false},{"type":"200","description":"succesfully retieved the card","optional":false}],"response":[{"name":"data","type":"object","description":"stripe source object","optional":false,"defaultvalue":null}],"name":"fetchBankAccount","longname":"Bucket.billing.fetchBankAccount","scope":"route"},{"route":{"name":"/api/bucket/:id/payment/banks","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"200","description":"succesfully retieved the card","optional":false},{"type":"404","description":"the user doesn't have any default account","optional":false}],"response":[{"name":".","type":"object","description":"stripe source object","optional":false,"defaultvalue":null}],"name":"deleteBankAccount","longname":"Bucket.billing.deleteBankAccount","scope":"route"}],"dashboardschema":[{"route":{"name":"/api/bucket/:id/dashboardSchema/","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"name","type":"string","description":"the name of the dashboard","optional":false,"defaultvalue":null},{"name":"data","type":"object","description":"the list of component that compose the dashboard","optional":false,"defaultvalue":null},{"name":"mode","type":"string","description":"the dashboard mode","optional":false,"defaultvalue":null},{"name":"image","type":"object","description":"background image for the dashboard","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully created dashboard","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"dashboard","description":"complete dashboard object from database","optional":false,"defaultvalue":null}],"name":"create","longname":"Bucket.dashboardschema.create","scope":"route"},{"route":{"name":"/api/bucket/:id/dashboardSchema/","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"array","description":"array of servers status","optional":false,"defaultvalue":null}],"name":"retrieveAll","longname":"Bucket.dashboardschema.retrieveAll","scope":"route"},{"route":{"name":"/api/bucket/:id/dashboardSchema/:dashid/visualization","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":dashid","type":"string","description":"dashboard id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"404","description":"dashboard not found","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"array","description":"array of dashboards","optional":false,"defaultvalue":null}],"name":"visualization","longname":"Bucket.dashboardschema.visualization","scope":"route"},{"route":{"name":"/api/bucket/:id/dashboardSchema/:dashid","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":dashid","type":"string","description":"dashboard id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"404","description":"dashboard not found","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"array","description":"array of dashboards","optional":false,"defaultvalue":null}],"name":"retrieve","longname":"Bucket.dashboardschema.retrieve","scope":"route"},{"route":{"name":"/api/bucket/:id/dashboardSchema/:dashid","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":dashid","type":"string","description":"dashboard id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully deleted dashboard","optional":false},{"type":"400","description":"Invalid params","optional":false},{"type":"404","description":"dashboard not found","optional":false}],"response":[{"name":".","type":"array","description":"array of dashboards","optional":false,"defaultvalue":null}],"name":"remove","longname":"Bucket.dashboardschema.remove","scope":"route"},{"route":{"name":"/api/bucket/:id/dashboardSchema/:dashId","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":dashId","type":"string","description":"dashboard id","optional":false}],"body":[{"name":"name","type":"string","description":"the name of the dashboard","optional":false,"defaultvalue":null},{"name":"data","type":"object","description":"the data to populate the dashboard","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"404","description":"dashboard not found","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"array","description":"array of servers status","optional":false,"defaultvalue":null}],"name":"update","longname":"Bucket.dashboardschema.update","scope":"route"}],"server":[{"route":{"name":"/api/bucket/:id/data/deleteServer","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"server_name","type":"string","description":"the name of server","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"406","description":"require an action before delete","optional":false},{"type":"400","description":"missing or invalid parameters","optional":false},{"type":"200","description":"successfully deleted","optional":false}],"response":[{"name":"success","type":"boolean","description":"can be true or false","optional":false,"defaultvalue":null},{"name":"msg","type":"string","description":"response","optional":false,"defaultvalue":null}],"name":"deleteServer","longname":"Bucket.server.deleteServer","scope":"route"}],"webcheck":[{"route":{"name":"/api/bucket/:id/webchecks/metrics","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"successfuly retrieved webchecks metrics","optional":false}],"name":"listMetrics","longname":"Bucket.webcheck.listMetrics","scope":"route"},{"route":{"name":"/api/bucket/:id/webchecks/regions","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"successfuly retrieved webchecks regions","optional":false}],"name":"listRegions","longname":"Bucket.webcheck.listRegions","scope":"route"},{"route":{"name":"/api/bucket/:id/webchecks/:webcheck/metrics","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":webcheck","type":"string","description":"webcheck id","optional":false}],"body":[{"name":"start","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"metrics","type":"array","description":"","optional":true,"defaultvalue":null},{"name":"end","type":"string","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"successfuly retrieved webchecks regions","optional":false}],"name":"getMetrics","longname":"Bucket.webcheck.getMetrics","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/webchecks","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"query":[{"name":"application","type":"string","description":"Application's id to filter","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"successfuly retrieved webchecks","optional":false}],"name":"list","longname":"Bucket.webcheck.list","scope":"route"},{"route":{"name":"/api/bucket/:id/webchecks/:webcheck","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":webcheck","type":"string","description":"webcheck id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"404","description":"webcheck not found","optional":false},{"type":"200","description":"successfuly retrieved webcheck","optional":false}],"name":"get","longname":"Bucket.webcheck.get","scope":"route"},{"route":{"name":"/api/bucket/:id/webchecks","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"name","type":"string","description":"Webcheck name","optional":false,"defaultvalue":null},{"name":"enabled","type":"boolean","description":"Webcheck's state","optional":true,"defaultvalue":null},{"name":"target","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"target.type","type":"string","description":"Should be `http`, `https` or `tcp`","optional":true,"defaultvalue":null},{"name":"target.port","type":"number","description":"Target's port","optional":true,"defaultvalue":null},{"name":"target.address","type":"string","description":"Target's IP/domain","optional":true,"defaultvalue":null},{"name":"target.path","type":"string","description":"HTTP Path (only for http/https)","optional":true,"defaultvalue":null},{"name":"target.is_frontend","type":"boolean","description":"Enable or disable frontend metrics (via puppeteer)","optional":true,"defaultvalue":null},{"name":"body","type":"string","description":"Body need to match this regex to succeed webcheck (only for http/https)","optional":true,"defaultvalue":null},{"name":"interval","type":"number","description":"Webcheck's interval check (ms)","optional":false,"defaultvalue":null},{"name":"timeout","type":"number","description":"Webcheck's timeout (ms)","optional":false,"defaultvalue":null},{"name":"source","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"source.region","type":"string","description":"Webcheck's worker region","optional":true,"defaultvalue":null},{"name":"retry","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"retry.max","type":"number","description":"Max webcheck's retry before mark as failed","optional":true,"defaultvalue":null},{"name":"retry.interval","type":"number","description":"Webcheck's retry interval (ms)","optional":true,"defaultvalue":null},{"name":"alerts","type":"object","description":"List of alerts (cf. Alert type)","optional":false,"defaultvalue":null},{"name":"application","type":"string","description":"Application's id","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing parameters","optional":false},{"type":"200","description":"successfuly created webcheck","optional":false}],"name":"create","longname":"Bucket.webcheck.create","scope":"route"},{"route":{"name":"/api/bucket/:id/webchecks/:webcheck","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":webcheck","type":"string","description":"webcheck id","optional":false}],"body":[{"name":"name","type":"string","description":"Webcheck name","optional":true,"defaultvalue":null},{"name":"enabled","type":"boolean","description":"Webcheck's state","optional":true,"defaultvalue":null},{"name":"target","type":"object","description":"","optional":true,"defaultvalue":null},{"name":"target.type","type":"string","description":"Should be `http`, `https` or `tcp`","optional":true,"defaultvalue":null},{"name":"target.port","type":"number","description":"Target's port","optional":true,"defaultvalue":null},{"name":"target.address","type":"string","description":"Target's IP/domain","optional":true,"defaultvalue":null},{"name":"target.path","type":"string","description":"HTTP Path (only for http/https)","optional":true,"defaultvalue":null},{"name":"target.is_frontend","type":"boolean","description":"Enable or disable frontend metrics (via puppeteer)","optional":true,"defaultvalue":null},{"name":"body","type":"string","description":"Body need to match this regex to succeed webcheck (only for http/https)","optional":true,"defaultvalue":null},{"name":"interval","type":"number","description":"Webcheck's interval check (ms)","optional":true,"defaultvalue":null},{"name":"timeout","type":"number","description":"Webcheck's timeout (ms)","optional":true,"defaultvalue":null},{"name":"source","type":"object","description":"","optional":true,"defaultvalue":null},{"name":"source.region","type":"string","description":"Webcheck's worker region","optional":true,"defaultvalue":null},{"name":"retry","type":"object","description":"","optional":true,"defaultvalue":null},{"name":"retry.max","type":"number","description":"Max webcheck's retry before mark as failed","optional":true,"defaultvalue":null},{"name":"retry.interval","type":"number","description":"Webcheck's retry interval (ms)","optional":true,"defaultvalue":null},{"name":"alerts","type":"object","description":"List of alerts (cf. Alert type)","optional":true,"defaultvalue":null},{"name":"application","type":"string","description":"Application's id","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing parameters","optional":false},{"type":"200","description":"successfuly updated webcheck","optional":false}],"name":"update","longname":"Bucket.webcheck.update","scope":"route"},{"route":{"name":"/api/bucket/:id/webchecks/:webcheck","type":"DELETE"},"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":webcheck","type":"string","description":"webcheck id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"204","description":"successfuly deleted webcheck","optional":false}],"name":"delete","longname":"Bucket.webcheck.delete","scope":"route","authentication":false}],"default":[{"route":{"name":"/api/bucket/:id/feedback","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"feedback","type":"string","description":"the feedback text","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing feedback field","optional":false},{"type":"200","description":"succesfully registered the feedback","optional":false}],"response":[{"name":"feedback","type":"string","description":"the feedback that hasn't been registered","optional":false,"defaultvalue":null}],"name":"sendFeedback","longname":"Bucket.sendFeedback","scope":"route"},{"name":"retrieveUsers","route":{"name":"/api/bucket/:id/users_authorized","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved bucket's members","optional":false}],"response":[{"name":".","type":"array","description":"a array of user containing their email, username and roles","optional":false,"defaultvalue":null}],"longname":"Bucket.retrieveUsers","scope":"route"},{"name":"currentRole","route":{"name":"/api/bucket/:id/current_role","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"200","description":"succesfully retrieved the use role","optional":false}],"response":[{"name":"role","type":"string","description":"the user role","optional":false,"defaultvalue":null}],"longname":"Bucket.currentRole","scope":"route"},{"route":{"name":"/api/bucket/:id/manage_notif","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"email","type":"string","description":"the user email","optional":false,"defaultvalue":null},{"name":"state","type":"string","description":"the notification state you want to set for that user\n (either 'email' or 'nonde)","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"404","description":"user not found","optional":false}],"response":[{"name":".","type":"array","description":"array of state for each user","optional":false,"defaultvalue":null}],"name":"setNotificationState","longname":"Bucket.setNotificationState","scope":"route"},{"name":"inviteUser","route":{"name":"/api/bucket/:id/add_user","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"email","type":"string","description":"the email of the user","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"missing/invalid parameters","optional":false},{"type":"403","description":"you cant invit more users because you hit the bucket limit","optional":false},{"type":"200","description":"succesfully invited the user (either directly or by email)","optional":false}],"response":[{"name":"invitations","type":"array","description":"the list of invitations actually active","optional":false,"defaultvalue":null}],"longname":"Bucket.inviteUser","scope":"route"},{"route":{"name":"/api/bucket/:id/invitation","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"query":[{"name":"email","type":"string","description":"the email of the invitation you want to delete","optional":true,"defaultvalue":null}],"code":[{"type":"400","description":"invalid/missing parameters","optional":false},{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully deleted the invitation","optional":false}],"response":[{"name":"invitations","type":"array","description":"the list of invitations actually active","optional":false,"defaultvalue":null}],"name":"removeInvitation","longname":"Bucket.removeInvitation","scope":"route"},{"route":{"name":"/api/bucket/:id/remove_user","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"email","type":"string","description":"the email of the user you want to remove","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"missing/invalid parameters","optional":false},{"type":"404","description":"user not found","optional":false},{"type":"403","description":"impossible to remove the owner from the bucket","optional":false},{"type":"500","description":"database error","optional":false}],"response":[{"name":".","type":"array","description":"a array of user containing their email, username and roles","optional":false,"defaultvalue":null}],"name":"removeUser","longname":"Bucket.removeUser","scope":"route"},{"route":{"name":"/api/bucket/:id/promote_user","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"email","type":"string","description":"the email of the user you want to change the role","optional":false,"defaultvalue":null},{"name":"role","type":"string","description":"the role you want to set","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"invalid/missing parameters","optional":false},{"type":"404","description":"user not found","optional":false},{"type":"403","description":"impossible to set the role of the owner","optional":false}],"response":[{"name":".","type":"array","description":"a array of user containing their email, username and roles","optional":false,"defaultvalue":null}],"name":"setUserRole","longname":"Bucket.setUserRole","scope":"route"},{"name":"retrieveAll","route":{"name":"/api/bucket/","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully fetched bucket","optional":false}],"response":[{"name":".","type":"array","description":"array of buckets","optional":false,"defaultvalue":null}],"longname":"Bucket.retrieveAll","scope":"route"},{"name":"create","route":{"name":"/api/bucket/create_classic","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"body":[{"name":"name","type":"string","description":"the name of the bucket","optional":false,"defaultvalue":null},{"name":"comment","type":"string","description":"any comments that will be written under the bucket name","optional":true,"defaultvalue":null},{"name":"app_url","type":"string","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"400","description":"missing parameters","optional":false},{"type":"403","description":"you cant create any more bucket","optional":false},{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully created a bucket","optional":false}],"response":[{"name":"bucket","type":"object","description":"the created bucket","optional":false,"defaultvalue":null}],"longname":"Bucket.create","scope":"route"},{"deprecated":true,"route":{"name":"/api/bucket/:id/start_trial","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"400","description":"can't claim trial","optional":false},{"type":"200","description":"trial launched","optional":false}],"response":[{"name":"duration","type":"string","description":"the duration of the trial","optional":false,"defaultvalue":null},{"name":"plan","type":"string","description":"the plan of the trial","optional":false,"defaultvalue":null}],"name":"claimTrial","longname":"Bucket.claimTrial","scope":"route"},{"deprecated":true,"name":"upgrade","route":{"name":"/api/bucket/:id/upgrade","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"plan","type":"string","description":"name of the plan to upgrade to","optional":false,"defaultvalue":null},{"name":"stripe_token","type":"string","description":"a card token created by stripe","optional":true,"defaultvalue":null},{"name":"coupon_id","type":"string","description":"the id of the stripe coupon","optional":true,"defaultvalue":null}],"code":[{"type":"400","description":"missing/invalid parameters","optional":false},{"type":"403","description":"need a credit card OR not allowed to subscribe to the plan","optional":false},{"type":"500","description":"stripe/database error","optional":false},{"type":"200","description":"succesfully upgraded","optional":false}],"response":[{"name":"bucket","type":"object","description":"the bucket object","optional":false,"defaultvalue":null},{"name":"subscription","type":"object","description":"the subscription object attached to the subscription","optional":false,"defaultvalue":null}],"longname":"Bucket.upgrade","scope":"route"},{"name":"retrieve","route":{"name":"/api/bucket/:id","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"200","description":"succesfully retrieved the bucket","optional":false}],"response":[{"name":".","type":"object","description":"bucket object","optional":false,"defaultvalue":null}],"longname":"Bucket.retrieve","scope":"route"},{"route":{"name":"/api/bucket/:id","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"name","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"comment","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"app_url","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"configuration","type":"string","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing parameters","optional":false}],"response":[{"name":".","type":"object","description":"bucket object","optional":false,"defaultvalue":null}],"name":"update","longname":"Bucket.update","scope":"route","async":true},{"name":"retrieveServers","route":{"name":"/api/bucket/:id/meta_servers","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved the server's metadata","optional":false}],"response":[{"name":".","type":"array","description":"servers metadata","optional":false,"defaultvalue":null}],"longname":"Bucket.retrieveServers","scope":"route"},{"route":{"name":"/api/bucket/:id","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully deleted the bucket","optional":false}],"response":[{"name":".","type":"object","description":"the deleted bucket","optional":false,"defaultvalue":null}],"name":"destroy","longname":"Bucket.destroy","scope":"route"},{"route":{"name":"/api/bucket/:id/transfer_ownership","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"new_owner","type":"string","description":"the wanted owner's email","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"Missing/invalid parameters","optional":false},{"type":"404","description":"user not found","optional":false},{"type":"403","description":"the new owner need to have a active credit card","optional":false},{"type":"200","description":"succesfully transfered the bucket, old owner is now admin","optional":false}],"response":[{"name":".","type":"object","description":"bucket object","optional":false,"defaultvalue":null}],"name":"transferOwnership","longname":"Bucket.transferOwnership","scope":"route"},{"route":{"name":"/api/bucket/:id/user_options","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"options","type":"object","description":"user options","optional":false,"defaultvalue":null}],"code":[{"type":"200","description":"succesfully update user options","optional":false},{"type":"400","description":"missing parameters","optional":false}],"response":[{"name":"bucket","type":"object","description":"","optional":false,"defaultvalue":null}],"name":"updateUserOptions","longname":"Bucket.updateUserOptions","scope":"route"}]},"dashboard":[{"route":{"name":"/api/bucket/:id/dashboard/","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"array","description":"array of servers status","optional":false,"defaultvalue":null}],"name":"retrieveAll","longname":"Dashboard.retrieveAll","scope":"route"},{"route":{"name":"/api/bucket/:id/dashboard/:dashid","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":dashid","type":"string","description":"dashboard id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"404","description":"dashboard not found","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"array","description":"array of dashboards","optional":false,"defaultvalue":null}],"name":"retrieve","longname":"Dashboard.retrieve","scope":"route"},{"route":{"name":"/api/bucket/:id/dashboard/:dashid","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":dashid","type":"string","description":"dashboard id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully deleted dashboard","optional":false},{"type":"400","description":"Invalid params","optional":false},{"type":"404","description":"dashboard not found","optional":false}],"response":[{"name":".","type":"array","description":"array of dashboards","optional":false,"defaultvalue":null}],"name":"remove","longname":"Dashboard.remove","scope":"route"},{"route":{"name":"/api/bucket/:id/dashboard/:dashId","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":dashId","type":"string","description":"dashboard id","optional":false}],"body":[{"name":"name","type":"string","description":"the name of the dashboard","optional":false,"defaultvalue":null},{"name":"children","type":"object","description":"the list of component that compose the dashboard","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"404","description":"dashboard not found","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"array","description":"array of servers status","optional":false,"defaultvalue":null}],"name":"update","longname":"Dashboard.update","scope":"route"},{"route":{"name":"/api/bucket/:id/dashboard/","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"name","type":"string","description":"the name of the dashboard","optional":false,"defaultvalue":null},{"name":"children","type":"object","description":"the list of component that compose the dashboard","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully created dashboard","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"dashboard","description":"complete dashboard object from database","optional":false,"defaultvalue":null}],"name":"create","longname":"Dashboard.create","scope":"route"}],"data":{"dependencies":[{"route":{"name":"/api/bucket/:id/data/dependencies/","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"string","description":"the application name","optional":false,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter by server name","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"missing parameters","optional":false}],"response":[{"name":".","type":"array","description":"recorded dependencies","optional":false,"defaultvalue":null}],"examples":["km.data.dependencies.retrieve(bucket._id, {\n app_name: 'my_api'\n })"],"name":"retrieve","longname":"Data.dependencies.retrieve","scope":"route"}],"events":[{"route":{"name":"/api/bucket/:id/data/events","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"event_name","type":"string","description":"the event name to retrieve","optional":false,"defaultvalue":null},{"name":"start","type":"date","description":"from which date to retrieve events","optional":true,"defaultvalue":null},{"name":"end","type":"date","description":"to which date to retrieve events","optional":true,"defaultvalue":null},{"name":"app_name","type":"string","description":"filter events by app source","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter events by server source","optional":true,"defaultvalue":null},{"name":"limit","type":"number","description":"limit the number of events to retrieve","optional":true,"defaultvalue":100},{"name":"offset","type":"number","description":"offset research by X","optional":true,"defaultvalue":0}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"invalid parameters","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of events","optional":false,"defaultvalue":null}],"name":"retrieve","longname":"Data.events.retrieve","scope":"route"},{"route":{"name":"/api/bucket/:id/data/eventsKeysByApp","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"invalid parameters","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of object representing events emitted for each application name","optional":false,"defaultvalue":null}],"name":"retrieveMetadatas","longname":"Data.events.retrieveMetadatas","scope":"route"},{"route":{"name":"/api/bucket/:id/data/events/stats","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"event_name","type":"string","description":"the event name to retrieve","optional":false,"defaultvalue":null},{"name":"app_name","type":"string","description":"filter events by app source","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter events by server source","optional":true,"defaultvalue":null},{"name":"days","type":"number","description":"limit the number of days of data","optional":true,"defaultvalue":2},{"name":"interval","type":"string","description":"interval of time between two point","optional":true,"defaultvalue":"minute"}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"invalid parameters","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of point (each point is one dimensional array, X are at 0 and Y at 1)","optional":false,"defaultvalue":null}],"name":"retrieveHistogram","longname":"Data.events.retrieveHistogram","scope":"route"},{"route":{"name":"/api/bucket/:id/data/events/delete_all","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully deleted data","optional":false}],"response":[{"name":".","type":"array","description":"array of object representing events emitted for each application name","optional":false,"defaultvalue":null}],"name":"deleteAll","longname":"Data.events.deleteAll","scope":"route"}],"exceptions":[{"route":{"name":"/api/bucket/:id/data/exceptions","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"server_name","type":"string","description":"filter exceptions by server source","optional":true,"defaultvalue":null},{"name":"app_name","type":"string","description":"filter exceptions by app source","optional":true,"defaultvalue":null},{"name":"before","type":"string","description":"filter out exceptions older than X (in minutes)","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of exceptions","optional":false,"defaultvalue":null}],"name":"retrieve","longname":"Data.exceptions.retrieve","scope":"route"},{"route":{"name":"/api/bucket/:id/data/exceptions/summary","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of object containing exceptions for each application for each server","optional":false,"defaultvalue":null}],"name":"retrieveSummary","longname":"Data.exceptions.retrieveSummary","scope":"route"},{"route":{"name":"/api/bucket/:id/data/exceptions/delete_all","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"name":"deleteAll","longname":"Data.exceptions.deleteAll","scope":"route"},{"route":{"name":"/api/bucket/:id/data/exceptions/delete","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"identifier","type":"string","description":"exception identifier","optional":true,"defaultvalue":null},{"name":"app_name","type":"string","description":"the application on which exception happened","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"the server on which exception happened","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"missing/invalid parameters","optional":false}],"response":[{"name":".","type":"array","description":"array of deleted exceptions","optional":false,"defaultvalue":null}],"name":"delete","longname":"Data.exceptions.delete","scope":"route"}],"issues":[{"route":{"name":"/api/bucket/:id/data/issues/list","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"server_name","type":"string","description":"filter exceptions by server source","optional":true,"defaultvalue":null},{"name":"app_name","type":"string","description":"filter exceptions by app source needed if initiator+source not provided","optional":true,"defaultvalue":null},{"name":"before","type":"string","description":"exclude exceptions older than 'before' minutes","optional":true,"defaultvalue":null},{"name":"initiator","type":"string","description":"filter exceptions by initiator (node/golang/browser/webcheck...) needed with source","optional":true,"defaultvalue":null},{"name":"source","type":"string","description":"filter exceptions by source (browser app id, webcheck id...)","optional":true,"defaultvalue":null},{"name":"tags","type":"array","description":"array of string to filter tags","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of exceptions","optional":false,"defaultvalue":null}],"name":"list","longname":"Data.issues.list","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/issues/occurrences/:identifier","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":identifier","type":"string","description":"issue identifier","optional":false}],"query":[{"name":"from","type":"number","description":"","optional":true,"defaultvalue":null},{"name":"search_after","type":"number","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of occurrences id","optional":false,"defaultvalue":null}],"name":"listOccurencesForIdentifier","longname":"Data.issues.listOccurencesForIdentifier","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/issues/replay/:uuid","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":uuid","type":"string","description":"replay id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":"replay","type":"string","description":"","optional":false,"defaultvalue":null}],"name":"getReplay","longname":"Data.issues.getReplay","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/issues/histogram","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"string","description":"a specific app name","optional":true,"defaultvalue":null},{"name":"start","type":"string","description":"ignore issue before this date","optional":true,"defaultvalue":null},{"name":"identifier","type":"string","description":"a specific issue identifier","optional":true,"defaultvalue":null},{"name":"interval","type":"string","description":"ignore issue before this date","optional":true,"defaultvalue":null},{"name":"end","type":"string","description":"ignore issue after this date","optional":true,"defaultvalue":null},{"name":"includeFixed","type":"boolean","description":"choose to ignore or not the fixed occurences","optional":true,"defaultvalue":false},{"name":"initiator","type":"string","description":"filter exceptions by initiator (node/golang/browser/webcheck...) needed with source","optional":true,"defaultvalue":null},{"name":"source","type":"string","description":"filter exceptions by source (browser app id, webcheck id...)","optional":true,"defaultvalue":null},{"name":"tags","type":"array","description":"array of string to filter tags","optional":true,"defaultvalue":null},{"name":"includeEmptyDocs","type":"boolean","description":"add empty docs","optional":true,"defaultvalue":false},{"name":"invertedTags","type":"boolean","description":"filter issue without tags","optional":true,"defaultvalue":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of object containing exceptions for each application for each server","optional":false,"defaultvalue":null}],"name":"retrieveHistogram","longname":"Data.issues.retrieveHistogram","scope":"route"},{"route":{"name":"/api/bucket/:id/data/issues/ocurrences","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"identifier","type":"object","description":"find occurence by using an issue identifier","optional":true,"defaultvalue":null},{"name":"occurrence_id","type":"object","description":"find ocurrence by his id","optional":true,"defaultvalue":null},{"name":"includeFixed","type":"boolean","description":"choose to ignore or not the fixed occurences","optional":true,"defaultvalue":false},{"name":"limit","type":"number","description":"limit","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of object containing ocurrences","optional":false,"defaultvalue":null}],"name":"findOccurences","longname":"Data.issues.findOccurences","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/issues/search","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"message","type":"string","description":"find occurence that match this message","optional":false,"defaultvalue":null},{"name":"includeFixed","type":"boolean","description":"choose to ignore or not the fixed occurences","optional":true,"defaultvalue":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of object containing exceptions for each application for each server","optional":false,"defaultvalue":null}],"name":"search","longname":"Data.issues.search","scope":"route"},{"route":{"name":"/api/bucket/:id/data/issues/summary/:aggregateBy","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":aggregateBy","type":"string","description":"servers, apps, initiators or sources","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"issues count aggregated","optional":false,"defaultvalue":null}],"name":"summary","longname":"Data.issues.summary","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/issues","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"query":[{"name":"app_name","type":"string","description":"an specific application to delete application","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"name":"deleteAll","longname":"Data.issues.deleteAll","scope":"route"},{"route":{"name":"/api/bucket/:id/data/issues/:identifier","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":identifier","type":"string","description":"the identifier of issue that you want to delete","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"missing/invalid parameters","optional":false}],"response":[{"name":".","type":"array","description":"array of deleted exceptions","optional":false,"defaultvalue":null}],"name":"delete","longname":"Data.issues.delete","scope":"route"}],"logs":[{"route":{"name":"/api/bucket/:id/data/logs","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"string","description":"the application name","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter by server name","optional":true,"defaultvalue":null},{"name":"before","type":"string","description":"only search log oldest than ","optional":true,"defaultvalue":null},{"name":"after","type":"string","description":"only search log newer than ","optional":true,"defaultvalue":null},{"name":"size","type":"integer","description":"line limit, default to 100","optional":true,"defaultvalue":null},{"name":"from","type":"integer","description":"offset limit","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"missing parameters","optional":false}],"response":[{"name":".","type":"array","description":"recorded dependencies","optional":false,"defaultvalue":null}],"examples":["km.data.logs.retrieve(bucket._id, {\n app_name: 'my_api'\n })"],"name":"retrieve","longname":"Data.logs.retrieve","scope":"route"},{"route":{"name":"/api/bucket/:id/data/logs/histogram","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"object","description":"a specific app name","optional":true,"defaultvalue":null},{"name":"start","type":"object","description":"ignore log before this date","optional":true,"defaultvalue":null},{"name":"interval","type":"object","description":"ignore log before this date","optional":true,"defaultvalue":null},{"name":"end","type":"object","description":"ignore log after this date","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of object containing exceptions for each application for each server","optional":false,"defaultvalue":null}],"name":"retrieveHistogram","longname":"Data.logs.retrieveHistogram","scope":"route"}],"metrics":[{"route":{"name":"/api/bucket/:id/data/metrics/aggregations","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"aggregations","type":"object","description":"array of aggregations to compute","optional":false,"defaultvalue":null},{"name":"aggregations[].name","type":"string","description":"the name of metric to compute the graph","optional":false,"defaultvalue":null},{"name":"aggregations[].types","type":"array","description":"type of aggregation (e.g. ['histogram', 'servers'])","optional":false,"defaultvalue":null},{"name":"aggregations[].start","type":"date","description":"oldest documents to aggregate on","optional":false,"defaultvalue":null},{"name":"aggregations[].end","type":"date","description":"newest documents to aggregate on","optional":true,"defaultvalue":null},{"name":"aggregations[].apps","type":"array","description":"filter source applications to aggregate on","optional":true,"defaultvalue":null},{"name":"aggregations[].interval","type":"number","description":"interval between two points","optional":true,"defaultvalue":null},{"name":"aggregations[].servers","type":"array","description":"filter source server to aggregate on","optional":true,"defaultvalue":null},{"name":"aggregations[].initiator","type":"string","description":"filter source initiator to aggregate on","optional":true,"defaultvalue":null},{"name":"aggregations[].webcheck","type":"string","description":"filter source webcheck to aggregate on","optional":true,"defaultvalue":null},{"name":"aggregations[].collector","type":"string","description":"filter source collector to aggregate on","optional":true,"defaultvalue":null},{"name":"aggregations[].tags","type":"array","description":"filter tags to aggregate on","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"aggregations","optional":false,"defaultvalue":null}],"examples":["// Example #1: Retrieve HTTP metrics of app INTERACTION, WEB-API, WORKER from all servers\n km.data.metrics.retrieveAggregations(bucket._id, {\n aggregations: [\n {\n 'start': 'now-5m',\n 'apps': ['INTERACTION', 'WEB-API', 'WORKER'],\n 'types': ['histogram', 'apps', 'servers'],\n 'name': 'HTTP'\n }\n ]\n})\n\n // Example #2: Retrieve HTTP metrics of ALL apps from all servers\n km.data.metrics.retrieveAggregations(bucket._id, {\n aggregations: [\n {\n 'start': 'now-1d',\n 'types': ['histogram', 'apps', 'servers'],\n 'name': 'HTTP'\n }\n ]\n})"],"name":"retrieveAggregations","longname":"Data.metrics.retrieveAggregations","scope":"route"},{"route":{"name":"/api/bucket/:id/data/metrics/histogram","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"string","description":"filter probes by app source","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter probes by server source","optional":true,"defaultvalue":null},{"name":"interval","type":"string","description":"interval of time between two point","optional":true,"defaultvalue":"minute"},{"name":"before","type":"string","description":"filter out probes that are after X minute","optional":true,"defaultvalue":60}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":"server_name","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"server_name.app_name","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"server_name.app_name.metrics","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"server_name.app_name.metrics.agg_type","type":"string","description":"the type of aggregation for this probe","optional":false,"defaultvalue":null},{"name":"server_name.app_name.metrics_name.timestamps_and_stats","type":"array","description":"array of point","optional":false,"defaultvalue":null}],"name":"retrieveHistogram","longname":"Data.metrics.retrieveHistogram","scope":"route"},{"route":{"name":"/api/bucket/:id/data/metrics/histogramPrecise","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"probe","type":"string","description":"probe name","optional":false,"defaultvalue":null},{"name":"app","type":"string","description":"filter probes by app source","optional":false,"defaultvalue":null},{"name":"server","type":"string","description":"filter probes by server source","optional":false,"defaultvalue":null},{"name":"after","type":"string","description":"interval of time between two point (now-5d, now-5m...)","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":"Array","type":"array","description":"of points","optional":false,"defaultvalue":null}],"name":"retrieveHistogramPrecise","longname":"Data.metrics.retrieveHistogramPrecise","scope":"route"},{"route":{"name":"/api/bucket/:id/data/metrics/list","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"servers","type":"object","description":"filter metrics by app name","optional":true,"defaultvalue":null},{"name":"apps","type":"object","description":"filter metrics by server name","optional":true,"defaultvalue":null},{"name":"initiator","type":"string","description":"filter metrics by a specific initiator","optional":true,"defaultvalue":null},{"name":"source","type":"string","description":"filter metrics by a specific source","optional":true,"defaultvalue":null},{"name":"collector","type":"string","description":"filter metrics by a specific collector","optional":true,"defaultvalue":null},{"name":"webcheck","type":"string","description":"filter metrics by a specific webcheck","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"name":"retrieveList","longname":"Data.metrics.retrieveList","scope":"route"},{"route":{"name":"/api/bucket/:id/data/metrics","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"string","description":"filter metrics by app source","optional":false,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter metrics by server source","optional":true,"defaultvalue":null},{"name":"before","type":"string","description":"filter out metrics that are after X minute","optional":true,"defaultvalue":720}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"name":"retrieveMetadatas","longname":"Data.metrics.retrieveMetadatas","scope":"route"}],"notifications":[{"route":{"name":"/api/bucket/:id/data/notifications","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"type","type":"string","description":"Type of notification","optional":true,"defaultvalue":null},{"name":"before","type":"string","description":"we search logs before this date (lower than)","optional":true,"defaultvalue":null},{"name":"after","type":"string","description":"we search logs after this date (greater than)","optional":true,"defaultvalue":null},{"name":"size","type":"number","description":"","optional":true,"defaultvalue":null},{"name":"from","type":"number","description":"","optional":true,"defaultvalue":null},{"name":"type","type":"string","description":"type of notification","optional":true,"defaultvalue":null},{"name":"providers","type":"array","description":"find notifications with this providers","optional":true,"defaultvalue":null},{"name":"contacts","type":"array","description":"find notifications with this contact","optional":true,"defaultvalue":null},{"name":"size","type":"integer","description":"line limit, default to 20","optional":true,"defaultvalue":null},{"name":"from","type":"integer","description":"offset limit","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"tags":[{"originalTitle":"reponse","title":"reponse","text":"{Array} . array of traces","value":"{Array} . array of traces","optional":false,"type":null}],"name":"list","longname":"Data.notifications.list","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/notifications/:notification","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":notification","type":"string","description":"notification id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"tags":[{"originalTitle":"reponse","title":"reponse","text":"{Object} . notification","value":"{Object} . notification","optional":false,"type":null}],"name":"retrieve","longname":"Data.notifications.retrieve","scope":"route","async":true}],"outliers":[{"route":{"name":"/api/bucket/:id/data/outliers/","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"string","description":"the application name","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter by server name","optional":true,"defaultvalue":null},{"name":"start","type":"string","description":"only search outlier newer than ","optional":true,"defaultvalue":null},{"name":"end","type":"string","description":"only search outlier older than ","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"missing parameters","optional":false}],"response":[{"name":".","type":"array","description":"recorded dependencies","optional":false,"defaultvalue":null}],"examples":["km.data.outliers.retrieve(bucket._id, {\n app_name: 'my_api'\n })"],"name":"retrieve","longname":"Data.outliers.retrieve","scope":"route"}],"processes":[{"route":{"name":"/api/bucket/:id/data/processEvents","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"string","description":"filter events by app source","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter events by server source","optional":true,"defaultvalue":null},{"name":"before","type":"string","description":"filter out events that are after X minute","optional":true,"defaultvalue":60}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of process events","optional":false,"defaultvalue":null}],"name":"retrieveEvents","longname":"Data.processes.retrieveEvents","scope":"route"},{"route":{"name":"/api/bucket/:id/data/processEvents/deployments","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"string","description":"filter events by app source","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter events by server source","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of deployments","optional":false,"defaultvalue":null}],"name":"retrieveDeployments","longname":"Data.processes.retrieveDeployments","scope":"route"}],"profiling":[{"route":{"name":"/api/bucket/:id/data/profilings/:filename","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":filename","type":"string","description":"filename","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"invalid parameters","optional":false}],"response":[{"name":".","type":"object","description":"return profile data","optional":false,"defaultvalue":null}],"name":"retrieve","longname":"Data.profiling.retrieve","scope":"route"},{"route":{"name":"/api/bucket/:id/data/profilings/:filename/download","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":filename","type":"string","description":"filename","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"invalid parameters","optional":false}],"response":[{"name":".","type":"file","description":"return a file","optional":false,"defaultvalue":null}],"name":"download","longname":"Data.profiling.download","scope":"route"},{"route":{"name":"/api/bucket/:id/data/profilings","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"apps","type":"object","description":"","optional":true,"defaultvalue":null},{"name":"servers","type":"object","description":"","optional":true,"defaultvalue":null},{"name":"from","type":"object","description":"","optional":true,"defaultvalue":null},{"name":"size","type":"object","description":"","optional":true,"defaultvalue":null},{"name":"type","type":"object","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of object containing profilings","optional":false,"defaultvalue":null}],"name":"list","longname":"Data.profiling.list","scope":"route"},{"route":{"name":"/api/bucket/:id/data/profilings/:filename","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":filename","type":"string","description":"filename","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"invalid parameters","optional":false}],"response":[{"name":".","type":"file","description":"return a file","optional":false,"defaultvalue":null}],"name":"delete","longname":"Data.profiling.delete","scope":"route"}],"status":[{"route":{"name":"/api/bucket/:id/data/status","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"tags":[{"originalTitle":"reponse","title":"reponse","text":"{Array} . array of servers status","value":"{Array} . array of servers status","optional":false,"type":null}],"name":"retrieve","longname":"Data.status.retrieve","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/status/blacklisted","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"tags":[{"originalTitle":"reponse","title":"reponse","text":"{Array} . array of servers status","value":"{Array} . array of servers status","optional":false,"type":null}],"name":"retrieveBlacklisted","longname":"Data.status.retrieveBlacklisted","scope":"route","async":true}],"traces":[{"route":{"name":"/api/bucket/:id/data/traces","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"includeSpans","type":"boolean","description":"","optional":true,"defaultvalue":true},{"name":"serviceName","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"limit","type":"string","description":"default: 10, max: 100","optional":true,"defaultvalue":null},{"name":"kind","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"minDuration","type":"number","description":"","optional":true,"defaultvalue":null},{"name":"start","type":"string","description":"date","optional":true,"defaultvalue":null},{"name":"end","type":"string","description":"date","optional":true,"defaultvalue":null},{"name":"tags","type":"array","description":"Query string array like [error=500, error, ...]","optional":true,"defaultvalue":null},{"name":"orderBy","type":"string","description":"Default: newest, enum: oldest, newest, shortest, longest","optional":true,"defaultvalue":null},{"name":"spanName","type":"string","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"tags":[{"originalTitle":"reponse","title":"reponse","text":"{Array} . array of traces","value":"{Array} . array of traces","optional":false,"type":null}],"name":"list","longname":"Data.traces.list","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/traces/:trace","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false},{"name":":trace","type":"string","description":"trace id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"tags":[{"originalTitle":"reponse","title":"reponse","text":"{Object} . trace","value":"{Object} . trace","optional":false,"type":null}],"name":"retrieve","longname":"Data.traces.retrieve","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/traces/services","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":"services,","type":"object","description":"spans names","optional":false,"defaultvalue":null}],"name":"getServices","longname":"Data.traces.getServices","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/traces/tags","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":"tags","type":"array","description":"","optional":false,"defaultvalue":null}],"name":"getTags","longname":"Data.traces.getTags","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/traces/histogram/tag","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"tag","type":"string","description":"","optional":false,"defaultvalue":null},{"name":"start","type":"string","description":"date","optional":true,"defaultvalue":null},{"name":"end","type":"string","description":"date","optional":true,"defaultvalue":null},{"name":"serviceName","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"spanName","type":"string","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":"aggregation","type":"array","description":"","optional":false,"defaultvalue":null}],"name":"getHistogramByTag","longname":"Data.traces.getHistogramByTag","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/traces/aggregation/tag","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"tag","type":"string","description":"","optional":false,"defaultvalue":null},{"name":"start","type":"string","description":"date","optional":true,"defaultvalue":null},{"name":"end","type":"string","description":"date","optional":true,"defaultvalue":null},{"name":"serviceName","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"spanName","type":"string","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":"aggregation","type":"array","description":"","optional":false,"defaultvalue":null}],"name":"getTagsValue","longname":"Data.traces.getTagsValue","scope":"route","async":true},{"route":{"name":"/api/bucket/:id/data/traces/aggregation/duration","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"start","type":"string","description":"date","optional":true,"defaultvalue":null},{"name":"end","type":"string","description":"date","optional":true,"defaultvalue":null},{"name":"serviceName","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"spanName","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"tags","type":"array","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":"aggregation","type":"array","description":"","optional":false,"defaultvalue":null}],"name":"getDurationAvg","longname":"Data.traces.getDurationAvg","scope":"route","async":true}],"transactions":[{"route":{"name":"/api/bucket/:id/data/transactions/v2/histogram","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"string","description":"filter transactions by app source","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter transactions by server source","optional":true,"defaultvalue":null},{"name":"interval","type":"string","description":"interval of time between two point","optional":true,"defaultvalue":"minute"},{"name":"before","type":"string","description":"filter out transactions that are after X minute","optional":true,"defaultvalue":60}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":".","type":"array","description":"array of times series containing points","optional":false,"defaultvalue":null}],"name":"retrieveHistogram","longname":"Data.transactions.retrieveHistogram","scope":"route"},{"route":{"name":"/api/bucket/:id/data/transactions/v2/summary","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"body":[{"name":"app_name","type":"string","description":"filter transactions by app source","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter transactions by server source","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":"server_name","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"server_name.app_name","type":"object","description":"transaction object","optional":false,"defaultvalue":null}],"name":"retrieveSummary","longname":"Data.transactions.retrieveSummary","scope":"route"},{"route":{"name":"/api/bucket/:id/data/transactions/v2/delete","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"bucket id","optional":false}],"query":[{"name":"app_name","type":"string","description":"filter transactions by app source","optional":true,"defaultvalue":null},{"name":"server_name","type":"string","description":"filter transactions by server source","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false}],"response":[{"name":"server_name","type":"object","description":"","optional":false,"defaultvalue":null},{"name":"server_name.app_name","type":"object","description":"transaction object","optional":false,"defaultvalue":null}],"name":"delete","longname":"Data.transactions.delete","scope":"route"}]},"misc":[{"route":{"name":"/api/misc/changelog","type":"GET"},"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":"changelog","type":"array","description":"articles","optional":false,"defaultvalue":null}],"name":"listChangelogArticles","longname":"Misc.listChangelogArticles","scope":"route","params":[],"authentication":false},{"route":{"name":"/api/misc/release/pm2","type":"GET"},"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":"pm2_version","type":"string","description":"latest version","optional":false,"defaultvalue":null}],"name":"retrievePM2Version","longname":"Misc.retrievePM2Version","scope":"route","params":[],"authentication":false},{"route":{"name":"/api/misc/release/nodejs/:version","type":"GET"},"params":[{"name":":version","type":"string","description":"semver version range","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"array","description":"array of releases matching the range requested","optional":false,"defaultvalue":null}],"name":"retrieveNodeRelease","longname":"Misc.retrieveNodeRelease","scope":"route","authentication":false},{"route":{"name":"/api/misc/plans","type":"GET"},"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"succesfully retrieved data","optional":false},{"type":"400","description":"Invalid params","optional":false}],"response":[{"name":".","type":"object","description":"list of plans keyed by plan name","optional":false,"defaultvalue":null}],"name":"retrievePlans","longname":"Misc.retrievePlans","scope":"route","params":[],"authentication":false},{"route":{"name":"/api/misc/stripe/retrieveCoupon","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"body":[{"name":"coupon","type":"string","description":"the coupon name","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"200","description":"succesfully retrieved the metadata","optional":false}],"response":[{"name":"coupon","type":"object","description":"the coupon object","optional":false,"defaultvalue":null}],"name":"retrieveCoupon","longname":"Misc.retrieveCoupon","scope":"route","params":[]},{"route":{"name":"/api/misc/stripe/retrieveCompany","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"body":[{"name":"vat_id","type":"string","description":"the vat id of the company","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"200","description":"succesfully retrieved the metadata","optional":false}],"response":[{"name":".","type":"object","description":"metadata about company","optional":false,"defaultvalue":null}],"name":"retrieveCompany","longname":"Misc.retrieveCompany","scope":"route","params":[]},{"route":{"name":"/api/misc/stripe/retrieveVat","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"body":[{"name":"country","type":"string","description":"country code of the user","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"stripe error","optional":false},{"type":"200","description":"succesfully retrieved the metadata","optional":false}],"response":[{"name":"coupon","type":"object","description":"the coupon object","optional":false,"defaultvalue":null}],"name":"retrieveVAT","longname":"Misc.retrieveVAT","scope":"route","params":[]}],"node":[{"route":{"name":"/api/node/default","type":"GET"},"response":[{"name":"node","type":"object","description":"Return node object","optional":false,"defaultvalue":null}],"name":"getDefaultNode","longname":"Node.getDefaultNode","scope":"route","params":[],"authentication":false}],"orchestration":[{"route":{"name":"/api/bucket/:id/balance","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"balancing error","optional":false},{"type":"403","description":"already on new node or not premium","optional":false},{"type":"200","description":"succesfully balanced the bucket","optional":false}],"response":[{"name":"migration","type":"object","description":"is equal true if succesfull","optional":false,"defaultvalue":null}],"name":"selfSend","longname":"Orchestration.selfSend","scope":"route","params":[]}],"tokens":[{"route":{"name":"/api/users/token/","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"200","description":"successfully retrieved","optional":false}],"response":[{"name":".","type":"object","description":"array of tokens","optional":false,"defaultvalue":null}],"name":"retrieve","longname":"Tokens.retrieve","scope":"route","params":[]},{"route":{"name":"/api/users/token/:id","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"params":[{"name":":id","type":"string","description":"token id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"404","description":"token not found","optional":false},{"type":"200","description":"refresh token has been deleted and all access token that have been created with it","optional":false}],"response":[{"name":".","type":"object","description":"array of tokens","optional":false,"defaultvalue":null}],"name":"remove","longname":"Tokens.remove","scope":"route"},{"route":{"name":"/api/users/token/","type":"PUT"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"body":[{"name":"scope","type":"object","description":"a valid oauth scope","optional":false,"defaultvalue":null}],"code":[{"type":"409","description":"the otp is already enabled for the user, you can only delete it","optional":false},{"type":"200","description":"the otp can be registered for the account, return the full response","optional":false}],"response":[{"name":".","type":"object","description":"generated token","optional":false,"defaultvalue":null}],"name":"create","longname":"Tokens.create","scope":"route","params":[]}],"user":{"otp":[{"route":{"name":"/api/users/otp","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"409","description":"the otp is already enabled for the user, you can only delete it","optional":false},{"type":"200","description":"the otp can be registered for the account, return the full response","optional":false}],"response":[{"name":"user","type":"object","description":"user model","optional":false,"defaultvalue":null},{"name":"key","type":"string","description":"otp secret key","optional":false,"defaultvalue":null},{"name":"qrImage","type":"string","description":"url to the QrCode","optional":false,"defaultvalue":null}],"name":"retrieve","longname":"User.otp.retrieve","scope":"route","params":[]},{"route":{"name":"/api/users/otp","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"body":[{"name":"otpKey","type":"string","description":"secret key used to generate OTP code","optional":false,"defaultvalue":null},{"name":"otpToken","type":"string","description":"a currently valid OTP code generated with the otpKey","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"missing parameters","optional":false},{"type":"403","description":"the code asked to add the OTP from user account is invalid","optional":false},{"type":"500","description":"error from database","optional":false},{"type":"200","description":"the otp has been registered for the user","optional":false}],"name":"enable","longname":"User.otp.enable","scope":"route","params":[]},{"route":{"name":"/api/users/otp","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"query":[{"name":"otpToken","type":"string","description":"a currently valid OTP code","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"missing parameters","optional":false},{"type":"403","description":"the code asked to remove the OTP from user account is invalid","optional":false},{"type":"500","description":"error from database","optional":false},{"type":"200","description":"the otp has been deleted for the user","optional":false}],"name":"disable","longname":"User.otp.disable","scope":"route","params":[]}],"providers":[{"route":{"name":"/api/users/integrations","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"200","description":"succesfully retrieved providers","optional":false}],"response":[{"name":".","type":"array","description":"array of providers for user account","optional":false,"defaultvalue":null}],"name":"retrieve","longname":"User.providers.retrieve","scope":"route","params":[]},{"route":{"name":"/api/users/integrations","type":"POST"},"authentication":true,"body":[{"name":"name","type":"string","description":"the provider name","optional":false,"defaultvalue":null}],"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"invalid parameters","optional":false},{"type":"403","description":"the user already have this provider","optional":false},{"type":"200","description":"succesfully added the provider","optional":false}],"name":"add","longname":"User.providers.add","scope":"route","params":[]},{"route":{"name":"/api/users/integrations/:name","type":"DELETE"},"authentication":true,"params":[{"name":":name","type":"string","description":"the provider name","optional":false}],"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"400","description":"invalid parameters or provider isn't implemented","optional":false},{"type":"403","description":"the provider isn't enabled","optional":false},{"type":"200","description":"succesfully removed the provider","optional":false}],"name":"remove","longname":"User.providers.remove","scope":"route"}],"default":[{"name":"retrieve","route":{"name":"/api/users/isLogged","type":"GET"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"200","description":"the user has been retrieved","optional":false}],"response":[{"name":"user","type":"object","description":"user model","optional":false,"defaultvalue":null}],"longname":"User.retrieve","scope":"route"},{"route":{"name":"/api/users/show/:id","type":"GET"},"params":[{"name":":id","type":"string","description":"user id","optional":false}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"invalid parameters (no id provided)","optional":false},{"type":"404","description":"no user account where found","optional":false},{"type":"200","description":"the mail has been sent to the provided email","optional":false}],"response":[{"name":"String","type":"","description":"email user email","optional":false,"defaultvalue":null},{"name":"String","type":"","description":"username user pseudo","optional":false,"defaultvalue":null}],"name":"show","longname":"User.show","scope":"route","authentication":false},{"route":{"name":"/api/users/update","type":"POST"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"body":[{"name":"username","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"email","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"old_password","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"new_password","type":"string","description":"","optional":true,"defaultvalue":null},{"name":"info","type":"object","description":"","optional":true,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"400","description":"missing parameters, no data to update","optional":false},{"type":"403","description":"when updating the password, it need a new one","optional":false},{"type":"406","description":"when updating the password, the old one is false","optional":false},{"type":"409","description":"when updating email or username\n another user already have one of those two","optional":false},{"type":"200","description":"succesfully updated the card","optional":false}],"response":[{"name":".","type":"object","description":"user object","optional":false,"defaultvalue":null}],"name":"update","longname":"User.update","scope":"route","params":[]},{"route":{"name":"/api/users/delete","type":"DELETE"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"database error","optional":false},{"type":"403","description":"permission denied (hold buckets)","optional":false},{"type":"200","description":"succesfully deleted the user","optional":false}],"response":[{"name":".","type":"object","description":"user object","optional":false,"defaultvalue":null}],"name":"delete","longname":"User.delete","scope":"route","params":[]}]},"auth":[{"name":"retrieveToken","route":{"name":"/api/oauth/token","type":"POST"},"service":{"name":"OAUTH"},"body":[{"name":"client_id","type":"string","description":"the public id of your oauth application","optional":false,"defaultvalue":null},{"name":"refresh_token","type":"string","description":"refresh token you retrieved via authorize endpoint","optional":false,"defaultvalue":null},{"name":"grant_type","type":"string","description":"","optional":false,"defaultvalue":"refresh_token"}],"code":[{"type":"400","description":"invalid parameters (missing or not correct)","optional":false}],"response":[{"name":"access_token","type":"string","description":"a fresh access_token","optional":false,"defaultvalue":null},{"name":"refresh_token","type":"string","description":"the refresh token you used","optional":false,"defaultvalue":null},{"name":"expire_at","type":"string","description":"UTC date at which the token will be considered\n as invalid","optional":false,"defaultvalue":null},{"name":"token_type","type":"string","description":"the type of token to use, for now its always Bearer","optional":false,"defaultvalue":null}],"longname":"Auth.retrieveToken","scope":"route","authentication":false},{"name":"requestNewPassword","route":{"name":"/api/oauth/reset_password","type":"POST"},"service":{"name":"OAUTH"},"body":[{"name":"email","type":"string","description":"email of the account that want a password reset","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"the database failed to register the token to reset the mail","optional":false},{"type":"400","description":"missing parameters","optional":false},{"type":"404","description":"no user account where found with the provided email","optional":false},{"type":"200","description":"the mail has been sent to the provided email","optional":false}],"longname":"Auth.requestNewPassword","scope":"route","authentication":false},{"name":"sendEmailLink","route":{"name":"/api/oauth/send_email_link","type":"POST"},"service":{"name":"OAUTH"},"code":[{"type":"500","description":"the database failed to register the token to reset the mail","optional":false},{"type":"401","description":"need to authenticated","optional":false},{"type":"200","description":"the mail has been sent to the provided email","optional":false}],"longname":"Auth.sendEmailLink","scope":"route","authentication":false},{"name":"validEmail","route":{"name":"/api/oauth/valid_email/:token","type":"GET"},"params":[{"description":"the token to validate the account","name":":token","optional":false,"type":null}],"service":{"name":"OAUTH"},"code":[{"type":"500","description":"the database failed to valid email","optional":false},{"type":"404","description":"need to authenticated","optional":false},{"type":"301","description":"the email has been valided","optional":false}],"longname":"Auth.validEmail","scope":"route","authentication":false},{"route":{"name":"/api/oauth/register","type":"GET"},"service":{"name":"OAUTH"},"body":[{"name":"username","type":"string","description":"","optional":false,"defaultvalue":null},{"name":"email","type":"string","description":"","optional":false,"defaultvalue":null},{"name":"password","type":"string","description":"","optional":false,"defaultvalue":null},{"name":"role","type":"string","description":"job title in user company","optional":true,"defaultvalue":null},{"name":"company","type":"string","description":"company name","optional":true,"defaultvalue":null},{"name":"accept_terms","type":"integer","description":"","optional":false,"defaultvalue":null}],"code":[{"type":"500","description":"either the registeration of new user is disabled or\nthe database failed to register the user","optional":false},{"type":"409","description":"the user field are already used by another user","optional":false},{"type":"200","description":"the user has been created","optional":false}],"response":[{"name":"user","type":"object","description":"user model","optional":false,"defaultvalue":null},{"name":"access_token","type":"object","description":"access token issued for the user","optional":false,"defaultvalue":null},{"name":"refreshToken","type":"object","description":"refresh token issued for the user","optional":false,"defaultvalue":null}],"name":"register","longname":"Auth.register","scope":"route","authentication":false},{"route":{"name":"/api/oauth/revoke","type":"POST"},"service":{"name":"OAUTH"},"authentication":true,"header":[{"name":"Authorization","type":"string","description":"bearer access token issued for the user","optional":false,"defaultvalue":null}],"code":[{"type":"404","description":"token not found","optional":false},{"type":"500","description":"database error","optional":false},{"type":"200","description":"the token has been succesfully deleted,\n if there was access token generated with this token, they\n have been deleted too","optional":false}],"name":"revoke","longname":"Auth.revoke","scope":"route"}]}
+},{}],41:[function(require,module,exports){
+/* global URLSearchParams, URL, localStorage */
+'use strict';
+
+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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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 _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
+function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
+function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
+function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
+function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
+function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
+var AuthStrategy = require('./strategy');
+module.exports = /*#__PURE__*/function (_AuthStrategy) {
+ _inherits(BrowserFlow, _AuthStrategy);
+ function BrowserFlow() {
+ _classCallCheck(this, BrowserFlow);
+ return _callSuper(this, BrowserFlow, arguments);
+ }
+ _createClass(BrowserFlow, [{
+ key: "removeUrlToken",
+ value: function removeUrlToken(refreshToken) {
+ var url = window.location.href;
+ var params = "?access_token=".concat(refreshToken, "&token_type=refresh_token");
+ var newUrl = url.replace(params, '');
+ window.history.pushState('', '', newUrl);
+ }
+ }, {
+ key: "retrieveTokens",
+ value: function retrieveTokens(km, cb) {
+ var _this = this;
+ var verifyToken = function verifyToken(refresh) {
+ return km.auth.retrieveToken({
+ client_id: _this.client_id,
+ refresh_token: refresh
+ });
+ };
+
+ // parse the url since it can contain tokens
+ var url = new URL(window.location);
+ this.response_mode = this.response_mode === 'query' ? 'search' : this.response_mode;
+ var params = new URLSearchParams(url[this.response_mode]);
+ if (params.get('access_token') !== null) {
+ // verify that the access_token in parameters is valid
+ verifyToken(params.get('access_token')).then(function (res) {
+ _this.removeUrlToken(res.data.refresh_token);
+ // Save refreshToken in localstorage
+ localStorage.setItem('km_refresh_token', params.get('access_token'));
+ var tokens = res.data;
+ return cb(null, tokens);
+ })["catch"](cb);
+ } else if (typeof localStorage !== 'undefined' && localStorage.getItem('km_refresh_token') !== null) {
+ // maybe in the local storage ?
+ verifyToken(localStorage.getItem('km_refresh_token')).then(function (res) {
+ _this.removeUrlToken(res.data.refresh_token);
+ var tokens = res.data;
+ return cb(null, tokens);
+ })["catch"](cb);
+ } else {
+ // otherwise we need to get a refresh token
+ window.location = "".concat(this.oauth_endpoint).concat(this.oauth_query, "&redirect_uri=").concat(window.location);
+ }
+ }
+ }, {
+ key: "deleteTokens",
+ value: function deleteTokens(km) {
+ var _this2 = this;
+ return new Promise(function (resolve, reject) {
+ // revoke the refreshToken
+ km.auth.revoke().then(function (res) {
+ return console.log('Token successfuly revoked!');
+ })["catch"](function (err) {
+ return console.error("Error when trying to revoke token: ".concat(err.message));
+ });
+ // We need to remove from storage and redirect user in every case (cf. https://github.com/keymetrics/pm2-io-js-api/issues/49)
+ // remove the token from the localStorage
+ localStorage.removeItem('km_refresh_token');
+ setTimeout(function (_) {
+ // redirect after few miliseconds so any user code will run
+ window.location = "".concat(_this2.oauth_endpoint).concat(_this2.oauth_query);
+ }, 500);
+ return resolve();
+ });
+ }
+ }]);
+ return BrowserFlow;
+}(AuthStrategy);
+
+},{"./strategy":43}],42:[function(require,module,exports){
+'use strict';
+
+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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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 _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
+function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
+function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
+function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
+function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
+function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
+var AuthStrategy = require('./strategy');
+module.exports = /*#__PURE__*/function (_AuthStrategy) {
+ _inherits(StandaloneFlow, _AuthStrategy);
+ function StandaloneFlow() {
+ _classCallCheck(this, StandaloneFlow);
+ return _callSuper(this, StandaloneFlow, arguments);
+ }
+ _createClass(StandaloneFlow, [{
+ key: "retrieveTokens",
+ value: function retrieveTokens(km, cb) {
+ if (this._opts.refresh_token && this._opts.access_token) {
+ // if both access and refresh tokens are provided, we are good
+ return cb(null, {
+ access_token: this._opts.access_token,
+ refresh_token: this._opts.refresh_token
+ });
+ } else if (this._opts.refresh_token && this._opts.client_id) {
+ // we can also make a request to get an access token
+ km.auth.retrieveToken({
+ client_id: this._opts.client_id,
+ refresh_token: this._opts.refresh_token
+ }).then(function (res) {
+ var tokens = res.data;
+ return cb(null, tokens);
+ })["catch"](cb);
+ } else {
+ // otherwise the flow isn't used correctly
+ throw new Error("If you want to use the standalone flow you need to provide either \n a refresh and access token OR a refresh token and a client id");
+ }
+ }
+ }, {
+ key: "deleteTokens",
+ value: function deleteTokens(km) {
+ return km.auth.revoke;
+ }
+ }]);
+ return StandaloneFlow;
+}(AuthStrategy);
+
+},{"./strategy":43}],43:[function(require,module,exports){
+'use strict';
+
+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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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); }
+var constants = require('../../constants.js');
+var AuthStrategy = /*#__PURE__*/function () {
+ function AuthStrategy(opts) {
+ _classCallCheck(this, AuthStrategy);
+ this._opts = opts;
+ this.client_id = opts.client_id || opts.OAUTH_CLIENT_ID;
+ if (!this.client_id) {
+ throw new Error('You must always provide a application id for any of the strategies');
+ }
+ this.scope = opts.scope || 'all';
+ this.response_mode = opts.reponse_mode || 'query';
+ var optsOauthEndpoint = null;
+ if (opts && opts.services) {
+ optsOauthEndpoint = opts.services.OAUTH || opts.services.API;
+ }
+ var oauthEndpoint = constants.services.OAUTH || constants.services.API;
+ this.oauth_endpoint = "".concat(optsOauthEndpoint || oauthEndpoint);
+ if (this.oauth_endpoint[this.oauth_endpoint.length - 1] === '/' && constants.OAUTH_AUTHORIZE_ENDPOINT[0] === '/') {
+ this.oauth_endpoint = this.oauth_endpoint.substr(0, this.oauth_endpoint.length - 1);
+ }
+ this.oauth_endpoint += constants.OAUTH_AUTHORIZE_ENDPOINT;
+ this.oauth_query = "?client_id=".concat(opts.client_id, "&response_mode=").concat(this.response_mode) + "&response_type=token&scope=".concat(this.scope);
+ }
+ _createClass(AuthStrategy, [{
+ key: "retrieveTokens",
+ value: function retrieveTokens() {
+ throw new Error('You need to implement a retrieveTokens function inside your strategy');
+ }
+ }, {
+ key: "deleteTokens",
+ value: function deleteTokens() {
+ throw new Error('You need to implement a deleteTokens function inside your strategy');
+ }
+ }], [{
+ key: "implementations",
+ value: function implementations(name) {
+ var flows = {
+ 'embed': {
+ nodule: require('./embed_strategy'),
+ condition: 'node'
+ },
+ 'browser': {
+ nodule: require('./browser_strategy'),
+ condition: 'browser'
+ },
+ 'standalone': {
+ nodule: require('./standalone_strategy'),
+ condition: null
+ }
+ };
+ return name ? flows[name] : null;
+ }
+ }]);
+ return AuthStrategy;
+}();
+module.exports = AuthStrategy;
+
+},{"../../constants.js":1,"./browser_strategy":41,"./embed_strategy":3,"./standalone_strategy":42}],44:[function(require,module,exports){
+'use strict';
+
+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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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); }
+var RequestValidator = require('./utils/validator');
+var debug = require('debug')('kmjs:endpoint');
+module.exports = /*#__PURE__*/function () {
+ function Endpoint(opts) {
+ _classCallCheck(this, Endpoint);
+ Object.assign(this, opts);
+ }
+ _createClass(Endpoint, [{
+ key: "build",
+ value: function build(http) {
+ var endpoint = this;
+ return function () {
+ var _arguments = arguments;
+ var callsite = new Error().stack.split('\n')[2];
+ if (callsite && callsite.length > 0) {
+ debug("Call to '".concat(endpoint.route.name, "' from ").concat(callsite.replace(' at ', '')));
+ }
+ return new Promise(function (resolve, reject) {
+ RequestValidator.extract(endpoint, Array.prototype.slice.call(_arguments)).then(function (opts) {
+ // Different service than default, setup base url in url
+ if (endpoint.service && endpoint.service.baseURL) {
+ var base = endpoint.service.baseURL;
+ base = base[base.length - 1] === '/' ? base.substr(0, base.length - 1) : base;
+ opts.url = base + opts.url;
+ }
+ http.request(opts).then(resolve, reject);
+ })["catch"](reject);
+ });
+ };
+ }
+ }]);
+ return Endpoint;
+}();
+
+},{"./utils/validator":48,"debug":4}],45:[function(require,module,exports){
+'use strict';
+
+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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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); }
+var Namespace = require('./namespace');
+var constants = require('../constants');
+var NetworkWrapper = require('./network');
+var logger = require('debug')('kmjs');
+var Keymetrics = /*#__PURE__*/function () {
+ /**
+ * @constructor
+ * Keymetrics
+ *
+ * @param {Object} [opts]
+ * @param {String} [opts.OAUTH_CLIENT_ID] the oauth client ID used to authenticate to KM
+ * @param {Object} [opts.services] base url for differents services
+ * @param {String} [opts.mappings] api mappings
+ */
+ function Keymetrics(opts) {
+ _classCallCheck(this, Keymetrics);
+ logger('init keymetrics instance');
+ this.opts = Object.assign(constants, opts);
+ logger('init network client (http/ws)');
+ this._network = new NetworkWrapper(this, this.opts);
+ var mapping = opts && opts.mappings ? opts.mappings : require('./api_mappings.json');
+ logger("Using mappings provided in ".concat(opts && opts.mappings ? 'options' : 'package'));
+
+ // build namespaces at startup
+ logger('building namespaces');
+ var root = new Namespace(mapping, {
+ name: 'root',
+ http: this._network,
+ services: this.opts.services
+ });
+ logger('exposing namespaces');
+ for (var key in root) {
+ if (key === 'name' || key === 'opts') continue;
+ this[key] = root[key];
+ }
+ logger("attached namespaces : ".concat(Object.keys(this)));
+ this.realtime = this._network.realtime;
+ }
+
+ /**
+ * Use a specific flow to retrieve an access token on behalf the user
+ * @param {String|Function} flow either a flow name or a custom implementation
+ * @param {Object} [opts]
+ * @param {String} [opts.client_id] the OAuth client ID to use to identify the application
+ * default to the one defined when instancing Keymetrics and fallback to 795984050 (custom tokens)
+ * @throws invalid use of this function, either the flow don't exist or isn't correctly implemented
+ */
+ _createClass(Keymetrics, [{
+ key: "use",
+ value: function use(flow, opts) {
+ var _this = this;
+ logger("using ".concat(flow, " authentication strategy"));
+ this._network.useStrategy(flow, opts);
+ // the logout is dependent of the auth flow so we need it to be initialize
+ // but also we need to give the access of the instance, so we inject it here
+ this.auth.logout = function () {
+ return _this._network.oauth_flow.deleteTokens(_this);
+ };
+ return this;
+ }
+
+ /**
+ * API date lag, in millisecond. This is the difference between the current browser date and the
+ * approximated API date. This is useful to compute duration between dates returned by the API
+ * and "now".
+ * @example
+ * const apiDate = moment().add(km.apiDateLag)
+ * const timeSinceLastUpdate = apiDate.diff(server.updated_at)
+ */
+ }, {
+ key: "apiDateLag",
+ get: function get() {
+ return this._network.apiDateLag;
+ }
+ }]);
+ return Keymetrics;
+}();
+module.exports = Keymetrics;
+
+},{"../constants":1,"./api_mappings.json":40,"./namespace":46,"./network":47,"debug":4}],46:[function(require,module,exports){
+'use strict';
+
+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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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); }
+var Endpoint = require('./endpoint');
+var logger = require('debug')('kmjs:namespace');
+module.exports = /*#__PURE__*/function () {
+ function Namespace(mapping, opts) {
+ _classCallCheck(this, Namespace);
+ logger("initialization namespace ".concat(opts.name));
+ this.name = opts.name;
+ this.http = opts.http;
+ this.endpoints = [];
+ this.namespaces = [];
+ logger("building namespace ".concat(opts.name));
+ for (var name in mapping) {
+ var child = mapping[name];
+ if (_typeof(mapping) === 'object' && !child.route) {
+ // ignore the 'default' namespace that should bind to the parent namespace
+ if (name === 'default') {
+ // create the namespace
+ var defaultNamespace = new Namespace(child, {
+ name: name,
+ http: this.http,
+ services: opts.services
+ });
+ this.namespaces.push(defaultNamespace);
+ // bind property of the default namespace to this namespace
+ for (var key in defaultNamespace) {
+ if (key === 'name' || key === 'opts') continue;
+ this[key] = defaultNamespace[key];
+ }
+ continue;
+ }
+ // if the parent namespace is a object, the child are namespace too
+ this.addNamespace(new Namespace(child, {
+ name: name,
+ http: this.http,
+ services: opts.services
+ }));
+ } else {
+ // otherwise its an endpoint
+ if (child.service && opts.services && opts.services[child.service.name]) {
+ child.service.baseURL = opts.services[child.service.name];
+ }
+ this.addEndpoint(new Endpoint(child));
+ }
+ }
+
+ // logging namespaces
+ if (this.namespaces.length > 0) {
+ logger("namespace ".concat(this.name, " contains namespaces : \n").concat(this.namespaces.map(function (namespace) {
+ return namespace.name;
+ }).join('\n'), "\n"));
+ }
+
+ // logging endpoints
+ if (this.endpoints.length > 0) {
+ logger("Namespace ".concat(this.name, " contains endpoints : \n").concat(this.endpoints.map(function (endpoint) {
+ return endpoint.route.name;
+ }).join('\n'), "\n"));
+ }
+ }
+ _createClass(Namespace, [{
+ key: "addNamespace",
+ value: function addNamespace(namespace) {
+ if (!namespace || namespace.name === this.name) {
+ throw new Error("A namespace must not have the same name as the parent namespace");
+ }
+ if (!(namespace instanceof Namespace)) {
+ throw new Error("addNamespace only accept Namespace instance");
+ }
+ this.namespaces.push(namespace);
+ this[namespace.name] = namespace;
+ }
+ }, {
+ key: "addEndpoint",
+ value: function addEndpoint(endpoint) {
+ if (!endpoint || endpoint.name === this.name) {
+ throw new Error("A endpoint must not have the same name as a namespace");
+ }
+ if (!(endpoint instanceof Endpoint)) {
+ throw new Error("addNamespace only accept Namespace instance");
+ }
+ this.endpoints.push(endpoint);
+ this[endpoint.name] = endpoint.build(this.http);
+ }
+ }]);
+ return Namespace;
+}();
+
+},{"./endpoint":44,"debug":4}],47:[function(require,module,exports){
+'use strict';
+
+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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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); }
+var extrareqp2 = require('extrareqp2');
+var AuthStrategy = require('./auth_strategies/strategy');
+var constants = require('../constants');
+var logger = require('debug')('kmjs:network');
+var loggerHttp = require('debug')('kmjs:network:http');
+var loggerWS = require('debug')('kmjs:network:ws');
+var WS = require('./utils/websocket');
+var EventEmitter = require('eventemitter2');
+var async = require('async');
+var BUFFERIZED = -1;
+module.exports = /*#__PURE__*/function () {
+ function NetworkWrapper(km, opts) {
+ _classCallCheck(this, NetworkWrapper);
+ logger('init network manager');
+ opts.baseURL = opts.services.API;
+ this.opts = opts;
+ this.opts.maxRedirects = 0;
+ this.tokens = {
+ refresh_token: null,
+ access_token: null
+ };
+ this.km = km;
+ this._queue = [];
+ this._extrareqp2 = extrareqp2.create(opts);
+ this._websockets = [];
+ this._endpoints = new Map();
+ this._bucketFilters = new Map();
+ this.apiDateLag = 0;
+ this.realtime = new EventEmitter({
+ wildcard: true,
+ delimiter: ':',
+ newListener: false,
+ maxListeners: 100
+ });
+ // https://github.com/EventEmitter2/EventEmitter2/issues/214
+ var self = this;
+ var realtimeOn = this.realtime.on;
+ this.realtime.on = function () {
+ self.editSocketFilters('push', arguments[0]);
+ return realtimeOn.apply(self.realtime, arguments);
+ };
+ var realtimeOff = this.realtime.off;
+ this.realtime.off = function () {
+ self.editSocketFilters('remove', arguments[0]);
+ return realtimeOff.apply(self.realtime, arguments);
+ };
+ this.realtime.subscribe = this.subscribe.bind(this);
+ this.realtime.unsubscribe = this.unsubscribe.bind(this);
+ this.authenticated = false;
+ this._setupDateLag();
+ }
+ _createClass(NetworkWrapper, [{
+ key: "_setupDateLag",
+ value: function _setupDateLag() {
+ var _this = this;
+ var updateApiDateLag = function updateApiDateLag(response) {
+ if (response && response.headers && response.headers.date) {
+ var headerDate = new Date(response.headers.date);
+ var clientDate = new Date();
+
+ // The header date is likely to be truncated to the second, so truncate the client date too
+ headerDate.setMilliseconds(0);
+ clientDate.setMilliseconds(0);
+ _this.apiDateLag = headerDate - clientDate;
+ }
+ };
+ this._extrareqp2.interceptors.response.use(function (response) {
+ updateApiDateLag(response);
+ return response;
+ }, function (error) {
+ updateApiDateLag(error.response);
+ return Promise.reject(error);
+ });
+ }
+ }, {
+ key: "_queueUpdater",
+ value: function _queueUpdater() {
+ if (this.authenticated === false) return;
+ if (this._queue.length > 0) {
+ logger("Emptying requests queue (size: ".concat(this._queue.length, ")"));
+ }
+
+ // when we are authenticated we can clear the queue
+ while (this._queue.length > 0) {
+ var promise = this._queue.shift();
+ // make the request
+ this.request(promise.request).then(promise.resolve, promise.reject);
+ }
+ }
+
+ /**
+ * Resolve the endpoint of the node to make the request to
+ * because each bucket might be on a different node
+ * @param {String} bucketID the bucket id
+ *
+ * @return {Promise}
+ */
+ }, {
+ key: "_resolveBucketEndpoint",
+ value: function _resolveBucketEndpoint(bucketID) {
+ var _this2 = this;
+ if (!bucketID) return Promise.reject(new Error("Missing argument : bucketID"));
+ if (!this._endpoints.has(bucketID)) {
+ var promise = this._extrareqp2.request({
+ url: "/api/bucket/".concat(bucketID),
+ method: 'GET',
+ headers: {
+ Authorization: "Bearer ".concat(this.tokens.access_token)
+ }
+ }).then(function (res) {
+ return res.data.node.endpoints.web;
+ })["catch"](function (e) {
+ _this2._endpoints["delete"](bucketID);
+ throw e;
+ });
+ this._endpoints.set(bucketID, promise);
+ }
+ return this._endpoints.get(bucketID);
+ }
+
+ /**
+ * Send a http request
+ * @param {Object} opts
+ * @param {String} [opts.method=GET] http method
+ * @param {String} opts.url the full URL
+ * @param {Object} [opts.data] body data
+ * @param {Object} [opts.params] url params
+ *
+ * @return {Promise}
+ */
+ }, {
+ key: "request",
+ value: function request(httpOpts) {
+ var _this3 = this;
+ return new Promise(function (resolve, reject) {
+ async.series([
+ // verify that we don't need to buffer the request because authentication
+ function (next) {
+ if (_this3.authenticated === true || httpOpts.authentication === false) return next();
+ loggerHttp("Queued request to ".concat(httpOpts.url));
+ _this3._queue.push({
+ resolve: resolve,
+ reject: reject,
+ request: httpOpts
+ });
+ // we need to stop the flow here
+ return next(BUFFERIZED);
+ },
+ // we need to verify that the baseURL is correct
+ function (next) {
+ if (!httpOpts.url.match(/bucket\/[0-9a-fA-F]{24}/)) return next();
+ // parse the bucket id from URL
+ var bucketID = httpOpts.url.split('/')[3];
+ // we need to retrieve where to send the request depending on the backend
+ _this3._resolveBucketEndpoint(bucketID).then(function (endpoint) {
+ httpOpts.baseURL = endpoint;
+ // then continue the flow
+ return next();
+ })["catch"](next);
+ },
+ // if the request has not been bufferized, make the request
+ function (next) {
+ // super trick to transform a promise response to a callback
+ var successNext = function successNext(res) {
+ return next(null, res);
+ };
+ loggerHttp("Making request to ".concat(httpOpts.url));
+ if (!httpOpts.headers) {
+ httpOpts.headers = {};
+ }
+ httpOpts.headers.Authorization = "Bearer ".concat(_this3.tokens.access_token);
+ _this3._extrareqp2.request(httpOpts).then(successNext)["catch"](function (error) {
+ var response = error.response;
+ // we only need to handle when code is 401 (which mean unauthenticated)
+ if (response && response.status !== 401) return next(response);
+ loggerHttp("Got unautenticated response, buffering request from now ...");
+
+ // we tell the client to not send authenticated request anymore
+ _this3.authenticated = false;
+ loggerHttp("Asking to the oauth flow to retrieve new tokens");
+ var q = function q() {
+ _this3.oauth_flow.retrieveTokens(_this3.km, function (err, data) {
+ // if it fail, we fail the whole request
+ if (err) {
+ loggerHttp("Failed to retrieve new tokens : ".concat(err.message || err));
+ return next(response);
+ }
+ // if its good, we try to update the tokens
+ loggerHttp("Succesfully retrieved new tokens");
+ _this3._updateTokens(null, data, function (err, authenticated) {
+ // if it fail, we fail the whole request
+ if (err) return next(response);
+ // then we can rebuffer the request
+ loggerHttp("Re-buffering call to ".concat(httpOpts.url, " since authenticated now"));
+ httpOpts.headers.Authorization = "Bearer ".concat(_this3.tokens.access_token);
+ return _this3._extrareqp2.request(httpOpts).then(successNext)["catch"](next);
+ });
+ });
+ };
+ if (httpOpts.url == _this3.opts.services.OAUTH + '/api/oauth/token') {
+ // Avoid infinite recursive loop to retrieveToken
+ return setTimeout(q.bind(_this3), 500);
+ }
+ q();
+ });
+ }], function (err, results) {
+ // if the flow is stoped because the request has been
+ // buferred, we don't need to do anything
+ if (err === BUFFERIZED) return;
+ return err ? reject(err) : resolve(results[2]);
+ });
+ });
+ }
+
+ /**
+ * Update the access token used by all the networking clients
+ * @param {Error} err if any erro
+ * @param {String} accessToken the token you want to use
+ * @param {Function} [cb] invoked with
+ * @private
+ */
+ }, {
+ key: "_updateTokens",
+ value: function _updateTokens(err, data, cb) {
+ var _this4 = this;
+ if (err) {
+ console.error('Error while retrieving tokens:', err);
+ // Try to logout/login user
+ this.oauth_flow.deleteTokens(this.km);
+ return console.error(err.response ? err.response.data : err.stack);
+ }
+ if (!data || !data.access_token || !data.refresh_token) throw new Error('Invalid tokens');
+ this.tokens = data;
+ loggerHttp("Registered new access_token : ".concat(data.access_token));
+ this._websockets.forEach(function (websocket) {
+ return websocket.updateAuthorization(data.access_token);
+ });
+ this._extrareqp2.defaults.headers.common['Authorization'] = "Bearer ".concat(data.access_token);
+ this._extrareqp2.request({
+ url: '/api/bucket',
+ method: 'GET',
+ headers: {
+ Authorization: "Bearer ".concat(data.access_token)
+ }
+ }).then(function (res) {
+ loggerHttp("Cached ".concat(res.data.length, " buckets for current user"));
+ _this4.authenticated = true;
+ _this4._queueUpdater();
+ return typeof cb === 'function' ? cb(null, true) : null;
+ })["catch"](function (err) {
+ console.error('Error while retrieving buckets');
+ console.error(err.response ? err.response.data : err);
+ return typeof cb === 'function' ? cb(err) : null;
+ });
+ }
+
+ /**
+ * Specify a strategy to use when authenticating to server
+ * @param {String|Function} flow the name of the flow to use or a custom implementation
+ * @param {Object} [opts]
+ * @param {String} [opts.client_id] the OAuth client ID to use to identify the application
+ * default to the one defined when instancing Keymetrics and fallback to 795984050 (custom tokens)
+ * @throws invalid use of this function, either the flow don't exist or isn't correctly implemented
+ */
+ }, {
+ key: "useStrategy",
+ value: function useStrategy(flow, opts) {
+ if (!opts) opts = {};
+ // if client not provided here, use the one given in the instance
+ if (!opts.client_id) {
+ opts.client_id = this.opts.OAUTH_CLIENT_ID;
+ }
+
+ // in the case of flow being a custom implementation
+ if (_typeof(flow) === 'object') {
+ this.oauth_flow = flow;
+ if (!this.oauth_flow.retrieveTokens || !this.oauth_flow.deleteTokens) {
+ throw new Error('You must implement the Strategy interface to use it');
+ }
+ return this.oauth_flow.retrieveTokens(this.km, this._updateTokens.bind(this));
+ }
+ // otherwise fallback on the flow that are implemented
+ if (typeof AuthStrategy.implementations(flow) === 'undefined') {
+ throw new Error("The flow named ".concat(flow, " doesn't exist"));
+ }
+ var flowMeta = AuthStrategy.implementations(flow);
+
+ // verify that the environnement condition is meet
+ if (flowMeta.condition && constants.ENVIRONNEMENT !== flowMeta.condition) {
+ throw new Error("The flow ".concat(flow, " is reserved for ").concat(flowMeta.condition, " environment"));
+ }
+ var FlowImpl = flowMeta.nodule;
+ this.oauth_flow = new FlowImpl(opts);
+ return this.oauth_flow.retrieveTokens(this.km, this._updateTokens.bind(this));
+ }
+ }, {
+ key: "editSocketFilters",
+ value: function editSocketFilters(type, event) {
+ if (event.indexOf('**') === 0) throw new Error('You need to provide a bucket public id.');
+ event = event.split(':');
+ var bucketPublicId = event[0];
+ var filter = event.slice(2).join(':');
+ var socket = this._websockets.find(function (socket) {
+ return socket.bucketPublic === bucketPublicId;
+ });
+ if (!this._bucketFilters.has(bucketPublicId)) this._bucketFilters.set(bucketPublicId, []);
+ var filters = this._bucketFilters.get(bucketPublicId);
+ if (type === 'push') {
+ filters.push(filter);
+ } else {
+ filters.splice(filters.indexOf(filter), 1);
+ }
+ if (!socket) return;
+ socket.send(JSON.stringify({
+ action: 'sub',
+ public_id: bucketPublicId,
+ filters: Array.from(new Set(filters)) // avoid duplicates
+ }));
+ }
+
+ /**
+ * Subscribe to realtime from bucket
+ * @param {String} bucketId bucket id
+ * @param {Object} [opts]
+ *
+ * @return {Promise}
+ */
+ }, {
+ key: "subscribe",
+ value: function subscribe(bucketId, opts) {
+ var _this5 = this;
+ return new Promise(function (resolve, reject) {
+ logger("Request endpoints for ".concat(bucketId));
+ _this5.km.bucket.retrieve(bucketId).then(function (res) {
+ var bucket = res.data;
+ var connected = false;
+ var endpoints = bucket.node.endpoints;
+ var endpoint = endpoints.realtime || endpoints.web;
+ endpoint = endpoint.replace('http', 'ws');
+ if (_this5.opts.IS_DEBUG) {
+ endpoint = endpoint.replace(':3000', ':4020');
+ }
+ loggerWS("Found endpoint for ".concat(bucketId, " : ").concat(endpoint));
+
+ // connect websocket client to the realtime endpoint
+ var socket = new WS("".concat(endpoint, "/primus"), _this5.tokens.access_token);
+ socket.bucketPublic = bucket.public_id;
+ socket.connected = false;
+ socket.bucket = bucketId;
+ var keepAliveHandler = function keepAliveHandler() {
+ socket.ping();
+ };
+ var keepAliveInterval = null;
+ var onConnect = function onConnect() {
+ logger("Connected to ws endpoint : ".concat(endpoint, " (bucket: ").concat(bucketId, ")"));
+ socket.connected = true;
+ _this5.realtime.emit("".concat(bucket.public_id, ":connected"));
+ socket.send(JSON.stringify({
+ action: 'sub',
+ public_id: bucket.public_id,
+ filters: Array.from(new Set(_this5._bucketFilters.get(bucket.public_id))) // avoid duplicates
+ }));
+ if (keepAliveInterval !== null) {
+ clearInterval(keepAliveInterval);
+ keepAliveInterval = null;
+ }
+ keepAliveInterval = setInterval(keepAliveHandler.bind(_this5), 5000);
+ if (!connected) {
+ connected = true;
+ return resolve(socket);
+ }
+ };
+ socket.onmaxreconnect = function (_) {
+ if (!connected) {
+ connected = true;
+ return reject(new Error('Connection timeout'));
+ }
+ };
+ socket.onopen = onConnect;
+ socket.onunexpectedresponse = function (req, res) {
+ if (res.statusCode === 401) {
+ return _this5.oauth_flow.retrieveTokens(_this5.km, function (err, data) {
+ if (err) return logger("Failed to retrieve tokens for ws: ".concat(err.message));
+ logger("Succesfully retrieved new tokens for ws");
+ _this5._updateTokens(null, data, function (err, authenticated) {
+ if (err) return logger("Failed to update tokens for ws: ".concat(err.message));
+ return socket._tryReconnect();
+ });
+ });
+ }
+ return socket._tryReconnect();
+ };
+ socket.onerror = function (err) {
+ loggerWS("Error on ".concat(endpoint, " (bucket: ").concat(bucketId, ")"));
+ loggerWS(err);
+ _this5.realtime.emit("".concat(bucket.public_id, ":error"), err);
+ };
+ socket.onclose = function () {
+ logger("Closing ws connection ".concat(endpoint, " (bucket: ").concat(bucketId, ")"));
+ socket.connected = false;
+ _this5.realtime.emit("".concat(bucket.public_id, ":disconnected"));
+ if (keepAliveInterval !== null) {
+ clearInterval(keepAliveInterval);
+ keepAliveInterval = null;
+ }
+ };
+
+ // broadcast in the bus
+ socket.onmessage = function (msg) {
+ loggerWS("Received message for bucket ".concat(bucketId, " (").concat((msg.data.length / 1000).toFixed(1), " Kb)"));
+ var data = null;
+ try {
+ data = JSON.parse(msg.data);
+ } catch (e) {
+ return loggerWS("Receive not json message for bucket ".concat(bucketId));
+ }
+ var packet = data.data[1];
+ Object.keys(packet).forEach(function (event) {
+ if (event === 'server_name') return;
+ _this5.realtime.emit("".concat(bucket.public_id, ":").concat(packet.server_name || 'none', ":").concat(event), packet[event]);
+ });
+ };
+ _this5._websockets.push(socket);
+ })["catch"](reject);
+ });
+ }
+
+ /**
+ * Unsubscribe realtime from bucket
+ * @param {String} bucketId bucket id
+ * @param {Object} [opts]
+ *
+ * @return {Promise}
+ */
+ }, {
+ key: "unsubscribe",
+ value: function unsubscribe(bucketId, opts) {
+ var _this6 = this;
+ return new Promise(function (resolve, reject) {
+ logger("Unsubscribe from realtime for ".concat(bucketId));
+ var socket = _this6._websockets.find(function (socket) {
+ return socket.bucket === bucketId;
+ });
+ if (!socket) {
+ return reject(new Error("Realtime wasn't connected to ".concat(bucketId)));
+ }
+ socket.close(1000, 'Disconnecting');
+ logger("Succesfully unsubscribed from realtime for ".concat(bucketId));
+ return resolve();
+ });
+ }
+ }]);
+ return NetworkWrapper;
+}();
+
+},{"../constants":1,"./auth_strategies/strategy":43,"./utils/websocket":49,"async":2,"debug":4,"eventemitter2":6,"extrareqp2":7}],48:[function(require,module,exports){
+'use strict';
+
+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 _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
+function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
+function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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); }
+module.exports = /*#__PURE__*/function () {
+ function RequestValidator() {
+ _classCallCheck(this, RequestValidator);
+ }
+ _createClass(RequestValidator, null, [{
+ key: "extract",
+ value:
+ /**
+ * Extract httpOptions from the endpoint definition
+ * and the data given by the user
+ *
+ * @param {Object} endpoint endpoint definition
+ * @param {Array} args arguments given by the user
+ * @return {Promise} resolve to the http options need to make the request
+ */
+ function extract(endpoint, args) {
+ var isDefined = function isDefined(val) {
+ return val !== null && typeof val !== 'undefined';
+ };
+ return new Promise(function (resolve, reject) {
+ var httpOpts = {
+ params: {},
+ data: {},
+ url: endpoint.route.name + '',
+ method: endpoint.route.type,
+ authentication: endpoint.authentication || false
+ };
+ switch (endpoint.route.type) {
+ // GET request, we assume data will only be in the query or url params
+ case 'GET':
+ {
+ var _iterator = _createForOfIteratorHelper(endpoint.params || []),
+ _step;
+ try {
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
+ var param = _step.value;
+ var value = args.shift();
+ // params should always be a string since they will be replaced in the url
+ if (typeof value !== 'string' && param.optional === false) {
+ return reject(new Error("Expected to receive string argument for ".concat(param.name, " to match but got ").concat(value)));
+ }
+ if (value) {
+ // if value is given, use it
+ httpOpts.url = httpOpts.url.replace(param.name, value);
+ } else if (param.optional === false && param.defaultvalue !== null) {
+ // use default value if available
+ httpOpts.url = httpOpts.url.replace(param.name, param.defaultvalue);
+ }
+ }
+ } catch (err) {
+ _iterator.e(err);
+ } finally {
+ _iterator.f();
+ }
+ var _iterator2 = _createForOfIteratorHelper(endpoint.query || []),
+ _step2;
+ try {
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
+ var _param = _step2.value;
+ var _value = args.shift();
+ // query should always be a string since they will be replaced in the url
+ if (typeof _value !== 'string' && _param.optional === false) {
+ return reject(new Error("Expected to receive string argument for ".concat(_param.name, " query but got ").concat(_value)));
+ }
+ // set query value
+ if (_value) {
+ // if value is given, use it
+ httpOpts.params[_param.name] = _value;
+ } else if (_param.optional === false && _param.defaultvalue !== null) {
+ // use default value if available
+ httpOpts.params[_param.name] = _param.defaultvalue;
+ }
+ }
+ } catch (err) {
+ _iterator2.e(err);
+ } finally {
+ _iterator2.f();
+ }
+ break;
+ }
+ // for PUT, POST and PATCH request, only params and body are authorized
+ case 'PUT':
+ case 'POST':
+ case 'PATCH':
+ {
+ var _iterator3 = _createForOfIteratorHelper(endpoint.params || []),
+ _step3;
+ try {
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
+ var _param2 = _step3.value;
+ var _value2 = args.shift();
+ // params should always be a string since they will be replaced in the url
+ if (typeof _value2 !== 'string' && _param2.optional === false) {
+ return reject(new Error("Expected to receive string argument for ".concat(_param2.name, " to match but got ").concat(_value2)));
+ }
+ // replace param in url
+ if (_value2) {
+ // if value is given, use it
+ httpOpts.url = httpOpts.url.replace(_param2.name, _value2);
+ } else if (_param2.optional === false && _param2.defaultvalue !== null) {
+ // use default value if available
+ httpOpts.url = httpOpts.url.replace(_param2.name, _param2.defaultvalue);
+ }
+ }
+ } catch (err) {
+ _iterator3.e(err);
+ } finally {
+ _iterator3.f();
+ }
+ var _iterator4 = _createForOfIteratorHelper(endpoint.query || []),
+ _step4;
+ try {
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
+ var _param3 = _step4.value;
+ var _value3 = args.shift();
+ // query should always be a string since they will be replaced in the url
+ if (typeof _value3 !== 'string' && _param3.optional === false) {
+ return reject(new Error("Expected to receive string argument for ".concat(_param3.name, " query but got ").concat(_value3)));
+ }
+ // set query value
+ if (_value3) {
+ // if value is given, use it
+ httpOpts.params[_param3.name] = _value3;
+ } else if (_param3.optional === false && _param3.defaultvalue !== null) {
+ // use default value if available
+ httpOpts.params[_param3.name] = _param3.defaultvalue;
+ }
+ }
+ // if we don't have any arguments, break
+ } catch (err) {
+ _iterator4.e(err);
+ } finally {
+ _iterator4.f();
+ }
+ if (args.length === 0) break;
+ var data = args[0];
+ if (_typeof(data) !== 'object' && endpoint.body.length > 0) {
+ return reject(new Error("Expected to receive an object for post data but received ".concat(_typeof(data))));
+ }
+ var _iterator5 = _createForOfIteratorHelper(endpoint.body || []),
+ _step5;
+ try {
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
+ var field = _step5.value;
+ var isSubfield = field.name.includes('[]') === true;
+
+ // verify that the mandatory field are here
+ if (!isDefined(data[field.name]) && isSubfield === false && field.optional === false && field.defaultvalue === null) {
+ return reject(new Error("Missing mandatory field ".concat(field.name, " to make a POST request on ").concat(endpoint.route.name)));
+ }
+ // verify that the mandatory field are the good type
+ if (_typeof(data[field.name]) !== field.type && isSubfield === false && field.optional === false && field.defaultvalue === null) {
+ // eslint-disable-line
+ return reject(new Error("Invalid type for field ".concat(field.name, ", expected ").concat(field.type, " but got ").concat(_typeof(data[field.name]))));
+ }
+
+ // add it to the request only when its present
+ if (isDefined(data[field.name])) {
+ httpOpts.data[field.name] = data[field.name];
+ }
+
+ // or else its not optional and has a default value
+ if (field.optional === false && field.defaultvalue !== null) {
+ httpOpts.data[field.name] = field.defaultvalue;
+ }
+ }
+ } catch (err) {
+ _iterator5.e(err);
+ } finally {
+ _iterator5.f();
+ }
+ break;
+ }
+ // DELETE can have params or query parameters
+ case 'DELETE':
+ {
+ var _iterator6 = _createForOfIteratorHelper(endpoint.params || []),
+ _step6;
+ try {
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
+ var _param4 = _step6.value;
+ var _value4 = args.shift();
+ // params should always be a string since they will be replaced in the url
+ if (typeof _value4 !== 'string' && _param4.optional === false) {
+ return reject(new Error("Expected to receive string argument for ".concat(_param4.name, " to match but got ").concat(_value4)));
+ }
+ // replace param in url
+ if (_value4) {
+ // if value is given, use it
+ httpOpts.url = httpOpts.url.replace(_param4.name, _value4);
+ } else if (_param4.optional === false && _param4.defaultvalue !== null) {
+ // use default value if available
+ httpOpts.url = httpOpts.url.replace(_param4.name, _param4.defaultvalue);
+ }
+ }
+ } catch (err) {
+ _iterator6.e(err);
+ } finally {
+ _iterator6.f();
+ }
+ var _iterator7 = _createForOfIteratorHelper(endpoint.query || []),
+ _step7;
+ try {
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
+ var _param5 = _step7.value;
+ var _value5 = args.shift();
+ // query should always be a string
+ if (typeof _value5 !== 'string' && _param5.optional === false) {
+ return reject(new Error("Expected to receive string argument for ".concat(_param5.name, " query but got ").concat(_value5)));
+ }
+ // replace param in url
+ if (_value5) {
+ // if value is given, use it
+ httpOpts.params[_param5.name] = _value5;
+ } else if (_param5.optional === false && _param5.defaultvalue !== null) {
+ // use default value if available
+ httpOpts.params[_param5.name] = _param5.defaultvalue;
+ }
+ }
+ } catch (err) {
+ _iterator7.e(err);
+ } finally {
+ _iterator7.f();
+ }
+ break;
+ }
+ default:
+ {
+ return reject(new Error("Invalid endpoint declaration, invalid method ".concat(endpoint.route.type, " found")));
+ }
+ }
+ return resolve(httpOpts);
+ });
+ }
+ }]);
+ return RequestValidator;
+}();
+
+},{}],49:[function(require,module,exports){
+/* global WebSocket */
+
+'use strict';
+
+var ws = require('ws');
+var debug = require('debug')('kmjs:network:_ws');
+var _WebSocket = typeof ws !== 'function' ? WebSocket : ws;
+var defaultOptions = {
+ debug: false,
+ automaticOpen: true,
+ reconnectOnError: true,
+ reconnectInterval: 1000,
+ maxReconnectInterval: 10000,
+ reconnectDecay: 1,
+ timeoutInterval: 2000,
+ maxReconnectAttempts: Infinity,
+ randomRatio: 3,
+ reconnectOnCleanClose: false
+};
+var ReconnectableWebSocket = function ReconnectableWebSocket(url, token, protocols, options) {
+ if (!protocols) protocols = [];
+ if (!options) options = [];
+ this.CONNECTING = 0;
+ this.OPEN = 1;
+ this.CLOSING = 2;
+ this.CLOSED = 3;
+ this._url = url;
+ this._token = token;
+ this._protocols = protocols;
+ this._options = Object.assign({}, defaultOptions, options);
+ this._messageQueue = [];
+ this._reconnectAttempts = 0;
+ this.readyState = this.CONNECTING;
+ if (typeof this._options.debug === 'function') {
+ this._debug = this._options.debug;
+ } else if (this._options.debug) {
+ this._debug = console.log.bind(console);
+ } else {
+ this._debug = function () {};
+ }
+ if (this._options.automaticOpen) this.open();
+};
+ReconnectableWebSocket.prototype.updateAuthorization = function (authorization) {
+ this._token = authorization;
+};
+ReconnectableWebSocket.prototype.open = function () {
+ debug('open');
+ var socket = this._socket = new _WebSocket("".concat(this._url, "?token=").concat(this._token), this._protocols);
+ if (this._options.binaryType) {
+ socket.binaryType = this._options.binaryType;
+ }
+ if (this._options.maxReconnectAttempts && this._options.maxReconnectAttempts < this._reconnectAttempts) {
+ return this.onmaxreconnect();
+ }
+ this._syncState();
+ if (socket.on) {
+ socket.on('unexpected-response', this._onunexpectedresponse);
+ }
+ socket.onmessage = this._onmessage.bind(this);
+ socket.onopen = this._onopen.bind(this);
+ socket.onclose = this._onclose.bind(this);
+ socket.onerror = this._onerror.bind(this);
+};
+ReconnectableWebSocket.prototype.send = function (data) {
+ debug('send');
+ if (this._socket && this._socket.readyState === _WebSocket.OPEN && this._messageQueue.length === 0) {
+ this._socket.send(data);
+ } else {
+ this._messageQueue.push(data);
+ }
+};
+ReconnectableWebSocket.prototype.ping = function () {
+ debug('ping');
+ if (this._socket.ping && this._socket && this._socket.readyState === _WebSocket.OPEN && this._messageQueue.length === 0) {
+ this._socket.ping();
+ }
+};
+ReconnectableWebSocket.prototype.close = function (code, reason) {
+ debug('close');
+ if (typeof code === 'undefined') code = 1000;
+ if (this._socket) this._socket.close(code, reason);
+};
+ReconnectableWebSocket.prototype._onunexpectedresponse = function (req, res) {
+ debug('unexpected-response');
+ this.onunexpectedresponse && this.onunexpectedresponse(req, res);
+};
+ReconnectableWebSocket.prototype._onmessage = function (message) {
+ debug('onmessage');
+ this.onmessage && this.onmessage(message);
+};
+ReconnectableWebSocket.prototype._onopen = function (event) {
+ debug('onopen');
+ this._syncState();
+ this._flushQueue();
+ if (this._reconnectAttempts !== 0) {
+ this.onreconnect && this.onreconnect();
+ }
+ this._reconnectAttempts = 0;
+ this.onopen && this.onopen(event);
+};
+ReconnectableWebSocket.prototype._onclose = function (event) {
+ debug('onclose', event);
+ this._syncState();
+ this._debug('WebSocket: connection is broken', event);
+ this.onclose && this.onclose(event);
+ this._tryReconnect(event);
+};
+ReconnectableWebSocket.prototype._onerror = function (event) {
+ debug('onerror', event);
+ // To avoid undetermined state, we close socket on error
+ this._socket.close();
+ this._syncState();
+ this._debug('WebSocket: error', event);
+ this.onerror && this.onerror(event);
+ if (this._options.reconnectOnError) this._tryReconnect(event);
+};
+ReconnectableWebSocket.prototype._tryReconnect = function (event) {
+ var self = this;
+ debug('Trying to reconnect');
+ if (event.wasClean && !this._options.reconnectOnCleanClose) {
+ return;
+ }
+ setTimeout(function () {
+ if (self.readyState === self.CLOSING || self.readyState === self.CLOSED) {
+ self._reconnectAttempts++;
+ self.open();
+ }
+ }, this._getTimeout());
+};
+ReconnectableWebSocket.prototype._flushQueue = function () {
+ while (this._messageQueue.length !== 0) {
+ var data = this._messageQueue.shift();
+ this._socket.send(data);
+ }
+};
+ReconnectableWebSocket.prototype._getTimeout = function () {
+ var timeout = this._options.reconnectInterval * Math.pow(this._options.reconnectDecay, this._reconnectAttempts);
+ timeout = timeout > this._options.maxReconnectInterval ? this._options.maxReconnectInterval : timeout;
+ return this._options.randomRatio ? getRandom(timeout / this._options.randomRatio, timeout) : timeout;
+};
+ReconnectableWebSocket.prototype._syncState = function () {
+ this.readyState = this._socket.readyState;
+};
+function getRandom(min, max) {
+ return Math.random() * (max - min) + min;
+}
+module.exports = ReconnectableWebSocket;
+
+},{"debug":4,"ws":3}],"/":[function(require,module,exports){
+"use strict";
+
+module.exports = require('./src/keymetrics.js');
+
+},{"./src/keymetrics.js":45}]},{},[])("/")
+});
diff --git a/node_modules/@pm2/js-api/dist/keymetrics.es5.min.js b/node_modules/@pm2/js-api/dist/keymetrics.es5.min.js
new file mode 100644
index 0000000..ba29b39
--- /dev/null
+++ b/node_modules/@pm2/js-api/dist/keymetrics.es5.min.js
@@ -0,0 +1 @@
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Keymetrics=e()}}(function(){return function(){return function e(t,n,o){function i(r,s){if(!n[r]){if(!t[r]){var l="function"==typeof require&&require;if(!s&&l)return l(r,!0);if(a)return a(r,!0);var u=new Error("Cannot find module '"+r+"'");throw u.code="MODULE_NOT_FOUND",u}var p=n[r]={exports:{}};t[r][0].call(p.exports,function(e){return i(t[r][1][e]||e)},p,p.exports,e,t,n,o)}return n[r].exports}for(var a="function"==typeof require&&require,r=0;r-1&&e%1==0&&e<=R}function N(e){return null!=e&&U(e.length)&&!function(e){if(!l(e))return!1;var t=z(e);return t==D||t==F||t==B||t==I}(e)}var q={};function M(){}function G(e){return function(){if(null!==e){var t=e;e=null,t.apply(this,arguments)}}}var H="function"==typeof Symbol&&Symbol.iterator,W=function(e){return H&&e[H]&&e[H]()};function V(e){return null!=e&&"object"==typeof e}var J="[object Arguments]";function K(e){return V(e)&&z(e)==J}var $=Object.prototype,Q=$.hasOwnProperty,X=$.propertyIsEnumerable,Y=K(function(){return arguments}())?K:function(e){return V(e)&&Q.call(e,"callee")&&!X.call(e,"callee")},Z=Array.isArray;var ee="object"==typeof n&&n&&!n.nodeType&&n,te=ee&&"object"==typeof t&&t&&!t.nodeType&&t,ne=te&&te.exports===ee?T.Buffer:void 0,oe=(ne?ne.isBuffer:void 0)||function(){return!1},ie=9007199254740991,ae=/^(?:0|[1-9]\d*)$/;function re(e,t){var n=typeof e;return!!(t=null==t?ie:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e2&&(o=a(arguments,1)),t){var u={};qe(i,function(e,t){u[t]=e}),u[e]=o,s=!0,l=Object.create(null),n(t,u)}else i[e]=o,Re(l[e]||[],function(e){e()}),f()});r++;var u=g(t[t.length-1]);t.length>1?u(i,o):u(o)}(e,t)})}function f(){if(0===u.length&&0===r)return n(null,i);for(;u.length&&r=0&&n.push(o)}),n}qe(e,function(t,n){if(!Z(t))return d(n,[t]),void p.push(n);var o=t.slice(0,t.length-1),i=o.length;if(0===i)return d(n,t),void p.push(n);c[n]=i,Re(o,function(a){if(!e[a])throw new Error("async.auto task `"+n+"` has a non-existent dependency `"+a+"` in "+o.join(", "));!function(e,t){var n=l[e];n||(n=l[e]=[]);n.push(t)}(a,function(){0===--i&&d(n,t)})})}),function(){var e,t=0;for(;p.length;)e=p.pop(),t++,Re(m(e),function(e){0==--c[e]&&p.push(e)});if(t!==o)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),f()};function We(e,t){for(var n=-1,o=null==e?0:e.length,i=Array(o);++n=o?e:function(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++o-1;);return n}(i,a),function(e,t){for(var n=e.length;n--&&Ge(t,e[n],0)>-1;);return n}(i,a)+1).join("")}var dt=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,ft=/,/,mt=/(=.+)?(\s*)$/,yt=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;function ht(e,t){var n={};qe(e,function(e,t){var o,i,a=b(e),r=!a&&1===e.length||a&&0===e.length;if(Z(e))o=e.slice(0,-1),e=e[e.length-1],n[t]=o.concat(o.length>0?s:e);else if(r)n[t]=e;else{if(o=i=(i=(i=(i=(i=e).toString().replace(yt,"")).match(dt)[2].replace(" ",""))?i.split(ft):[]).map(function(e){return ct(e.replace(mt,""))}),0===e.length&&!a&&0===o.length)throw new Error("autoInject task functions require explicit parameters.");a||o.pop(),n[t]=o.concat(s)}function s(t,n){var i=We(o,function(e){return t[e]});i.push(n),g(e).apply(null,i)}}),He(n,t)}function vt(){this.head=this.tail=null,this.length=0}function bt(e,t){e.length=1,e.head=e.tail=t}function gt(e,t,n){if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var o=g(e),i=0,a=[],r=!1;function s(e,t,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");if(p.started=!0,Z(e)||(e=[e]),0===e.length&&p.idle())return f(function(){p.drain()});for(var o=0,i=e.length;o0&&a.splice(s,1),r.callback.apply(r,arguments),null!=t&&p.error(t,r.data)}i<=p.concurrency-p.buffer&&p.unsaturated(),p.idle()&&p.drain(),p.process()}}var u=!1,p={_tasks:new vt,concurrency:t,payload:n,saturated:M,unsaturated:M,buffer:t/4,empty:M,drain:M,error:M,started:!1,paused:!1,push:function(e,t){s(e,!1,t)},kill:function(){p.drain=M,p._tasks.empty()},unshift:function(e,t){s(e,!0,t)},remove:function(e){p._tasks.remove(e)},process:function(){if(!u){for(u=!0;!p.paused&&i2&&(i=a(arguments,1)),o[t]=i,n(e)})},function(e){n(e,o)})}function vn(e,t){hn(xe,e,t)}function bn(e,t,n){hn(je(t),e,n)}var gn=function(e,t){var n=g(e);return gt(function(e,t){n(e[0],t)},t,1)},kn=function(e,t){var n=gn(e,t);return n.push=function(e,t,o){if(null==o&&(o=M),"function"!=typeof o)throw new Error("task callback must be a function");if(n.started=!0,Z(e)||(e=[e]),0===e.length)return f(function(){n.drain()});t=t||0;for(var i=n._tasks.head;i&&t>=i.priority;)i=i.next;for(var a=0,r=e.length;ao?1:0}Le(e,function(e,t){o(e,function(n,o){if(n)return t(n);t(null,{value:e,criteria:o})})},function(e,t){if(e)return n(e);n(null,We(t.sort(i),Xt("value")))})}function In(e,t,n){var o=g(e);return s(function(i,a){var r,s=!1;i.push(function(){s||(a.apply(null,arguments),clearTimeout(r))}),r=setTimeout(function(){var t=e.name||"anonymous",o=new Error('Callback function "'+t+'" timed out.');o.code="ETIMEDOUT",n&&(o.info=n),s=!0,a(o)},t),o.apply(null,i)})}var Rn=Math.ceil,Un=Math.max;function Nn(e,t,n,o){var i=g(n);De(function(e,t,n,o){for(var i=-1,a=Un(Rn((t-e)/(n||1)),0),r=Array(a);a--;)r[o?a:++i]=e,e+=n;return r}(0,e,1),t,i,o)}var qn=Ae(Nn,1/0),Mn=Ae(Nn,1);function Gn(e,t,n,o){arguments.length<=3&&(o=n,n=t,t=Z(e)?[]:{}),o=G(o||M);var i=g(n);xe(e,function(e,n,o){i(t,e,n,o)},function(e){o(e,t)})}function Hn(e,t){var n,o=null;t=t||M,Wt(e,function(e,t){g(e)(function(e,i){n=arguments.length>2?a(arguments,1):i,o=e,t(!e)})},function(){t(o,n)})}function Wn(e){return function(){return(e.unmemoized||e).apply(null,arguments)}}function Vn(e,t,n){n=Te(n||M);var o=g(t);if(!e())return n(null);var i=function(t){if(t)return n(t);if(e())return o(i);var r=a(arguments,1);n.apply(null,[null].concat(r))};o(i)}function Jn(e,t,n){Vn(function(){return!e.apply(this,arguments)},t,n)}var Kn=function(e,t){if(t=G(t||M),!Z(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var n=0;function o(t){var o=g(e[n++]);t.push(Te(i)),o.apply(null,t)}function i(i){if(i||n===e.length)return t.apply(null,arguments);o(a(arguments,1))}o([])},$n={apply:r,applyEach:ze,applyEachSeries:Ie,asyncify:m,auto:He,autoInject:ht,cargo:kt,compose:jt,concat:St,concatLimit:At,concatSeries:Ot,constant:xt,detect:zt,detectLimit:Bt,detectSeries:Dt,dir:It,doDuring:Rt,doUntil:Nt,doWhilst:Ut,during:qt,each:Gt,eachLimit:Ht,eachOf:xe,eachOfLimit:Ee,eachOfSeries:wt,eachSeries:Wt,ensureAsync:Vt,every:Kt,everyLimit:$t,everySeries:Qt,filter:tn,filterLimit:nn,filterSeries:on,forever:an,groupBy:sn,groupByLimit:rn,groupBySeries:ln,log:un,map:Le,mapLimit:De,mapSeries:Fe,mapValues:cn,mapValuesLimit:pn,mapValuesSeries:dn,memoize:mn,nextTick:yn,parallel:vn,parallelLimit:bn,priorityQueue:kn,queue:gn,race:wn,reduce:_t,reduceRight:_n,reflect:Tn,reflectAll:jn,reject:An,rejectLimit:Sn,rejectSeries:On,retry:Cn,retryable:Pn,seq:Tt,series:Ln,setImmediate:f,some:zn,someLimit:Bn,someSeries:Dn,sortBy:Fn,timeout:In,times:qn,timesLimit:Nn,timesSeries:Mn,transform:Gn,tryEach:Hn,unmemoize:Wn,until:Jn,waterfall:Kn,whilst:Vn,all:Kt,allLimit:$t,allSeries:Qt,any:zn,anyLimit:Bn,anySeries:Dn,find:zt,findLimit:Bt,findSeries:Dt,forEach:Gt,forEachSeries:Wt,forEachLimit:Ht,forEachOf:xe,forEachOfSeries:wt,forEachOfLimit:Ee,inject:_t,foldl:_t,foldr:_n,select:tn,selectLimit:nn,selectSeries:on,wrapSync:m};n.default=$n,n.apply=r,n.applyEach=ze,n.applyEachSeries=Ie,n.asyncify=m,n.auto=He,n.autoInject=ht,n.cargo=kt,n.compose=jt,n.concat=St,n.concatLimit=At,n.concatSeries=Ot,n.constant=xt,n.detect=zt,n.detectLimit=Bt,n.detectSeries=Dt,n.dir=It,n.doDuring=Rt,n.doUntil=Nt,n.doWhilst=Ut,n.during=qt,n.each=Gt,n.eachLimit=Ht,n.eachOf=xe,n.eachOfLimit=Ee,n.eachOfSeries=wt,n.eachSeries=Wt,n.ensureAsync=Vt,n.every=Kt,n.everyLimit=$t,n.everySeries=Qt,n.filter=tn,n.filterLimit=nn,n.filterSeries=on,n.forever=an,n.groupBy=sn,n.groupByLimit=rn,n.groupBySeries=ln,n.log=un,n.map=Le,n.mapLimit=De,n.mapSeries=Fe,n.mapValues=cn,n.mapValuesLimit=pn,n.mapValuesSeries=dn,n.memoize=mn,n.nextTick=yn,n.parallel=vn,n.parallelLimit=bn,n.priorityQueue=kn,n.queue=gn,n.race=wn,n.reduce=_t,n.reduceRight=_n,n.reflect=Tn,n.reflectAll=jn,n.reject=An,n.rejectLimit=Sn,n.rejectSeries=On,n.retry=Cn,n.retryable=Pn,n.seq=Tt,n.series=Ln,n.setImmediate=f,n.some=zn,n.someLimit=Bn,n.someSeries=Dn,n.sortBy=Fn,n.timeout=In,n.times=qn,n.timesLimit=Nn,n.timesSeries=Mn,n.transform=Gn,n.tryEach=Hn,n.unmemoize=Wn,n.until=Jn,n.waterfall=Kn,n.whilst=Vn,n.all=Kt,n.allLimit=$t,n.allSeries=Qt,n.any=zn,n.anyLimit=Bn,n.anySeries=Dn,n.find=zt,n.findLimit=Bt,n.findSeries=Dt,n.forEach=Gt,n.forEachSeries=Wt,n.forEachLimit=Ht,n.forEachOf=xe,n.forEachOfSeries=wt,n.forEachOfLimit=Ee,n.inject=_t,n.foldl=_t,n.foldr=_n,n.select=tn,n.selectLimit=nn,n.selectSeries=on,n.wrapSync=m,Object.defineProperty(n,"__esModule",{value:!0})})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{_process:37,timers:38}],3:[function(e,t,n){},{}],4:[function(e,t,n){(function(o){(function(){n.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&"%c"===e&&(i=++o)}),e.splice(i,0,n)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}!e&&void 0!==o&&"env"in o&&(e=o.env.DEBUG);return e},n.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(n);const{formatters:i}=t.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":5,_process:37}],5:[function(e,t,n){t.exports=function(t){function n(e){let t,i,a,r=null;function s(...e){if(!s.enabled)return;const o=s,i=Number(new Date),a=i-(t||i);o.diff=a,o.prev=t,o.curr=i,t=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if("%%"===t)return"%";r++;const a=n.formatters[i];if("function"==typeof a){const n=e[r];t=a.call(o,n),e.splice(r,1),r--}return t}),n.formatArgs.call(o,e),(o.log||n.log).apply(o,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=o,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(i!==n.namespaces&&(i=n.namespaces,a=n.enabled(e)),a),set:e=>{r=e}}),"function"==typeof n.init&&n.init(s),s}function o(e,t){const o=n(this.namespace+(void 0===t?":":t)+e);return o.log=this.log,o}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){const e=[...n.names.map(i),...n.skips.map(i).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length;for(t=0;t{n[e]=t[e]}),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n0;)if(a===e[r])return o;i(t)}}Object.assign(v.prototype,{subscribe:function(e,t,n){var o=this,i=this._target,a=this._emitter,r=this._listeners,s=function(){var o=y.apply(null,arguments),r={data:o,name:t,original:e};n?!1!==n.call(i,r)&&a.emit.apply(a,[r.name].concat(o)):a.emit.apply(a,[t].concat(o))};if(r[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,a._newListener&&a._removeListener&&!o._onNewListener?(this._onNewListener=function(n){n===t&&null===r[e]&&(r[e]=s,o._on.call(i,e,s))},a.on("newListener",this._onNewListener),this._onRemoveListener=function(n){n===t&&!a.hasListeners(n)&&r[e]&&(r[e]=null,o._off.call(i,e,s))},r[e]=null,a.on("removeListener",this._onRemoveListener)):(r[e]=s,o._on.call(i,e,s))},unsubscribe:function(e){var t,n,o,i=this,a=this._listeners,r=this._emitter,s=this._off,l=this._target;if(e&&"string"!=typeof e)throw TypeError("event must be a string");function u(){i._onNewListener&&(r.off("newListener",i._onNewListener),r.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var e=j.call(r,i);r._observers.splice(e,1)}if(e){if(!(t=a[e]))return;s.call(l,e,t),delete a[e],--this._listenersCount||u()}else{for(o=(n=c(a)).length;o-- >0;)e=n[o],s.call(l,e,a[e]);this._listeners={},this._listenersCount=0,u()}}});var w=k(["function"]),_=k(["object","function"]);function T(e,t,n){var o,i,a,r=0,s=new e(function(l,u,p){function c(){i&&(i=null),r&&(clearTimeout(r),r=0)}n=b(n,{timeout:0,overload:!1},{timeout:function(e,t){return("number"!=typeof(e*=1)||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}});var d=function(e){c(),l(e)},f=function(e){c(),u(e)};(o=!n.overload&&"function"==typeof e.prototype.cancel&&"function"==typeof p)?t(d,f,p):(i=[function(e){f(e||Error("canceled"))}],t(d,f,function(e){if(a)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof e)throw TypeError("onCancel callback must be a function");i.push(e)}),a=!0),n.timeout>0&&(r=setTimeout(function(){var e=Error("timeout");e.code="ETIMEDOUT",r=0,s.cancel(e),u(e)},n.timeout))});return o||(s.cancel=function(e){if(i){for(var t=i.length,n=1;n