Compare commits

..
Author SHA1 Message Date
ShareVB fa01008dc8 fix: let user choice 'standard' vs 'aws'
Let the user choose between cron format (since help is different)
2024-09-22 12:27:49 +02:00
ShareVB 8754d626e1 Merge branch 'fix/crontab-enh' of https://github.com/sharevb/it-tools into fix/crontab-enh 2024-09-21 14:42:39 +02:00
ShareVB 605229f4ef fix: helpers dup % 2024-09-21 14:42:22 +02:00
sharevb 9fa58666e5 Merge branch 'main' into fix/crontab-enh 2024-09-21 14:38:42 +02:00
ShareVB c7154c36eb Merge remote-tracking branch 'origin/main' into fix/crontab-enh 2024-09-21 14:37:53 +02:00
ShareVB 0b4a261e06 Merge branch 'fix/crontab-enh' of https://github.com/sharevb/it-tools into fix/crontab-enh 2024-09-21 14:35:02 +02:00
sharevb 48b4904cf1 fix(Cron Parser): handle aws, next executions and TZ
Handle AWS Cron syntax and distinguishe from standard syntax (fix #855)
Add show crontab next 5 execution times (taken from #1283)
Add Timezone handling: fix #261
2024-09-21 14:33:13 +02:00
sharevb f1044b3e2b fix(Cron Parser): handle more patterns
Just use validation of cronstrue package
Fix #855
2024-05-01 23:40:37 +02:00
25 changed files with 333 additions and 348 deletions

No files matched your search

+1 -1
View File
@@ -117,7 +117,7 @@ Big thanks to all the people who have already contributed!
## Credits
Coded with ❤️ by [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=readme).
Coded with ❤️ by [Corentin Thomasset](//corentin-thomasset.fr).
This project is continuously deployed using [vercel.com](https://vercel.com).
+6 -6
View File
@@ -109,7 +109,6 @@ declare module '@vue/runtime-core' {
Ipv6UlaGenerator: typeof import('./src/tools/ipv6-ula-generator/ipv6-ula-generator.vue')['default']
JsonDiff: typeof import('./src/tools/json-diff/json-diff.vue')['default']
JsonMinify: typeof import('./src/tools/json-minify/json-minify.vue')['default']
JsonSizeAnalyzer: typeof import('./src/tools/json-size-analyzer/json-size-analyzer.vue')['default']
JsonToCsv: typeof import('./src/tools/json-to-csv/json-to-csv.vue')['default']
JsonToToml: typeof import('./src/tools/json-to-toml/json-to-toml.vue')['default']
JsonToXml: typeof import('./src/tools/json-to-xml/json-to-xml.vue')['default']
@@ -136,18 +135,19 @@ declare module '@vue/runtime-core' {
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDivider: typeof import('naive-ui')['NDivider']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem']
NH1: typeof import('naive-ui')['NH1']
NH3: typeof import('naive-ui')['NH3']
NIcon: typeof import('naive-ui')['NIcon']
NInput: typeof import('naive-ui')['NInput']
NInputNumber: typeof import('naive-ui')['NInputNumber']
NLayout: typeof import('naive-ui')['NLayout']
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
NMenu: typeof import('naive-ui')['NMenu']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSlider: typeof import('naive-ui')['NSlider']
NRadio: typeof import('naive-ui')['NRadio']
NRadioGroup: typeof import('naive-ui')['NRadioGroup']
NSpace: typeof import('naive-ui')['NSpace']
NSwitch: typeof import('naive-ui')['NSwitch']
NTree: typeof import('naive-ui')['NTree']
NTable: typeof import('naive-ui')['NTable']
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
+1 -1
View File
@@ -38,7 +38,7 @@ about:
# Über IT-Tools
Diese wunderbare Website, erstellt mit ❤ von [Corentin
Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about), sammelt nützliche Tools für
Thomasset](https://github.com/CorentinTh), sammelt nützliche Tools für
Entwickler und Menschen, die in der IT arbeiten. Wenn du sie nützlich
findest, teile sie gerne mit Personen, von denen du denkst, dass sie sie
ebenfalls nützlich finden könnten, und vergiss nicht, sie in deiner
+1 -1
View File
@@ -30,7 +30,7 @@ about:
content: >
# About IT-Tools
This wonderful website, made with ❤ by [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about) , aggregates useful tools for developer and people working in IT. If you find it useful, please feel free to share it to people you think may find it useful too and don't forget to bookmark it in your shortcut bar!
This wonderful website, made with ❤ by [Corentin Thomasset](https://github.com/CorentinTh) , aggregates useful tools for developer and people working in IT. If you find it useful, please feel free to share it to people you think may find it useful too and don't forget to bookmark it in your shortcut bar!
IT Tools is open-source (under the MIT license) and free, and will always be, but it costs me money to host and renew the domain name. If you want to support my work, and encourage me to add more tools, please consider supporting by [sponsoring me](https://www.buymeacoffee.com/cthmsst).
+3 -3
View File
@@ -30,7 +30,7 @@ about:
content: >
# Sobre IT-Tools
Este maravilloso sitio web, hecho con ❤ por [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about) , agrega herramientas útiles para desarrolladores y personas que trabajan en IT. Si lo encuentra útil, no dude en compartirlo con las personas que crea que también pueden encontrarlo útil y ¡no olvide marcarlo como favorito en su barra de accesos directos!
Este maravilloso sitio web, hecho con ❤ por [Corentin Thomasset](https://github.com/CorentinTh) , agrega herramientas útiles para desarrolladores y personas que trabajan en IT. Si lo encuentra útil, no dude en compartirlo con las personas que crea que también pueden encontrarlo útil y ¡no olvide marcarlo como favorito en su barra de accesos directos!
IT Tools es de código abierto (under the MIT license) y gratis, y siempre lo será, pero me cuesta dinero alojar y renovar el nombre de dominio. Si desea apoyar mi trabajo y animarme a agregar más herramientas, considere apoyarme a través de[sponsoring me](https://www.buymeacoffee.com/cthmsst).
@@ -39,7 +39,7 @@ about:
IT Tools está creado en Vue.js (Vue 3) con la biblioteca de componentes Naive UI y Vercel lo aloja y lo implementa continuamente. En algunas herramientas se utilizan bibliotecas de código abierto de terceros; puede encontrar la lista completa en [package.json](https://github.com/CorentinTh/it-tools/blob/main/package.json) archivo del repositorio.
## ¿Encontraste un error? ¿Falta una herramienta?
Si necesita una herramienta que actualmente no está presente aquí y cree que puede ser útil, puede enviar una solicitud de función en el [issues section](https://github.com/CorentinTh/it-tools/issues/new/choose) en el repositorio de GitHub.
Y si encontró un error o algo no funciona como se esperaba, presente un reporte de error en el [issues section](https://github.com/CorentinTh/it-tools/issues/new/choose) en el repositorio de GitHub.
@@ -68,4 +68,4 @@ tools:
math: Math
measurement: Measurement
text: Text
data: Data
data: Data
+1 -1
View File
@@ -29,7 +29,7 @@ about:
content: >
# À propos de IT-Tools
Ce merveilleux site, fait avec ❤ par [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about), regroupe des outils utiles pour les développeurs et les personnes travaillant dans l'informatique. Si vous le trouvez utile, n'hésitez pas à le partager et n'oubliez pas de le mettre dans vos favoris !
Ce merveilleux site, fait avec ❤ par [Corentin Thomasset](https://github.com/CorentinTh), regroupe des outils utiles pour les développeurs et les personnes travaillant dans l'informatique. Si vous le trouvez utile, n'hésitez pas à le partager et n'oubliez pas de le mettre dans vos favoris !
IT Tools est open-source (sous licence MIT) et gratuit, et le restera toujours, mais cela me coûte de l'argent pour l'héberger et renouveler le nom de domaine. Si vous voulez soutenir mon travail, et m'encourager à ajouter plus d'outils, n'hésitez pas à me [soutenir](https://www.buymeacoffee.com/cthmsst).
+1 -1
View File
@@ -30,7 +30,7 @@ about:
content: >
# Sobre o IT-Tools
Este site maravilhoso, feito com ❤ por [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about), junta ferramentas úteis para desenvolvedores e outras pessoas que trabalham com TI. Se você achar o site útil, fique à vontade para compartilhar com quem também possa gostar e não esqueça de salvar o bookmark na sua barra de atalhos!
Este site maravilhoso, feito com ❤ por [Corentin Thomasset](https://github.com/CorentinTh), junta ferramentas úteis para desenvolvedores e outras pessoas que trabalham com TI. Se você achar o site útil, fique à vontade para compartilhar com quem também possa gostar e não esqueça de salvar o bookmark na sua barra de atalhos!
O IT Tools é código aberto (sob a licença MIT), é gratuito, e sempre será, mas custa dinheiro para hospedar e renovar o domínio. Se quiser apoiar meu trabalho e me encorajar a adicionar mais ferramentas, por favor considere [ser patrocinador](https://www.buymeacoffee.com/cthmsst).
+1 -1
View File
@@ -30,7 +30,7 @@ about:
content: >
# Про IT-Tools
Цей чудовий вебсайт, створений з ❤ [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about), агрегує корисні інструменти для розробників і людей, які працюють в сфері IT. Якщо вам це корисно, будь ласка, поділіться цим з людьми, які, на вашу думку, також можуть знайти його корисним, і не забудьте додати його до закладок у вашій панелі швидкого доступу!
Цей чудовий вебсайт, створений з ❤ [Corentin Thomasset](https://github.com/CorentinTh), агрегує корисні інструменти для розробників і людей, які працюють в сфері IT. Якщо вам це корисно, будь ласка, поділіться цим з людьми, які, на вашу думку, також можуть знайти його корисним, і не забудьте додати його до закладок у вашій панелі швидкого доступу!
IT Tools є відкритим програмним забезпеченням (під ліцензією MIT) і безкоштовним, і завжди буде таким, але мені коштує гроші для хостингу і продовження доменного імені. Якщо ви хочете підтримати мою роботу і підтримати мене у додаванні нових інструментів, розгляньте можливість підтримки, [спонсоруючи мене](https://www.buymeacoffee.com/cthmsst).
+1 -1
View File
@@ -30,7 +30,7 @@ about:
content: >
# Về IT-Tools
Website tuyệt vời này, được tạo ra bằng ❤ bởi [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about), tổng hợp các công cụ hữu ích cho nhà phát triển và những người làm việc trong lĩnh vực IT. Nếu bạn thấy nó hữu ích, xin đừng ngần ngại chia sẻ cho những người mà bạn nghĩ sẽ thấy nó hữu ích và đừng quên đánh dấu nó trong thanh lối tắt của bạn!
Website tuyệt vời này, được tạo ra bằng ❤ bởi [Corentin Thomasset](https://github.com/CorentinTh), tổng hợp các công cụ hữu ích cho nhà phát triển và những người làm việc trong lĩnh vực IT. Nếu bạn thấy nó hữu ích, xin đừng ngần ngại chia sẻ cho những người mà bạn nghĩ sẽ thấy nó hữu ích và đừng quên đánh dấu nó trong thanh lối tắt của bạn!
IT Tools là mã nguồn mở (dưới giấy phép MIT) và miễn phí, và sẽ luôn như vậy, nhưng tôi phải trả tiền để lưu trữ và gia hạn tên miền. Nếu bạn muốn hỗ trợ công việc của tôi, và khích lệ tôi thêm nhiều công cụ hơn, hãy xem xét hỗ trợ bằng cách [tài trợ cho tôi](https://www.buymeacoffee.com/cthmsst).
+1 -1
View File
@@ -30,7 +30,7 @@ about:
content: >
# 关于 IT-Tools
IT-Tools 由 [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about) 用 ❤ 开发,汇集了对开发人员和 IT 从业者有用的工具。如果对您有帮助,请将其分享给您的朋友,并且添加到收藏夹中!
IT-Tools 由 [Corentin Thomasset](https://github.com/CorentinTh) 用 ❤ 开发,汇集了对开发人员和 IT 从业者有用的工具。如果对您有帮助,请将其分享给您的朋友,并且添加到收藏夹中!
IT-Tools 永久免费且开源(MIT 许可证),但需要资金用于托管和续订域名。如果您想支持我的工作,并鼓励我添加更多工具,请考虑通过 [赞助我](https://www.buymeacoffee.com/cthmsst) 进行支持。
+12 -9
View File
@@ -1,14 +1,7 @@
{
"name": "it-tools",
"version": "2024.5.13-a0bc346",
"packageManager": "pnpm@8.15.3",
"description": "Collection of handy online tools for developers, with great UX. ",
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://corentin.tech)",
"license": "GNU GPLv3",
"repository": {
"type": "git",
"url": "https://github.com/CorentinTh/it-tools"
},
"keywords": [
"productivity",
"converter",
@@ -20,6 +13,12 @@
"developer-tools",
"developer-productivity"
],
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://github.com/CorentinTh)",
"license": "GNU GPLv3",
"repository": {
"type": "git",
"url": "https://github.com/CorentinTh/it-tools"
},
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && NODE_OPTIONS=--max_old_space_size=4096 vite build",
@@ -54,7 +53,9 @@
"change-case": "^4.1.2",
"colord": "^2.9.3",
"composerize-ts": "^0.6.2",
"countries-and-timezones": "^3.6.0",
"country-code-lookup": "^0.1.0",
"cron-parser": "^4.9.0",
"cron-validator": "^1.3.1",
"cronstrue": "^2.26.0",
"crypto-js": "^4.1.1",
@@ -62,14 +63,15 @@
"dompurify": "^3.0.6",
"email-normalizer": "^1.0.0",
"emojilib": "^3.0.10",
"event-cron-parser": "^1.0.34",
"figlet": "^1.7.0",
"figue": "^1.2.0",
"fuse.js": "^6.6.2",
"get-timezone-offset": "^1.0.5",
"highlight.js": "^11.7.0",
"iarna-toml-esm": "^3.0.5",
"ibantools": "^4.3.3",
"js-base64": "^3.7.6",
"json-analyzer": "^1.2.2",
"json5": "^2.2.3",
"jwt-decode": "^3.1.2",
"libphonenumber-js": "^1.10.28",
@@ -147,5 +149,6 @@
"vitest": "^0.34.0",
"workbox-window": "^7.0.0",
"zx": "^7.2.1"
}
},
"packageManager": "pnpm@8.15.3"
}
+46 -51
View File
@@ -59,9 +59,15 @@ dependencies:
composerize-ts:
specifier: ^0.6.2
version: 0.6.2
countries-and-timezones:
specifier: ^3.6.0
version: 3.6.0
country-code-lookup:
specifier: ^0.1.0
version: 0.1.0
cron-parser:
specifier: ^4.9.0
version: 4.9.0
cron-validator:
specifier: ^1.3.1
version: 1.3.1
@@ -83,6 +89,9 @@ dependencies:
emojilib:
specifier: ^3.0.10
version: 3.0.10
event-cron-parser:
specifier: ^1.0.34
version: 1.0.34
figlet:
specifier: ^1.7.0
version: 1.7.0
@@ -92,6 +101,9 @@ dependencies:
fuse.js:
specifier: ^6.6.2
version: 6.6.2
get-timezone-offset:
specifier: ^1.0.5
version: 1.0.5
highlight.js:
specifier: ^11.7.0
version: 11.7.0
@@ -104,9 +116,6 @@ dependencies:
js-base64:
specifier: ^3.7.6
version: 3.7.7
json-analyzer:
specifier: ^1.2.2
version: 1.2.2
json5:
specifier: ^2.2.3
version: 2.2.3
@@ -4567,11 +4576,6 @@ packages:
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
dev: true
/colors@1.4.0:
resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==}
engines: {node: '>=0.1.90'}
dev: false
/combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
@@ -4665,6 +4669,11 @@ packages:
browserslist: 4.22.1
dev: true
/countries-and-timezones@3.6.0:
resolution: {integrity: sha512-8/nHBCs1eKeQ1jnsZVGdqrLYxS8nPcfJn8PnmxdJXWRLZdXsGFR8gnVhRjatGDBjqmPm7H+FtYpBYTPWd0Eiqg==}
engines: {node: '>=8.x', npm: '>=5.x'}
dev: false
/country-code-lookup@0.1.0:
resolution: {integrity: sha512-IOI66HEG+8bXfWPy+sTzuN7161vmDZOHg1wgIPFf3WfD73FeLajnn6C+fnxOIa9RL1WRBDMXQQWW/FOaOYaQ3w==}
dev: false
@@ -4673,6 +4682,13 @@ packages:
resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==}
dev: false
/cron-parser@4.9.0:
resolution: {integrity: sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==}
engines: {node: '>=12.0.0'}
dependencies:
luxon: 3.5.0
dev: false
/cron-validator@1.3.1:
resolution: {integrity: sha512-C1HsxuPCY/5opR55G5/WNzyEGDWFVG+6GLrA+fW/sCTcP6A6NTjUP2AK7B8n2PyFs90kDG2qzwm8LMheADku6A==}
dev: false
@@ -5574,6 +5590,12 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/event-cron-parser@1.0.34:
resolution: {integrity: sha512-ytqZmMrNfSvzHWriiHdoNOpYKFr4d2fDoC4Rgq0F8lEA37abCWkYhSsqslC/kngWwnTGq7L0Q9VlMreKe6EJbQ==}
dependencies:
number-to-words: 1.2.4
dev: false
/event-stream@3.3.4:
resolution: {integrity: sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==}
dependencies:
@@ -5868,6 +5890,11 @@ packages:
get-intrinsic: 1.2.2
dev: true
/get-timezone-offset@1.0.5:
resolution: {integrity: sha512-+B+/vEJ9qJgZheDVNmuY+4il8sJhTFXRvSiiqyRfwiCEhTaZqn/yCoNToDzQL+Mv9DLKlyO1bSIP5nUCJQN9Aw==}
engines: {node: '>=4.0.0'}
dev: false
/get-tsconfig@4.7.2:
resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==}
dependencies:
@@ -6627,21 +6654,6 @@ packages:
hasBin: true
dev: true
/json-analyzer@1.2.2:
resolution: {integrity: sha512-3xWTxyIggxOYIPT9NkucQPxlOBPJY14/ifely3eCtifE5pAxJXl/jUmSDwq+fLVhHIIj9MIJ6Bv7u3ItChG8vQ==}
engines: {node: '>=8.0.0'}
hasBin: true
dependencies:
commander: 2.20.3
lodash.flowright: 3.5.0
lodash.get: 4.4.2
lodash.isobject: 3.0.2
pako: 1.0.11
pretty-bytes: 5.6.0
prettyjson: 1.2.5
utf8-length: 0.0.1
dev: false
/json-parse-even-better-errors@2.3.1:
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
dev: true
@@ -6781,18 +6793,6 @@ packages:
resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==}
dev: true
/lodash.flowright@3.5.0:
resolution: {integrity: sha512-YxTYuodkvyINbDInmFcGGvkQwoAuoGUYosqstRTr5eq63GQt7WQ2xFU0wG1UfdbKYPwevd3zWDd6ybEE2g6qvA==}
dev: false
/lodash.get@4.4.2:
resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==}
dev: false
/lodash.isobject@3.0.2:
resolution: {integrity: sha512-3/Qptq2vr7WeJbB4KHUSKlq8Pl7ASXi3UG6CMbBm8WRtXi8+GHm7mKaU3urfpSEzWe2wCIChs6/sdocUsTKJiA==}
dev: false
/lodash.merge@4.6.2:
resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
dev: true
@@ -6852,6 +6852,11 @@ packages:
dependencies:
yallist: 4.0.0
/luxon@3.5.0:
resolution: {integrity: sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==}
engines: {node: '>=12'}
dev: false
/magic-string@0.25.9:
resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==}
dependencies:
@@ -7040,6 +7045,7 @@ packages:
/minimist@1.2.8:
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
dev: true
/mlly@1.4.0:
resolution: {integrity: sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg==}
@@ -7220,6 +7226,10 @@ packages:
boolbase: 1.0.0
dev: true
/number-to-words@1.2.4:
resolution: {integrity: sha512-/fYevVkXRcyBiZDg6yzZbm0RuaD6i0qRfn8yr+6D0KgBMOndFPxuW10qCHpzs50nN8qKuv78k8MuotZhcVX6Pw==}
dev: false
/nwsapi@2.2.7:
resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==}
dev: true
@@ -7358,10 +7368,6 @@ packages:
resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
engines: {node: '>=6'}
/pako@1.0.11:
resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==}
dev: false
/param-case@2.1.1:
resolution: {integrity: sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==}
dependencies:
@@ -7594,6 +7600,7 @@ packages:
/pretty-bytes@5.6.0:
resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==}
engines: {node: '>=6'}
dev: true
/pretty-bytes@6.1.0:
resolution: {integrity: sha512-Rk753HI8f4uivXi4ZCIYdhmG1V+WKzvRMg/X+M42a6t7D07RcmopXJMDNk6N++7Bl75URRGsb40ruvg7Hcp2wQ==}
@@ -7609,14 +7616,6 @@ packages:
react-is: 18.2.0
dev: true
/prettyjson@1.2.5:
resolution: {integrity: sha512-rksPWtoZb2ZpT5OVgtmy0KHVM+Dca3iVwWY9ifwhcexfjebtgjg3wmrUt9PvJ59XIYBcknQeYHD8IAnVlh9lAw==}
hasBin: true
dependencies:
colors: 1.4.0
minimist: 1.2.8
dev: false
/prosemirror-changeset@2.2.1:
resolution: {integrity: sha512-J7msc6wbxB4ekDFj+n9gTW/jav/p53kdlivvuppHsrZXCaQdVgRghoZbSS3kwrRyAstRVQ4/+u5k7YfLgkkQvQ==}
dependencies:
@@ -9073,10 +9072,6 @@ packages:
requires-port: 1.0.0
dev: true
/utf8-length@0.0.1:
resolution: {integrity: sha512-j/XH2ftofBiobnyApxlN/J6j/ixwT89WEjDcjT66d2i0+GIn9RZfzt8lpEXXE4jUe4NsjBSUq70kS2euQ4nnMw==}
dev: false
/util-deprecate@1.0.2:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
dev: true
+1 -1
View File
@@ -81,7 +81,7 @@ const tools = computed<ToolCategory[]>(() => [
</div>
<div>
© {{ new Date().getFullYear() }}
<c-link target="_blank" rel="noopener" href="https://corentin.tech?utm_source=it-tools&utm_medium=footer">
<c-link target="_blank" rel="noopener" href="https://github.com/CorentinTh">
Corentin Thomasset
</c-link>
</div>
@@ -0,0 +1,63 @@
import { describe, expect, it } from 'vitest';
import { getCronType, getLastExecutionTimes, isCronValid } from './crontab-generator.service';
describe('crontab-generator', () => {
describe('isCronValid', () => {
it('should return true for all valid formats', () => {
// standard format
expect(isCronValid('0 0 * * 1-5')).toBe(true);
expect(isCronValid('23 0-20/2 * * *')).toBe(true);
// AWS formats
expect(isCronValid('0 11-22 ? * MON-FRI *')).toBe(true);
expect(isCronValid('0 0 ? * 1 *')).toBe(true);
});
it('should check standard format', () => {
// standard format
expect(isCronValid('0 0 * * 1-5', 'standard')).toBe(true);
expect(isCronValid('23 0-20/2 * * *', 'standard')).toBe(true);
// AWS format
expect(isCronValid('0 11-22 ? * MON-FRI *', 'standard')).toBe(false);
expect(isCronValid('0 0 ? * 1 *', 'standard')).toBe(false);
});
it('should check aws format', () => {
// standard format
expect(isCronValid('0 0 * * 1-5', 'aws')).toBe(false);
expect(isCronValid('23 0-20/2 * * *', 'aws')).toBe(false);
// AWS format
expect(isCronValid('0 11-22 ? * MON-FRI *', 'aws')).toBe(true);
expect(isCronValid('0 0 ? * 1 *', 'aws')).toBe(true);
});
it('should return false for all invalid formats', () => {
expect(isCronValid('aert')).toBe(false);
expect(isCronValid('40 *')).toBe(false);
});
});
describe('getCronType', () => {
it('should return right type', () => {
expect(getCronType('0 0 * * 1-5')).toBe('standard');
expect(getCronType('23 0-20/2 * * *')).toBe('standard');
// AWS formats
expect(getCronType('0 11-22 ? * MON-FRI *')).toBe('aws');
expect(getCronType('0 0 ? * 1 *')).toBe('aws');
expect(getCronType('aert')).toBe(false);
expect(getCronType('40 *')).toBe(false);
});
});
describe('getLastExecutionTimes', () => {
it('should return next valid datetimes', () => {
expect(getLastExecutionTimes('0 0 * * 1-5')).toHaveLength(5);
expect(getLastExecutionTimes('23 0-20/2 * * *')).toHaveLength(5);
// AWS formats
expect(getLastExecutionTimes('0 11-22 ? * MON-FRI *')).toHaveLength(5);
expect(getLastExecutionTimes('0 0 ? * 1 *')).toHaveLength(5);
});
});
});
@@ -0,0 +1,47 @@
import { parseExpression } from 'cron-parser';
import EventCronParser from 'event-cron-parser';
export type CronType = 'standard' | 'aws';
export function getLastExecutionTimes(cronExpression: string, tz: string | undefined = undefined, count: number = 5) {
if (getCronType(cronExpression) === 'standard') {
const interval = parseExpression(cronExpression, { tz });
const times = [];
for (let i = 0; i < count; i++) {
times.push(interval.next().toJSON());
}
return times;
}
if (getCronType(cronExpression) === 'aws') {
const parsed = new EventCronParser(cronExpression);
const times = [];
for (let i = 0; i < count; i++) {
times.push(JSON.stringify(parsed.next()));
}
return times;
}
return [];
}
export function isCronValid(cronExpression: string, cronType: CronType | 'any' = 'any') {
const expressionCronType = getCronType(cronExpression);
return cronType === 'any' ? !!expressionCronType : expressionCronType === cronType;
}
export function getCronType(cronExpression: string) {
try {
parseExpression(cronExpression);
return 'standard';
}
catch (_) {
try {
const parsed = new EventCronParser(cronExpression);
parsed.validate();
return 'aws';
}
catch (_) {
}
}
return false;
}
+142 -10
View File
@@ -1,11 +1,10 @@
<script setup lang="ts">
import cronstrue from 'cronstrue';
import { isValidCron } from 'cron-validator';
import ctz from 'countries-and-timezones';
import getTimezoneOffset from 'get-timezone-offset';
import { type CronType, getLastExecutionTimes, isCronValid } from './crontab-generator.service';
import { useStyleStore } from '@/stores/style.store';
function isCronValid(v: string) {
return isValidCron(v, { allowBlankDay: true, alias: true, seconds: true });
}
import { useQueryParamOrStorage } from '@/composable/queryParams';
const styleStore = useStyleStore();
@@ -15,9 +14,25 @@ const cronstrueConfig = reactive({
dayOfWeekStartIndexZero: true,
use24HourTimeFormat: true,
throwExceptionOnParseError: true,
monthStartIndexZero: false,
tzOffset: (new Date()).getTimezoneOffset() / 60,
});
const helpers = [
// getTimezoneOffset(tz.name, now) / 60
const browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const allTimezones = Object.values(ctz.getAllTimezones()).map((tz) => {
const timezoneUTCDSTOffset = tz.utcOffset === tz.dstOffset ? tz.utcOffsetStr : `${tz.utcOffsetStr}/${tz.dstOffsetStr}`;
return {
value: tz.name,
label: `${tz.name === browserTimezone ? 'Browser TZ - ' : ''}${tz.name} (${timezoneUTCDSTOffset})`,
};
});
const currentTimezone = useQueryParamOrStorage({ name: 'tz', storageName: 'crongen:tz', defaultValue: browserTimezone });
watchEffect(() => {
cronstrueConfig.tzOffset = -getTimezoneOffset(currentTimezone.value, new Date()) / 60;
});
const commonHelpers = [
{
symbol: '*',
meaning: 'Any value',
@@ -42,6 +57,10 @@ const helpers = [
example: '*/10 * * *',
equivalent: 'Every 10 minutes',
},
];
const standardHelpers = [
...commonHelpers,
{
symbol: '@yearly',
meaning: 'Once every year at midnight of 1 January',
@@ -92,6 +111,59 @@ const helpers = [
},
];
const awsHelpers = [
...commonHelpers,
{
symbol: '?',
meaning: 'One or another. In the Day-of-month field you could enter 7, and if you didn\'t care what day of the week the seventh was, you could enter ? in the Day-of-week field',
example: '9 * 7,9,11 5 ? 2021',
equivalent: 'At 9 minutes past the hour, every hour, on day 7, 9, and 11 of the month, only in May, only in 2021',
},
{
symbol: 'L',
meaning: 'The L wildcard in the Day-of-month or Day-of-week fields specifies the last day of the month or week.',
example: '9 * L 5 ? 2019,2020',
equivalent: 'At 9 minutes past the hour, every hour, on the last day of the month, only in May, only in 2019 and 2020',
},
{
symbol: 'W',
meaning: 'The W wildcard in the Day-of-month field specifies a weekday. In the Day-of-month field, 3W specifies the day closest to the third weekday of the month.',
example: '19 4 3W 9 ? 2019,2020',
equivalent: 'At 04:19 AM, on the weekday nearest day 3 of the month, only in September, only in 2019 and 2020',
},
{
symbol: '#',
meaning: 'The # wildcard in the Day-of-week field specifies the nieth weekday of the month. 3#5 specifies the fifth Wednesday of the month',
example: '9 8-20 ? 12 3#5 2019,2020',
equivalent: 'At 9 minutes past the hour, between 08:00 AM and 08:59 PM, on the fifth Wednesday of the month, only in December, only in 2019 and 2020',
},
];
const defaultAWSCronExpression = '0 0 ? * 1 *';
const defaultStandardCronExpression = '40 * * * *';
const cronType = ref<CronType>('standard');
watch(cronType,
(newCronType) => {
if (newCronType === 'aws') {
if (!cron.value || cron.value === defaultStandardCronExpression) {
cron.value = defaultAWSCronExpression;
}
}
else if (newCronType === 'standard') {
if (!cron.value || cron.value === defaultAWSCronExpression) {
cron.value = defaultStandardCronExpression;
}
}
},
);
const getHelpers = computed(() => {
if (cronType.value === 'aws') {
return awsHelpers;
}
return standardHelpers;
});
const cronString = computed(() => {
if (isCronValid(cron.value)) {
return cronstrue.toString(cron.value, cronstrueConfig);
@@ -101,10 +173,24 @@ const cronString = computed(() => {
const cronValidationRules = [
{
validator: (value: string) => isCronValid(value),
validator: (value: string) => isCronValid(value, cronType.value),
message: 'This cron is invalid',
},
];
const executionTimesString = computed(() => {
if (isCronValid(cron.value)) {
try {
const lastExecutionTimes = getLastExecutionTimes(cron.value, currentTimezone.value);
const executionTimesString = lastExecutionTimes.join('\n');
return `Next 5 execution times:\n${executionTimesString}`;
}
catch (e: any) {
return e.toString();
}
}
return ' ';
});
</script>
<template>
@@ -119,10 +205,27 @@ const cronValidationRules = [
/>
</div>
<n-radio-group v-model:value="cronType" name="radiogroup" mb-2 flex justify-center>
<n-space>
<n-radio
value="standard"
label="Unix standard"
/>
<n-radio
value="aws"
label="AWS"
/>
</n-space>
</n-radio-group>
<div class="cron-string">
{{ cronString }}
</div>
<div class="cron-execution-string">
{{ executionTimesString }}
</div>
<n-divider />
<div flex justify-center>
@@ -136,11 +239,21 @@ const cronValidationRules = [
<n-form-item label="Days start at 0">
<n-switch v-model:value="cronstrueConfig.dayOfWeekStartIndexZero" />
</n-form-item>
<n-form-item label="Months start at 0">
<n-switch v-model:value="cronstrueConfig.monthStartIndexZero" />
</n-form-item>
<c-select
v-model:value="currentTimezone"
searchable
label="Timezone:"
:options="allTimezones"
/>
</n-form>
</div>
</c-card>
<c-card>
<pre>
<pre v-if="cronType === 'standard'">
-- Standard CRON Syntax --
┌──────────── [optional] seconds (0 - 59)
| ┌────────── minute (0 - 59)
| | ┌──────── hour (0 - 23)
@@ -150,8 +263,19 @@ const cronValidationRules = [
| | | | | |
* * * * * * command</pre>
<pre v-if="cronType === 'aws'">
-- AWS CRON Syntax --
┌──────────── minute (0 - 59)
| ┌────────── hour (0 - 23)
| | ┌──────── day of month (1 - 31) OR ? OR L OR W
| | | ┌────── month (1 - 12) OR jan,feb,mar,apr ...
| | | | ┌──── day of week (0 - 6, sunday=0) OR sun,mon OR L ...
| | | | | ┌── year
| | | | | |
* * * * * *</pre>
<div v-if="styleStore.isSmallScreen">
<c-card v-for="{ symbol, meaning, example, equivalent } in helpers" :key="symbol" mb-3 important:border-none>
<c-card v-for="{ symbol, meaning, example, equivalent } in getHelpers" :key="symbol" mb-3 important:border-none>
<div>
Symbol: <strong>{{ symbol }}</strong>
</div>
@@ -168,7 +292,7 @@ const cronValidationRules = [
</c-card>
</div>
<c-table v-else :data="helpers" />
<c-table v-else :data="getHelpers" />
</c-card>
</template>
@@ -191,4 +315,12 @@ pre {
overflow: auto;
padding: 10px 0;
}
.cron-execution-string{
text-align: center;
font-size: 14px;
opacity: 0.8;
margin: 5px 0 15px;
white-space: pre-wrap;
}
</style>
+3
View File
@@ -0,0 +1,3 @@
declare module "get-timezone-offset" {
export default function(timeZoneName: string, date: Date);
}
+1
View File
@@ -20,6 +20,7 @@ export const tool = defineTool({
'day',
'minute',
'second',
'aws',
],
component: () => import('./crontab-generator.vue'),
icon: Alarm,
-2
View File
@@ -2,7 +2,6 @@ import { tool as base64FileConverter } from './base64-file-converter';
import { tool as base64StringConverter } from './base64-string-converter';
import { tool as basicAuthGenerator } from './basic-auth-generator';
import { tool as emailNormalizer } from './email-normalizer';
import { tool as jsonSizeAnalyzer } from './json-size-analyzer';
import { tool as asciiTextDrawer } from './ascii-text-drawer';
@@ -152,7 +151,6 @@ export const toolsByCategory: ToolCategory[] = [
crontabGenerator,
jsonViewer,
jsonMinify,
jsonSizeAnalyzer,
jsonToCsv,
sqlPrettify,
chmodCalculator,
-12
View File
@@ -1,12 +0,0 @@
import { FileAnalytics } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Json Size Analyzer',
path: '/json-size-analyzer',
description: 'Measure JSON nodes relative weights',
keywords: ['json', 'size', 'analyzer'],
component: () => import('./json-size-analyzer.vue'),
icon: FileAnalytics,
createdAt: new Date('2024-07-14'),
});
-13
View File
@@ -1,13 +0,0 @@
declare module 'json-analyzer' {
export default function analyze({
json,
verbose,
maxDepth,
target,
}: {
json: any,
verbose: boolean,
maxDepth: number,
target: string,
});
}
@@ -1,113 +0,0 @@
import { describe, expect, it } from 'vitest';
import { getJsonUsageTreeNodes } from './json-size-analyzer.service';
describe('json-size-analyzer', () => {
describe('getJsonUsageTreeNodes', () => {
it('return correct tree nodes structures', () => {
expect(getJsonUsageTreeNodes([{ a: [1, 2, 3] }, { b: 'a' }])).to.deep.eq({
children: [
{
children: [
{
children: [
{
children: [],
key: '$.[0].a.[0]',
label: '$.[0].a.[0]: 1 B(26 B gzip)',
},
{
children: [],
key: '$.[0].a.[1]',
label: '$.[0].a.[1]: 1 B(24 B gzip)',
},
{
children: [],
key: '$.[0].a.[2]',
label: '$.[0].a.[2]: 1 B(25 B gzip)',
},
],
key: '$.[0].a',
label: '$.[0].a: 7 B(35 B gzip) ; 28.000% of parent ; biggest child node: \'0\'',
},
],
key: '$.[0]',
label: '$.[0]: 13 B(43 B gzip) ; 52.000% of parent ; biggest child node: \'a\'',
},
{
children: [
{
children: [],
key: '$.[1].b',
label: '$.[1].b: 1 B(25 B gzip)',
},
],
key: '$.[1]',
label: '$.[1]: 9 B(34 B gzip) ; 36.000% of parent ; biggest child node: \'b\'',
},
],
key: '$',
label: '$: 25 B(61 B gzip) ; 100.00% of parent ; biggest child node: \'0\'',
});
expect(getJsonUsageTreeNodes({ a: { b: [1, 2, 3], c: 12 } })).to.deep.eq({
children: [
{
children: [
{
children: [
{
children: [],
key: '$.a.b.[0]',
label: '$.a.b.[0]: 1 B(26 B gzip)',
},
{
children: [],
key: '$.a.b.[1]',
label: '$.a.b.[1]: 1 B(24 B gzip)',
},
{
children: [],
key: '$.a.b.[2]',
label: '$.a.b.[2]: 1 B(25 B gzip)',
},
],
key: '$.a.b',
label: '$.a.b: 7 B(35 B gzip) ; 26.923% of parent ; biggest child node: \'0\'',
},
{
children: [],
key: '$.a.c',
label: '$.a.c: 2 B(24 B gzip)',
},
],
key: '$.a',
label: '$.a: 20 B(50 B gzip) ; 76.923% of parent ; biggest child node: \'b\'',
},
],
key: '$',
label: '$: 26 B(63 B gzip) ; 100.00% of parent ; biggest child node: \'a\'',
});
expect(getJsonUsageTreeNodes({ a: { b: 'azerty', c: 'ueop' } })).to.deep.eq({
children: [
{
children: [
{
children: [],
key: '$.a.b',
label: '$.a.b: 6 B(30 B gzip)',
},
{
children: [],
key: '$.a.c',
label: '$.a.c: 4 B(29 B gzip)',
},
],
key: '$.a',
label: '$.a: 25 B(51 B gzip) ; 80.645% of parent ; biggest child node: \'b\'',
},
],
key: '$',
label: '$: 31 B(61 B gzip) ; 100.00% of parent ; biggest child node: \'a\'',
});
});
});
});
@@ -1,51 +0,0 @@
import jsonAnalyzer from 'json-analyzer';
export interface Meta {
__meta__: {
size?: {
value: number
raw: string
gzip: string
}
number_of_childs?: number
parent_relative_percentage?: string
biggest_node_child: string
}
}
export type AnalysisNode = {
[key: string]: object & Meta
} & Meta;
export type TreeNode = {
key: string
label: string
children: Array<TreeNode>
} & Record<string, unknown>;
function getTreeNodes(obj: AnalysisNode, parentName: string): TreeNode {
const childNodes = Object.entries(obj)
.filter(([key, v]) => key !== '__meta__' && typeof v === 'object')
.map(([k, v]) => ({
key: (Number.isNaN(Number.parseInt(k, 10)) ? `.${k}` : `.[${k}]`),
value: v as AnalysisNode,
}));
const biggest_child_node = obj.__meta__.biggest_node_child ? ` ; biggest child node: '${obj.__meta__.biggest_node_child}'` : '';
const parent_relative_percentage = obj.__meta__.parent_relative_percentage ? ` ; ${obj.__meta__.parent_relative_percentage} of parent` : '';
return {
key: parentName,
label: obj.__meta__
? `${parentName}: ${obj.__meta__.size?.raw}(${obj.__meta__.size?.gzip} gzip)${parent_relative_percentage}${biggest_child_node}`
: parentName,
children: childNodes.map(childNode => getTreeNodes(childNode.value, parentName + childNode.key)),
};
}
export function getJsonUsageTreeNodes(jsonObj: any, maxDepth: number = 100, targetNode: string = ''): TreeNode {
const analysis = jsonAnalyzer({
json: jsonObj,
verbose: true,
maxDepth,
target: targetNode,
});
return getTreeNodes(analysis, '$');
}
@@ -1,68 +0,0 @@
<script setup lang="ts">
import JSON5 from 'json5';
import { getJsonUsageTreeNodes } from './json-size-analyzer.service';
import { useValidation } from '@/composable/validation';
const json = ref('{"a": 1, "b": [1,2,3]}');
const maxDepth = ref(100);
const target = ref('');
const jsonSizes = computed(() => {
const jsonObj = JSON5.parse(json.value);
if (!jsonObj) {
return null;
}
return [getJsonUsageTreeNodes(jsonObj, maxDepth.value - 1, target.value)];
});
const searchInAnalysis = ref('');
const jsonValidation = useValidation({
source: json,
rules: [
{
validator: (v) => {
return JSON5.parse(v);
},
message: 'Provided JSON is not valid.',
},
],
});
</script>
<template>
<div style="max-width: 600px;">
<c-card title="Input" mb-2>
<c-input-text
v-model:value="json"
label="JSON"
multiline
placeholder="Put your JSON data here..."
rows="5"
:validation="jsonValidation"
mb-2
/>
<n-form-item label="Max Depth:" label-placement="left">
<n-input-number v-model:value="maxDepth" :min="0" w-full />
</n-form-item>
<c-input-text
v-model:value="target"
label="Target Node"
placeholder="Where to start the analyze (ie, a[0].b.c)"
mb-2
/>
</c-card>
<c-card v-if="jsonSizes" title="Analysis">
<n-input v-model:value="searchInAnalysis" placeholder="Search in result" />
<n-tree
:show-irrelevant-nodes="false"
:pattern="searchInAnalysis"
:default-expand-all="true"
:data="jsonSizes"
block-line
/>
</c-card>
</div>
</template>
+1 -1
View File
@@ -4,7 +4,7 @@ import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Regex Tester',
path: '/regex-tester',
description: 'Test your regular expressions with sample text.',
description: 'Regex Tester',
keywords: ['regex', 'tester', 'sample', 'expression'],
component: () => import('./regex-tester.vue'),
icon: Language,