227 Commits
6 ... v0.3.2

Author SHA1 Message Date
e6f7dd2be8 Merge pull request 'Alpha Release 0.3.2' (#31) from dev into main
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
Reviewed-on: #31
Reviewed-by: Philipp Dormann <philipp@philippdormann.de>
2021-02-18 15:22:26 +00:00
49590b897e 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-18 15:18:27 +00:00
a9019e4c67 🚀Bumped version to v0.3.2
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-18 16:18:01 +01:00
cc6a53b258 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-18 15:17:10 +00:00
e0db6f6a78 Merge pull request 'Now using full group names feature/18-group_names' (#30) from feature/18-group_names into dev
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #30
2021-02-18 15:16:53 +00:00
0fcfb30d5c Updated templates with full group name
ref #18
2021-02-17 18:59:14 +01:00
c2909082a2 Now manually parsing runnergroup full names
ref #18
2021-02-17 18:57:21 +01:00
92c52401b3 📖New license file version [CI SKIP] [skip ci] 2021-02-16 17:49:26 +00:00
7ca7266ea4 Pinned routing controllers version as temp workaround for routing controllers openapi being broken again
All checks were successful
continuous-integration/drone/push Build is passing
Initial failure: https://ci.odit.services/lfk/document-server/47/1/2
2021-02-16 18:47:52 +01:00
adf11ab1c3 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-13 20:13:40 +00:00
db91661556 Merge pull request 'Alpha Release 0.3.1 - API Keys' (#29) from dev into main
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #29
Reviewed-by: Philipp Dormann <philipp@philippdormann.de>
2021-02-13 20:13:14 +00:00
9d7d044384 📖New license file version [CI SKIP] [skip ci] 2021-02-13 20:11:44 +00:00
95099c5fbd 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-13 20:10:54 +00:00
782861bd93 Merge branch 'dev' of git.odit.services:lfk/document-server into dev
Some checks failed
continuous-integration/drone/push Build is failing
2021-02-13 21:10:34 +01:00
dcde424b77 🚀Bumped version to v0.3.1 2021-02-13 21:10:26 +01:00
b7c6c6e157 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-13 20:09:52 +00:00
2d031dae03 Merge pull request 'API Key based auth feature/26-api_auth' (#27) from feature/26-api_auth into dev
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #27
2021-02-13 20:09:36 +00:00
729f2d7240 Added auth to openapi spec
ref #26
2021-02-13 16:24:47 +01:00
454309278e Added api key to env doc
ref #26
2021-02-13 16:16:36 +01:00
7be211f8b7 Fixed bug
ref #26
2021-02-13 16:14:08 +01:00
bdeadd274b Implemented basic auth
ref #26
2021-02-13 16:09:58 +01:00
e306cdb2c8 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-12 17:04:08 +00:00
406add3d51 Merge pull request 'Alpha Release 0.3.0 - Runnercard generation' (#25) from dev into main
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Reviewed-on: #25
Reviewed-by: Philipp Dormann <philipp@philippdormann.de>
2021-02-12 17:03:26 +00:00
e74b9a4c9d 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-12 17:01:30 +00:00
449a96b302 🚀Bumped version to v0.3.0
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-12 18:00:42 +01:00
703eaa0e9d Merge pull request 'Card generation feature/14-card_generation' (#24) from feature/14-card_generation into dev
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #24
2021-02-12 16:59:53 +00:00
b4dc1d2be7 Merge branch 'dev' into feature/14-card_generation 2021-02-12 16:56:20 +00:00
cf0f5839ee Added new env vars to readme
ref #14
2021-02-12 17:55:48 +01:00
29376a7782 Now loading sponsor logos from env
ref #14
2021-02-12 17:55:37 +01:00
08e858726c Fixed runnercard backside padding
ref #14
2021-02-12 17:45:52 +01:00
68a1b8f3e0 Implmented sponsoring image selection from array
ref #14
2021-02-12 17:19:57 +01:00
9697d53a15 Fixed bug in array swapping function
ref #14
2021-02-12 17:06:20 +01:00
d38923c4ad Added card generation speed tests (part 2)
ref #14
2021-02-09 19:40:02 +01:00
03c7d590d0 Merge branch 'dev' into feature/14-card_generation
# Conflicts:
#	src/PdfCreator.ts
#	src/asyncHelpers.ts
#	src/controllers/PdfController.ts
#	src/tests/speedtest.ts
2021-02-09 19:38:27 +01:00
8a90f63b09 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-09 18:38:04 +00:00
491cdb8d71 🚀Bumped version to v0.2.0
Some checks failed
continuous-integration/drone/push Build is failing
2021-02-09 19:37:46 +01:00
68572b194e Added card generation speed tests (part 1)
ref #14
2021-02-09 19:37:32 +01:00
1eb634fe11 Merge branch 'dev' into feature/14-card_generation 2021-02-09 19:28:21 +01:00
dbccbf68f4 📖New license file version [CI SKIP] [skip ci] 2021-02-09 18:26:21 +00:00
96204d809e 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-09 18:24:56 +00:00
7ac8edb5cf Merge pull request 'Added speedtest feature/19-speed_test' (#23) from feature/19-speed_test into dev
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #23
2021-02-09 18:24:37 +00:00
05561db5b8 Merge branch 'dev' into feature/19-speed_test 2021-02-09 19:22:30 +01:00
149bf1849d 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-09 18:21:49 +00:00
b952ac4d72 Merge pull request 'Alpha Release 0.2.0 - The barcode release' (#22) from dev into main
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is failing
Reviewed-on: #22
Reviewed-by: Philipp Dormann <philipp@philippdormann.de>
2021-02-09 18:21:14 +00:00
5c075bce8b Added barcode generatin
ref #19
2021-02-09 19:15:08 +01:00
b77945a9e4 Merge branch 'dev' into feature/14-card_generation 2021-02-09 18:43:32 +01:00
aefe5493b0 Beautified output a bit
ref #19
2021-02-09 18:43:15 +01:00
75b8b281b8 Added speedtest script to package
ref #19
2021-02-09 18:02:43 +01:00
44f139aa01 Merge branch 'dev' into feature/19-speed_test 2021-02-09 17:54:44 +01:00
a1b0a1918d Implemented basic contracts tests in various sizes
ref #19
2021-02-09 17:54:13 +01:00
467d8df6db Merge branch 'dev' into feature/19-speed_test 2021-02-09 17:50:05 +01:00
fea0b1dc05 📖New license file version [CI SKIP] [skip ci] 2021-02-09 16:45:18 +00:00
7122fe7dbe 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-09 16:44:09 +00:00
ff36b4871f Merge pull request 'Barcode generation feature/13-barcode_generation' (#21) from feature/13-barcode_generation into dev
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #21
2021-02-09 16:43:45 +00:00
03f63e3777 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-09 16:43:32 +00:00
ecd02a1af7 Merge pull request 'Alpha Release 0.1.3 - More env vars' (#20) from dev into main
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is failing
Reviewed-on: #20
Reviewed-by: Philipp Dormann <philipp@philippdormann.de>
2021-02-09 16:43:06 +00:00
b0d42939a6 Merge branch 'dev' into feature/13-barcode_generation
# Conflicts:
#	src/PdfCreator.ts
#	src/config.ts
2021-02-09 17:35:20 +01:00
502345782f Added fallback error image
ref #13
2021-02-09 17:28:21 +01:00
9a7c1d64fd Now loading barcode format from env with overwrite via query param
ref #13
2021-02-09 17:28:04 +01:00
4b79b29ee6 Now with working code scaleing
ref #13
2021-02-09 17:02:02 +01:00
edc846ab05 Implemented async barcode generation using async helpers
ref #13
2021-02-09 16:38:18 +01:00
0d27916188 tmp 2021-02-08 18:12:35 +01:00
0894446085 Implemented runner generation using fakerjs
ref #19
2021-02-08 18:08:01 +01:00
4187a8e820 Fixed broken mime-type
ref #13
2021-02-08 17:52:04 +01:00
e1ec193a4f Removed promise
ref #13
2021-02-08 17:48:09 +01:00
ad9a8a4fe0 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-08 16:39:08 +00:00
6a14232889 🚀Bumped version to v0.1.3
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-08 17:38:42 +01:00
b6296b8d97 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-08 16:37:35 +00:00
bc4d16e6f8 Merge pull request 'Load more stuff from env feature/16-env_vars' (#17) from feature/16-env_vars into dev
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #17
2021-02-08 16:37:07 +00:00
e3a45a61ac Implemented first experimental speedtest
ref #19
2021-02-08 17:32:02 +01:00
7f58dd694b Fixed double-sided printing
ref #14
2021-02-08 16:14:10 +01:00
68f46a45b5 Added **very** basic backside
ref #14
2021-02-08 15:57:09 +01:00
016f746c7c Styled front
ref #14
2021-02-08 15:53:44 +01:00
b77bb3ad9d Added new env vars to readme
ref #16
2021-02-08 10:23:02 +01:00
b4ebae283b Now loading interpolation vars from config/env
ref #16
2021-02-08 10:22:49 +01:00
3bb322ede5 Added new env vars to config
ref #16
2021-02-08 10:22:29 +01:00
b92a6f7b2b Added sizing for the real cards
ref #14
2021-02-08 10:14:27 +01:00
d3a213ce33 Added basic logic to generate two-sided runnercards
ref #14
2021-02-08 10:07:58 +01:00
8fc6c7176e Added basic card generation function
ref #14
2021-02-08 09:55:29 +01:00
929ac81515 Added cards api endpoint
ref #14
2021-02-08 09:51:52 +01:00
75d2ac3c5f Added todo
ref #13
2021-02-08 09:47:28 +01:00
3e2b011d28 Switched to using the current runner's id as the barcode text
ref #13
2021-02-08 09:24:10 +01:00
1c06689800 Reworked template layout for barcode
ref #13
2021-02-08 09:20:45 +01:00
a35f8cfd3a First part of the handlebars barcode generation
ref #13
2021-02-08 09:11:59 +01:00
27d1d69360 Added barcode field to template
ref #13
2021-02-08 09:11:27 +01:00
8072d0b194 Added basic barcode generation
ref #13
2021-02-08 08:32:39 +01:00
a30600943d 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-07 18:06:06 +00:00
123cf8ad48 Merge pull request 'Alpha Release 0.1.2 - Hotfix release' (#15) from dev into main
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
Reviewed-on: #15
Reviewed-by: Philipp Dormann <philipp@philippdormann.de>
2021-02-07 18:05:41 +00:00
22b1e0097e 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-07 17:59:40 +00:00
7e507d4cc4 🚀Bumped version to v0.1.2
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-07 18:59:20 +01:00
f7dfd6d0c3 PAtch: Copy locales
Some checks failed
continuous-integration/drone/push Build is failing
2021-02-07 18:59:10 +01:00
cbff3074d1 Merge pull request 'Alpha Release 0.1.1 - Hotfix release' (#12) from dev into main
Some checks failed
continuous-integration/drone/tag Build encountered an error
continuous-integration/drone/push Build is passing
Reviewed-on: #12
Reviewed-by: Philipp Dormann <philipp@philippdormann.de>
2021-02-07 17:41:14 +00:00
9755e437c2 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-07 17:36:21 +00:00
fe0f45ea92 Revert "Now only using our mirror to build"
Some checks failed
continuous-integration/drone/push Build was killed
This reverts commit b07c5a96f2.
2021-02-07 18:36:05 +01:00
b07c5a96f2 Now only using our mirror to build
Some checks failed
continuous-integration/drone/push Build is failing
2021-02-07 18:35:11 +01:00
dba765cb01 Switched to using our mirrored images for buildi
Some checks failed
continuous-integration/drone/push Build encountered an error
2021-02-07 18:16:38 +01:00
8ca015ecf8 Merge branch 'dev' of git.odit.services:lfk/document-server into dev
Some checks failed
continuous-integration/drone/push Build encountered an error
2021-02-07 18:04:19 +01:00
6ab3946c31 Pinned alpine version 2021-02-07 17:55:07 +01:00
603a814ad4 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-07 16:53:09 +00:00
7736ccdc0c Merge branch 'dev' of git.odit.services:lfk/document-server into dev
Some checks failed
continuous-integration/drone/push Build is failing
2021-02-07 17:52:55 +01:00
d1b07f39fd 🚀Bumped version to v0.1.1 2021-02-07 17:52:50 +01:00
8d4e7a16d1 📖New license file version [CI SKIP] [skip ci] 2021-02-07 16:52:46 +00:00
4fca5afdfa 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-07 16:51:51 +00:00
ea8028dfd5 Updated dockerfile & build for dockerized puppeteer
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-07 17:51:36 +01:00
bc2b6fadd9 Merge pull request 'Alpha Release 0.1.0 - Contract generation' (#11) from dev into main
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Reviewed-on: #11
Reviewed-by: Philipp Dormann <philipp@philippdormann.de>
2021-02-07 15:53:07 +00:00
ee19efa0e6 📖New license file version [CI SKIP] [skip ci] 2021-02-07 15:39:51 +00:00
f3de80af78 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-07 15:38:51 +00:00
6a42fe37d0 🚀Bumped version to v0.1.0
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-07 16:38:31 +01:00
84259d37d4 Merge pull request 'Sponsoring contract generation feature/5-sponsoring_contracts' (#10) from feature/5-sponsoring_contracts into dev
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #10
2021-02-07 15:37:51 +00:00
140fda11cc Added optimization args
ref #5
2021-02-07 16:37:24 +01:00
e92820e12f Parellized the chunks
ref #5
2021-02-07 16:28:26 +01:00
4773a5f18c Added sentence about large requests to the /contracts openapi description
ref #5
2021-02-07 16:11:35 +01:00
06dedc0797 Removed puppeteer args
ref #5
2021-02-07 16:07:38 +01:00
785544ca16 Added pdf merging for big requests (over 100 runners)
ref #5
2021-02-07 16:04:56 +01:00
4f191dcb52 Expanded max request body size to 500mb
ref #5
2021-02-07 15:41:53 +01:00
1ced0e3175 Added option to generate empty sponsoring contracts
ref #5
2021-02-07 13:11:54 +01:00
5e1252545b Removed the example data from the fill-in fields
ref #5
2021-02-07 13:04:45 +01:00
2d0b7ce79e Formatting
ref #5
2021-02-07 12:59:11 +01:00
1962499d18 Sorted locales
ref #5
2021-02-07 12:55:40 +01:00
1e67672ef0 Added translation sorting secript
ref #
2021-02-07 12:55:24 +01:00
e401d0ec72 Removed base64 image
ref #5
2021-02-07 12:32:54 +01:00
42443af734 Added automatic img to base64 conversion
ref #5
2021-02-07 12:32:23 +01:00
c07319b250 Now awaiting language change
ref #5
2021-02-06 22:02:16 +01:00
388d8a2dc6 Removed fullname from groups (to be renabled later)
ref #5
2021-02-06 21:48:47 +01:00
ee8ba99cc7 Fixed the controller not waiting for initialization
ref #5
2021-02-06 21:37:56 +01:00
47a05facb3 Moved pdf creatior initialization to new function
ref #5
2021-02-06 21:30:18 +01:00
f755f4f9fb Added full interpolation support to the i18n
ref #5
2021-02-06 21:15:48 +01:00
784d7c656f Added a bunch of english and german translations 🌎
ref #5
2021-02-06 20:33:47 +01:00
e345c36dd0 Added i18n strings
ref #5
2021-02-06 20:33:21 +01:00
c617c40e9d Working Styleing
ref #5
2021-02-06 20:15:33 +01:00
a9e3360ee2 First working (TM) template code
ref #5
2021-02-06 20:04:08 +01:00
13776d1ecb Added first parts of template
ref #5
2021-02-06 19:16:45 +01:00
f69e7779e4 Updated readme
ref #5
2021-02-05 22:23:48 +01:00
8ec5de4877 Merge branch 'feature/5-sponsoring_contracts' of git.odit.services:lfk/document-server into feature/5-sponsoring_contracts 2021-02-05 22:19:50 +01:00
7c3813b94d Now with workin i18n-ally config🥳
ref #5
2021-02-05 22:19:47 +01:00
b4232e51e0 Now with workin i18n-ally config🥳
ref #5
2021-02-05 22:19:38 +01:00
cd51e78282 Added comments
ref #5
2021-02-05 22:02:26 +01:00
f833ae222e Now accepting arrays for sponsoring contract generation
ref #5
2021-02-05 21:56:33 +01:00
4cd437b6af Removed useless await
ref #5
2021-02-05 21:48:47 +01:00
9be3e789a5 Merge branch 'feature/5-sponsoring_contracts' of git.odit.services:lfk/document-server into feature/5-sponsoring_contracts 2021-02-05 21:48:18 +01:00
119102aef8 Updated comments
ref #5
2021-02-05 21:48:15 +01:00
cf9cd298b6 Updated comments
ref #5
2021-02-05 21:47:23 +01:00
05e471878f Updated readme for handlebars
ref #5
2021-02-05 21:29:21 +01:00
6f81566cb8 Implemented language selection by query param
ref #5
2021-02-05 21:27:14 +01:00
a596188c00 Updated template for i18n
ref #5
2021-02-05 21:20:20 +01:00
75eb925267 Added translations using i18next
ref #5
2021-02-05 21:20:05 +01:00
19697692bc Added example locales
ref #5
2021-02-05 21:17:08 +01:00
4acf3e39ce Switched to handlebars for templateing
ref #5
2021-02-05 20:08:47 +01:00
3af76a53e3 first working pdf generation from class 🎉
ref #5
2021-02-05 17:59:26 +01:00
d58453faf9 Edited html template
ref #5
2021-02-05 17:49:42 +01:00
bd6ec6215d Fixed data validation problem
ref #5
2021-02-05 17:48:14 +01:00
96d863bfc8 Merge branch 'feature/5-sponsoring_contracts' of git.odit.services:lfk/document-server into feature/5-sponsoring_contracts
# Conflicts:
#	src/PdfCreator.ts
2021-02-05 14:09:57 +01:00
ba7cedd187 PDF Creator now accepts single instances of class
ref #5
2021-02-05 14:09:44 +01:00
78205ee8c7 PDF Creator now accepts single instances of class
ref #5
2021-02-05 14:09:20 +01:00
041c0ed6bb Added a coupple of real replacement strings to the sponsoring template
ref #5
2021-02-05 13:59:13 +01:00
6121b1e3bf Updated the contract template to use external css
ref #5
2021-02-05 13:57:04 +01:00
5afd26ea22 Switched to puppeteer for pdf generation
ref #5
2021-02-05 13:53:46 +01:00
4585a83838 Merge pull request 'Patch 0.0.2' (#9) from dev into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #9
Reviewed-by: Philipp Dormann <philipp@philippdormann.de>
2021-02-03 17:24:33 +00:00
c07c6aeeab Fixed file broken in merge
Some checks failed
continuous-integration/drone/push Build is failing
2021-02-03 18:23:08 +01:00
9a115e75b1 Merge branch 'dev' of git.odit.services:lfk/document-server into dev
Some checks failed
continuous-integration/drone/push Build is failing
2021-02-03 18:21:04 +01:00
f4a34dd36b 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-03 18:21:01 +01:00
42d6c40d0c 🧾New changelog file version [CI SKIP] [skip ci] 2021-02-03 17:11:34 +00:00
de432c4481 🚀Bumped version to v0.0.2
Some checks failed
continuous-integration/drone/push Build is failing
2021-02-03 18:11:15 +01:00
73915da203 Merge pull request 'Basic documentation feature/6-documentation' (#8) from feature/6-documentation into dev
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #8
2021-02-03 17:10:01 +00:00
15cd5f6579 Merge branch 'dev' into feature/6-documentation 2021-02-03 17:09:50 +00:00
95b882aced Typos
ref #6
2021-02-03 18:07:35 +01:00
376087fe66 Merge branch 'feature/6-documentation' of git.odit.services:lfk/document-server into feature/6-documentation 2021-02-03 18:06:17 +01:00
68e34a9054 Typos
ref #6
2021-02-03 18:06:13 +01:00
465efe0300 📖New license file version [CI SKIP] [skip ci] 2021-02-03 17:02:45 +00:00
782b41756d Merge branch 'dev' into feature/6-documentation 2021-02-03 17:02:30 +00:00
15f16415c0 Merge pull request 'Implemented the basics for templateing feature/3-pdf_templateing' (#4) from feature/3-pdf_templateing into dev
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #4
2021-02-03 17:01:59 +00:00
82b5f9e86e Merge branch 'dev' into feature/3-pdf_templateing 2021-02-03 17:01:41 +00:00
b5e79e51ef Merge pull request 'Implemented the basic request classes feature/1-input_classes' (#2) from feature/1-input_classes into dev
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #2
2021-02-03 16:49:20 +00:00
8141269dd9 Added a template section to the readme
ref #6
2021-02-02 14:48:27 +01:00
56b72275ac Added editor and stageing infos to the README
ref #6
2021-02-02 14:36:00 +01:00
df94b1b750 Added a basic readme
ref #6
2021-02-02 14:35:10 +01:00
15ff412d75 Merge branch 'feature/6-documentation' of git.odit.services:lfk/document-server into feature/6-documentation 2021-02-02 14:31:37 +01:00
36396af50a Updated apidoc viewer settings
ref #6
2021-02-02 14:31:36 +01:00
4d45e0f80d Updated apidoc viewer settings 2021-02-02 14:31:26 +01:00
6435c8a88e Added openapi viewers
ref #6
2021-02-02 14:31:09 +01:00
3fb8be22b7 Added typeing to the buffer and stream conversion
ref #3
2021-02-02 11:34:01 +01:00
7d5b5750ad Created a pdf class that takes care of the pdf wrapping
ref #3
2021-02-02 11:30:51 +01:00
64bd1ffc3a Created a barebones pdf controller
ref #3
2021-02-02 11:28:24 +01:00
3ca38abe93 Switched to the splitted functions
ref #3
2021-02-02 11:28:07 +01:00
2c7b0254ec Adjusted template font styleing
ref #3
2021-02-02 11:27:14 +01:00
f726a6e699 Added a bs example template
ref #3
2021-02-02 11:20:47 +01:00
a7d4001ad9 Added html-pdf package
ref #3
2021-02-02 11:03:06 +01:00
4617f2c5bd Resolved fun issues with promises
ref #3
2021-02-02 11:02:23 +01:00
557cc26f28 Added Barebones pdf creator class
ref #3
2021-02-02 10:01:31 +01:00
8a30265fc6 Added templates folder
ref #3
2021-02-02 09:59:48 +01:00
9f3758de39 Added PDFs to gitignore
ref #3
2021-02-02 09:59:34 +01:00
cfa65e83ca Added a basic donor class
ref #1
2021-02-02 09:09:10 +01:00
1d73e4ed9c Added the donation classes
ref #1
2021-02-02 09:05:21 +01:00
1d1fa50327 Moved distance to the main runner object
ref #1
2021-02-02 09:05:02 +01:00
d08bdfd961 Added a certificaterunner class
ref #1
2021-02-02 08:59:30 +01:00
aae4f507ea Runners now use the runnergroup class instead of strings
ref #1
2021-02-02 08:50:31 +01:00
cb7325bbf9 Added a runnercard class
ref #1
2021-02-02 08:49:41 +01:00
e29c17a29a Added a simplified runnergroup class
ref #1
2021-02-02 08:49:18 +01:00
63f9523766 Added input class for contract generation
ref #1
2021-01-30 18:32:28 +01:00
d291cf0d1b Added address class and errors
ref #1
2021-01-30 18:32:01 +01:00
d493e74bf3 📖New license file version [CI SKIP] [skip ci] 2021-01-30 17:11:56 +00:00
83c4bd62cb fixed license-exporter call
All checks were successful
continuous-integration/drone/push Build is passing
2021-01-30 18:11:27 +01:00
8f250f747a 🧾New changelog file version [CI SKIP] [skip ci] 2021-01-30 17:07:00 +00:00
0c4e5a182c Added license export and release scripts
All checks were successful
continuous-integration/drone/push Build is passing
2021-01-30 18:06:46 +01:00
48d7cad9f3 Added drone file 2021-01-30 18:05:37 +01:00
185e66fb5b Added release-it config 2021-01-30 17:55:07 +01:00
cbc421cd83 Added build script 2021-01-30 17:53:08 +01:00
b9d4cc3619 Added dockerfile and docker-compose 2021-01-30 17:50:09 +01:00
1d62e7f14c Added a simple status controller 2021-01-30 17:47:34 +01:00
4efb62921b Cleaned up openapi stuff 2021-01-30 17:47:22 +01:00
c2d714116e Added missing dependencies 2021-01-30 17:47:10 +01:00
cff70110fd Added version to config 2021-01-30 17:45:13 +01:00
814b564752 Added dev script 2021-01-30 17:44:04 +01:00
915ff92418 Added base app 2021-01-30 17:27:43 +01:00
94e5e51f8d Added openapi dependency 2021-01-30 17:27:36 +01:00
57afbd4b6c Added loaders 2021-01-30 17:27:25 +01:00
6539fd7855 Added errorhandler middleware 2021-01-30 17:27:01 +01:00
9d62225478 Added openapi related classes 2021-01-30 17:26:51 +01:00
b1747f6374 Added version to config 2021-01-30 17:25:36 +01:00
ae466b4d7e Added vscode workspace config 2021-01-30 17:22:42 +01:00
e1f03788db Added tsconfig 2021-01-30 17:22:17 +01:00
278c56386b Added config class 2021-01-30 17:21:52 +01:00
66134c0e1e Added files to gitignore 2021-01-30 17:21:46 +01:00
61c7dbff0b Merge branch 'dev' of git.odit.services:lfk/document-server into dev
# Conflicts:
#	package.json
2021-01-30 17:20:56 +01:00
43bb728d0d Added basic dependencies 2021-01-30 17:20:42 +01:00
d450ceac74 Added basic dependencies 2021-01-30 17:19:06 +01:00
b0427a6d81 Initialized package 2021-01-30 17:16:12 +01:00
51 changed files with 12555 additions and 3 deletions

130
.drone.yml Normal file
View File

@@ -0,0 +1,130 @@
---
kind: pipeline
type: docker
name: build:dev
clone:
disable: true
steps:
- name: clone
image: alpine/git
commands:
- git clone $DRONE_REMOTE_URL .
- git checkout dev
- name: build dev
image: plugins/docker
depends_on: [clone]
settings:
username:
from_secret: DOCKER_REGISTRY_USER
password:
from_secret: DOCKER_REGISTRY_PASSWORD
repo: registry.odit.services/lfk/document-server
tags:
- dev
registry: registry.odit.services
- name: run changelog export
depends_on: ["clone"]
image: node:latest
commands:
- npx auto-changelog --commit-limit false -p -u --hide-credit
- name: push new changelog to repo
depends_on: ["run changelog export"]
image: appleboy/drone-git-push
settings:
branch: dev
commit: true
commit_message: 🧾New changelog file version [CI SKIP] [skip ci]
author_email: bot@odit.services
remote: git@git.odit.services:lfk/document-server.git
ssh_key:
from_secret: GITLAB_SSHKEY
- name: run full license export
depends_on: ["clone"]
image: node:14.15.1-alpine3.12
commands:
- yarn
- yarn licenses:export
- name: push new licenses file to repo
depends_on: ["run full license export"]
image: appleboy/drone-git-push
settings:
branch: dev
commit: true
commit_message: 📖New license file version [CI SKIP] [skip ci]
author_email: bot@odit.services
remote: git@git.odit.services:lfk/document-server.git
skip_verify: true
ssh_key:
from_secret: GITLAB_SSHKEY
trigger:
branch:
- dev
event:
- push
---
kind: pipeline
type: docker
name: build:latest
clone:
disable: true
steps:
- name: clone
image: alpine/git
commands:
- git clone $DRONE_REMOTE_URL .
- git checkout dev
- git merge main
- git checkout main
- name: build latest
depends_on: ["clone"]
image: plugins/docker
settings:
username:
from_secret: DOCKER_REGISTRY_USER
password:
from_secret: DOCKER_REGISTRY_PASSWORD
repo: registry.odit.services/lfk/document-server
tags:
- latest
registry: registry.odit.services
- name: push merge to repo
depends_on: ["clone"]
image: appleboy/drone-git-push
settings:
branch: dev
commit: false
remote: git@git.odit.services:lfk/document-server.git
ssh_key:
from_secret: GITLAB_SSHKEY
trigger:
branch:
- main
event:
- push
---
kind: pipeline
type: docker
name: build:tags
steps:
- name: build $DRONE_TAG
image: plugins/docker
depends_on: [clone]
settings:
username:
from_secret: DOCKER_REGISTRY_USER
password:
from_secret: DOCKER_REGISTRY_PASSWORD
repo: registry.odit.services/lfk/document-server
tags:
- '${DRONE_TAG}'
registry: registry.odit.services
trigger:
event:
- tag

12
.gitignore vendored
View File

@@ -4,6 +4,7 @@
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/i18n-ally-custom-framework.yml
*.code-workspace
# Local History for Visual Studio Code
@@ -127,3 +128,14 @@ dist
.yarn/install-state.gz
.pnp.*
yarn.lock
package-lock.json
build
*.sqlite
*.sqlite-jurnal
/docs
lib
/oss-attribution
*.tmp
*.pdf

11
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"recommendations": [
"2gua.rainbow-brackets",
"christian-kohler.npm-intellisense",
"remimarsal.prettier-now",
"lokalise.i18n-ally",
],
"unwantedRecommendations": [
"antfu.i18n-ally"
]
}

View File

@@ -0,0 +1,8 @@
languageIds:
- javascript
- html
keyMatchReg:
- '\{\{__ "([a-zA-Z0-9_]+)"\}\}'
monopoly: false
refactorTemplates:
- '{{__ "$1"}}'

27
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,27 @@
{
"editor.formatOnSave": true,
"typescript.format.enable": true,
"typescript.preferences.quoteStyle": "single",
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features",
"editor.codeActionsOnSave": {
"source.organizeImports": true,
// "source.fixAll": true
}
},
"javascript.preferences.quoteStyle": "single",
"javascript.preferences.importModuleSpecifierEnding": "minimal",
"typescript.preferences.importModuleSpecifierEnding": "minimal",
"typescript.preferences.includePackageJsonAutoImports": "on",
"i18n-ally.localesPaths": "src/locales",
"i18n-ally.keystyle": "nested",
"i18n-ally.extract.keygenStrategy":"slug",
"i18n-ally.enabledFrameworks": [
"custom"
],
"i18n-ally.sourceLanguage": "en"
}

241
CHANGELOG.md Normal file
View File

@@ -0,0 +1,241 @@
### Changelog
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
#### [v0.3.2](https://git.odit.services/lfk/document-server/compare/v0.3.0...v0.3.2)
- 🧾New changelog file version [CI SKIP] [skip ci] [`cc6a53b`](https://git.odit.services/lfk/document-server/commit/cc6a53b25895594874acca370a1439d37bb280de)
- 🚀Bumped version to v0.3.2 [`a9019e4`](https://git.odit.services/lfk/document-server/commit/a9019e4c67e7620b65650d60b0ebd57bc11a854e)
- Merge pull request 'Now using full group names feature/18-group_names' (#30) from feature/18-group_names into dev [`e0db6f6`](https://git.odit.services/lfk/document-server/commit/e0db6f6a78d0026a8485a57c88af1e9407bd68a4)
- 🚀Bumped version to v0.3.1 [`dcde424`](https://git.odit.services/lfk/document-server/commit/dcde424b77dcc9753859f94f7bcbe24fe3523c27)
- 📖New license file version [CI SKIP] [skip ci] [`92c5240`](https://git.odit.services/lfk/document-server/commit/92c52401b398f6a2f247c10879e17f6dc105aa8e)
- Now manually parsing runnergroup full names [`c290908`](https://git.odit.services/lfk/document-server/commit/c2909082a2dbb38041ae0fc695bd0fa1451b39ff)
- Implemented basic auth [`bdeadd2`](https://git.odit.services/lfk/document-server/commit/bdeadd274bc0f9c8cbab35a8a5605bef4c22ba6c)
- 📖New license file version [CI SKIP] [skip ci] [`9d7d044`](https://git.odit.services/lfk/document-server/commit/9d7d0443848522e5bdfdb6a80c836bea4bc200a1)
- 🧾New changelog file version [CI SKIP] [skip ci] [`e306cdb`](https://git.odit.services/lfk/document-server/commit/e306cdb2c8e58fc1aef79b95cba5d4cc96ac7658)
- Added auth to openapi spec [`729f2d7`](https://git.odit.services/lfk/document-server/commit/729f2d7240b54ffe2d4db36cce29de0afdfc9417)
- Pinned routing controllers version as temp workaround for routing controllers openapi being broken again [`7ca7266`](https://git.odit.services/lfk/document-server/commit/7ca7266ea46965251c9df637a2556f2a1706e7e6)
- 🧾New changelog file version [CI SKIP] [skip ci] [`adf11ab`](https://git.odit.services/lfk/document-server/commit/adf11ab1c356b6964230541331836abd363170b0)
- 🧾New changelog file version [CI SKIP] [skip ci] [`b7c6c6e`](https://git.odit.services/lfk/document-server/commit/b7c6c6e15708e471f5c3d0ca4cf11b1c08c88c9c)
- 🧾New changelog file version [CI SKIP] [skip ci] [`95099c5`](https://git.odit.services/lfk/document-server/commit/95099c5fbd7e6cb07c68151a998eebb0f00556f3)
- Updated templates with full group name [`0fcfb30`](https://git.odit.services/lfk/document-server/commit/0fcfb30d5c13266ca4faf7697308dfb7a0f91b4f)
- Merge pull request 'Alpha Release 0.3.1 - API Keys' (#29) from dev into main [`db91661`](https://git.odit.services/lfk/document-server/commit/db916615564813e8d21e3672581e4f3a4d748b89)
- Merge pull request 'API Key based auth feature/26-api_auth' (#27) from feature/26-api_auth into dev [`2d031da`](https://git.odit.services/lfk/document-server/commit/2d031dae035866a4aa247398ea68ff338ab58cbd)
- Added api key to env doc [`4543092`](https://git.odit.services/lfk/document-server/commit/454309278ef20a2b97248277b07a7b58a063618d)
- Fixed bug [`7be211f`](https://git.odit.services/lfk/document-server/commit/7be211f8b7b26f7f620df81af4ebde5eec2feec2)
#### [v0.3.0](https://git.odit.services/lfk/document-server/compare/v0.2.0...v0.3.0)
> 12 February 2021
- Merge pull request 'Alpha Release 0.3.0 - Runnercard generation' (#25) from dev into main [`406add3`](https://git.odit.services/lfk/document-server/commit/406add3d517473d01628b6405569de6cb85114e0)
- 🚀Bumped version to v0.2.0 [`491cdb8`](https://git.odit.services/lfk/document-server/commit/491cdb8d71a80ea196d16334c0c80b8f7cc859c5)
- Added card generation speed tests (part 1) [`68572b1`](https://git.odit.services/lfk/document-server/commit/68572b194eb740238be8101efed6fdb2a207f65b)
- Implemented first experimental speedtest [`e3a45a6`](https://git.odit.services/lfk/document-server/commit/e3a45a61ac3b2d691c2f75d36155896b7ed301d8)
- Added basic logic to generate two-sided runnercards [`d3a213c`](https://git.odit.services/lfk/document-server/commit/d3a213ce3326aeb96d924e16a31fc87bf82eb5b3)
- 🧾New changelog file version [CI SKIP] [skip ci] [`149bf18`](https://git.odit.services/lfk/document-server/commit/149bf1849db20b863ec998a72c77559ec401bc32)
- Fixed double-sided printing [`7f58dd6`](https://git.odit.services/lfk/document-server/commit/7f58dd694b53152069c2095b2e18dd3a46cd04dd)
- 🧾New changelog file version [CI SKIP] [skip ci] [`e74b9a4`](https://git.odit.services/lfk/document-server/commit/e74b9a4c9d041780e0cfd8c4d68a5b63f916e091)
- Added basic card generation function [`8fc6c71`](https://git.odit.services/lfk/document-server/commit/8fc6c7176ee92f813db1e1d4b3e5ef1b2f4e1aef)
- Beautified output a bit [`aefe549`](https://git.odit.services/lfk/document-server/commit/aefe5493b06c04cc2b20029e1f7fc5f15ec9c04e)
- Added barcode generatin [`5c075bc`](https://git.odit.services/lfk/document-server/commit/5c075bce8b94ff4482448c3cd56bdc28cbe0a7d9)
- Implemented runner generation using fakerjs [`0894446`](https://git.odit.services/lfk/document-server/commit/08944460854c78cd4368cf178b022c31b624c8d9)
- Styled front [`016f746`](https://git.odit.services/lfk/document-server/commit/016f746c7cec29ab391b3918c7589dea0cff9890)
- Now loading sponsor logos from env [`29376a7`](https://git.odit.services/lfk/document-server/commit/29376a7782ce39f04f856ec78775e65aa11f0ed7)
- Implmented sponsoring image selection from array [`68a1b8f`](https://git.odit.services/lfk/document-server/commit/68a1b8f3e0515e56c7c6069f7f3ef8db24c92674)
- 📖New license file version [CI SKIP] [skip ci] [`dbccbf6`](https://git.odit.services/lfk/document-server/commit/dbccbf68f4e22470b4fc93c894527cc78973e324)
- Added cards api endpoint [`929ac81`](https://git.odit.services/lfk/document-server/commit/929ac81515b3b426ff06f1d6d913bab930421a92)
- 🧾New changelog file version [CI SKIP] [skip ci] [`96204d8`](https://git.odit.services/lfk/document-server/commit/96204d809e852c1bcea808a9c8f5ca0f8475c87f)
- Fixed runnercard backside padding [`08e8587`](https://git.odit.services/lfk/document-server/commit/08e858726c1462b599ba9cb3f7fb057f35178b83)
- Added sizing for the real cards [`b92a6f7`](https://git.odit.services/lfk/document-server/commit/b92a6f7b2b98fb0074d5a563d9918295e9ec0274)
- 🧾New changelog file version [CI SKIP] [skip ci] [`8a90f63`](https://git.odit.services/lfk/document-server/commit/8a90f63b0919376beefef6a52aae9a59337aea59)
- 🚀Bumped version to v0.3.0 [`449a96b`](https://git.odit.services/lfk/document-server/commit/449a96b3027fe93d8042b30420245f66e92f14b8)
- Merge pull request 'Card generation feature/14-card_generation' (#24) from feature/14-card_generation into dev [`703eaa0`](https://git.odit.services/lfk/document-server/commit/703eaa0e9d667b628eab4e8496689fe66238f896)
- Added speedtest script to package [`75b8b28`](https://git.odit.services/lfk/document-server/commit/75b8b281b87d9b173093f16beae12d707ec05052)
- Fixed bug in array swapping function [`9697d53`](https://git.odit.services/lfk/document-server/commit/9697d53a1527854536f8ddf5426f7ca902772f51)
- Added **very** basic backside [`68f46a4`](https://git.odit.services/lfk/document-server/commit/68f46a45b5a51c8a8edafca852cb274af388fa76)
- Added card generation speed tests (part 2) [`d38923c`](https://git.odit.services/lfk/document-server/commit/d38923c4ad3a2cf8872e236dd42f078e2a0e1045)
- Implemented basic contracts tests in various sizes [`a1b0a19`](https://git.odit.services/lfk/document-server/commit/a1b0a1918db552eb385fedcbaa576ad493a1d605)
- tmp [`0d27916`](https://git.odit.services/lfk/document-server/commit/0d27916188114fa41e666170135de2b714ff113a)
- Added new env vars to readme [`cf0f583`](https://git.odit.services/lfk/document-server/commit/cf0f5839ee1e1b87f7b5bd5a299a35574fd1bb3c)
- Merge pull request 'Added speedtest feature/19-speed_test' (#23) from feature/19-speed_test into dev [`7ac8edb`](https://git.odit.services/lfk/document-server/commit/7ac8edb5cf4b7317a703faa32ded482a8c2b9b91)
#### [v0.2.0](https://git.odit.services/lfk/document-server/compare/v0.1.3...v0.2.0)
> 9 February 2021
- Merge pull request 'Alpha Release 0.2.0 - The barcode release' (#22) from dev into main [`b952ac4`](https://git.odit.services/lfk/document-server/commit/b952ac4d728952e1fb6d26b0929e3f946748b85b)
- Implemented async barcode generation using async helpers [`edc846a`](https://git.odit.services/lfk/document-server/commit/edc846ab05319a4e60422625678f204bc145884c)
- 📖New license file version [CI SKIP] [skip ci] [`fea0b1d`](https://git.odit.services/lfk/document-server/commit/fea0b1dc0582d2906bad22f2ff5e5aad90a1c885)
- Reworked template layout for barcode [`1c06689`](https://git.odit.services/lfk/document-server/commit/1c066898009883f510fa204c66800e5f6228a15d)
- 🧾New changelog file version [CI SKIP] [skip ci] [`7122fe7`](https://git.odit.services/lfk/document-server/commit/7122fe7dbe3fae64806492636255147078eb03c8)
- Merge pull request 'Barcode generation feature/13-barcode_generation' (#21) from feature/13-barcode_generation into dev [`ff36b48`](https://git.odit.services/lfk/document-server/commit/ff36b4871f2d696c0b86883d529365ee8f1c6132)
- Now with working code scaleing [`4b79b29`](https://git.odit.services/lfk/document-server/commit/4b79b29ee6319559c9d68ddb11f831d25f12b3da)
- Added basic barcode generation [`8072d0b`](https://git.odit.services/lfk/document-server/commit/8072d0b1940ef6f316ce78dcbcb9e5af5bab04e7)
- Now loading barcode format from env with overwrite via query param [`9a7c1d6`](https://git.odit.services/lfk/document-server/commit/9a7c1d64fdbdadbd104739133a87773e4d2bca01)
- Added fallback error image [`5023457`](https://git.odit.services/lfk/document-server/commit/502345782f26895ccf3089d15c3817709b62dfcc)
- First part of the handlebars barcode generation [`a35f8cf`](https://git.odit.services/lfk/document-server/commit/a35f8cfd3aa94923968fd77425c074844d28ec0d)
- Added todo [`75d2ac3`](https://git.odit.services/lfk/document-server/commit/75d2ac3c5f80f8440b6d48c33b15ef17565559b3)
- Removed promise [`e1ec193`](https://git.odit.services/lfk/document-server/commit/e1ec193a4ff1cd618da90f5f2d029ec848a6f669)
- 🧾New changelog file version [CI SKIP] [skip ci] [`03f63e3`](https://git.odit.services/lfk/document-server/commit/03f63e3777381a4475910e6fa4a3986f87b73f39)
- Fixed broken mime-type [`4187a8e`](https://git.odit.services/lfk/document-server/commit/4187a8e82015495c0e0362e957e236ed6935a908)
- Switched to using the current runner's id as the barcode text [`3e2b011`](https://git.odit.services/lfk/document-server/commit/3e2b011d2887d261fb9c36820982095d6dd6d847)
- Added barcode field to template [`27d1d69`](https://git.odit.services/lfk/document-server/commit/27d1d69360c8513079abcfe3a6fc2a50309a2b61)
#### [v0.1.3](https://git.odit.services/lfk/document-server/compare/v0.1.2...v0.1.3)
> 9 February 2021
- Merge pull request 'Alpha Release 0.1.3 - More env vars' (#20) from dev into main [`ecd02a1`](https://git.odit.services/lfk/document-server/commit/ecd02a1af7431d0bf615c4ec064f64e023946e49)
- 🚀Bumped version to v0.1.3 [`6a14232`](https://git.odit.services/lfk/document-server/commit/6a142328898d5b89fa11eaf033372971d1093b0c)
- 🧾New changelog file version [CI SKIP] [skip ci] [`ad9a8a4`](https://git.odit.services/lfk/document-server/commit/ad9a8a4fe0649d48db924771be8ecb4cbf5c162a)
- 🧾New changelog file version [CI SKIP] [skip ci] [`b6296b8`](https://git.odit.services/lfk/document-server/commit/b6296b8d97cda943dfb5e11bc9dfbb2f363f5b81)
- Merge pull request 'Load more stuff from env feature/16-env_vars' (#17) from feature/16-env_vars into dev [`bc4d16e`](https://git.odit.services/lfk/document-server/commit/bc4d16e6f8959ed35d7e87647de84584cdfddd7b)
- Added new env vars to config [`3bb322e`](https://git.odit.services/lfk/document-server/commit/3bb322ede5db15a147c0d7a8db2a68ccb7fa2112)
- Added new env vars to readme [`b77bb3a`](https://git.odit.services/lfk/document-server/commit/b77bb3ad9dba9d73c2c81215ba57936192155a9a)
- Now loading interpolation vars from config/env [`b4ebae2`](https://git.odit.services/lfk/document-server/commit/b4ebae283b472b2f0c6e28caed49b30edb119585)
- 🧾New changelog file version [CI SKIP] [skip ci] [`a306009`](https://git.odit.services/lfk/document-server/commit/a30600943d01116b99e946cb705a16d0372b5095)
#### [v0.1.2](https://git.odit.services/lfk/document-server/compare/v0.1.1...v0.1.2)
> 7 February 2021
- Merge pull request 'Alpha Release 0.1.2 - Hotfix release' (#15) from dev into main [`123cf8a`](https://git.odit.services/lfk/document-server/commit/123cf8ad48a45fa10dcd5208215a6e525f31115a)
- 🧾New changelog file version [CI SKIP] [skip ci] [`22b1e00`](https://git.odit.services/lfk/document-server/commit/22b1e0097efc865de9cc150cb0d0b99bf789b519)
- 🚀Bumped version to v0.1.2 [`7e507d4`](https://git.odit.services/lfk/document-server/commit/7e507d4cc415877ac0b25503dc0ff9ecdceabf42)
- PAtch: Copy locales [`f7dfd6d`](https://git.odit.services/lfk/document-server/commit/f7dfd6d0c3c69881338bc1f66d5d33ae9abff628)
#### [v0.1.1](https://git.odit.services/lfk/document-server/compare/v0.1.0...v0.1.1)
> 7 February 2021
- Merge pull request 'Alpha Release 0.1.1 - Hotfix release' (#12) from dev into main [`cbff307`](https://git.odit.services/lfk/document-server/commit/cbff3074d10110dbb64dda1ed516d2a18402eeca)
- 🧾New changelog file version [CI SKIP] [skip ci] [`4fca5af`](https://git.odit.services/lfk/document-server/commit/4fca5afdfa15d3260ac28c1feb89d50221b1f03f)
- Updated dockerfile & build for dockerized puppeteer [`ea8028d`](https://git.odit.services/lfk/document-server/commit/ea8028dfd54861335e9752334db335ad21e75cf2)
- 📖New license file version [CI SKIP] [skip ci] [`8d4e7a1`](https://git.odit.services/lfk/document-server/commit/8d4e7a16d1ebae6976ec183b761ca3e6a8946629)
- Revert "Now only using our mirror to build" [`fe0f45e`](https://git.odit.services/lfk/document-server/commit/fe0f45ea92099a65d998e342ef885af39d06915f)
- Now only using our mirror to build [`b07c5a9`](https://git.odit.services/lfk/document-server/commit/b07c5a96f2a670f2279a6575b03f9c553b59e0a9)
- 🧾New changelog file version [CI SKIP] [skip ci] [`9755e43`](https://git.odit.services/lfk/document-server/commit/9755e437c2b68c09e9b0ffa47c6bc1729e6bee14)
- 🧾New changelog file version [CI SKIP] [skip ci] [`603a814`](https://git.odit.services/lfk/document-server/commit/603a814ad4783c0b29c1f6a1db638f269b29f775)
- Switched to using our mirrored images for buildi [`dba765c`](https://git.odit.services/lfk/document-server/commit/dba765cb017998ad636f3f91fb00a8a277d3b225)
- 🚀Bumped version to v0.1.1 [`d1b07f3`](https://git.odit.services/lfk/document-server/commit/d1b07f39fd7e3c282a631924bf45367e866e667a)
- Pinned alpine version [`6ab3946`](https://git.odit.services/lfk/document-server/commit/6ab3946c31a7716d1c42fb217b0a0f7be8172dba)
#### v0.1.0
> 7 February 2021
- Merge pull request 'Alpha Release 0.1.0 - Contract generation' (#11) from dev into main [`bc2b6fa`](https://git.odit.services/lfk/document-server/commit/bc2b6fadd912f275bc05be29c6fbd87367d617df)
- 📖New license file version [CI SKIP] [skip ci] [`ee19efa`](https://git.odit.services/lfk/document-server/commit/ee19efa0e63f21a10fed1cf24beb16118bbe6cde)
- 🚀Bumped version to v0.0.2 [`de432c4`](https://git.odit.services/lfk/document-server/commit/de432c448129a8acb36fef6b40ef920eeb2f7887)
- First working (TM) template code [`a9e3360`](https://git.odit.services/lfk/document-server/commit/a9e3360ee258e4d48c8dbe3a55468409bb6ee0f7)
- Working Styleing [`c617c40`](https://git.odit.services/lfk/document-server/commit/c617c40e9d7e03382f647eafde9ff458db3c6c15)
- Removed base64 image [`e401d0e`](https://git.odit.services/lfk/document-server/commit/e401d0ec7219e88fbb277b2dcf456a22dae0d1e5)
- Updated the contract template to use external css [`6121b1e`](https://git.odit.services/lfk/document-server/commit/6121b1e3bfcf6fc9f88e0589205044c59859b4a7)
- Sorted locales [`1962499`](https://git.odit.services/lfk/document-server/commit/1962499d18685347302fd7d8491c6e3e7a355fcb)
- Switched to puppeteer for pdf generation [`5afd26e`](https://git.odit.services/lfk/document-server/commit/5afd26ea22cff3b8a339cf658ed37d2053db24ba)
- Added a coupple of real replacement strings to the sponsoring template [`041c0ed`](https://git.odit.services/lfk/document-server/commit/041c0ed6bbe5f8645e4e96b57c02d4e45b445402)
- Added automatic img to base64 conversion [`42443af`](https://git.odit.services/lfk/document-server/commit/42443af734ccc9ce202aec045a07775f4a054b92)
- Added i18n strings [`e345c36`](https://git.odit.services/lfk/document-server/commit/e345c36dd0b03f276259521aebf423853a81a04d)
- first working pdf generation from class 🎉 [`3af76a5`](https://git.odit.services/lfk/document-server/commit/3af76a53e3156bdc2d1d3ade6ff940db9d7b24b5)
- Added a bunch of english and german translations 🌎 [`784d7c6`](https://git.odit.services/lfk/document-server/commit/784d7c656fd2dfc726722459f3ccb7612021b882)
- Added translations using i18next [`75eb925`](https://git.odit.services/lfk/document-server/commit/75eb9252672883f7b6f89a812a37d2b96f9f626e)
- Switched to handlebars for templateing [`4acf3e3`](https://git.odit.services/lfk/document-server/commit/4acf3e39ce55c0ad9e697cf9598569ec1c1dcb44)
- Moved pdf creatior initialization to new function [`47a05fa`](https://git.odit.services/lfk/document-server/commit/47a05facb33c178e9bf3f99c25049abc010361c4)
- 🧾New changelog file version [CI SKIP] [skip ci] [`f3de80a`](https://git.odit.services/lfk/document-server/commit/f3de80af78c96bd697715a30dee7cae6806f9f9f)
- 🚀Bumped version to v0.1.0 [`6a42fe3`](https://git.odit.services/lfk/document-server/commit/6a42fe37d053a6a00005e3c5781edfcefe61183e)
- Merge pull request 'Sponsoring contract generation feature/5-sponsoring_contracts' (#10) from feature/5-sponsoring_contracts into dev [`84259d3`](https://git.odit.services/lfk/document-server/commit/84259d37d42234e1be75f3a5c95f4b442a9e5844)
- Added optimization args [`140fda1`](https://git.odit.services/lfk/document-server/commit/140fda11cc88cb93218116d4cbdbf13c014a659d)
- Added first parts of template [`13776d1`](https://git.odit.services/lfk/document-server/commit/13776d1ecb2db03f19dd0c01a930d4c98222cf6b)
- Added pdf merging for big requests (over 100 runners) [`785544c`](https://git.odit.services/lfk/document-server/commit/785544ca16cd4907a378eb2d48e4269778e3dccc)
- Fixed file broken in merge [`c07c6ae`](https://git.odit.services/lfk/document-server/commit/c07c6aeeab70589a4e1ddf025a07bde96c68ef6e)
- Now with workin i18n-ally config🥳 [`7c3813b`](https://git.odit.services/lfk/document-server/commit/7c3813b94d06ca38b83db90b7f9fba6c33716a05)
- Now with workin i18n-ally config🥳 [`b4232e5`](https://git.odit.services/lfk/document-server/commit/b4232e51e084f491d1a7fb4f929327e88f3b4c00)
- Now accepting arrays for sponsoring contract generation [`f833ae2`](https://git.odit.services/lfk/document-server/commit/f833ae222e68b7df9b8f8a8ec7ce17d679a9710f)
- Added full interpolation support to the i18n [`f755f4f`](https://git.odit.services/lfk/document-server/commit/f755f4f9fb1463af6bec3cf73b7fabf95ef3fb2e)
- Added option to generate empty sponsoring contracts [`1ced0e3`](https://git.odit.services/lfk/document-server/commit/1ced0e317544217599a42c6b270c9136dc73676d)
- Added translation sorting secript [`1e67672`](https://git.odit.services/lfk/document-server/commit/1e67672ef0d28f94a50b0377cca8e8ff2a87e983)
- Removed the example data from the fill-in fields [`5e12525`](https://git.odit.services/lfk/document-server/commit/5e1252545b7eafeee6c3a1d67567d00e5d615d85)
- Edited html template [`d58453f`](https://git.odit.services/lfk/document-server/commit/d58453faf9840037c583e029c41ef1b31a0bafa8)
- PDF Creator now accepts single instances of class [`78205ee`](https://git.odit.services/lfk/document-server/commit/78205ee8c7659ae0dc2e4a184554b042251d9271)
- PDF Creator now accepts single instances of class [`ba7cedd`](https://git.odit.services/lfk/document-server/commit/ba7cedd187dbc51a53ba169889d8e0ca22a97b5d)
- Updated template for i18n [`a596188`](https://git.odit.services/lfk/document-server/commit/a596188c00444c285565eecbb1f0bc668bb4706c)
- Parellized the chunks [`e92820e`](https://git.odit.services/lfk/document-server/commit/e92820e12f289b4fd28b4ebc985b5b711777fc35)
- Fixed the controller not waiting for initialization [`ee8ba99`](https://git.odit.services/lfk/document-server/commit/ee8ba99cc7778f89a8bb99400c7d1cf1a12898f7)
- Implemented language selection by query param [`6f81566`](https://git.odit.services/lfk/document-server/commit/6f81566cb82a0801a20523a7177996ea40cb3968)
- Added comments [`cd51e78`](https://git.odit.services/lfk/document-server/commit/cd51e78282278cae6cb86bd0c9616746612a97e3)
- Added example locales [`1969769`](https://git.odit.services/lfk/document-server/commit/19697692bcb6c0c1c978918916caccd95a8f2035)
- Fixed data validation problem [`bd6ec62`](https://git.odit.services/lfk/document-server/commit/bd6ec6215d362325c510611e4545b7643b918200)
- Removed fullname from groups (to be renabled later) [`388d8a2`](https://git.odit.services/lfk/document-server/commit/388d8a2dc6ee06d39e621e1e45ae595dae587483)
- Updated comments [`119102a`](https://git.odit.services/lfk/document-server/commit/119102aef8f43a68f537e7542c2f2cd3b41cd28e)
- Updated readme for handlebars [`05e4718`](https://git.odit.services/lfk/document-server/commit/05e471878f2321a1873b21730ae85ad6b8af5766)
- Updated readme [`f69e777`](https://git.odit.services/lfk/document-server/commit/f69e7779e42f18df7ec3ccb1cdf9dcf7fa845ee6)
- 🧾New changelog file version [CI SKIP] [skip ci] [`f4a34dd`](https://git.odit.services/lfk/document-server/commit/f4a34dd36b57bd122a650f2de4ea8e00816276ed)
- Typos [`95b882a`](https://git.odit.services/lfk/document-server/commit/95b882aceded275ad89446ad92a10cf36b166ab7)
- Added sentence about large requests to the /contracts openapi description [`4773a5f`](https://git.odit.services/lfk/document-server/commit/4773a5f18c866b6e9d50b421d7917416860cb6b5)
- Removed puppeteer args [`06dedc0`](https://git.odit.services/lfk/document-server/commit/06dedc0797b649f3fa8934f0d774ccae2b062849)
- Expanded max request body size to 500mb [`4f191dc`](https://git.odit.services/lfk/document-server/commit/4f191dcb52cd727e34770ab4304937cd1e7e480d)
- Now awaiting language change [`c07319b`](https://git.odit.services/lfk/document-server/commit/c07319b250db9452f6122e797b6059151031e2a9)
- 🧾New changelog file version [CI SKIP] [skip ci] [`42d6c40`](https://git.odit.services/lfk/document-server/commit/42d6c40d0c673f39c27e3d5a6484f01a4da77266)
- Formatting [`2d0b7ce`](https://git.odit.services/lfk/document-server/commit/2d0b7ce79ed47d4827096a2bbccfe3bbcd061810)
- Removed useless await [`4cd437b`](https://git.odit.services/lfk/document-server/commit/4cd437b6afe40e4c09027c0e2004a1130bc51870)
- Updated comments [`cf9cd29`](https://git.odit.services/lfk/document-server/commit/cf9cd298b638012e079be0a04d1b48efea20026f)
- Merge pull request 'Patch 0.0.2' (#9) from dev into main [`4585a83`](https://git.odit.services/lfk/document-server/commit/4585a83838b80552160c9d9e5be0af891eae39c8)
- Merge pull request 'Basic documentation feature/6-documentation' (#8) from feature/6-documentation into dev [`73915da`](https://git.odit.services/lfk/document-server/commit/73915da20321940e22145b4c5d830b9f700be566)
- 📖New license file version [CI SKIP] [skip ci] [`465efe0`](https://git.odit.services/lfk/document-server/commit/465efe03000ecc00d14479ac38710ffdba2cafb5)
- Typos [`68e34a9`](https://git.odit.services/lfk/document-server/commit/68e34a9054a195545b0bd10ce888f7274854fae6)
- Merge pull request 'Implemented the basics for templateing feature/3-pdf_templateing' (#4) from feature/3-pdf_templateing into dev [`15f1641`](https://git.odit.services/lfk/document-server/commit/15f16415c0ac5012df8126c8df6bd4da93ad0a20)
- Merge pull request 'Implemented the basic request classes feature/1-input_classes' (#2) from feature/1-input_classes into dev [`b5e79e5`](https://git.odit.services/lfk/document-server/commit/b5e79e51ef5d751a67e7a1763809ece91a7627f2)
- Added openapi viewers [`6435c8a`](https://git.odit.services/lfk/document-server/commit/6435c8a88e2ea3f4417ad5d8be9a07b9c043b41b)
- 📖New license file version [CI SKIP] [skip ci] [`d493e74`](https://git.odit.services/lfk/document-server/commit/d493e74bf39bc85de842ac7cd3e3d37ba8797a04)
- Initial commit [`0908bcd`](https://git.odit.services/lfk/document-server/commit/0908bcd63529b44463bc57ad7d6b8785564e4ddc)
- Added address class and errors [`d291cf0`](https://git.odit.services/lfk/document-server/commit/d291cf0d1bf375e96fda822543d5ceb29dc67010)
- Added drone file [`48d7cad`](https://git.odit.services/lfk/document-server/commit/48d7cad9f37485656cfb1c70abef158b5dd8d847)
- Added the donation classes [`1d73e4e`](https://git.odit.services/lfk/document-server/commit/1d73e4ed9ccb3dfb7709cb89957ed5bbcefad870)
- Added openapi related classes [`9d62225`](https://git.odit.services/lfk/document-server/commit/9d6222547811fd3c94b91496d9917b7df5115fc6)
- Added a bs example template [`f726a6e`](https://git.odit.services/lfk/document-server/commit/f726a6e699575b839d332c15e61c9008fe996fa9)
- Added a basic donor class [`cfa65e8`](https://git.odit.services/lfk/document-server/commit/cfa65e83cafcefbd6261a99ab7a4eaf099665a81)
- Added input class for contract generation [`63f9523`](https://git.odit.services/lfk/document-server/commit/63f952376698c3561754bfb206a64c58c1ae86f1)
- Initialized package [`b0427a6`](https://git.odit.services/lfk/document-server/commit/b0427a6d810656096c467881a302eef244f86d29)
- Added a simplified runnergroup class [`e29c17a`](https://git.odit.services/lfk/document-server/commit/e29c17a29a6ee84944f8d67d7b6f3c4292763c10)
- Resolved fun issues with promises [`4617f2c`](https://git.odit.services/lfk/document-server/commit/4617f2c5bdcb29534b46865ebe21d15e2b1cd72f)
- Added a runnercard class [`cb7325b`](https://git.odit.services/lfk/document-server/commit/cb7325bbf906b405955bd81e199abae5edc27d91)
- Added a basic readme [`df94b1b`](https://git.odit.services/lfk/document-server/commit/df94b1b750922989d870546150ff8d9ff8af4102)
- Added base app [`915ff92`](https://git.odit.services/lfk/document-server/commit/915ff92418a2859c11e0ce58b79220fb5ea06c7f)
- Added vscode workspace config [`ae466b4`](https://git.odit.services/lfk/document-server/commit/ae466b4d7e5b67c5cd1bc440214f477d15f768a2)
- Created a pdf class that takes care of the pdf wrapping [`7d5b575`](https://git.odit.services/lfk/document-server/commit/7d5b5750ad78fd979cb1b647d8b318a84513532a)
- Added editor and stageing infos to the README [`56b7227`](https://git.odit.services/lfk/document-server/commit/56b72275aca57b227c775c4a61e91fd03471f987)
- Added dockerfile and docker-compose [`b9d4cc3`](https://git.odit.services/lfk/document-server/commit/b9d4cc36199b8f0090d555e961a3454bf35f4bd6)
- Added loaders [`57afbd4`](https://git.odit.services/lfk/document-server/commit/57afbd4b6c48cf641b69a2fcbb28783ff84e1cfd)
- Added a certificaterunner class [`d08bdfd`](https://git.odit.services/lfk/document-server/commit/d08bdfd961f4128981b969cf149df7397a257193)
- Added a template section to the readme [`8141269`](https://git.odit.services/lfk/document-server/commit/8141269dd99f03b33019e5a8f4a010954c4fc44a)
- Created a barebones pdf controller [`64bd1ff`](https://git.odit.services/lfk/document-server/commit/64bd1ffc3ad8459c13154e2cd9a568f27baa2bf2)
- Moved distance to the main runner object [`1d1fa50`](https://git.odit.services/lfk/document-server/commit/1d1fa50327927328ce77af33c1abbf994df9ac8b)
- Added tsconfig [`e1f0378`](https://git.odit.services/lfk/document-server/commit/e1f03788dbdddcb1cb138556c1fed4da9ca104a8)
- Added basic dependencies [`43bb728`](https://git.odit.services/lfk/document-server/commit/43bb728d0d8b75239f1db765071d28a839300102)
- Added typeing to the buffer and stream conversion [`3fb8be2`](https://git.odit.services/lfk/document-server/commit/3fb8be22b74204accabed8a8c8fb5161c5ad7504)
- Added basic dependencies [`d450cea`](https://git.odit.services/lfk/document-server/commit/d450ceac74959bdfb694f9b12fb1fd14ff85b598)
- Added release-it config [`185e66f`](https://git.odit.services/lfk/document-server/commit/185e66fb5b2e4330233ff2e74101c4447c317b5a)
- Added config class [`278c563`](https://git.odit.services/lfk/document-server/commit/278c56386b0e9079a71d3339b40d08f046255a3e)
- Added Barebones pdf creator class [`557cc26`](https://git.odit.services/lfk/document-server/commit/557cc26f281da0b47621dff667435a788c42c103)
- Added a simple status controller [`1d62e7f`](https://git.odit.services/lfk/document-server/commit/1d62e7f14c8d6219607ed6ecf774ae152e362cc1)
- Added errorhandler middleware [`6539fd7`](https://git.odit.services/lfk/document-server/commit/6539fd785568971330639fb7055827417424c81a)
- Runners now use the runnergroup class instead of strings [`aae4f50`](https://git.odit.services/lfk/document-server/commit/aae4f507eafbfd51cd9972cf0fac4c5afafbb45a)
- Added files to gitignore [`66134c0`](https://git.odit.services/lfk/document-server/commit/66134c0e1e5dce2ebd9eae3f88a6ad893bad0283)
- Switched to the splitted functions [`3ca38ab`](https://git.odit.services/lfk/document-server/commit/3ca38abe9359e436fe0f80400ad0308ad9d64a4f)
- Cleaned up openapi stuff [`4efb629`](https://git.odit.services/lfk/document-server/commit/4efb62921bced79c817499b48bbc55b05e6371e5)
- Updated apidoc viewer settings [`36396af`](https://git.odit.services/lfk/document-server/commit/36396af50a1f7d1842effbd24e08a8d34946a375)
- Updated apidoc viewer settings [`4d45e0f`](https://git.odit.services/lfk/document-server/commit/4d45e0f80d5721c91de0b25334d040448d92e01d)
- 🧾New changelog file version [CI SKIP] [skip ci] [`8f250f7`](https://git.odit.services/lfk/document-server/commit/8f250f747a95feb246b1698a7c9be9ee19a1be12)
- Added missing dependencies [`c2d7141`](https://git.odit.services/lfk/document-server/commit/c2d714116e02bb4c2ff6501ba32417cd998e2f3e)
- Added license export and release scripts [`0c4e5a1`](https://git.odit.services/lfk/document-server/commit/0c4e5a182c91b99a657c83f2c24f4cfaae1ef48d)
- Added build script [`cbc421c`](https://git.odit.services/lfk/document-server/commit/cbc421cd838b6c874fbe50556350edeb08a7b882)
- Added dev script [`814b564`](https://git.odit.services/lfk/document-server/commit/814b564752aa95ed2c034a9a98c800b43452bf88)
- Adjusted template font styleing [`2c7b025`](https://git.odit.services/lfk/document-server/commit/2c7b0254ec7e49c31f8f33eed334ab4156052fb6)
- Added html-pdf package [`a7d4001`](https://git.odit.services/lfk/document-server/commit/a7d4001ad992d60e2af69e9bbed53366bc0a46d3)
- Added PDFs to gitignore [`9f3758d`](https://git.odit.services/lfk/document-server/commit/9f3758de39ef1d5b591a24868eb683caa742f694)
- Added version to config [`b1747f6`](https://git.odit.services/lfk/document-server/commit/b1747f6374c029e1e9c3a87584ea54b9d3714d92)
- fixed license-exporter call [`83c4bd6`](https://git.odit.services/lfk/document-server/commit/83c4bd62cbbb13ae33a790baa45cc15a77d99e41)
- Added version to config [`cff7011`](https://git.odit.services/lfk/document-server/commit/cff70110fde72c7fede0625872acdc0666703fa1)
- Added openapi dependency [`94e5e51`](https://git.odit.services/lfk/document-server/commit/94e5e51f8d421ea7fd64ded2281b89ff4a252b29)
- Added templates folder [`8a30265`](https://git.odit.services/lfk/document-server/commit/8a30265fc600dad17f584f95dd51db976945d4c5)

39
Dockerfile Normal file
View File

@@ -0,0 +1,39 @@
# Typescript Build
FROM registry.odit.services/mirror/node:14.15.1-alpine3.12
WORKDIR /app
COPY package.json ./
RUN npm i -g pnpm
RUN pnpm i
COPY tsconfig.json ./
COPY src ./src
RUN pnpm run build
# final image
FROM registry.odit.services/mirror/alpine:3.13.1
WORKDIR /app
RUN apk add --no-cache \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont \
nodejs \
yarn
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
RUN addgroup -S pptruser && adduser -S -g pptruser pptruser \
&& mkdir -p /home/pptruser/Downloads /app \
&& chown -R pptruser:pptruser /home/pptruser \
&& chown -R pptruser:pptruser /app
# Run everything after as non-privileged user.
USER pptruser
COPY package.json ./
RUN yarn
COPY --from=0 /app/dist app
ENTRYPOINT ["node", "app/app.js"]

View File

@@ -1,3 +1,80 @@
# document-server
The document generation server responsible for creating pdfs for sponsoring contracts, certificates and more.
# @lfk/document-server
The document generation server responsible for creating pdfs for sponsoring contracts, certificates and more.
This server doesn't interact with any database and can therefor be deployed on it's own.
The basic generation mechanism makes the templates and routes interchangeable (if you want to expand or modify it).
## Quickstart 🐳
> Use this to run the document server in docker.
1. Clone the repo or copy the docker-compose
2. Run in the folder that contains the docker-compose file: `docker-compose up -d`
3. Visit http://127.0.0.1:4010/docs to check if the server is running
## Dev Setup 🛠
> Local dev setup
1. Rename the .env.example file to .env (you can adjust app port and other settings, if needed)
2. Install Dependencies
```bash
yarn
```
3. Start the server
```bash
yarn dev
```
## ENV Vars
> You can provide them via .env file or docker env vars.
| Name | Type | Default | Description
| - | - | - | -
| APP_PORT | Number | 4010 | The port the backend server listens on. Is optional.
| NODE_ENV | String | dev | The apps env - influences debug info.
| EVENT_NAME | String | "Please set the event name" | The event's name - used to generate pdf text.
| CURRENCY_SYMBOL | String | "€" | The your currency's symbol - used to generate pdf text.
| SPONSORING_RECEIPT_MINIMUM_AMOUNT | String | "10" | The mimimum total donation amount a sponsor has to donate to be able to receive a donation receipt - used to generate pdf text.
| SPONOR_LOGOS | Array<String> | Empty png | The sponsor images you want to loop through. You can provide them via http url, local file or base64-encoded image.
| API_KEY | String(min length: 64) | Random generated string | The api key you want to use for auth (query-param `key`), has to be at least 64 chars long.
## Templates
> The document server uses html templates to generate various pdf documents.
> The templates are stored in src/templates by default.
We provide a set of default templates that we use for the ["Lauf für Kaya!" charity run](https://lauf-fuer-kaya.de).
We use handlebars for templateing utilizing i18next for translation - the i18n string format in the templates is : `{{__ "string"}}`
You can provide your own templates by replacing the ones we provided before compiling the project or by simply mounting your custom templates into the docker container.
The server currently needs the following templates to work:
* sponsoring_contract.html
### Sponsoring Contracts
| Template Data | Type | Optional | Description
| - | - | - | -
| runners | array(Runner) | ❌ | The runner objects. We generate a contract for each runner on a new DIN-A5 page.
## Recommended Editor
[Visual Studio Code](https://code.visualstudio.com/)
### Recommended Extensions
* will be automatically recommended via ./vscode/extensions.json
* we also provide a config for i18n-ally in the .vscode folder
## Staging
### Branches & Tags
* vX.Y.Z: Release tags created from the main branch
* The version numbers follow the semver standard
* A new release tag automaticly triggers the release ci pipeline
* main: Protected "release" branch
* The latest tag of the docker image get's build from this
* New releases get created as tags from this
* dev: Current dev branch for merging the different feature branches and bugfixes
* The dev tag of the docker image get's build from this
* Only push minor changes to this branch!
* To merge a feature branch into this please create a pull request
* feature/xyz: Feature branches - nameing scheme: `feature/issueid-title`
* bugfix/xyz: Branches for bugfixes - nameing scheme:`bugfix/issueid-title`

9
docker-compose.yml Normal file
View File

@@ -0,0 +1,9 @@
version: "3"
services:
document_server:
build: .
ports:
- 4010:4010
environment:
APP_PORT: 4010
NODE_ENV: production

1068
licenses.md Normal file

File diff suppressed because it is too large Load Diff

92
package.json Normal file
View File

@@ -0,0 +1,92 @@
{
"name": "@odit/lfk-document-server",
"version": "0.3.2",
"description": "The document generation server for the LfK! runner system. This generates certificates, sponsoring aggreements and more",
"main": "src/app.ts",
"scripts": {
"dev": "nodemon src/app.ts",
"build": "rimraf ./dist && tsc && cp-cli ./src/templates ./dist/templates && cp-cli ./src/locales ./dist/locales",
"licenses:export": "license-exporter --markdown",
"release": "release-it --only-version",
"translations:sort": "node sort_translations.js",
"test:speed": "start-server-and-test dev http://localhost:4010/docs/openapi.json test:speed:run",
"test:speed:run": "ts-node src/tests/speedtest.ts"
},
"repository": {
"type": "git",
"url": "git@git.odit.services:lfk/document-server.git"
},
"keywords": [
"odit",
"lfk",
"pdf",
"generate"
],
"author": {
"name": "ODIT.Services",
"email": "info@odit.services",
"url": "https://odit.services"
},
"contributors": [
{
"name": "Philipp Dormann",
"email": "philipp@philippdormann.de",
"url": "https://philippdormann.de"
},
{
"name": "Nicolai Ort",
"email": "info@nicolai-ort.com",
"url": "https://nicolai-ort.com"
}
],
"license": "CC-BY-NC-SA-4.0",
"dependencies": {
"@odit/class-validator-jsonschema": "^2.1.1",
"async-helpers": "^0.3.17",
"axios": "^0.21.1",
"bwip-js": "^2.0.12",
"cheerio": "^1.0.0-rc.5",
"class-transformer": "0.3.1",
"class-validator": "^0.13.1",
"consola": "^2.15.0",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"handlebars": "^4.7.6",
"i18next": "^19.8.7",
"i18next-fs-backend": "^1.0.8",
"mime-types": "^2.1.28",
"pdf-lib": "^1.16.0",
"puppeteer": "^7.0.1",
"reflect-metadata": "^0.1.13",
"routing-controllers": "0.9.0-alpha.6",
"routing-controllers-openapi": "2.2.0"
},
"devDependencies": {
"@odit/license-exporter": "^0.0.10",
"@types/express": "^4.17.11",
"@types/node": "^14.14.22",
"@types/puppeteer": "^5.4.3",
"cp-cli": "^2.0.0",
"faker": "^5.3.1",
"nodemon": "^2.0.7",
"release-it": "^14.2.2",
"rimraf": "^3.0.2",
"start-server-and-test": "^1.12.0",
"ts-node": "^9.1.1",
"typescript": "^4.1.3"
},
"release-it": {
"git": {
"commit": true,
"requireCleanWorkingDir": false,
"commitMessage": "🚀Bumped version to v${version}",
"requireBranch": "dev",
"push": false,
"tag": false
},
"npm": {
"publish": false
}
}
}

16
sort_translations.js Normal file
View File

@@ -0,0 +1,16 @@
const fs = require('fs');
// get all language files
const files = fs.readdirSync('./src/locales/');
files.forEach((f) => {
// read file as object
const unordered = JSON.parse(fs.readFileSync(`src/locales/${f}`));
// order object by keys alpabetically A-Z
const ordered = Object.keys(unordered).sort().reduce((obj, key) => {
obj[key] = unordered[key];
return obj;
}, {});
// format output as json for commit diff compatibility
const out = JSON.stringify(ordered, 0, 4);
// write output file
fs.writeFileSync(`src/locales/${f}`, out);
});

265
src/PdfCreator.ts Normal file
View File

@@ -0,0 +1,265 @@
import axios from 'axios';
import cheerio from "cheerio";
import fs from "fs";
import Handlebars from 'handlebars';
import i18next from "i18next";
import Backend from 'i18next-fs-backend';
import mime from "mime-types";
import path from 'path';
import { PDFDocument } from 'pdf-lib';
import puppeteer from "puppeteer";
import { awaitAsyncHandlebarHelpers, helpers } from './asyncHelpers';
import { config } from './config';
import { Runner } from './models/Runner';
import { RunnerCard } from './models/RunnerCard';
import { RunnerGroup } from './models/RunnerGroup';
/**
* This class is responsible for all things pdf creation.
* This uses the html templates from src/templates.
*/
export class PdfCreator {
private templateDir = path.join(__dirname, '/templates');
private browser;
private static interpolations = { eventname: config.eventname, sponsoring_receipt_minimum_amount: config.sponsoring_receipt_minimum_amount, currency_symbol: config.currency_symbol }
/**
* Main constructor.
* Initializes i18n(ext), Handlebars and puppeteer.
*/
constructor() {
this.init();
}
/**
* Main constructor.
* Initializes i18n(ext), Handlebars and puppeteer.
*/
public async init() {
const minimal_args = [
'--autoplay-policy=user-gesture-required',
'--disable-background-networking',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows',
'--disable-breakpad',
'--disable-client-side-phishing-detection',
'--disable-component-update',
'--disable-default-apps',
'--disable-dev-shm-usage',
'--disable-domain-reliability',
'--disable-extensions',
'--disable-features=AudioServiceOutOfProcess',
'--disable-hang-monitor',
'--disable-ipc-flooding-protection',
'--disable-notifications',
'--disable-offer-store-unmasked-wallet-cards',
'--disable-popup-blocking',
'--disable-print-preview',
'--disable-prompt-on-repost',
'--disable-renderer-backgrounding',
'--disable-speech-api',
'--disable-sync',
'--hide-scrollbars',
'--ignore-gpu-blacklist',
'--metrics-recording-only',
'--mute-audio',
'--no-default-browser-check',
'--no-first-run',
'--no-pings',
'--no-zygote',
'--password-store=basic',
'--use-gl=swiftshader',
'--no-sandbox'
];
await i18next
.use(Backend)
.init({
fallbackLng: 'en',
lng: 'en',
backend: {
loadPath: path.join(__dirname, '/locales/{{lng}}.json')
}
});
await Handlebars.registerHelper(helpers);
await Handlebars.registerHelper('__',
function (str) {
return i18next.t(str, PdfCreator.interpolations).toString();
}
);
await Handlebars.registerHelper('--sponsor',
function (str) {
const index = (parseInt(str) % config.sponor_logos.length);
if (isNaN(index)) {
return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg=="
}
return config.sponor_logos[index];
}
);
this.browser = await puppeteer.launch({ headless: true, args: minimal_args });
}
/**
* Generate sponsoring contract pdfs.
* @param runner The runner you want to generate the contracts for.
* @param locale The locale used for the contracts (default:en)
*/
public async generateSponsoringContract(runners: Runner[], locale: string = "en", codeformat: string = config.codeformat): Promise<Buffer> {
if (runners.length == 1 && Object.keys(runners[0]).length == 0) {
runners[0] = this.generateEmptyRunner();
}
if (runners.length > 50) {
let pdf_promises = new Array<Promise<Buffer>>();
let i, j;
for (i = 0, j = runners.length; i < j; i += 50) {
let chunk = runners.slice(i, i + 50);
pdf_promises.push(this.generateSponsoringContract(chunk, locale));
}
const pdfs = await Promise.all(pdf_promises);
return await this.mergePdfs(pdfs);
}
await i18next.changeLanguage(locale);
const template_source = fs.readFileSync(`${this.templateDir}/sponsoring_contract.html`, 'utf8');
const template = Handlebars.compile(template_source);
let result = template({ runners, codeformat });
result = await awaitAsyncHandlebarHelpers(result);
const pdf = await this.renderPdf(result, { format: "A5", landscape: true });
return pdf
}
/**
* Generate runner card pdfs.
* @param cards The runner cars you want to generate the cards for.
* @param locale The locale used for the cards (default:en)
*/
public async generateRunnerCards(cards: RunnerCard[], locale: string = "en", codeformat: string = config.codeformat): Promise<Buffer> {
if (cards.length > 10) {
let pdf_promises = new Array<Promise<Buffer>>();
let i, j;
for (i = 0, j = cards.length; i < j; i += 10) {
let chunk = cards.slice(i, i + 10);
pdf_promises.push(this.generateRunnerCards(chunk, locale));
}
const pdfs = await Promise.all(pdf_promises);
return await this.mergePdfs(pdfs);
}
const cards_swapped = this.swapArrayPairs(cards);
await i18next.changeLanguage(locale);
const template_source = fs.readFileSync(`${this.templateDir}/runner_card.html`, 'utf8');
const template = Handlebars.compile(template_source);
let result = template({ cards, cards_swapped, eventname: "LfK! 2069", codeformat: "qrcode" })
result = await awaitAsyncHandlebarHelpers(result);
fs.writeFileSync("lelelelele.tmp", result);
const pdf = await this.renderPdf(result, { format: "A4", landscape: false });
return pdf
}
/**
* Converts all images in html to base64.
* Works with image files in the template directory or images from urls.
* @param html The html string whoms images shall get replaced.
*/
public async imgToBase64(html): Promise<string> {
const $ = cheerio.load(html)
$('img').each(async (index, element) => {
let imgsrc = $(element).attr("src");
if (imgsrc.startsWith("data:image")) {
return;
}
const img_type = mime.lookup(imgsrc);
if (!(img_type.includes("image"))) {
throw new Error("File is not image mime type");
}
let image;
if (imgsrc.startsWith("http")) {
image = (await axios.get(imgsrc)).data;
image = Buffer.from(image).toString('base64');
}
else {
if (imgsrc.startsWith("./")) {
imgsrc = imgsrc.replace("./", "");
}
image = fs.readFileSync(`${this.templateDir}/${imgsrc}`, { encoding: "base64" });
}
image = `data:${img_type};base64,${image}`
$(element).attr("src", image)
})
return $.html();
}
/**
* This method manages the creation of pdfs via puppeteer.
* @param html The HTML that should get rendered.
* @param options Puppeteer PDF option (eg: {format: "A4"})
*/
public async renderPdf(html: string, options): Promise<any> {
html = await this.imgToBase64(html);
let page = await this.browser.newPage();
await page.setContent(html);
const pdf = await page.pdf(options);
await page.close();
return pdf;
}
/**
* Merges multiple pdfs into one.
* @param pdfs The pdfs you want to merge as an buffer array.
* @returns The merged pdf as a buffer.
*/
private async mergePdfs(pdfs: Buffer[]): Promise<Buffer> {
const mergedPdf = await PDFDocument.create();
for (const pdfBuffer of pdfs) {
const pdf = await PDFDocument.load(pdfBuffer);
const copiedPages = await mergedPdf.copyPages(pdf, pdf.getPageIndices());
copiedPages.forEach((page) => {
mergedPdf.addPage(page);
});
}
return <Buffer>(await mergedPdf.save());
}
/**
* Generates a new dummy runner with halfspaces for all strings.
* Can be used to generate empty sponsoring contracts.
* @returns A new runner object that apears to be empty.
*/
private generateEmptyRunner(): Runner {
let group = new RunnerGroup();
group.id = 0;
group.name = "";
let runner = new Runner();
runner.id = 0;
runner.firstname = "";
runner.lastname = "";
runner.group = group;
return runner;
}
/**
* Swaps pairs (0/1, 2/3, ...) of elements in an array recursively.
* If the last element has no partner it inserts an empty element at the end and swaps the two
* This is needed to generate pdfs with front- and backside that get printet on one paper.
* @param array The array which's pairs shall get switched.
* @returns Array with swapped pairs,
*/
private swapArrayPairs(array): Array<any> {
if (array.length == 1) {
return [null, array[0]];
}
if (array.length == 0) {
return null;
}
const rest = this.swapArrayPairs(array.slice(2))
if (!rest) {
return [array[1], array[0]]
}
return [array[1], array[0]].concat(rest);
}
}

33
src/apispec.ts Normal file
View File

@@ -0,0 +1,33 @@
import { MetadataArgsStorage } from 'routing-controllers';
import { routingControllersToSpec } from 'routing-controllers-openapi';
import { config } from './config';
/**
* This function generates a the openapi spec from route metadata and type schemas.
* @param storage MetadataArgsStorage object generated by routing-controllers.
* @param schemas MetadataArgsStorage object generated by class-validator-jsonschema.
*/
export function generateSpec(storage: MetadataArgsStorage, schemas) {
return routingControllersToSpec(
storage,
{},
{
components: {
schemas,
"securitySchemes": {
"AuthToken": {
"type": "apiKey",
"in": "query",
"name": "key",
description: "A simple api key. See the README's env section for more details."
}
}
},
info: {
description: "The the API for the LfK! document server.",
title: "LfK! document server API",
version: config.version
},
}
);
}

31
src/app.ts Normal file
View File

@@ -0,0 +1,31 @@
import consola from "consola";
import "reflect-metadata";
import { createExpressServer } from "routing-controllers";
import { config, e as errors } from './config';
import loaders from "./loaders/index";
import AuthChecker from './middlewares/AuthChecker';
import { ErrorHandler } from './middlewares/ErrorHandler';
const CONTROLLERS_FILE_EXTENSION = process.env.NODE_ENV === 'production' ? 'js' : 'ts';
const app = createExpressServer({
middlewares: [ErrorHandler],
authorizationChecker: AuthChecker,
development: config.development,
cors: true,
controllers: [`${__dirname}/controllers/*.${CONTROLLERS_FILE_EXTENSION}`],
});
async function main() {
await loaders(app);
app.listen(config.internal_port, () => {
consola.success(
`⚡️[server]: Server is running at http://localhost:${config.internal_port}`
);
});
}
if (errors === 0) {
main();
} else {
consola.error("error");
// something's wrong
}

45
src/asyncHelpers.ts Normal file

File diff suppressed because one or more lines are too long

52
src/config.ts Normal file
View File

@@ -0,0 +1,52 @@
import consola from "consola";
import { config as configDotenv } from 'dotenv';
configDotenv();
export const config = {
internal_port: parseInt(process.env.APP_PORT) || 4010,
development: process.env.NODE_ENV === "production",
version: process.env.VERSION || require('../package.json').version,
eventname: process.env.EVENT_NAME || "Please set the event name",
currency_symbol: process.env.CURRENCY_SYMBOL || "€",
sponsoring_receipt_minimum_amount: process.env.SPONSORING_RECEIPT_MINIMUM_AMOUNT || "10",
codeformat: process.env.CODEFORMAT || "qrcode",
sponor_logos: getSponsorLogos(),
api_key: getApiKey(),
}
let errors = 0
if (typeof config.internal_port !== "number") {
errors++
}
if (typeof config.development !== "boolean") {
errors++
}
function getSponsorLogos(): string[] {
try {
const logos = JSON.parse(process.env.SPONOR_LOGOS);
if (!Array.isArray(logos)) { throw new Error("Not an array.") }
return logos;
} catch (error) {
return ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg=="];
}
}
function getApiKey(): string {
const key = process.env.API_KEY;
if (!key) {
consola.info("No API key set - generating a random one...");
let result = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charactersLength = characters.length;
for (var i = 0; i < 64; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
consola.info(`API KEY: ${result}`)
return result;
}
if (key.length < 64) {
consola.error(`API key is too short - minimum: 64, current: ${key.length}`)
throw new Error("API_KEY too short.")
}
return key
}
export let e = errors

View File

@@ -0,0 +1,78 @@
import { Authorized, Body, JsonController, Post, QueryParam, Res } from 'routing-controllers';
import { OpenAPI } from 'routing-controllers-openapi';
import { Runner } from '../models/Runner';
import { RunnerCard } from '../models/RunnerCard';
import { PdfCreator } from '../PdfCreator';
/**
* The pdf controller handels all endpoints concerning pdf generation.
* It therefore is the hearth of the document-generation server's endpoints.
* All endpoints have to accept a locale query-param to support i18n.
*/
@JsonController()
@Authorized()
@OpenAPI({ security: [{ "AuthToken": [] }] })
export class PdfController {
private pdf: PdfCreator = new PdfCreator();
private initialized: boolean = false;
@Post('/contracts')
@OpenAPI({ description: "Generate Sponsoring contract pdfs from runner objects.<br>You can choose your prefered locale by passing the 'locale' query-param.<br> If you provide more than 100 runenrs this could take a moment or two (we tested up to 1000 runners in about 70sec so far)." })
async generateContracts(@Body({ validate: true, options: { limit: "500mb" } }) runners: Runner[], @Res() res: any, @QueryParam("locale") locale: string, @QueryParam("codeformat") codeformat: string) {
if (!this.initialized) {
await this.pdf.init();
this.initialized = true;
}
if (!Array.isArray(runners)) {
runners = [runners];
}
runners = this.mapRunnerGroupNames(runners)
const contracts = await this.pdf.generateSponsoringContract(runners, locale, codeformat);
res.setHeader('content-type', 'application/pdf');
return contracts;
}
@Post('/cards')
@OpenAPI({ description: "Generate runner card pdfs from runner card objects.<br>You can choose your prefered locale by passing the 'locale' query-param." })
async generateCards(@Body({ validate: true, options: { limit: "500mb" } }) cards: RunnerCard | RunnerCard[], @Res() res: any, @QueryParam("locale") locale: string) {
if (!this.initialized) {
await this.pdf.init();
this.initialized = true;
}
if (!Array.isArray(cards)) {
cards = [cards];
}
cards = this.mapCardGroupNames(cards);
const contracts = await this.pdf.generateRunnerCards(cards, locale);
res.setHeader('content-type', 'application/pdf');
return contracts;
}
private mapRunnerGroupNames(runners: Runner[]): Runner[] {
let response = new Array<Runner>();
for (let runner of runners) {
if (!runner.group.parentGroup) {
runner.group.fullName = runner.group.name;
}
else {
runner.group.fullName = `${runner.group.parentGroup.name}/${runner.group.name}`;
}
response.push(runner)
}
return response;
}
private mapCardGroupNames(cards: RunnerCard[]): RunnerCard[] {
let response = new Array<RunnerCard>();
for (let card of cards) {
if (!card.runner.group.parentGroup) {
card.runner.group.fullName = card.runner.group.name;
}
else {
card.runner.group.fullName = `${card.runner.group.parentGroup.name}/${card.runner.group.name}`;
}
response.push(card)
}
return response;
}
}

View File

@@ -0,0 +1,17 @@
import { Get, JsonController } from 'routing-controllers';
import { OpenAPI } from 'routing-controllers-openapi';
import { config } from '../config';
/**
* The statuscontroller provides simple endpoints concerning basic information about the server.
*/
@JsonController()
export class StatusController {
@Get('/version')
@OpenAPI({ description: "A very basic endpoint that just returns the curent package version." })
getVersion() {
return {
"version": config.version
}
}
}

View File

@@ -0,0 +1,57 @@
import { IsString } from 'class-validator';
import { BadRequestError } from 'routing-controllers';
/**
* Error to throw when an address's postal code fails validation.
*/
export class AddressPostalCodeInvalidError extends BadRequestError {
@IsString()
name = "AddressPostalCodeInvalidError"
@IsString()
message = "The postal code you provided is invalid. \n Please check if your postal code follows the postal code validation guidelines."
}
/**
* Error to throw when an non-empty address's first line isn't set.
*/
export class AddressFirstLineEmptyError extends BadRequestError {
@IsString()
name = "AddressFirstLineEmptyError"
@IsString()
message = "You provided a empty first address line. \n If you want an empty address please set all propertys to null. \n For non-empty addresses the following fields have to be set: address1, postalcode, city, country"
}
/**
* Error to throw when an non-empty address's postal code isn't set.
*/
export class AddressPostalCodeEmptyError extends BadRequestError {
@IsString()
name = "AddressPostalCodeEmptyError"
@IsString()
message = "You provided a empty postal code. \n If you want an empty address please set all propertys to null. \n For non-empty addresses the following fields have to be set: address1, postalcode, city, country"
}
/**
* Error to throw when an non-empty address's city isn't set.
*/
export class AddressCityEmptyError extends BadRequestError {
@IsString()
name = "AddressCityEmptyError"
@IsString()
message = "You provided a empty city. \n If you want an empty address please set all propertys to null. \n For non-empty addresses the following fields have to be set: address1, postalcode, city, country"
}
/**
* Error to throw when an non-empty address's country isn't set.
*/
export class AddressCountryEmptyError extends BadRequestError {
@IsString()
name = "AddressCountryEmptyError"
@IsString()
message = "You provided a empty country. \n If you want an empty address please set all propertys to null. \n For non-empty addresses the following fields have to be set: address1, postalcode, city, country"
}

11
src/loaders/express.ts Normal file
View File

@@ -0,0 +1,11 @@
import { Application } from "express";
/**
* Loader for express related configurations.
* Configures proxy trusts, globally used middlewares and other express features.
*/
export default async (app: Application) => {
app.enable('trust proxy');
app.disable('x-powered-by');
app.disable('x-served-by');
return app;
};

13
src/loaders/index.ts Normal file
View File

@@ -0,0 +1,13 @@
import { Application } from "express";
import expressLoader from "./express";
import openapiLoader from "./openapi";
/**
* Index Loader that executes the other loaders in the right order.
* This basicly exists for abstraction and a overall better dev experience.
*/
export default async (app: Application) => {
await openapiLoader(app);
await expressLoader(app);
return app;
};

24
src/loaders/openapi.ts Normal file
View File

@@ -0,0 +1,24 @@
import { validationMetadatasToSchemas } from "@odit/class-validator-jsonschema";
import express, { Application } from "express";
import path from 'path';
import { getMetadataArgsStorage } from "routing-controllers";
import { generateSpec } from '../apispec';
/**
* Loader for everything openapi related - from creating the schema to serving it via a static route and swaggerUiExpress.
* All auth schema related stuff also has to be configured here
*/
export default async (app: Application) => {
const storage = getMetadataArgsStorage();
const schemas = validationMetadatasToSchemas({
refPointerPrefix: "#/components/schemas/",
});
//Spec creation based on the previously created schemas
const spec = generateSpec(storage, schemas);
app.get(["/docs/openapi.json", "/docs/swagger.json"], (req, res) => {
res.json(spec);
});
app.use('/docs', express.static(path.join(__dirname, '../static/docs'), { index: "index.html", extensions: ['html'] }));
return app;
};

20
src/locales/de.json Normal file
View File

@@ -0,0 +1,20 @@
{
"address": "Adresse",
"city": "Stadt",
"date": "Datum",
"firstname": "Vorname",
"group": "Team/Klasse",
"house_number": "Hausnummer",
"id": "ID",
"lastname": "Nachname",
"location": "Ort",
"please_use_blockletters": "Bitte in DRUCKBUCHSTABEN schreiben",
"postalcode": "Postleitzahl",
"signature": "Unterschrift",
"sponsor": "Sponsor",
"sponsoring_address_condition": "Muss ausgefüllt werden, wenn Sie eine Spendenquittung benötigen - Spendenquittungen können erst ab einem Gesamtbetrag von {{sponsoring_receipt_minimum_amount}}{{currency_symbol}} ausgestellt werden",
"sponsoring_amount_per_distance": "mit einem Betrag von _____{{currency_symbol}} pro gelaufenem Kilometer zu unterstützen.",
"sponsoring_subtitle": "Ich/Wir sind bereit anlässlich des {{eventname}}",
"sponsoring_title": "Sponsoringerklärung",
"street": "Straße"
}

19
src/locales/en.json Normal file
View File

@@ -0,0 +1,19 @@
{
"address": "Address",
"city": "City",
"date": "date",
"firstname": "First name",
"group": "Team/class",
"house_number": "House number",
"lastname": "Last name",
"location": "Location",
"please_use_blockletters": "Please write in BLOCK LETTERS.",
"postalcode": "Postal code",
"signature": "Signature",
"sponsor": "sponsor",
"sponsoring_address_condition": "You have to provide an address if you want a donation receipt - Donation receipts can't be issued for total donation amounts under {{sponsoring_receipt_minimum_amount}}{{currency_symbol}}",
"sponsoring_amount_per_distance": "with the amount of _____{{currency_symbol}} per kilometer run.",
"sponsoring_subtitle": "On the ocation of the {{eventname}} I/We want to support",
"sponsoring_title": "Sponsoring contract",
"street": "Street"
}

View File

@@ -0,0 +1,14 @@
import { Action } from "routing-controllers";
import { config } from '../config';
/**
* Handles authentication via jwt's (Bearer authorization header) for all api endpoints using the @Authorized decorator.
* @param action Routing-Controllers action object that provides request and response objects among other stuff.
* @param permissions The permissions that the endpoint using @Authorized requires.
*/
const AuthChecker = async (action: Action) => {
const provided_token = action.request.query.key;
return provided_token == config.api_key;
}
export default AuthChecker

View File

@@ -0,0 +1,14 @@
import { ExpressErrorMiddlewareInterface, Middleware } from "routing-controllers";
/**
* Our Error handling middlware that returns our custom httperrors to the user.
*/
@Middleware({ type: "after" })
export class ErrorHandler implements ExpressErrorMiddlewareInterface {
public error(error: any, request: any, response: any, next: (err: any) => any) {
if (response.headersSent) {
return;
}
response.json(error);
}
}

50
src/models/Address.ts Normal file
View File

@@ -0,0 +1,50 @@
import {
IsString
} from "class-validator";
/**
* Defines the Address class.
* Implemented this way to prevent any formatting differences.
*/
export class Address {
/**
* The address's first line.
* Containing the street and house number.
*/
@IsString()
address1?: string;
/**
* The address's second line.
* Containing optional information.
*/
@IsString()
address2?: string;
/**
* The address's postal code.
* This will get checked against the postal code syntax for the configured country.
*/
@IsString()
postalcode: string;
/**
* The address's city.
*/
@IsString()
city: string;
/**
* The address's country.
*/
@IsString()
country: string;
public reset() {
this.address1 = null;
this.address2 = null;
this.city = null;
this.country = null;
this.postalcode = null;
}
}

View File

@@ -0,0 +1,16 @@
import {
IsArray
} from "class-validator";
import { DistanceDonation } from './DistanceDonation';
import { Runner } from './Runner';
/**
* Defines the certificate runner class (from which the runner certificates get generated).
*/
export class CertificateRunner extends Runner {
/**
* Array containing all distance donations associated with the runner.
*/
@IsArray()
distanceDonations: DistanceDonation[];
}

View File

@@ -0,0 +1,40 @@
import { IsInt, IsNotEmpty, IsObject, IsPositive } from "class-validator";
import { Donation } from "./Donation";
import { Runner } from "./Runner";
/**
* Defines the DistanceDonation class.
* For distanceDonations a donor pledges to donate a certain amount for each kilometer ran by a runner.
*/
export class DistanceDonation extends Donation {
/**
* The donation's associated runner.
* Used as the source of the donation's distance.
*/
@IsObject()
@IsNotEmpty()
runner: Runner;
/**
* The donation's amount donated per distance.
* The amount the donor set to be donated per kilometer that the runner ran.
*/
@IsInt()
@IsPositive()
amountPerDistance: number;
/**
* The donation's amount in cents (or whatever your currency's smallest unit is.).
* Get's calculated from the runner's distance ran and the amount donated per kilometer.
*/
public get amount(): number {
let calculatedAmount = 0;
try {
calculatedAmount = this.amountPerDistance * (this.runner.distance / 1000);
} catch (error) {
throw error;
}
return calculatedAmount;
}
}

32
src/models/Donation.ts Normal file
View File

@@ -0,0 +1,32 @@
import {
IsInt,
IsNotEmpty,
IsObject
} from "class-validator";
import { Donor } from './Donor';
/**
* Defines the Donation base calss.
* A donation just associates a donor with a donation amount.
* The specifics of the amoun's determination has to be implemented in child classes.
*/
export abstract class Donation {
/**
* Autogenerated unique id (primary key).
*/
@IsInt()
id: number;
/**
* The donations's donor.
*/
@IsNotEmpty()
@IsObject()
donor: Donor;
/**
* The donation's amount in cents (or whatever your currency's smallest unit is.).
* The exact implementation may differ for each type of donation.
*/
public abstract get amount(): number;
}

37
src/models/Donor.ts Normal file
View File

@@ -0,0 +1,37 @@
import {
IsInt,
IsString
} from "class-validator";
/**
* Defines the Donor class.
*/
export class Donor {
/**
* The donor's id.
*/
@IsInt()
id: number;
/**
* The donor's first name.
*/
@IsString()
firstname: string;
/**
* The donor's middle name.
*/
@IsString()
middlename?: string;
/**
* The donor's last name.
*/
@IsString()
lastname: string;
}

View File

@@ -0,0 +1,16 @@
import { IsInt, IsPositive } from "class-validator";
import { Donation } from "./Donation";
/**
* Defines the FixedDonation entity.
* In the past there was no easy way to track fixed donations (eg. for creating donation receipts).
*/
export class FixedDonation extends Donation {
/**
* The donation's amount in cents (or whatever your currency's smallest unit is.).
*/
@IsInt()
@IsPositive()
amount: number;
}

69
src/models/Runner.ts Normal file
View File

@@ -0,0 +1,69 @@
import {
IsInt,
IsNotEmpty,
IsObject,
IsOptional,
IsPositive,
IsString,
ValidateNested
} from "class-validator";
import { RunnerGroup } from './RunnerGroup';
/**
* Defines the runner class (from which the runner sponsoring contracts get generated).
*/
export class Runner {
/**
* The runner's id.
*/
@IsInt()
@IsPositive()
id: number;
/**
* The runner's first name.
*/
@IsString()
@IsNotEmpty()
firstname: string;
/**
* The runner's middle name.
*/
@IsString()
@IsOptional()
middlename?: string;
/**
* The runner's last name.
*/
@IsString()
@IsNotEmpty()
lastname: string;
/**
* The runner's group.
*/
@IsObject()
@ValidateNested()
group: RunnerGroup;
/**
* The total distance ran by the runner.
*/
@IsInt()
distance: number;
constructor() {
console.log("called")
}
}

33
src/models/RunnerCard.ts Normal file
View File

@@ -0,0 +1,33 @@
import {
IsEAN,
IsInt,
IsNotEmpty,
IsObject,
IsString
} from "class-validator";
import { Runner } from './Runner';
/**
* Defines the runner card class (used to create runner card pdfs).
*/
export class RunnerCard {
/**
* The cards's id.
*/
@IsInt()
id: number;
/**
* The card's associated runner.
*/
@IsObject()
runner: Runner | null;
/**
* The card's code.
*/
@IsEAN()
@IsString()
@IsNotEmpty()
code: string;
}

30
src/models/RunnerGroup.ts Normal file
View File

@@ -0,0 +1,30 @@
import { IsInt, IsNotEmpty, IsObject, IsOptional, IsPositive, IsString } from "class-validator";
/**
* Defines the runner group class - a simplified version of the backend's ResponseRunnerTeam/-Organization
*/
export class RunnerGroup {
/**
* The group's id.
*/
@IsInt()
@IsPositive()
id: number;
/**
* The group's name.
*/
@IsString()
@IsNotEmpty()
name: string;
/**
* The group's parent group.
* If it is set this implies that the object is a team.
*/
@IsObject()
@IsOptional()
parentGroup?: RunnerGroup;
fullName: string;
}

156
src/static/docs/index.html Normal file
View File

@@ -0,0 +1,156 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Docs</title>
<style>
:root {
--bg-color: #fff;
--bg-secondary-color: #f3f3f6;
--color-primary: #14854f;
--color-lightGrey: #d2d6dd;
--color-grey: #747681;
--color-darkGrey: #3f4144;
--color-error: #d43939;
--color-success: #28bd14;
--grid-maxWidth: 120rem;
--grid-gutter: 2rem;
--font-size: 1.6rem;
--font-color: #333;
--font-family-sans: -apple-system, BlinkMacSystemFont, Avenir, "Avenir Next", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
--font-family-mono: monaco, "Consolas", "Lucida Console", monospace
}
html {
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-size: 62.5%;
line-height: 1.15;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%
}
*,
:after,
:before {
-webkit-box-sizing: inherit;
box-sizing: inherit
}
body {
background-color: var(--bg-color);
line-height: 1.6;
font-size: var(--font-size);
color: var(--font-color);
font-family: Segoe UI, Helvetica Neue, sans-serif;
font-family: var(--font-family-sans);
margin: 0;
padding: 0
}
h3 {
font-weight: 500;
margin: .35em 0 .7em
}
h3 {
font-size: 1.5em
}
a {
color: var(--color-primary);
text-decoration: none
}
a:hover:not(.button) {
opacity: .75
}
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=color]):not([type=button]):not([type=reset]):not(:disabled):hover {
border-color: var(--color-grey)
}
::-webkit-input-placeholder {
color: #bdbfc4
}
::-moz-placeholder {
color: #bdbfc4
}
:-ms-input-placeholder {
color: #bdbfc4
}
::-ms-input-placeholder {
color: #bdbfc4
}
.tabs {
display: -webkit-box;
display: -ms-flexbox;
display: flex
}
.tabs a {
text-decoration: none
}
.tabs>a {
padding: 1rem 2rem;
-webkit-box-flex: 0;
-ms-flex: 0 1 auto;
flex: 0 1 auto;
color: var(--color-darkGrey);
border-bottom: 2px solid var(--color-lightGrey);
text-align: center
}
.tabs>a:hover {
opacity: 1;
border-bottom: 2px solid var(--color-darkGrey)
}
.is-vertical-align {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center
}
.is-center {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center
}
.is-center {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center
}
</style>
</head>
<body>
<div class="hero">
<div class="logo is-center is-vertical-align">
<h3>API Docs</h3>
</div>
<nav class="tabs is-center">
<a href="./redoc">ReDoc</a>
<a href="./swaggerui">SwaggerUI</a>
<a href="./rapidoc">RapiDoc</a>
<a href="./openapi.json">Raw Spec (json)</a>
</nav>
</div>
</body>
</html>

220
src/static/docs/rapidoc-min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="module" src="./rapidoc-min.js"></script>
</head>
<body>
<rapi-doc
spec-url="/docs/openapi.json"
> </rapi-doc>
</body>
</html>

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>ReDoc</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<redoc spec-url='/docs/openapi.json'></redoc>
<script src="./redoc.standalone.js"> </script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,58 @@
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after
{
box-sizing: inherit;
}
body
{
margin:0;
background: #fafafa;
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "/docs/openapi.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
// End Swagger UI call region
window.ui = ui
}
</script>
</body>
</html>

0
src/templates/.gitkeep Normal file
View File

View File

@@ -0,0 +1,71 @@
<html>
<head>
<meta charset="utf8">
<title>Sponsoring contract</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
<style>
.sheet {
margin: 0;
overflow: hidden;
position: relative;
box-sizing: border-box;
page-break-after: always;
padding: 1.2cm 2cm 1.2cm 2cm
}
body.A4 .sheet {
width: 210mm;
height: 296mm
}
.runnercard {
border: 1px solid;
height: 5.5cm;
overflow: hidden;
}
</style>
</head>
<body class="A4 landscape">
<div class="sheet">
<div class="columns is-multiline">
{{#each cards}}
<div class="column is-half runnercard">
<p class="title is-5" style="text-align: center; padding-bottom: 0; margin-top: -0.75rem;">{{../eventname}}</p>
<p style="text-align: center; margin-top: -1.5rem; font-size: small;">lauf-fuer-kaya.de - am 01.01.2021</p>
<p style="font-size: small;">Mit unterstützung von:</p>
<div class="columns" style="height: 6rem; overflow: hidden;">
<div class="column is-two-thirds">
<!--SPONSOR LOGO HERE-->
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
src="{{--sponsor this.id}}" />
</div>
<div class="column is-one-third">
<!--BARCODE HERE-->
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
src="{{--bc this.id ../codeformat}}" />
</div>
</div>
<p>{{this.runner.lastname}}, {{this.runner.firstname}} {{this.runner.middlename}}</p>
<p>{{this.runner.group.fullName}}</p>
</div>
{{/each}}
</div>
</div>
<div class="sheet">
<div class="columns is-multiline">
{{#each cards_swapped}}
<div class="column is-half runnercard" style="justify-content: center; align-items: center; text-align: center;">
<!--SPONSOR LOGO FIRST-->
<div style="height: 2cm; padding: 0 0 2.25cm 0">
<img style="object-fit: cover; max-height: 2cm;" src="{{--sponsor this.id}}" />
</div>
<img style="object-fit: cover; max-height: 2.5cm; position: relative;" src="{{--bc this.id ../codeformat}}" />
</div>
{{/each}}
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,120 @@
<html>
<head>
<meta charset="utf8">
<title>Sponsoring contract</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
<style>
.sheet {
margin: 0;
overflow: hidden;
position: relative;
box-sizing: border-box;
page-break-after: always;
}
body.A5.landscape .sheet {
width: 210mm;
height: 147mm
}
.column {
margin-bottom: -20;
}
</style>
</head>
<body class="A5 landscape">
{{#each runners}}
<div class="sheet">
<img id="header_img" width="100%" src="sponsoringheader.png" />
<div style=" padding: 0 1rem 0 1rem;">
<div class="columns">
<div class="column is-10">
<div class="columns" style="padding-bottom: 0;">
<div class="column is-two-fifths">
<p style="font-size: large; font-weight: bold;">{{__ "sponsoring_title"}}</p>
</div>
<div class="column">
<p style="font-size: x-small; vertical-align: revert; margin-top: auto;">{{__ "please_use_blockletters"}}
</p>
</div>
</div>
<p> {{__ "sponsoring_subtitle"}} </p>
<div class="columns">
<div class="column is-9">
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{this.firstname}}
{{this.middlename}}</span>
<p style="font-size: x-small; display: block;">{{__ "firstname"}}</p>
</div>
<div class="column is-3">
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{this.id}}</span>
<p style="font-size: x-small; display: block;">ID</p>
</div>
</div>
</div>
<div class="column">
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
src="{{--bc this.id ../codeformat}}" />
</div>
</div>
<div class="columns" style="padding-top: 1rem;">
<div class="column is-6">
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{this.lastname}}</span>
<p style="font-size: x-small; display: block;">{{__ "lastname"}}</p>
</div>
<div class="column is-6">
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{this.group.fullName}}</span>
<p style="font-size: x-small; display: block;">{{__ "group"}}</p>
</div>
</div>
<p>{{__ "sponsoring_amount_per_distance"}}</p>
<div class="columns">
<div class="column is-6">
<span style="border-bottom: 1px solid; width: 100%; display: block;"></span>
<p style="font-size: x-small; display: block;">{{__ "lastname"}}</p>
</div>
<div class="column is-6">
<span style="border-bottom: 1px solid; width: 100%; display: block;"></span>
<p style="font-size: x-small; display: block;">{{__ "firstname"}}</p>
</div>
</div>
<p style="font-size: medium;">{{__ "address"}} ({{__ "sponsor"}})</p>
<p style="font-size: x-small;">({{__ "sponsoring_address_condition"}})</p>
<div class="columns">
<div class="column is-8">
<span style="border-bottom: 1px solid; width: 100%; display: block;"></span>
<p style="font-size: x-small; display: block;">{{__ "street"}}</p>
</div>
<div class="column is-4">
<span style="border-bottom: 1px solid; width: 100%; display: block;"></span>
<p style="font-size: x-small; display: block;">{{__ "house_number"}}</p>
</div>
</div>
<div class="columns">
<div class="column is-4">
<span style="border-bottom: 1px solid; width: 100%; display: block;"></span>
<p style="font-size: x-small; display: block;">{{__ "postalcode"}}</p>
</div>
<div class="column is-8">
<span style="border-bottom: 1px solid; width: 100%; display: block;"></span>
<p style="font-size: x-small; display: block;">{{__ "city"}}</p>
</div>
</div>
<br>
<div class="columns">
<div class="column is-7">
<span style="border-bottom: 1px solid; width: 100%; display: block;"></span>
<p style="font-size: x-small; display: block;">{{__ "location"}}, {{__ "date"}}</p>
</div>
<div class="column is-5">
<span style="border-bottom: 1px solid; width: 100%; display: block;"></span>
<p style="font-size: x-small; display: block;">{{__ "signature"}}</p>
</div>
</div>
</div>
</div>
{{/each}}
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

128
src/tests/speedtest.ts Normal file
View File

@@ -0,0 +1,128 @@
import axios from "axios"
import faker from "faker"
import { Runner } from '../models/Runner'
import { RunnerCard } from '../models/RunnerCard'
import { RunnerGroup } from '../models/RunnerGroup'
const baseurl = "http://localhost:4010"
axios.interceptors.request.use((config) => {
config.headers['request-startTime'] = process.hrtime()
return config
})
axios.interceptors.response.use((response) => {
const start = response.config.headers['request-startTime']
const end = process.hrtime(start)
const milliseconds = Math.round((end[0] * 1000) + (end[1] / 1000000))
response.headers['request-duration'] = milliseconds
return response
})
function generateRunners(amount: number): Runner[] {
let runners: Runner[] = new Array<Runner>();
let group = new RunnerGroup();
let runner = new Runner();
for (var i = 0; i < amount; i++) {
group.name = faker.company.bsBuzz();
group.id = Math.floor(Math.random() * (9999999 - 1) + 1);
runner.firstname = faker.name.firstName();
runner.lastname = faker.name.lastName();
runner.id = Math.floor(Math.random() * (9999999 - 1) + 1);
runners.push(runner);
}
return runners;
}
function generateCards(amount: number): RunnerCard[] {
let cards: RunnerCard[] = new Array<RunnerCard>();
let card = new RunnerCard();
for (let runner of generateRunners(amount)) {
card.id = runner.id;
card.code = idToEan13(card.id);
card.runner = runner;
cards.push(card);
}
return cards;
}
function idToEan13(id): string {
const multiply = [1, 3];
id = id.toString();
if (id.length > 12) {
throw new Error("id too long");
}
while (id.length < 12) { id = '0' + id; }
let total = 0;
id.split('').forEach((letter, index) => {
total += parseInt(letter, 10) * multiply[index % 2];
});
const checkSum = (Math.ceil(total / 10) * 10) - total;
return id + checkSum.toString();
}
async function postContracts(runners: Runner[]): Promise<Measurement> {
const res = await axios.post(`${baseurl}/contracts`, runners);
return new Measurement("contract", runners.length, parseInt(res.headers['request-duration']))
}
async function postCards(cards: RunnerCard[]): Promise<Measurement> {
const res = await axios.post(`${baseurl}/cards`, cards);
return new Measurement("card", cards.length, parseInt(res.headers['request-duration']))
}
async function testContracts(sizes): Promise<Measurement[]> {
let measurements = new Array<Measurement>();
console.log("#### Testing contracts ####");
for (let size of sizes) {
const m = await postContracts(generateRunners(size));
console.log(m.toString());
measurements.push(m);
}
return measurements;
}
async function testCards(sizes): Promise<Measurement[]> {
let measurements = new Array<Measurement>();
console.log("#### Testing Cards ####");
for (let size of sizes) {
const m = await postCards(generateCards(size));
console.log(m.toString());
measurements.push(m);
}
return measurements;
}
async function main() {
const sizes = [0, 1, 10, 50, 100, 200, 500, 1000]
console.log("########### Speedtest ###########");
console.log(`Document server version (according to the api): ${(await axios.get("http://localhost:4010/version")).data.version}`);
console.log("####### Running tests #######");
const contractResults = await testContracts(sizes);
const cardResults = await testCards(sizes);
console.log("####### Results #######");
console.table(contractResults);
console.table(cardResults);
}
main();
class Measurement {
public type: string;
public inputcount: number;
public responsetime: number;
constructor(type: string, input: number, time: number) {
this.type = type;
this.inputcount = input;
this.responsetime = time;
}
public toString(): string {
return `It took ${this.responsetime}ms to generate ${this.inputcount} pdfs for the type ${this.type}.`
}
}

19
tsconfig.json Normal file
View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"rootDir": "./src",
"outDir": "./dist",
"esModuleInterop": true,
"strict": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"sourceMap": false
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
]
}