mybase 1.1.19 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mybase",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "",
5
5
  "main": "mybase.js",
6
6
  "scripts": {
@@ -25,13 +25,14 @@
25
25
  "validator": "^13.7.0",
26
26
  "@types/debug": "^4.1.12",
27
27
  "@types/ip6addr": "^0.2.6",
28
- "@types/jest": "^29.5.11",
29
28
  "@types/mysql": "^2.15.25",
30
29
  "@types/node": "^20.11.5",
31
- "@types/validator": "^13.11.8"
30
+ "@types/validator": "^13.11.8",
31
+ "@types/request": "^2.48.12"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@jest/globals": "^29.7.0",
35
+ "@types/jest": "^29.5.11",
35
36
  "chai": "^4.2.0",
36
37
  "jest": "^29.7.0",
37
38
  "mocha": "^8.2.1",
@@ -20,3 +20,4 @@ function Geoip2Paths() {
20
20
  };
21
21
  }
22
22
  exports.Geoip2Paths = Geoip2Paths;
23
+ //# sourceMappingURL=Geoip2Paths.js.map
@@ -0,0 +1 @@
1
+ export declare function MaxRuntimeHours(hours?: number): void;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MaxRuntimeHours = void 0;
4
+ function MaxRuntimeHours(hours = 24) {
5
+ setTimeout(() => {
6
+ console.log(`Max runtime of ${hours} hours reached, exiting`);
7
+ process.exit(0);
8
+ }, hours * 60 * 60 * 1000);
9
+ }
10
+ exports.MaxRuntimeHours = MaxRuntimeHours;
11
+ //# sourceMappingURL=MaxRuntimeHours.js.map
@@ -0,0 +1,7 @@
1
+
2
+ export function MaxRuntimeHours(hours:number=24) {
3
+ setTimeout(() => {
4
+ console.log(`Max runtime of ${hours} hours reached, exiting`)
5
+ process.exit(0)
6
+ }, hours * 60 * 60 * 1000)
7
+ }
@@ -11,3 +11,4 @@ function asJSON(inputString) {
11
11
  return false;
12
12
  }
13
13
  exports.asJSON = asJSON;
14
+ //# sourceMappingURL=asJSON.js.map
@@ -37,3 +37,4 @@ function fileCacheIsValid(cacheFileName, cache_in_minutes = 60) {
37
37
  return false;
38
38
  }
39
39
  exports.fileCacheIsValid = fileCacheIsValid;
40
+ //# sourceMappingURL=fileCacheIsValid.js.map
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
35
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
27
  };
@@ -39,34 +30,33 @@ exports.getMysql1 = void 0;
39
30
  const mysql1 = __importStar(require("mysql"));
40
31
  const debug_1 = __importDefault(require("debug"));
41
32
  const dbg = (0, debug_1.default)("getMysql1");
42
- function getMysql1(config, pingInterval = 0) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- return new Promise((resolve, reject) => {
45
- const mysql_client = mysql1.createConnection({
46
- host: config.host,
47
- port: config.port ? config.port : 3306,
48
- user: config.login,
49
- password: config.password,
50
- database: config.db
51
- });
52
- mysql_client.connect((err, res) => {
53
- if (err) {
54
- dbg(`mysql connection has failed to ${config.host}@${config.db}`, err);
55
- return reject(err);
56
- }
57
- dbg(`mysql connection has been established to ${config.host}@${config.db}`);
58
- // install a pinger every 30 seconds to keep the connection alive
59
- if (pingInterval > 0)
60
- setInterval(() => {
61
- mysql_client.ping(function (err) {
62
- if (err)
63
- return console.log(`could not ping mysql ${config.host}@${config.db}`, err.code);
64
- dbg(`mysql ${config.host}@${config.db} is pinging properly`);
65
- });
66
- }, pingInterval);
67
- resolve(mysql_client);
68
- });
33
+ async function getMysql1(config, pingInterval = 0) {
34
+ return new Promise((resolve, reject) => {
35
+ const mysql_client = mysql1.createConnection({
36
+ host: config.host,
37
+ port: config.port ? config.port : 3306,
38
+ user: config.login,
39
+ password: config.password,
40
+ database: config.db
41
+ });
42
+ mysql_client.connect((err, res) => {
43
+ if (err) {
44
+ dbg(`mysql connection has failed to ${config.host}@${config.db}`, err);
45
+ return reject(err);
46
+ }
47
+ dbg(`mysql connection has been established to ${config.host}@${config.db}`);
48
+ // install a pinger every 30 seconds to keep the connection alive
49
+ if (pingInterval > 0)
50
+ setInterval(() => {
51
+ mysql_client.ping(function (err) {
52
+ if (err)
53
+ return console.log(`could not ping mysql ${config.host}@${config.db}`, err.code);
54
+ dbg(`mysql ${config.host}@${config.db} is pinging properly`);
55
+ });
56
+ }, pingInterval);
57
+ resolve(mysql_client);
69
58
  });
70
59
  });
71
60
  }
72
61
  exports.getMysql1 = getMysql1;
62
+ //# sourceMappingURL=getMysql1.js.map
@@ -1,3 +1,4 @@
1
+ import { Connection } from "mysql2";
1
2
  export type Mysql2ServerConfiguration = {
2
3
  host: string;
3
4
  port: number;
@@ -5,4 +6,4 @@ export type Mysql2ServerConfiguration = {
5
6
  password: string;
6
7
  db: string;
7
8
  };
8
- export declare function getMysql2(config: Mysql2ServerConfiguration, pingInterval?: number): Promise<unknown>;
9
+ export declare function getMysql2(config: Mysql2ServerConfiguration, pingInterval?: number): Promise<Connection>;
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
35
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
27
  };
@@ -39,34 +30,33 @@ exports.getMysql2 = void 0;
39
30
  const mysql2 = __importStar(require("mysql2"));
40
31
  const debug_1 = __importDefault(require("debug"));
41
32
  const dbg = (0, debug_1.default)("getMysql2");
42
- function getMysql2(config, pingInterval = 0) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- return new Promise((resolve, reject) => {
45
- const mysql_client = mysql2.createConnection({
46
- host: config.host,
47
- port: config.port ? config.port : 3306,
48
- user: config.login,
49
- password: config.password,
50
- database: config.db
51
- });
52
- mysql_client.connect((err) => {
53
- if (err) {
54
- dbg(`mysql connection has failed to ${config.host}@${config.db}`, err);
55
- return reject(err);
56
- }
57
- dbg(`mysql connection has been established to ${config.host}@${config.db}`);
58
- // install a pinger every 30 seconds to keep the connection alive
59
- if (pingInterval > 0)
60
- setInterval(() => {
61
- mysql_client.ping(function (err) {
62
- if (err)
63
- return console.log(`could not ping mysql ${config.host}@${config.db}`, err.code);
64
- dbg(`mysql ${config.host}@${config.db} is pinging properly`);
65
- });
66
- }, pingInterval);
67
- resolve(mysql_client);
68
- });
33
+ async function getMysql2(config, pingInterval = 0) {
34
+ return new Promise((resolve, reject) => {
35
+ const mysql_client = mysql2.createConnection({
36
+ host: config.host,
37
+ port: config.port ? config.port : 3306,
38
+ user: config.login,
39
+ password: config.password,
40
+ database: config.db
41
+ });
42
+ mysql_client.connect((err) => {
43
+ if (err) {
44
+ dbg(`mysql connection has failed to ${config.host}@${config.db}`, err);
45
+ return reject(err);
46
+ }
47
+ dbg(`mysql connection has been established to ${config.host}@${config.db}`);
48
+ // install a pinger every 30 seconds to keep the connection alive
49
+ if (pingInterval > 0)
50
+ setInterval(() => {
51
+ mysql_client.ping(function (err) {
52
+ if (err)
53
+ return console.log(`could not ping mysql ${config.host}@${config.db}`, err.code);
54
+ dbg(`mysql ${config.host}@${config.db} is pinging properly`);
55
+ });
56
+ }, pingInterval);
57
+ resolve(mysql_client);
69
58
  });
70
59
  });
71
60
  }
72
61
  exports.getMysql2 = getMysql2;
62
+ //# sourceMappingURL=getMysql2.js.map
@@ -1,5 +1,5 @@
1
1
  import * as mysql2 from "mysql2"
2
- import { QueryError } from "mysql2"
2
+ import { QueryError,Connection } from "mysql2"
3
3
  import debug from "debug"
4
4
  const dbg = debug("getMysql2")
5
5
 
@@ -11,7 +11,7 @@ export type Mysql2ServerConfiguration = {
11
11
  db: string
12
12
  }
13
13
 
14
- export async function getMysql2(config: Mysql2ServerConfiguration, pingInterval: number = 0) {
14
+ export async function getMysql2(config: Mysql2ServerConfiguration, pingInterval: number = 0):Promise<Connection> {
15
15
  return new Promise((resolve, reject) => {
16
16
  const mysql_client = mysql2.createConnection({
17
17
  host: config.host,
@@ -8,3 +8,4 @@ function hash_sha512(plainString) {
8
8
  return "";
9
9
  }
10
10
  exports.hash_sha512 = hash_sha512;
11
+ //# sourceMappingURL=hash_sha512.js.map
@@ -36,3 +36,4 @@ function initMysql2Pool(sqlServer) {
36
36
  return mysql2.createPool(connectionUri);
37
37
  }
38
38
  exports.initMysql2Pool = initMysql2Pool;
39
+ //# sourceMappingURL=initMysql2Pool.js.map
@@ -15,3 +15,4 @@ function int2ip(ipInt) {
15
15
  return ip4;
16
16
  }
17
17
  exports.int2ip = int2ip;
18
+ //# sourceMappingURL=int2ip.js.map
@@ -15,3 +15,4 @@ function ip2int(ip) {
15
15
  return ip.split('.').reduce(function (ipInt, octet) { return (ipInt << 8) + parseInt(octet, 10); }, 0) >>> 0;
16
16
  }
17
17
  exports.ip2int = ip2int;
18
+ //# sourceMappingURL=ip2int.js.map
@@ -44,3 +44,4 @@ function isLANIp(ip) {
44
44
  return false;
45
45
  }
46
46
  exports.isLANIp = isLANIp;
47
+ //# sourceMappingURL=isLANIp.js.map
@@ -9,3 +9,4 @@ function isLocal() {
9
9
  return (os_1.default.type() === 'Darwin');
10
10
  }
11
11
  exports.isLocal = isLocal;
12
+ //# sourceMappingURL=isLocal.js.map
@@ -37,3 +37,4 @@ function isLoopbackIP(ip) {
37
37
  return false;
38
38
  }
39
39
  exports.isLoopbackIP = isLoopbackIP;
40
+ //# sourceMappingURL=isLoopbackIP.js.map
@@ -16,3 +16,4 @@ function promiseTimeout(miliseconds, inputPromise, onTimeout = 'TIMEDOUT') {
16
16
  ]);
17
17
  }
18
18
  exports.promiseTimeout = promiseTimeout;
19
+ //# sourceMappingURL=promiseTimeout.js.map
@@ -8,3 +8,4 @@ function randomIP() {
8
8
  return int2ip(Math.random() * Math.pow(2, 32));
9
9
  }
10
10
  exports.randomIP = randomIP;
11
+ //# sourceMappingURL=randomIP.js.map
@@ -14,3 +14,4 @@ function randomIP6() {
14
14
  return ip6_1.default.abbreviate(ip6_1.default.normalize(((_a = bytes.toString('hex').match(/.{1,4}/g)) === null || _a === void 0 ? void 0 : _a.join(':')) || '0000:0000:0000:0000:0000:0000:0000:0000'));
15
15
  }
16
16
  exports.randomIP6 = randomIP6;
17
+ //# sourceMappingURL=randomIP6.js.map
@@ -5,3 +5,4 @@ function randomString(length = 10, charSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefgh
5
5
  return Array.from({ length }, () => charSet.charAt(Math.floor(Math.random() * charSet.length))).join('');
6
6
  }
7
7
  exports.randomString = randomString;
8
+ //# sourceMappingURL=randomString.js.map
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
25
  Object.defineProperty(exports, "__esModule", { value: true });
35
26
  exports.randomTCPPort = void 0;
36
27
  const net = __importStar(require("net"));
@@ -45,56 +36,53 @@ const net = __importStar(require("net"));
45
36
  * @param tries the number of tries to find a port number
46
37
  * @param host the host to bind to
47
38
  */
48
- function randomTCPPort(timeout = 1000, fromPort = 1025, untilPort = 65534, tries = 1000, host = '127.0.0.1') {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- return new Promise(function (resolve, reject) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- // check if the given port range is valid
53
- if (fromPort > untilPort)
54
- return resolve(false);
55
- // check if the given port range is valid
56
- if (fromPort < 0 || untilPort < 0)
57
- return resolve(false);
58
- // check if the given port range is valid
59
- if (fromPort > 65535 || untilPort > 65535)
60
- return resolve(false);
61
- // this function shall return a random port number that is not in use and we should validate this port number by trying to listen to it and releasing
62
- // this port number immediately
63
- // this function should be used for testing purposes only
64
- // this function is not suitable for production use
65
- while (true && tries > 0) {
66
- tries--;
67
- let port = Math.floor(Math.random() * (untilPort - fromPort + 1) + fromPort);
68
- let server = net.createServer();
69
- let checkPort = new Promise((resolveInner, reject) => {
70
- server.on('error', (err) => {
71
- // any error should raise problem
72
- resolveInner(false);
73
- });
74
- server.on('listening', () => {
75
- resolveInner(true);
76
- });
77
- });
78
- server.listen(port, host);
79
- let result = yield checkPort;
80
- if (result) {
81
- let to = setTimeout(() => {
82
- return resolve(port);
83
- }, 1000);
84
- server.on('close', () => {
85
- clearTimeout(to);
86
- return resolve(port);
87
- });
88
- server.close();
89
- return;
90
- }
91
- else
92
- server.close();
93
- }
94
- if (tries === 0)
95
- return resolve(false);
39
+ async function randomTCPPort(timeout = 1000, fromPort = 1025, untilPort = 65534, tries = 1000, host = '127.0.0.1') {
40
+ return new Promise(async function (resolve, reject) {
41
+ // check if the given port range is valid
42
+ if (fromPort > untilPort)
43
+ return resolve(false);
44
+ // check if the given port range is valid
45
+ if (fromPort < 0 || untilPort < 0)
46
+ return resolve(false);
47
+ // check if the given port range is valid
48
+ if (fromPort > 65535 || untilPort > 65535)
49
+ return resolve(false);
50
+ // this function shall return a random port number that is not in use and we should validate this port number by trying to listen to it and releasing
51
+ // this port number immediately
52
+ // this function should be used for testing purposes only
53
+ // this function is not suitable for production use
54
+ while (true && tries > 0) {
55
+ tries--;
56
+ let port = Math.floor(Math.random() * (untilPort - fromPort + 1) + fromPort);
57
+ let server = net.createServer();
58
+ let checkPort = new Promise((resolveInner, reject) => {
59
+ server.on('error', (err) => {
60
+ // any error should raise problem
61
+ resolveInner(false);
62
+ });
63
+ server.on('listening', () => {
64
+ resolveInner(true);
65
+ });
96
66
  });
97
- });
67
+ server.listen(port, host);
68
+ let result = await checkPort;
69
+ if (result) {
70
+ let to = setTimeout(() => {
71
+ return resolve(port);
72
+ }, 1000);
73
+ server.on('close', () => {
74
+ clearTimeout(to);
75
+ return resolve(port);
76
+ });
77
+ server.close();
78
+ return;
79
+ }
80
+ else
81
+ server.close();
82
+ }
83
+ if (tries === 0)
84
+ return resolve(false);
98
85
  });
99
86
  }
100
87
  exports.randomTCPPort = randomTCPPort;
88
+ //# sourceMappingURL=randomTCPPort.js.map
@@ -1,4 +1,3 @@
1
- import { wait } from './wait'
2
1
  import * as net from 'net'
3
2
 
4
3
  /**
@@ -28,3 +28,4 @@ function randomUTFString(minLength, maxLength, includeAscii = true) {
28
28
  return result;
29
29
  }
30
30
  exports.randomUTFString = randomUTFString;
31
+ //# sourceMappingURL=randomUTFString.js.map
@@ -5,3 +5,4 @@ function utcnow() {
5
5
  return Math.floor(Date.now() / 1000);
6
6
  }
7
7
  exports.utcnow = utcnow;
8
+ //# sourceMappingURL=utcnow.js.map
@@ -18,3 +18,4 @@ function validEmail(email) {
18
18
  return (/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/).test(email);
19
19
  }
20
20
  exports.validEmail = validEmail;
21
+ //# sourceMappingURL=validEmail.js.map
@@ -29,3 +29,4 @@ function validIp(IPAddress) {
29
29
  return net.isIP(IPAddress);
30
30
  }
31
31
  exports.validIp = validIp;
32
+ //# sourceMappingURL=validIp.js.map
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.vaultFill = void 0;
13
4
  const debug_1 = require("debug");
@@ -19,31 +10,29 @@ function vaultFill(vaultInstance, inputObject, ignoreError = false, keepCache =
19
10
  // if you call it again, it does reload the configuration
20
11
  // v2.2
21
12
  // supports keepCache - if vault fails, we will keep previous values instead of filling with false
22
- return new Promise(function (resolve, reject) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- let vaultKeys = Array();
25
- let vaultResults = {};
26
- findVaultKeyMappings(inputObject, vaultKeys);
27
- // read these keys from vault
28
- for (let idx in vaultKeys) {
29
- const val = vaultKeys[idx];
30
- if (typeof val !== "string")
31
- continue;
32
- try {
33
- let got = yield (0, vaultRead_1.vaultRead)(vaultInstance, vaultKeys[idx]);
34
- got['__vaultkey'] = val;
35
- got['__vaultfilled'] = Date.now();
36
- vaultResults[val] = got;
37
- }
38
- catch (err) {
39
- dbg(`Could not read vaultKey '${val}'`, err);
40
- if (!ignoreError)
41
- vaultResults[val] = false;
42
- }
13
+ return new Promise(async function (resolve, reject) {
14
+ let vaultKeys = Array();
15
+ let vaultResults = {};
16
+ findVaultKeyMappings(inputObject, vaultKeys);
17
+ // read these keys from vault
18
+ for (let idx in vaultKeys) {
19
+ const val = vaultKeys[idx];
20
+ if (typeof val !== "string")
21
+ continue;
22
+ try {
23
+ let got = await (0, vaultRead_1.vaultRead)(vaultInstance, vaultKeys[idx]);
24
+ got['__vaultkey'] = val;
25
+ got['__vaultfilled'] = Date.now();
26
+ vaultResults[val] = got;
27
+ }
28
+ catch (err) {
29
+ dbg(`Could not read vaultKey '${val}'`, err);
30
+ if (!ignoreError)
31
+ vaultResults[val] = false;
43
32
  }
44
- fillVaultKeyMappings(inputObject, vaultResults, keepCache);
45
- resolve(true);
46
- });
33
+ }
34
+ fillVaultKeyMappings(inputObject, vaultResults, keepCache);
35
+ resolve(true);
47
36
  });
48
37
  }
49
38
  exports.vaultFill = vaultFill;
@@ -94,3 +83,4 @@ function fillVaultKeyMappings(config, vaultResults, keepCache = true) {
94
83
  }
95
84
  }
96
85
  }
86
+ //# sourceMappingURL=vaultFill.js.map
@@ -49,3 +49,4 @@ function vaultRead(vaultInstance, vaultKey, cache_in_minutes = 10) {
49
49
  });
50
50
  }
51
51
  exports.vaultRead = vaultRead;
52
+ //# sourceMappingURL=vaultRead.js.map
package/ts/funcs/wait.js CHANGED
@@ -7,3 +7,4 @@ function wait(seconds = 1) {
7
7
  });
8
8
  }
9
9
  exports.wait = wait;
10
+ //# sourceMappingURL=wait.js.map
package/ts/global.js CHANGED
@@ -13,3 +13,4 @@ try {
13
13
  catch (e) {
14
14
  console.log(e);
15
15
  }
16
+ //# sourceMappingURL=global.js.map
package/ts/index.d.ts CHANGED
@@ -22,3 +22,4 @@ export * from "./funcs/getMysql1";
22
22
  export * from "./funcs/getMysql2";
23
23
  export * from "./funcs/initMysql2Pool";
24
24
  export * from "./funcs/randomUTFString";
25
+ export * from "./funcs/MaxRuntimeHours";
package/ts/index.js CHANGED
@@ -38,3 +38,5 @@ __exportStar(require("./funcs/getMysql1"), exports);
38
38
  __exportStar(require("./funcs/getMysql2"), exports);
39
39
  __exportStar(require("./funcs/initMysql2Pool"), exports);
40
40
  __exportStar(require("./funcs/randomUTFString"), exports);
41
+ __exportStar(require("./funcs/MaxRuntimeHours"), exports);
42
+ //# sourceMappingURL=index.js.map
package/ts/index.ts CHANGED
@@ -21,4 +21,5 @@ export * from "./funcs/isLANIp"
21
21
  export * from "./funcs/getMysql1"
22
22
  export * from "./funcs/getMysql2"
23
23
  export * from "./funcs/initMysql2Pool"
24
- export * from "./funcs/randomUTFString"
24
+ export * from "./funcs/randomUTFString"
25
+ export * from "./funcs/MaxRuntimeHours"
package/ts/types.js CHANGED
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
package/tsconfig.json CHANGED
@@ -1,113 +1,34 @@
1
1
  {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
-
5
- /* Projects */
6
- // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
- // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
-
13
- /* Language and Environment */
14
- "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
- // "jsx": "preserve", /* Specify what JSX code is generated. */
17
- // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
18
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
- // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
-
27
- /* Modules */
28
- "module": "commonjs", /* Specify what module code is generated. */
29
- // "rootDir": "./", /* Specify the root folder within your source files. */
30
- // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
31
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
- // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
39
- // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
40
- // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
41
- // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
42
- // "resolveJsonModule": true, /* Enable importing .json files. */
43
- // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
44
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
45
-
46
- /* JavaScript Support */
47
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
48
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
49
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
50
-
51
- /* Emit */
52
- "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
53
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
54
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
55
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
56
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
57
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58
- // "outDir": "./", /* Specify an output folder for all emitted files. */
59
- // "removeComments": true, /* Disable emitting comments. */
60
- // "noEmit": true, /* Disable emitting files from a compilation. */
61
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
62
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
63
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
64
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
65
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
66
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
67
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
68
- // "newLine": "crlf", /* Set the newline character for emitting files. */
69
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
70
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
71
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
72
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
73
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
74
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
75
-
76
- /* Interop Constraints */
77
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
78
- // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
79
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
80
- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
81
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
82
- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
83
-
84
- /* Type Checking */
85
- "strict": true, /* Enable all strict type-checking options. */
86
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
87
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
88
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
89
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
90
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
91
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
92
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
93
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
99
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
100
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
101
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
102
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
103
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
104
-
105
- /* Completeness */
106
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
108
-
2
+ "compilerOptions": {
3
+ "target": "es2017",
4
+ "experimentalDecorators": true,
5
+ "emitDecoratorMetadata": true,
6
+ "module": "commonjs",
7
+ "moduleResolution" : "Node",
8
+ "esModuleInterop": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "strict": true,
11
+ "noImplicitReturns": true, // Report error when not all code paths in function return a value
12
+ "noUnusedLocals": true, // Report errors on unused locals
13
+ // "noUnusedParameters": true, // Report errors on unused parameters
14
+ "noFallthroughCasesInSwitch": true, // Report errors for fallthrough cases in switch statement
15
+ // "noUncheckedIndexedAccess": true, // Include 'undefined' in index signature results
16
+ "noImplicitAny": true, // Raise error on expressions and declarations with an implied 'any' type
17
+ "strictNullChecks": true, // Enable strict null checking
18
+ "strictFunctionTypes": true, // Ensure function parameter types match
19
+ "strictBindCallApply": true, // Ensure 'bind', 'call', and 'apply' methods match function types
20
+ "strictPropertyInitialization": true, // Ensure non-undefined class properties are initialized in the constructor
21
+ "alwaysStrict": true, // Parse in strict mode and emit "use strict" for each source file
22
+ "sourceMap": true,
23
+ "skipLibCheck": true,
24
+ "baseUrl": ".",
25
+ "paths": {
26
+ "@root/*": ["./*"],
27
+ "@models/*": ["./models/*"],
28
+ "@inc/*": ["./inc/ts/*"]
29
+ }
109
30
  },
110
31
  "exclude": [
111
- "**/*.test.ts",
32
+ "**/*.test.ts"
112
33
  ]
113
- }
34
+ }