Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
25f7ad37ae | |||
992d167a34 | |||
cfcfde2132 | |||
b5ab945501 | |||
88378e2f31 | |||
db92311daa | |||
36bff0a70a | |||
fa8fd9fa35 | |||
dd783b455f | |||
996685e7fb | |||
110b2c00cf | |||
c8b455b8e2 | |||
d16fd8b69b | |||
f7ed88cd57 | |||
19b5ba4a5d | |||
457182a97a | |||
a7a961c869 | |||
f1d7771e30 | |||
ff16b70206 | |||
8e43ce7e9b |
172
package-lock.json
generated
172
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smarttime",
|
"name": "@pushrocks/smarttime",
|
||||||
"version": "3.0.26",
|
"version": "3.0.36",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1309,9 +1309,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@gitzone/tstest": {
|
"@gitzone/tstest": {
|
||||||
"version": "1.0.44",
|
"version": "1.0.52",
|
||||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.44.tgz",
|
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.52.tgz",
|
||||||
"integrity": "sha512-IzQ9mEboN17Vgm/ecW2GtJa8FsnxDawD0PTeWfvtFbS4KNcqOxVM/gkkO7H4f1eJuzDaMvKWlsjBt2DBRhKqSg==",
|
"integrity": "sha512-9n6mhGAd1MKMb4lcXstJvoG9bIl+mb+M9wdajbFe/jzv9q62P5RL9pSdyW4Yk8I7ObJmyggBvr8cLaOUsaqzAQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@gitzone/tsbundle": "^1.0.78",
|
"@gitzone/tsbundle": "^1.0.78",
|
||||||
@ -1321,7 +1321,7 @@
|
|||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.10",
|
||||||
"@pushrocks/smartexpress": "^3.0.76",
|
"@pushrocks/smartexpress": "^3.0.76",
|
||||||
"@pushrocks/smartfile": "^8.0.0",
|
"@pushrocks/smartfile": "^8.0.0",
|
||||||
"@pushrocks/smartlog": "^2.0.36",
|
"@pushrocks/smartlog": "^2.0.39",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@pushrocks/smartshell": "^2.0.25",
|
"@pushrocks/smartshell": "^2.0.25",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^3.2.9",
|
||||||
@ -1330,22 +1330,60 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartfile": {
|
"@pushrocks/smartfile": {
|
||||||
"version": "8.0.0",
|
"version": "8.0.5",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-8.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-8.0.5.tgz",
|
||||||
"integrity": "sha512-A5uk7O3UZBXt0obIkQDpN9eihQwq4PVryr21xTv9Uw573mJWGfGB/xs07tdC6Qgbtlvl7i2vXl5qmKFDRky9Mg==",
|
"integrity": "sha512-mptjn41uTOHX5j2mecLlBkdLtRX5HPgIi2x6CLMZpB2NDTitj9elUej/puvLYWuNR+uGmCVG/UgXgW5fYVq5gw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"@pushrocks/smartfile-interfaces": "^1.0.7",
|
||||||
"@pushrocks/smarthash": "^2.1.6",
|
"@pushrocks/smarthash": "^2.1.6",
|
||||||
|
"@pushrocks/smartjson": "^4.0.3",
|
||||||
"@pushrocks/smartmime": "^1.0.3",
|
"@pushrocks/smartmime": "^1.0.3",
|
||||||
"@pushrocks/smartpath": "^4.0.3",
|
"@pushrocks/smartpath": "^4.0.3",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@pushrocks/smartrequest": "^1.1.47",
|
"@pushrocks/smartrequest": "^1.1.51",
|
||||||
"@types/fs-extra": "^9.0.1",
|
"@types/fs-extra": "^9.0.1",
|
||||||
|
"@types/glob": "^7.1.3",
|
||||||
|
"@types/js-yaml": "^3.12.5",
|
||||||
"fs-extra": "^9.0.1",
|
"fs-extra": "^9.0.1",
|
||||||
"glob": "^7.1.6",
|
"glob": "^7.1.6",
|
||||||
"js-yaml": "^3.14.0"
|
"js-yaml": "^3.14.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@pushrocks/smartjson": {
|
||||||
|
"version": "4.0.4",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartjson/-/smartjson-4.0.4.tgz",
|
||||||
|
"integrity": "sha512-kmjTn8qY8w0iVMfX7/0I1J3rZ12g7K+v15zNbG4rl5BOvt/uBySebG/oRijvRgVmGtV4rbYOsGOsciC+MA+tRQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/buffer-json": "^2.0.0",
|
||||||
|
"@types/fast-json-stable-stringify": "^2.0.0",
|
||||||
|
"buffer-json": "^2.0.0",
|
||||||
|
"fast-json-stable-stringify": "^2.1.0",
|
||||||
|
"lodash.clonedeep": "^4.5.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@pushrocks/smartlog": {
|
||||||
|
"version": "2.0.39",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartlog/-/smartlog-2.0.39.tgz",
|
||||||
|
"integrity": "sha512-fHCoBLwKM+F3jN5nZH6QEcEVWtgyESN+ysT9KLxmM/wrhIibG98yLxp6kwfZZbv6aKmHWbtKEvBmv+Vd4Hfwlg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@pushrocks/isounique": "^1.0.4",
|
||||||
|
"@pushrocks/smartlog-interfaces": "^2.0.20"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@pushrocks/smartrequest": {
|
||||||
|
"version": "1.1.51",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrequest/-/smartrequest-1.1.51.tgz",
|
||||||
|
"integrity": "sha512-RJUvo7MEIAm+gFueJrmf8LcpVals5jp7PgOZ+ebGTvDoVwCpor0Z6nmJDOs9ykjFCIvvPhfiterQeb6hJr2uDw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
|
"agentkeepalive": "^4.1.3",
|
||||||
|
"form-data": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/fs-extra": {
|
"@types/fs-extra": {
|
||||||
"version": "9.0.1",
|
"version": "9.0.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2ffs-extra/-/fs-extra-9.0.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2ffs-extra/-/fs-extra-9.0.1.tgz",
|
||||||
@ -1355,6 +1393,28 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"agentkeepalive": {
|
||||||
|
"version": "4.1.3",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/agentkeepalive/-/agentkeepalive-4.1.3.tgz",
|
||||||
|
"integrity": "sha512-wn8fw19xKZwdGPO47jivonaHRTd+nGOMP1z11sgGeQzDy2xd5FG0R67dIMcKHDE2cJ5y+YXV30XVGUBPRSY7Hg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"debug": "^4.1.0",
|
||||||
|
"depd": "^1.1.2",
|
||||||
|
"humanize-ms": "^1.2.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"form-data": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/form-data/-/form-data-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fs-extra": {
|
"fs-extra": {
|
||||||
"version": "9.0.1",
|
"version": "9.0.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/fs-extra/-/fs-extra-9.0.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/fs-extra/-/fs-extra-9.0.1.tgz",
|
||||||
@ -1646,6 +1706,12 @@
|
|||||||
"js-yaml": "^3.13.1"
|
"js-yaml": "^3.13.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@pushrocks/smartfile-interfaces": {
|
||||||
|
"version": "1.0.7",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile-interfaces/-/smartfile-interfaces-1.0.7.tgz",
|
||||||
|
"integrity": "sha512-C/v9Scbx1J+ByMk3YBZrlLRYXdObty/Uz/h6kSZqsO8ghYuT9l7OVpEcyduiSVPakaMi6YnzfME3Nfs3oLj//Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@pushrocks/smarthash": {
|
"@pushrocks/smarthash": {
|
||||||
"version": "2.1.6",
|
"version": "2.1.6",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarthash/-/smarthash-2.1.6.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarthash/-/smarthash-2.1.6.tgz",
|
||||||
@ -2003,16 +2069,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smarttime": {
|
"@pushrocks/smarttime": {
|
||||||
"version": "3.0.24",
|
"version": "3.0.35",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.24.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.35.tgz",
|
||||||
"integrity": "sha512-c/n0Y3CUnVNa3TnuXZ5aRc0bWj4RX7+XSjPes1J4HidU1yBOd9UOt6l08W8aPH5jMjT9Ei2jH0GsheaTGoVEYA==",
|
"integrity": "sha512-KBDprr2gMcw+21kD6GkJ0Y9fc/SuMijhFPDKoBmuCW9Nhn+KAnabCB8Qn8OzeUuQcoHQ3SFJ/4KioJWNxMgxaQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/lik": "^4.0.13",
|
"@pushrocks/lik": "^4.0.17",
|
||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.10",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"croner": "^1.1.23",
|
"croner": "^1.1.23",
|
||||||
"dayjs": "^1.8.29",
|
"dayjs": "^1.8.35",
|
||||||
"is-nan": "^1.3.0"
|
"is-nan": "^1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2171,6 +2237,12 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/buffer-json": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@types%2fbuffer-json/-/buffer-json-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-nFKOrY93Tvv5Tobws+YbkGlPOJsn1nVpZah3BlSyQ4EniFm97KLvSr54tZ5xQp8mlf/XxbYwskNCYQB9EdrPlQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/chai": {
|
"@types/chai": {
|
||||||
"version": "4.2.11",
|
"version": "4.2.11",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.2.11.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.2.11.tgz",
|
||||||
@ -2305,6 +2377,16 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/glob": {
|
||||||
|
"version": "7.1.3",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@types%2fglob/-/glob-7.1.3.tgz",
|
||||||
|
"integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/minimatch": "*",
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/helmet": {
|
"@types/helmet": {
|
||||||
"version": "0.0.47",
|
"version": "0.0.47",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fhelmet/-/helmet-0.0.47.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fhelmet/-/helmet-0.0.47.tgz",
|
||||||
@ -2325,6 +2407,12 @@
|
|||||||
"@types/uglify-js": "*"
|
"@types/uglify-js": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/js-yaml": {
|
||||||
|
"version": "3.12.5",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@types%2fjs-yaml/-/js-yaml-3.12.5.tgz",
|
||||||
|
"integrity": "sha512-JCcp6J0GV66Y4ZMDAQCXot4xprYB+Zfd3meK9+INSJeVZwJmHAW30BBEEkPzXswMXuiyReUGOP3GxrADc9wPww==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/mime": {
|
"@types/mime": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fmime/-/mime-2.0.3.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fmime/-/mime-2.0.3.tgz",
|
||||||
@ -2343,9 +2431,9 @@
|
|||||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "14.6.2",
|
"version": "14.11.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.6.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.11.2.tgz",
|
||||||
"integrity": "sha512-onlIwbaeqvZyniGPfdw/TEhKIh79pz66L1q06WUQqJLnAb6wbjvOtepLYTGHTqzdXgBYIE3ZdmqHDGsRsbBz7A==",
|
"integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/parcel-bundler": {
|
"@types/parcel-bundler": {
|
||||||
@ -2358,9 +2446,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/puppeteer": {
|
"@types/puppeteer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.5",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fpuppeteer/-/puppeteer-2.1.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fpuppeteer/-/puppeteer-2.1.5.tgz",
|
||||||
"integrity": "sha512-rNPCKZ+PuHR11au5Qu36TK63i9ppcdvREyEUd45jGc9Yj4AsoLpiCm22ebwDDRSzNc1N2+XOmaa5i6ZSW8FOMQ==",
|
"integrity": "sha512-ZZKAcX5XVEtSK+CLxz6FhofPt8y1D3yDtjGZHDFBZ4bGe8v2aaS6qBDHY4crruvpb4jsO7HKrPEx39IIqsZAUg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
@ -3234,6 +3322,12 @@
|
|||||||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
|
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"buffer-json": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/buffer-json/-/buffer-json-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-+jjPFVqyfF1esi9fvfUs3NqM0pH1ziZ36VP4hmA/y/Ssfo/5w5xHKfTw9BwQjoJ1w/oVtpLomqwUHKdefGyuHw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"buffer-xor": {
|
"buffer-xor": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/buffer-xor/-/buffer-xor-1.0.3.tgz",
|
"resolved": "https://verdaccio.lossless.one/buffer-xor/-/buffer-xor-1.0.3.tgz",
|
||||||
@ -3922,9 +4016,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"crypto-random-string": {
|
"crypto-random-string": {
|
||||||
"version": "3.2.0",
|
"version": "3.3.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/crypto-random-string/-/crypto-random-string-3.2.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/crypto-random-string/-/crypto-random-string-3.3.0.tgz",
|
||||||
"integrity": "sha512-8vPu5bsKaq2uKRy3OL7h1Oo7RayAWB8sYexLKAqvCXVib8SxgbmoF1IN4QMKjBv8uI8mp5gPPMbiRah25GMrVQ==",
|
"integrity": "sha512-teWAwfMb1d6brahYyKqcBEb5Yp8PJPvPOdOonXDnvaKOTmKDFNVE8E3Y2XQuzjNV/3XMwHbrX9fHWvrhRKt4Gg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"type-fest": "^0.8.1"
|
"type-fest": "^0.8.1"
|
||||||
@ -4232,9 +4326,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dayjs": {
|
"dayjs": {
|
||||||
"version": "1.8.35",
|
"version": "1.9.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/dayjs/-/dayjs-1.8.35.tgz",
|
"resolved": "https://verdaccio.lossless.one/dayjs/-/dayjs-1.9.1.tgz",
|
||||||
"integrity": "sha512-isAbIEenO4ilm6f8cpqvgjZCsuerDAz2Kb7ri201AiNn58aqXuaLJEnCtfIMdCvERZHNGRY5lDMTr/jdAnKSWQ=="
|
"integrity": "sha512-01NCTBg8cuMJG1OQc6PR7T66+AFYiPwgDvdJmvJBn29NGzIG+DIFxPLNjHzwz3cpFIvG+NcwIjP9hSaPVoOaDg=="
|
||||||
},
|
},
|
||||||
"deasync": {
|
"deasync": {
|
||||||
"version": "0.1.20",
|
"version": "0.1.20",
|
||||||
@ -6559,9 +6653,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ip-regex": {
|
"ip-regex": {
|
||||||
"version": "4.1.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/ip-regex/-/ip-regex-4.1.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/ip-regex/-/ip-regex-4.2.0.tgz",
|
||||||
"integrity": "sha512-pKnZpbgCTfH/1NLIlOduP/V+WRXzC2MOz3Qo8xmxk8C5GudJLgK5QyLVXOSWy3ParAH7Eemurl3xjv/WXYFvMA==",
|
"integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ipaddr.js": {
|
"ipaddr.js": {
|
||||||
@ -7610,9 +7704,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node-fetch": {
|
"node-fetch": {
|
||||||
"version": "2.6.0",
|
"version": "2.6.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/node-fetch/-/node-fetch-2.6.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==",
|
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node-forge": {
|
"node-forge": {
|
||||||
@ -9661,12 +9755,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sitemap": {
|
"sitemap": {
|
||||||
"version": "6.2.0",
|
"version": "6.3.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/sitemap/-/sitemap-6.2.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/sitemap/-/sitemap-6.3.2.tgz",
|
||||||
"integrity": "sha512-ta9BLo/ZLUNgfGVhknA2IHWuIXfcFPxMvMCY3Xhf141rEZoW8G5nIVCDR0/zeXJCAvWk+UzqxyLBtRBH1OOq6w==",
|
"integrity": "sha512-JmOG+bYzUfqXFfvh4JZocRvjrPGJddCWuDqiCTDe8me28CGCkWHYRtTFyTnmZu4x0SoD/6KNDGd88Fc5wBYlfQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "^14.0.18",
|
"@types/node": "^14.11.1",
|
||||||
"@types/sax": "^1.2.1",
|
"@types/sax": "^1.2.1",
|
||||||
"arg": "^4.1.3",
|
"arg": "^4.1.3",
|
||||||
"sax": "^1.2.4"
|
"sax": "^1.2.4"
|
||||||
@ -10246,9 +10340,9 @@
|
|||||||
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
|
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
|
||||||
},
|
},
|
||||||
"systeminformation": {
|
"systeminformation": {
|
||||||
"version": "4.27.3",
|
"version": "4.27.7",
|
||||||
"resolved": "https://verdaccio.lossless.one/systeminformation/-/systeminformation-4.27.3.tgz",
|
"resolved": "https://verdaccio.lossless.one/systeminformation/-/systeminformation-4.27.7.tgz",
|
||||||
"integrity": "sha512-0Nc8AYEK818h7FI+bbe/kj7xXsMD5zOHvO9alUqQH/G4MHXu5tHQfWqC/bzWOk4JtoQPhnyLgxMYncDA2eeSBw==",
|
"integrity": "sha512-3ozUwGSf5jmrhGgOXlX/O6hk1KQ28XPb7d3NiPZX267QmimuDq3TuIgnkw+vICUrGJGKWPLKmXVASnuJ3w07nw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"terser": {
|
"terser": {
|
||||||
|
10
package.json
10
package.json
@ -1,23 +1,23 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smarttime",
|
"name": "@pushrocks/smarttime",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "3.0.26",
|
"version": "3.0.36",
|
||||||
"description": "handle time in smart ways",
|
"description": "handle time in smart ways",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest ./test/)",
|
"test": "(tstest ./test)",
|
||||||
"build": "(tsbuild --web && tsbundle npm)"
|
"build": "(tsbuild --web && tsbundle npm)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.25",
|
"@gitzone/tsbuild": "^2.1.25",
|
||||||
"@gitzone/tsbundle": "^1.0.78",
|
"@gitzone/tsbundle": "^1.0.78",
|
||||||
"@gitzone/tsrun": "^1.2.12",
|
"@gitzone/tsrun": "^1.2.12",
|
||||||
"@gitzone/tstest": "^1.0.44",
|
"@gitzone/tstest": "^1.0.52",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^3.2.9",
|
||||||
"@types/node": "^14.6.2",
|
"@types/node": "^14.11.2",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.10",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"croner": "^1.1.23",
|
"croner": "^1.1.23",
|
||||||
"dayjs": "^1.8.35",
|
"dayjs": "^1.9.1",
|
||||||
"is-nan": "^1.3.0"
|
"is-nan": "^1.3.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -12,7 +12,7 @@ tap.test('should create a valid instance of cronmanager', async () => {
|
|||||||
tap.test('should create a valid cronJon', async (tools) => {
|
tap.test('should create a valid cronJon', async (tools) => {
|
||||||
const done = tools.defer();
|
const done = tools.defer();
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
testCronManager.addCronjob('*/2 * * * * *', () => {
|
testCronManager.addCronjob('*/2 * * * * *', async () => {
|
||||||
if (counter === 10) {
|
if (counter === 10) {
|
||||||
done.resolve();
|
done.resolve();
|
||||||
}
|
}
|
||||||
|
@ -11,13 +11,46 @@ tap.test('should create a valid instance of cronmanager', async () => {
|
|||||||
|
|
||||||
tap.test('should create a valid cronJon', async (tools) => {
|
tap.test('should create a valid cronJon', async (tools) => {
|
||||||
const done = tools.defer();
|
const done = tools.defer();
|
||||||
|
const done2 = tools.defer();
|
||||||
|
const done3 = tools.defer();
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
testCronManager.addCronjob('*/2 * * * * *', () => {
|
let counter2 = 0;
|
||||||
|
let counter3 = 0;
|
||||||
|
const cronJob = testCronManager.addCronjob('*/2 * * * * *', async () => {
|
||||||
if (counter === 10) {
|
if (counter === 10) {
|
||||||
|
testCronManager.removeCronjob(cronJob);
|
||||||
done.resolve();
|
done.resolve();
|
||||||
}
|
}
|
||||||
counter++;
|
counter++;
|
||||||
console.log(`hey ${counter}`);
|
console.log(`${new Date().getSeconds()} hey ${counter} -> runs every 2 seconds`);
|
||||||
|
});
|
||||||
|
const cronJob2 = testCronManager.addCronjob('*/3 * * * * *', async () => {
|
||||||
|
if (counter2 === 10) {
|
||||||
|
testCronManager.removeCronjob(cronJob2);
|
||||||
|
done2.resolve();
|
||||||
|
}
|
||||||
|
counter2++;
|
||||||
|
console.log(`${new Date().getSeconds()} hey ${counter2} -> runs every 3 seconds`);
|
||||||
|
});
|
||||||
|
const cronJob3 = testCronManager.addCronjob('*/4 * * * * *', async () => {
|
||||||
|
if (counter3 === 10) {
|
||||||
|
done3.resolve();
|
||||||
|
}
|
||||||
|
counter3++;
|
||||||
|
console.log(`${new Date().getSeconds()} hey ${counter3} -> runs every 4 seconds`);
|
||||||
|
});
|
||||||
|
testCronManager.start();
|
||||||
|
await done.promise;
|
||||||
|
await done2.promise;
|
||||||
|
await done3.promise;
|
||||||
|
testCronManager.stop();
|
||||||
|
testCronManager.removeCronjob(cronJob3);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('runs every full minute', async (tools) => {
|
||||||
|
const done = tools.defer();
|
||||||
|
const cronJob = testCronManager.addCronjob('0 * * * * *', async () => {
|
||||||
|
done.resolve();
|
||||||
});
|
});
|
||||||
testCronManager.start();
|
testCronManager.start();
|
||||||
await done.promise;
|
await done.promise;
|
||||||
|
@ -21,4 +21,9 @@ tap.test('should create a European date string', async () => {
|
|||||||
expect(extendedDate.exportToEuropeanDate()).to.equal('13.02.2018');
|
expect(extendedDate.exportToEuropeanDate()).to.equal('13.02.2018');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tap.test('should format a date', async () => {
|
||||||
|
const extendedDate = new smarttime.ExtendedDate(Date.now());
|
||||||
|
console.log(extendedDate.format('YYYY-MM-DD - hh:mm'));
|
||||||
|
})
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import * as plugins from './smarttime.plugins';
|
import * as plugins from './smarttime.plugins';
|
||||||
import { CronManager } from './smarttime.classes.cronmanager';
|
import { CronManager } from './smarttime.classes.cronmanager';
|
||||||
|
|
||||||
|
import { CronParser } from './smarttime.classes.cronparser';
|
||||||
|
|
||||||
export type TJobFunction = (() => void) | (() => Promise<any>);
|
export type TJobFunction = (() => void) | (() => Promise<any>);
|
||||||
|
|
||||||
export class CronJob {
|
export class CronJob {
|
||||||
public croner;
|
public cronParser: CronParser | typeof plugins.croner;
|
||||||
public status: 'started' | 'stopped' | 'initial' = 'initial';
|
public status: 'started' | 'stopped' | 'initial' = 'initial';
|
||||||
public cronExpression: string;
|
public cronExpression: string;
|
||||||
public jobFunction: TJobFunction;
|
public jobFunction: TJobFunction;
|
||||||
@ -13,7 +15,7 @@ export class CronJob {
|
|||||||
constructor(cronManager: CronManager, cronExpressionArg: string, jobFunction: TJobFunction) {
|
constructor(cronManager: CronManager, cronExpressionArg: string, jobFunction: TJobFunction) {
|
||||||
this.cronExpression = cronExpressionArg;
|
this.cronExpression = cronExpressionArg;
|
||||||
this.jobFunction = jobFunction;
|
this.jobFunction = jobFunction;
|
||||||
this.croner = plugins.croner(this.cronExpression);
|
this.cronParser = plugins.croner(cronExpressionArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,15 +23,29 @@ export class CronJob {
|
|||||||
*/
|
*/
|
||||||
public checkExecution(): number {
|
public checkExecution(): number {
|
||||||
if (this.nextExecutionUnix === 0) {
|
if (this.nextExecutionUnix === 0) {
|
||||||
this.nextExecutionUnix = this.croner.msToNext();
|
this.getNextExecutionTime();
|
||||||
}
|
}
|
||||||
if (Date.now() > this.nextExecutionUnix) {
|
if (Date.now() > this.nextExecutionUnix) {
|
||||||
this.jobFunction();
|
const maybePromise = this.jobFunction();
|
||||||
this.nextExecutionUnix = this.croner.msToNext();
|
if (maybePromise instanceof Promise) {
|
||||||
|
maybePromise.catch(e => console.log(e));
|
||||||
|
}
|
||||||
|
this.nextExecutionUnix = this.getNextExecutionTime();
|
||||||
}
|
}
|
||||||
return this.nextExecutionUnix;
|
return this.nextExecutionUnix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getNextExecutionTime() {
|
||||||
|
return this.nextExecutionUnix = Date.now() + this.getTimeToNextExecution();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets the time to next execution
|
||||||
|
*/
|
||||||
|
public getTimeToNextExecution() {
|
||||||
|
return this.cronParser.msToNext();
|
||||||
|
}
|
||||||
|
|
||||||
public start() {
|
public start() {
|
||||||
this.status = 'started';
|
this.status = 'started';
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ export class CronManager {
|
|||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
public addCronjob(cronIdentifierArg: string, cronFunctionArg: () => any) {
|
public addCronjob(cronIdentifierArg: string, cronFunctionArg: () => Promise<void>) {
|
||||||
const newCronJob = new CronJob(this, cronIdentifierArg, cronFunctionArg);
|
const newCronJob = new CronJob(this, cronIdentifierArg, cronFunctionArg);
|
||||||
this.cronjobs.add(newCronJob);
|
this.cronjobs.add(newCronJob);
|
||||||
if (this.status === 'started') {
|
if (this.status === 'started') {
|
||||||
@ -33,30 +33,34 @@ export class CronManager {
|
|||||||
for (const cronJob of this.cronjobs.getArray()) {
|
for (const cronJob of this.cronjobs.getArray()) {
|
||||||
cronJob.start();
|
cronJob.start();
|
||||||
}
|
}
|
||||||
this.executionTimeout = new plugins.smartdelay.Timeout(0);
|
const runCronCycle = async () => {
|
||||||
|
this.executionTimeout = new plugins.smartdelay.Timeout(0);
|
||||||
// recursion
|
do {
|
||||||
const runCheckExecution = () => {
|
let nextRunningCronjob: CronJob;
|
||||||
console.log(
|
|
||||||
`Next CronJob scheduled in ${this.executionTimeout.getTimeLeft()} milliseconds`
|
|
||||||
);
|
|
||||||
this.executionTimeout.promise.then(() => {
|
|
||||||
let timeToNextOverallExecution: number;
|
|
||||||
for (const cronJob of this.cronjobs.getArray()) {
|
for (const cronJob of this.cronjobs.getArray()) {
|
||||||
const timeToNextJobExecution = cronJob.checkExecution();
|
cronJob.checkExecution();
|
||||||
if (
|
if (
|
||||||
timeToNextJobExecution < timeToNextOverallExecution ||
|
!nextRunningCronjob ||
|
||||||
!timeToNextOverallExecution
|
cronJob.getTimeToNextExecution() < nextRunningCronjob.getTimeToNextExecution()
|
||||||
) {
|
) {
|
||||||
timeToNextOverallExecution = timeToNextJobExecution;
|
nextRunningCronjob = cronJob;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.executionTimeout = new plugins.smartdelay.Timeout(timeToNextOverallExecution);
|
if (nextRunningCronjob) {
|
||||||
runCheckExecution();
|
this.executionTimeout = new plugins.smartdelay.Timeout(nextRunningCronjob.getTimeToNextExecution());
|
||||||
});
|
console.log(
|
||||||
|
`Next CronJob scheduled in ${this.executionTimeout.getTimeLeft()} milliseconds`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.executionTimeout = new plugins.smartdelay.Timeout(1000);
|
||||||
|
console.log('no cronjobs specified! Checking again in 1 second');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
await this.executionTimeout.promise;
|
||||||
|
} while (this.status === 'started');
|
||||||
};
|
};
|
||||||
|
runCronCycle();
|
||||||
runCheckExecution();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
88
ts/smarttime.classes.cronparser.ts
Normal file
88
ts/smarttime.classes.cronparser.ts
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
import * as plugins from './smarttime.plugins';
|
||||||
|
|
||||||
|
export class CronParser {
|
||||||
|
public cronExpression: string;
|
||||||
|
public get cronArray() {
|
||||||
|
return this.cronExpression.split(' ');
|
||||||
|
}
|
||||||
|
constructor(cronExpressionArg: string) {
|
||||||
|
this.cronExpression = cronExpressionArg;
|
||||||
|
if (this.cronArray.length < 6) {
|
||||||
|
throw new Error('CronParser needs second level accuracy');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private getNextPartMatch(cronPart: string, startValue: number, moduloArg: number) {
|
||||||
|
if (cronPart === '*') {
|
||||||
|
return startValue;
|
||||||
|
}
|
||||||
|
if (cronPart.includes('/')) {
|
||||||
|
const every = parseInt(cronPart.split('/')[1], 10);
|
||||||
|
const findEvenMatch = (recursionStartArg: number) => {
|
||||||
|
if (recursionStartArg % every === 0) {
|
||||||
|
return recursionStartArg;
|
||||||
|
} else {
|
||||||
|
return findEvenMatch(recursionStartArg + 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return findEvenMatch(startValue);
|
||||||
|
}
|
||||||
|
if (parseInt(cronPart, 10) || cronPart === '0') {
|
||||||
|
const match = parseInt(cronPart, 10);
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public msToNext() {
|
||||||
|
const cronArray = this.cronArray;
|
||||||
|
const secondExpression = cronArray[0];
|
||||||
|
const minuteExpression = cronArray[1];
|
||||||
|
const hourExpression = cronArray[2];
|
||||||
|
const dayExpression = cronArray[3];
|
||||||
|
const monthExpression = cronArray[4];
|
||||||
|
const yearExpression = cronArray[5];
|
||||||
|
|
||||||
|
let currentDate = new Date();
|
||||||
|
let currentSecond = currentDate.getSeconds() + 1;
|
||||||
|
let currentMinute = currentDate.getMinutes();
|
||||||
|
let currentHour = currentDate.getHours();
|
||||||
|
let currentDay = currentDate.getDate();
|
||||||
|
let currentMonth = currentDate.getMonth();
|
||||||
|
let currentYear = currentDate.getFullYear();
|
||||||
|
|
||||||
|
const targetSecond = this.getNextPartMatch(secondExpression, currentSecond, 59);
|
||||||
|
if (targetSecond < currentSecond) {
|
||||||
|
currentMinute = (currentMinute + 1) % 59;
|
||||||
|
}
|
||||||
|
const targetMinute = this.getNextPartMatch(minuteExpression, currentMinute, 59);
|
||||||
|
if (targetMinute < currentMinute) {
|
||||||
|
currentHour = (currentHour + 1) % 23;
|
||||||
|
}
|
||||||
|
const targetHour = this.getNextPartMatch(hourExpression, currentHour, 23);
|
||||||
|
if (targetHour < currentHour) {
|
||||||
|
currentDay = (currentDay + 1) % 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
const targetDay = currentDay;
|
||||||
|
if (targetDay < currentDay) {
|
||||||
|
currentMonth = (currentMonth + 1) % 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
const targetMonth = currentMonth;
|
||||||
|
if (targetMonth < currentMonth) {
|
||||||
|
currentYear = (currentYear + 1);
|
||||||
|
}
|
||||||
|
const targetYear = currentYear;
|
||||||
|
|
||||||
|
const targetDate = new Date(
|
||||||
|
targetYear,
|
||||||
|
targetMonth,
|
||||||
|
targetDay,
|
||||||
|
targetHour,
|
||||||
|
targetMinute,
|
||||||
|
targetSecond
|
||||||
|
);
|
||||||
|
const targetTime = targetDate.getTime();
|
||||||
|
return targetTime - Date.now();
|
||||||
|
}
|
||||||
|
}
|
@ -121,4 +121,8 @@ export class ExtendedDate extends Date {
|
|||||||
dayOfTheWeekName: daysArray[this.getDay()],
|
dayOfTheWeekName: daysArray[this.getDay()],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public format (formatArg: string) {
|
||||||
|
return plugins.dayjs(this.getTime()).format(formatArg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user