Compare commits
107 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
bbe01cd231
|
|||
|
10c68cfb37
|
|||
|
c21076a049
|
|||
|
fc774d5af3
|
|||
|
dd0b60b2ba
|
|||
|
6add09c7df
|
|||
|
d064b51e1b
|
|||
|
744f567b7c
|
|||
|
7dbce9e870
|
|||
|
72ed2495f6
|
|||
|
05e0c63931
|
|||
| fcbcec85c5 | |||
|
b47b2f804f
|
|||
|
5f4fc74cd9
|
|||
| 300b8fd01a | |||
| 8b951dfb3f | |||
|
517e8a0819
|
|||
|
3af4b521d3
|
|||
| dca2829323 | |||
| 57a84c256a | |||
| b78534e1b0 | |||
| 9b85b54da5 | |||
| 4b5a86282d | |||
|
c9cb03ea95
|
|||
| c7f57548f3 | |||
| 8d00307170 | |||
| 5e92b9a48f | |||
| 01e1323555 | |||
| f8465721cd | |||
| 4cea7cb32f | |||
|
72303b1105
|
|||
| 451b7fbe05 | |||
|
2a3322612d
|
|||
| 4b4d66ae78 | |||
| c935950eb0 | |||
| 573b921197 | |||
|
274c13e358
|
|||
| ff0421da2f | |||
| 915baa6efa | |||
| bac004d74e | |||
| b7b7f6a0ae | |||
| 11efdebacf | |||
| 0f2d6f58d6 | |||
| df8bd1133b | |||
| 22fb3edd78 | |||
| ded610f114 | |||
| a4c8dade23 | |||
| b6fc069042 | |||
| 60cc343adf | |||
| 010f2046ad | |||
| c18cb7f135 | |||
| 2e7c3e8a5b | |||
| ac9be793bd | |||
| c18fc4ec93 | |||
| 981bae4786 | |||
| 754d0ca58c | |||
| fa26ed6012 | |||
| cc4a2b4ab4 | |||
| e97e209746 | |||
| 8f30d8933f | |||
| f78037c0f1 | |||
| 3c02e13997 | |||
| d8f3a6ed06 | |||
| 2ee4c06055 | |||
| 76418f65e1 | |||
| a57e0909b9 | |||
| a81db03ba3 | |||
| 7ae4750307 | |||
| f623c0a7cd | |||
| 3fc612488d | |||
| f220e70743 | |||
| d3f7d1a6c9 | |||
| 82159bed53 | |||
| 479e28c46c | |||
| e75f15142e | |||
| cec893032d | |||
| 2278e4ad06 | |||
| 5a98688d60 | |||
| 63c7beb8b9 | |||
| 2a4cfdb2f8 | |||
| a580841973 | |||
| 6b23dea477 | |||
| e0add846bb | |||
| 1d12de7045 | |||
| b43aeec0cf | |||
| 405bb20601 | |||
| ac572f1ea3 | |||
| 7fea1ca78f | |||
| 64fce5bd01 | |||
| 5ba26c4cbf | |||
| b82a32ae3e | |||
| 0af9b81b38 | |||
| 955e11846b | |||
| d1577cd08d | |||
| 6767c3b2d1 | |||
| 2b2195727b | |||
| 3ca2237953 | |||
| 8d6ea4dbf9 | |||
| 8b71608792 | |||
| f1084b59a7 | |||
| c8dc998ecd | |||
| 3df3d26708 | |||
| 922e762aa2 | |||
| c3beb3e103 | |||
| 457ea26cf8 | |||
| c2d2b66f2f | |||
| 289a0d8671 |
87
.drone.yml
87
.drone.yml
@@ -33,53 +33,23 @@ steps:
|
|||||||
- git clone $DRONE_REMOTE_URL .
|
- git clone $DRONE_REMOTE_URL .
|
||||||
- git checkout dev
|
- git checkout dev
|
||||||
- name: build dev
|
- name: build dev
|
||||||
image: plugins/docker
|
depends_on: ["clone"]
|
||||||
depends_on: [clone]
|
image: registry.odit.services/library/drone-kaniko
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
repo: registry.odit.services/lfk/document-server
|
build_args:
|
||||||
|
- NPM_REGISTRY_DOMAIN:
|
||||||
|
from_secret: npmjs_domain
|
||||||
|
- NPM_REGISTRY_TOKEN:
|
||||||
|
from_secret: npmjs_token
|
||||||
|
repo: lfk/document-server
|
||||||
tags:
|
tags:
|
||||||
- dev
|
- dev
|
||||||
|
cache: true
|
||||||
registry: registry.odit.services
|
registry: registry.odit.services
|
||||||
mtu: 1000
|
|
||||||
- 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: git_ssh
|
|
||||||
- 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: git_ssh
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- dev
|
- dev
|
||||||
@@ -99,29 +69,24 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- git clone $DRONE_REMOTE_URL .
|
- git clone $DRONE_REMOTE_URL .
|
||||||
- git checkout dev
|
- git checkout dev
|
||||||
- git merge main
|
- name: build dev
|
||||||
- git checkout main
|
|
||||||
- name: build latest
|
|
||||||
depends_on: ["clone"]
|
depends_on: ["clone"]
|
||||||
image: plugins/docker
|
image: registry.odit.services/library/drone-kaniko
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
repo: registry.odit.services/lfk/document-server
|
build_args:
|
||||||
|
- NPM_REGISTRY_DOMAIN:
|
||||||
|
from_secret: npmjs_domain
|
||||||
|
- NPM_REGISTRY_TOKEN:
|
||||||
|
from_secret: npmjs_token
|
||||||
|
repo: lfk/document-server
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
|
cache: true
|
||||||
registry: registry.odit.services
|
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: git_ssh
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
@@ -136,17 +101,23 @@ name: build:tags
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build $DRONE_TAG
|
- name: build $DRONE_TAG
|
||||||
image: plugins/docker
|
depends_on: ["clone"]
|
||||||
depends_on: [clone]
|
image: registry.odit.services/library/drone-kaniko
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
repo: registry.odit.services/lfk/document-server
|
build_args:
|
||||||
|
- NPM_REGISTRY_DOMAIN:
|
||||||
|
from_secret: npmjs_domain
|
||||||
|
- NPM_REGISTRY_TOKEN:
|
||||||
|
from_secret: npmjs_token
|
||||||
|
repo: lfk/document-server
|
||||||
tags:
|
tags:
|
||||||
- '${DRONE_TAG}'
|
- "${DRONE_TAG}"
|
||||||
|
cache: true
|
||||||
registry: registry.odit.services
|
registry: registry.odit.services
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
|
|||||||
124
CHANGELOG.md
124
CHANGELOG.md
@@ -2,8 +2,131 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||||
|
|
||||||
|
#### [v0.6.1](https://git.odit.services/lfk/document-server/compare/v0.6.0...v0.6.1)
|
||||||
|
|
||||||
|
- Dependency cleanup [`c21076a`](https://git.odit.services/lfk/document-server/commit/c21076a049484e353735db8542a932d93d0520c1)
|
||||||
|
- Dependency Bumps [`fc774d5`](https://git.odit.services/lfk/document-server/commit/fc774d5af39d7b6db999e85f2be8e109400cf862)
|
||||||
|
- Slimmed down docker build thx to copy [`10c68cf`](https://git.odit.services/lfk/document-server/commit/10c68cfb37025642688cde40cac69a8ff7f6c513)
|
||||||
|
|
||||||
|
#### [v0.6.0](https://git.odit.services/lfk/document-server/compare/v0.5.1...v0.6.0)
|
||||||
|
|
||||||
|
> 23 February 2023
|
||||||
|
|
||||||
|
- Merge branch 'bugfix/44-runner-certificates-result-in-a-status-500' into dev [`#44`](https://git.odit.services/lfk/document-server/issues/44)
|
||||||
|
- Lockfile [`b47b2f8`](https://git.odit.services/lfk/document-server/commit/b47b2f804f5419bff6f0cddbc1dbc12d29afd935)
|
||||||
|
- Fixed Locale comma format [`2a33226`](https://git.odit.services/lfk/document-server/commit/2a3322612d473bd9002cf8d6f9807f9dc7d687da)
|
||||||
|
- Added autochangelog [`d064b51`](https://git.odit.services/lfk/document-server/commit/d064b51e1b3e00d9c49b1e983bd75def6d8512be)
|
||||||
|
- Moved drone to kaniko [`744f567`](https://git.odit.services/lfk/document-server/commit/744f567b7cc7fcbe916143bb98f1dd784fe794da)
|
||||||
|
- Updated translation due to customer request [`517e8a0`](https://git.odit.services/lfk/document-server/commit/517e8a081970b9ce4f6f225a7f9b5b54cca1258e)
|
||||||
|
- 🚀Bumped version to v0.6.0 [`dd0b60b`](https://git.odit.services/lfk/document-server/commit/dd0b60b2ba98efaeaeeea3b056f6937c5579598a)
|
||||||
|
- Bumped docker images [`05e0c63`](https://git.odit.services/lfk/document-server/commit/05e0c639319a2a635bbcf0f5f6bd08d6a46dce74)
|
||||||
|
- wrap distanceDonations.reduce in array length check [`bac004d`](https://git.odit.services/lfk/document-server/commit/bac004d74eb954d1753d4efcdb927822b89fa757)
|
||||||
|
- Nerf [`7dbce9e`](https://git.odit.services/lfk/document-server/commit/7dbce9e87046567de1ea46deaea427a5353057b3)
|
||||||
|
- Version pin [`6add09c`](https://git.odit.services/lfk/document-server/commit/6add09c7df6872b6922f6624ee89b4a04ad6fc0a)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`300b8fd`](https://git.odit.services/lfk/document-server/commit/300b8fd01a0b601935c3658b195759dd19041c5f)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`ff0421d`](https://git.odit.services/lfk/document-server/commit/ff0421da2f16a8f79f9987dabea7bdcb4ef88c05)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`fcbcec8`](https://git.odit.services/lfk/document-server/commit/fcbcec85c531d774be1337f179dae2aa1d5f3839)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`b78534e`](https://git.odit.services/lfk/document-server/commit/b78534e1b0165522ff0ee1dfd110d8ba78f183d8)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`5e92b9a`](https://git.odit.services/lfk/document-server/commit/5e92b9a48fcbb8ab6a179c53f180a7a6bd743ae7)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`dca2829`](https://git.odit.services/lfk/document-server/commit/dca2829323f3a19247455df99498633605d09603)
|
||||||
|
- Fixed decimal separator in docker [`c9cb03e`](https://git.odit.services/lfk/document-server/commit/c9cb03ea95acccd6cdc8b86c747c787938840d07)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`451b7fb`](https://git.odit.services/lfk/document-server/commit/451b7fbe0543991e8a203e38daa350a954ae0e11)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`573b921`](https://git.odit.services/lfk/document-server/commit/573b9211972a55df0a38742cb6eb789d6fd3717b)
|
||||||
|
- Added image [`5f4fc74`](https://git.odit.services/lfk/document-server/commit/5f4fc74cd9ff6764d209d49822020cda70b3514e)
|
||||||
|
- 🚀Bumped version to v0.6.0 [`72ed249`](https://git.odit.services/lfk/document-server/commit/72ed2495f6feb90643d3c9d7fa943a2703533331)
|
||||||
|
- Changed default kilometer formatting to min 2 decimals, max 3 [`3af4b52`](https://git.odit.services/lfk/document-server/commit/3af4b521d302e3aab558d20f1fccca57ea61fff3)
|
||||||
|
- Merge pull request 'Fixed decimal separator' (#47) from dev into main [`57a84c2`](https://git.odit.services/lfk/document-server/commit/57a84c256a978f583508bdf772499466a73b4a22)
|
||||||
|
- 🚀Bumped version to v0.5.4 [`4b5a862`](https://git.odit.services/lfk/document-server/commit/4b5a86282d0618a0c5b00fc796efe77db2103356)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`c7f5754`](https://git.odit.services/lfk/document-server/commit/c7f57548f316e1bb6635bd56bd269d80ac1e220f)
|
||||||
|
- Merge pull request 'Hotfixes' (#46) from dev into main [`8d00307`](https://git.odit.services/lfk/document-server/commit/8d003071704b5a6d7b0d70aff2f9cb05c3660b78)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`f846572`](https://git.odit.services/lfk/document-server/commit/f8465721cddfb55d51eb30d29d74ef63d825b5ac)
|
||||||
|
- Fix for runner donation array [`72303b1`](https://git.odit.services/lfk/document-server/commit/72303b11052276ad15373887f9e04183841f56f4)
|
||||||
|
- 🚀Bumped version to v0.5.3 [`01e1323`](https://git.odit.services/lfk/document-server/commit/01e1323555fe67f6f0ce3c18163e475035bd1cdd)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`4b4d66a`](https://git.odit.services/lfk/document-server/commit/4b4d66ae784150f7e1cc491a3fc5d84c93273aee)
|
||||||
|
- Merge pull request 'v0.5.2: hotfix TypeError in Runner Certificate generation' (#45) from dev into main [`c935950`](https://git.odit.services/lfk/document-server/commit/c935950eb052bce71185fc74c750ec77f081e7df)
|
||||||
|
- 🚀Bumped version to v0.5.2 [`274c13e`](https://git.odit.services/lfk/document-server/commit/274c13e358f16207fe8bb5cdc1b9ede0582ecb46)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`b7b7f6a`](https://git.odit.services/lfk/document-server/commit/b7b7f6a0ae304d24f90a3de3931f53cf08770060)
|
||||||
|
|
||||||
|
#### [v0.5.1](https://git.odit.services/lfk/document-server/compare/v0.5.0...v0.5.1)
|
||||||
|
|
||||||
|
> 22 April 2021
|
||||||
|
|
||||||
|
- Merge pull request 'Release 0.5.1' (#43) from dev into main [`11efdeb`](https://git.odit.services/lfk/document-server/commit/11efdebacf076ecfe0e10cdcda37ac07464901ce)
|
||||||
|
- Quick callstack fix🛠 [`76418f6`](https://git.odit.services/lfk/document-server/commit/76418f65e1e111e83838f0d42c541ae6a8063a09)
|
||||||
|
- Fixed barcode generation for runenrcard pdfs🐞 [`f78037c`](https://git.odit.services/lfk/document-server/commit/f78037c0f15162d5b98986edf20d263961f43e69)
|
||||||
|
- Updated docker-compose example🐳 [`a4c8dad`](https://git.odit.services/lfk/document-server/commit/a4c8dade23e448d4d4caefe304a6cd9195c873a4)
|
||||||
|
- Now laoding card subtitle from env [`e97e209`](https://git.odit.services/lfk/document-server/commit/e97e2097463f4c88947e865a38ea1e5aa2be1f5d)
|
||||||
|
- typo fixes [`fa26ed6`](https://git.odit.services/lfk/document-server/commit/fa26ed6012ded759d3702587dba67c2090324801)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`2ee4c06`](https://git.odit.services/lfk/document-server/commit/2ee4c060557a44db1974a015412288f7942ebe72)
|
||||||
|
- more typo fixes [`981bae4`](https://git.odit.services/lfk/document-server/commit/981bae4786a2fa12a1355122e8c5a1e95e29cf32)
|
||||||
|
- You can now configure the card's code format distinct from the others [`ac9be79`](https://git.odit.services/lfk/document-server/commit/ac9be793bd598771174f5313ef8288240306ba5c)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`0f2d6f5`](https://git.odit.services/lfk/document-server/commit/0f2d6f58d6a8a8888263778cf1a14c73b28e774e)
|
||||||
|
- 🚀Bumped version to v0.5.1 [`22fb3ed`](https://git.odit.services/lfk/document-server/commit/22fb3edd7836ba4ca35e6b208ab6f6620da60f4a)
|
||||||
|
- Emoji+Chinese fixes🌍 [`b6fc069`](https://git.odit.services/lfk/document-server/commit/b6fc069042dc9c5d7ec97f2660568e8e105780b9)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`cc4a2b4`](https://git.odit.services/lfk/document-server/commit/cc4a2b4ab4c2cb9976797f93e8348607fb88ea7d)
|
||||||
|
- Dependenc bump 🔝 [`d8f3a6e`](https://git.odit.services/lfk/document-server/commit/d8f3a6ed063a9cdf6189e85ae01a5516b4295892)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`a57e090`](https://git.odit.services/lfk/document-server/commit/a57e0909b919a1c720c9994b6baa8910b78dc569)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`ded610f`](https://git.odit.services/lfk/document-server/commit/ded610f11464a27429b8184a32554e99aed63f72)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`60cc343`](https://git.odit.services/lfk/document-server/commit/60cc343adf71ed3b849d1d93af3d60cbc2820fed)
|
||||||
|
- Added new config options to reamde [`010f204`](https://git.odit.services/lfk/document-server/commit/010f2046ad326898c75b6546e4d70a6f78346d8b)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`2e7c3e8`](https://git.odit.services/lfk/document-server/commit/2e7c3e8a5b7f6a0461254b33c6f412929719c966)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`754d0ca`](https://git.odit.services/lfk/document-server/commit/754d0ca58ccf8f77570ff6218f2dec61cfb4f808)
|
||||||
|
- Fixed typo in translation [`8f30d89`](https://git.odit.services/lfk/document-server/commit/8f30d8933f105b4bf112c81222a72ca1931145d7)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`3c02e13`](https://git.odit.services/lfk/document-server/commit/3c02e13997b1626fb0e6496da4c58eac2cc6fcf8)
|
||||||
|
|
||||||
|
#### [v0.5.0](https://git.odit.services/lfk/document-server/compare/v0.4.3...v0.5.0)
|
||||||
|
|
||||||
|
> 31 March 2021
|
||||||
|
|
||||||
|
- Merge pull request 'Release 0.5.0' (#42) from dev into main [`a81db03`](https://git.odit.services/lfk/document-server/commit/a81db03ba3b274c44be4b4c0c318083bdeb07987)
|
||||||
|
- Added translations [`ac572f1`](https://git.odit.services/lfk/document-server/commit/ac572f1ea31cb66985e04cb5d56cc67f521e990d)
|
||||||
|
- Added translations [`7fea1ca`](https://git.odit.services/lfk/document-server/commit/7fea1ca78ff6fdbb38dee0edd9918eaeb1264d18)
|
||||||
|
- Sorted translations 🌍 [`2278e4a`](https://git.odit.services/lfk/document-server/commit/2278e4ad06947b540323856ea1e71022562ea719)
|
||||||
|
- Added front certificate design [`8b71608`](https://git.odit.services/lfk/document-server/commit/8b71608792f00084df1e71956e503f102cea290d)
|
||||||
|
- 📖New license file version [CI SKIP] [skip ci] [`3fc6124`](https://git.odit.services/lfk/document-server/commit/3fc612488d1f231d83d6a5823a13dc4817e6a588)
|
||||||
|
- Addest first coupple of test improvements [`a580841`](https://git.odit.services/lfk/document-server/commit/a5808419738563fec3a7d8d35f4ce20d76c017fb)
|
||||||
|
- Pinned depencencies (and bumped some) [`479e28c`](https://git.odit.services/lfk/document-server/commit/479e28c46c6b3b8ba1622bcf5712695a94c2ae89)
|
||||||
|
- Added new basic certificate endpoint [`0af9b81`](https://git.odit.services/lfk/document-server/commit/0af9b81b38e1c28261c012375af2c91808e65621)
|
||||||
|
- Added function for generateing runner certificates [`955e118`](https://git.odit.services/lfk/document-server/commit/955e11846b5385c1a0b6f0b54b9951f0768ff414)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`f220e70`](https://git.odit.services/lfk/document-server/commit/f220e70743534c1fc66ff6f50e3693182d35990a)
|
||||||
|
- Now formatting currency ans distance [`e0add84`](https://git.odit.services/lfk/document-server/commit/e0add846bb37b435da9807bdc76c70793002896e)
|
||||||
|
- Fixed bg image opacity overlay [`8d6ea4d`](https://git.odit.services/lfk/document-server/commit/8d6ea4dbf9763994f0f44c4ad9b32a7b1d16f11a)
|
||||||
|
- Pinned dev dependencies [`82159be`](https://git.odit.services/lfk/document-server/commit/82159bed536bbafd20746927f5a7f61f76959637)
|
||||||
|
- Now calculateing total donations (perdistance) [`6b23dea`](https://git.odit.services/lfk/document-server/commit/6b23dea47745e98371a65a4f577f2e20cfdfe597)
|
||||||
|
- Added backside table [`3ca2237`](https://git.odit.services/lfk/document-server/commit/3ca22379535bba72d05e0b3fafe22d3a4b2f549d)
|
||||||
|
- Added template strings [`6767c3b`](https://git.odit.services/lfk/document-server/commit/6767c3b2d1e991e2f4f74b8d423a72e240ffcb8c)
|
||||||
|
- Added template strings [`2b21957`](https://git.odit.services/lfk/document-server/commit/2b2195727b15b8666edf0d925f2e68a98030153d)
|
||||||
|
- Fixed background opacity [`2a4cfdb`](https://git.odit.services/lfk/document-server/commit/2a4cfdb2f88ad3ac1ebc925199a440756e9e9d3a)
|
||||||
|
- Now with embedded background [`64fce5b`](https://git.odit.services/lfk/document-server/commit/64fce5bd019a00bf34c1ebd133c1904bb577b67b)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`7ae4750`](https://git.odit.services/lfk/document-server/commit/7ae47503076f6721d1cfd82fbf8218b9febfa580)
|
||||||
|
- 🚀Bumped version to v0.5.0 [`f623c0a`](https://git.odit.services/lfk/document-server/commit/f623c0a7cd06f707ac488456c9e8a051d3ceae46)
|
||||||
|
- Merge pull request 'Generate runner certificates feature/36-runner_certificates' (#41) from feature/36-runner_certificates into dev [`d3f7d1a`](https://git.odit.services/lfk/document-server/commit/d3f7d1a6c9858d7fdf09c696622962e6f8471e78)
|
||||||
|
- disabled testing for now [`cec8930`](https://git.odit.services/lfk/document-server/commit/cec893032dea9f312e37841232a9434e19b79003)
|
||||||
|
- Added missing interpolations [`b43aeec`](https://git.odit.services/lfk/document-server/commit/b43aeec0cf40a9c37a10072062ab5d93102f6c81)
|
||||||
|
- Made footer text configureable [`63c7beb`](https://git.odit.services/lfk/document-server/commit/63c7beb8b9cdc564186c5b86a4f305c8575f5b9f)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`f1084b5`](https://git.odit.services/lfk/document-server/commit/f1084b59a74dcc5981fd314721c36726706f386c)
|
||||||
|
- disabled testing for now [`e75f151`](https://git.odit.services/lfk/document-server/commit/e75f15142e293349a071a7cdcc53cc10780304f6)
|
||||||
|
- Removed temporary background-image fix [`5ba26c4`](https://git.odit.services/lfk/document-server/commit/5ba26c4cbfae7d3f31d3709aaeb372c14de78fa9)
|
||||||
|
- Fixed page size+background image [`b82a32a`](https://git.odit.services/lfk/document-server/commit/b82a32ae3ee3256402be5dde0ada903f2c19a8cc)
|
||||||
|
- Fixed typo [`1d12de7`](https://git.odit.services/lfk/document-server/commit/1d12de7045b5e8324dc0ddc421944e70ffc2ec73)
|
||||||
|
- Documented new env var [`5a98688`](https://git.odit.services/lfk/document-server/commit/5a98688d60eed34644391ecde638949fe5a46c65)
|
||||||
|
|
||||||
|
#### [v0.4.3](https://git.odit.services/lfk/document-server/compare/v0.4.2...v0.4.3)
|
||||||
|
|
||||||
|
> 30 March 2021
|
||||||
|
|
||||||
|
- Merge pull request 'Release 0.4.3' (#40) from dev into main [`c8dc998`](https://git.odit.services/lfk/document-server/commit/c8dc998ecdccc7fc4348ecc0db552a3d7bc2eb52)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`289a0d8`](https://git.odit.services/lfk/document-server/commit/289a0d8671575dda911c64f79d24726d3bbee071)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`3df3d26`](https://git.odit.services/lfk/document-server/commit/3df3d26708aab12590cd9c1f697cfdea8017ace4)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`457ea26`](https://git.odit.services/lfk/document-server/commit/457ea26cf8124009084415d12c7a0e31912a3eb1)
|
||||||
|
- 🚀Bumped version to v0.4.3 [`c3beb3e`](https://git.odit.services/lfk/document-server/commit/c3beb3e1032492f9a8304c4b099a700ad0d1d2cf)
|
||||||
|
- Pipeline mtu fix [`c2d2b66`](https://git.odit.services/lfk/document-server/commit/c2d2b66f2f6fbd30c2027fd3dab393db5219eb44)
|
||||||
|
|
||||||
#### [v0.4.2](https://git.odit.services/lfk/document-server/compare/v0.4.0...v0.4.2)
|
#### [v0.4.2](https://git.odit.services/lfk/document-server/compare/v0.4.0...v0.4.2)
|
||||||
|
|
||||||
|
> 29 March 2021
|
||||||
|
|
||||||
|
- Merge pull request 'Release 0.4.2' (#39) from dev into main [`ce3053c`](https://git.odit.services/lfk/document-server/commit/ce3053c0ba5404ebd8d4cbd5386c454d8cd8c4d2)
|
||||||
- 🚀Bumped version to v0.4.1 [`d17108f`](https://git.odit.services/lfk/document-server/commit/d17108f4b9f041727afcee5c171d5d8f9a3c677c)
|
- 🚀Bumped version to v0.4.1 [`d17108f`](https://git.odit.services/lfk/document-server/commit/d17108f4b9f041727afcee5c171d5d8f9a3c677c)
|
||||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`0ade575`](https://git.odit.services/lfk/document-server/commit/0ade57536e372a62356fe2f329f6cfe04bcfc397)
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`0ade575`](https://git.odit.services/lfk/document-server/commit/0ade57536e372a62356fe2f329f6cfe04bcfc397)
|
||||||
- Fixed faulty object mapping [`9584bfe`](https://git.odit.services/lfk/document-server/commit/9584bfed8ba5b8c856b55aa90969874d4d6751ff)
|
- Fixed faulty object mapping [`9584bfe`](https://git.odit.services/lfk/document-server/commit/9584bfed8ba5b8c856b55aa90969874d4d6751ff)
|
||||||
@@ -11,6 +134,7 @@ All notable changes to this project will be documented in this file. Dates are d
|
|||||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`b8f0d1f`](https://git.odit.services/lfk/document-server/commit/b8f0d1fa60da4e3262623cecf4a78c8a9a322f8c)
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`b8f0d1f`](https://git.odit.services/lfk/document-server/commit/b8f0d1fa60da4e3262623cecf4a78c8a9a322f8c)
|
||||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`073433f`](https://git.odit.services/lfk/document-server/commit/073433f308f2f8e7ada97dd0b3896fb541e85711)
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`073433f`](https://git.odit.services/lfk/document-server/commit/073433f308f2f8e7ada97dd0b3896fb541e85711)
|
||||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`a478081`](https://git.odit.services/lfk/document-server/commit/a47808172797e12800c46d17ccf4b458f4a506de)
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`a478081`](https://git.odit.services/lfk/document-server/commit/a47808172797e12800c46d17ccf4b458f4a506de)
|
||||||
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`6608456`](https://git.odit.services/lfk/document-server/commit/6608456c686e51d3aa16e630ba72c7c29e428b2a)
|
||||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`0839ff6`](https://git.odit.services/lfk/document-server/commit/0839ff63593cfb9e8339b2b2a86dbe7e2afb5dcb)
|
- 🧾New changelog file version [CI SKIP] [skip ci] [`0839ff6`](https://git.odit.services/lfk/document-server/commit/0839ff63593cfb9e8339b2b2a86dbe7e2afb5dcb)
|
||||||
- Now using our own images to build stuff 🚀 [`96886c7`](https://git.odit.services/lfk/document-server/commit/96886c74bc397e1ee793e83e0d01a6bbaa953da3)
|
- Now using our own images to build stuff 🚀 [`96886c7`](https://git.odit.services/lfk/document-server/commit/96886c74bc397e1ee793e83e0d01a6bbaa953da3)
|
||||||
- 🚀Bumped version to v0.4.2 [`1cbe5a1`](https://git.odit.services/lfk/document-server/commit/1cbe5a1614c40fbf23f032be60039ddb1472ca94)
|
- 🚀Bumped version to v0.4.2 [`1cbe5a1`](https://git.odit.services/lfk/document-server/commit/1cbe5a1614c40fbf23f032be60039ddb1472ca94)
|
||||||
|
|||||||
34
Dockerfile
34
Dockerfile
@@ -1,25 +1,29 @@
|
|||||||
# Typescript Build
|
# Typescript Build
|
||||||
FROM registry.odit.services/hub/library/node:14.15.1-alpine3.12
|
FROM registry.odit.services/hub/library/node:19.0.1-alpine3.16 AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
RUN npm i -g pnpm
|
RUN npm i -g pnpm
|
||||||
RUN pnpm i
|
RUN pnpm i
|
||||||
COPY tsconfig.json ./
|
COPY tsconfig.json ./
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
RUN pnpm run build
|
RUN pnpm run build \
|
||||||
|
&& rm -rf /app/node_modules \
|
||||||
|
&& pnpm i --production --prefer-offline
|
||||||
|
|
||||||
# final image
|
# final image
|
||||||
FROM registry.odit.services/hub/library/alpine:3.13.1
|
FROM registry.odit.services/hub/library/alpine:3.16
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
chromium \
|
chromium \
|
||||||
nss \
|
nss \
|
||||||
freetype \
|
freetype \
|
||||||
freetype-dev \
|
freetype-dev \
|
||||||
harfbuzz \
|
harfbuzz \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
ttf-freefont \
|
ttf-freefont \
|
||||||
nodejs \
|
nodejs \
|
||||||
yarn
|
font-noto-emoji \
|
||||||
|
&& apk add wqy-zenhei --update-cache --repository https://nl.alpinelinux.org/alpine/edge/testing
|
||||||
|
|
||||||
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
|
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
|
||||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
||||||
@@ -33,7 +37,7 @@ RUN addgroup -S pptruser && adduser -S -g pptruser pptruser \
|
|||||||
# Run everything after as non-privileged user.
|
# Run everything after as non-privileged user.
|
||||||
USER pptruser
|
USER pptruser
|
||||||
|
|
||||||
COPY package.json ./
|
COPY --from=build /app/package.json /app/
|
||||||
RUN yarn
|
COPY --from=build /app/node_modules /app/node_modules
|
||||||
COPY --from=0 /app/dist app
|
COPY --from=build /app/dist app
|
||||||
ENTRYPOINT ["node", "app/app.js"]
|
ENTRYPOINT ["node", "app/app.js"]
|
||||||
@@ -37,7 +37,11 @@ The basic generation mechanism makes the templates and routes interchangeable (i
|
|||||||
| 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.
|
| 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.
|
| 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.
|
||||||
| DISCLAIMER_TEXT | String | N/A | A disclaimer that will get displayed on the bottom of each sponsoring contract. R/N You can only provide the disclaimer for one language.
|
| DISCLAIMER_TEXT | String | N/A | A disclaimer that will get displayed on the bottom of each sponsoring contract. R/N You can only provide the disclaimer for one language.
|
||||||
|
| DONATIONS_FOOTER_TEXT | String | N/A | A text that will get displayed on the bottom of each runner certificate's second page. R/N You can only provide the text for one language.
|
||||||
| CONTRACTS_PER_RUNNER | Number | 1 | The amount of contracts that get created per runner (per request).
|
| CONTRACTS_PER_RUNNER | Number | 1 | The amount of contracts that get created per runner (per request).
|
||||||
|
| CODEFORMAT | String | code39 | The barcode format for everything except.
|
||||||
|
| CODEFORMAT_CARDS | String | code39 | The barcode format for runnercards (overwrites CODEFORMAT).
|
||||||
|
| CARD_SUBTITLE | String | Empty | A subtitle that get's displayed on the cards under the eventname.
|
||||||
|
|
||||||
## Templates
|
## Templates
|
||||||
> The document server uses html templates to generate various pdf documents.
|
> The document server uses html templates to generate various pdf documents.
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
document_server:
|
document_server:
|
||||||
|
# image: registry.odit.services/lfk/beamershow:0.1.3
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- 4010:4010
|
- 4010:4010
|
||||||
environment:
|
environment:
|
||||||
APP_PORT: 4010
|
APP_PORT: 4010
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
EVENT_NAME: "Lauf für Kaya! 2021"
|
EVENT_NAME: "Testen für Kaya!"
|
||||||
CURRENCY_SYMBOL: "€"
|
CURRENCY_SYMBOL: "€"
|
||||||
API_KEY: RYRccAJ4SKZnZaEci6Nyk9Z6mw3sD94fyKJ74WNzi6hLkxGNyJDrKPkxBmPwvR4f
|
API_KEY: NqZSYTy5AFQ7MppbLW5moqpTk7u7YrNUHKYhKYuThnnya2WpCOIU694hIZT1FzYe
|
||||||
CONTRACTS_PER_RUNNER: 2
|
CONTRACTS_PER_RUNNER: 2
|
||||||
SPONSORING_RECEIPT_MINIMUM_AMOUNT: 50
|
SPONSORING_RECEIPT_MINIMUM_AMOUNT: 42
|
||||||
DISCLAIMER_TEXT: "Rechtsgrundlage unserer Datenverarbeitung aufgrund freiwilliger Einwilligung ist Art. 6 Abs. 1 e), Abs. 3 DSGVO i.V.m. Art. 85 BayEUG. Mit Ihrer Unterschrift willigen Sie in unsere Datennutzung zum Zwecke des Lauf für Kaya! ein. Die Daten für Spendenquittungen"
|
DISCLAIMER_TEXT: "Hier könnte ihre Werbung stehen"
|
||||||
|
CODEFORMAT: "code39"
|
||||||
|
CODEFORMAT_CARDS: "ean13"
|
||||||
|
CARD_SUBTITLE: "Hier könnte mehr Werbung stehen"
|
||||||
|
|||||||
137
licenses.md
137
licenses.md
@@ -1,6 +1,6 @@
|
|||||||
# @odit/class-validator-jsonschema
|
# @odit/class-validator-jsonschema
|
||||||
**Author**: Aleksi Pekkala <aleksipekkala@gmail.com>
|
**Author**: Aleksi Pekkala <aleksipekkala@gmail.com>
|
||||||
**Repo**: git@github.com:epiphone/class-validator-jsonschema.git
|
**Repo**: git@github.com:epiphone/class-validator-jsonschema
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Convert class-validator-decorated classes into JSON schema
|
**Description**: Convert class-validator-decorated classes into JSON schema
|
||||||
## License Text
|
## License Text
|
||||||
@@ -29,7 +29,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
# async-helpers
|
# async-helpers
|
||||||
**Author**: Brian Woodward (https://github.com/doowb)
|
**Author**: Brian Woodward (https://github.com/doowb)
|
||||||
**Repo**: doowb/async-helpers
|
**Repo**: https://github.com/doowb/async-helpers
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Use async helpers in templates with engines that typically only handle sync helpers. Handlebars and Lodash have been tested.
|
**Description**: Use async helpers in templates with engines that typically only handle sync helpers. Handlebars and Lodash have been tested.
|
||||||
## License Text
|
## License Text
|
||||||
@@ -58,34 +58,22 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
# axios
|
# axios
|
||||||
**Author**: Matt Zabriskie
|
**Author**: Matt Zabriskie
|
||||||
**Repo**: https://github.com/axios/axios.git
|
**Repo**: https://github.com/axios/axios
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Promise based HTTP client for the browser and node.js
|
**Description**: Promise based HTTP client for the browser and node.js
|
||||||
## License Text
|
## License Text
|
||||||
Copyright (c) 2014-present Matt Zabriskie
|
# Copyright (c) 2014-present Matt Zabriskie & Collaborators
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
# bwip-js
|
# bwip-js
|
||||||
**Author**: Mark Warren <mwarren@metafloor.com>
|
**Author**: Mark Warren <mwarren@metafloor.com>
|
||||||
**Repo**: https://github.com/metafloor/bwip-js.git
|
**Repo**: https://github.com/metafloor/bwip-js
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: JavaScript barcode generator supporting over 100 types and standards.
|
**Description**: JavaScript barcode generator supporting over 100 types and standards.
|
||||||
## License Text
|
## License Text
|
||||||
@@ -117,7 +105,7 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
# cheerio
|
# cheerio
|
||||||
**Author**: Matt Mueller <mattmuelle@gmail.com> (mat.io)
|
**Author**: Matt Mueller <mattmuelle@gmail.com> (mat.io)
|
||||||
**Repo**: git://github.com/cheeriojs/cheerio.git
|
**Repo**: https://github.comcheeriojs/cheerio
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
|
**Description**: Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
|
||||||
## License Text
|
## License Text
|
||||||
@@ -144,8 +132,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
# class-transformer
|
# class-transformer
|
||||||
**Author**: [object Object]
|
**Author**: Umed Khudoiberdiev
|
||||||
**Repo**: https://github.com/typestack/class-transformer.git
|
**Repo**: https://github.com/typestack/class-transformer
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Proper decorator-based transformation / serialization / deserialization of plain javascript objects to class constructors
|
**Description**: Proper decorator-based transformation / serialization / deserialization of plain javascript objects to class constructors
|
||||||
## License Text
|
## License Text
|
||||||
@@ -173,7 +161,7 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
# class-validator
|
# class-validator
|
||||||
**Author**: TypeStack contributors
|
**Author**: TypeStack contributors
|
||||||
**Repo**: https://github.com/typestack/class-validator.git
|
**Repo**: https://github.com/typestack/class-validator
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Decorator-based property validation for classes.
|
**Description**: Decorator-based property validation for classes.
|
||||||
## License Text
|
## License Text
|
||||||
@@ -201,7 +189,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
# consola
|
# consola
|
||||||
**Author**: undefined
|
**Author**: ?
|
||||||
**Repo**: nuxt/consola
|
**Repo**: nuxt/consola
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Elegant Console Logger for Node.js and Browser
|
**Description**: Elegant Console Logger for Node.js and Browser
|
||||||
@@ -239,8 +227,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
|
|
||||||
# dotenv
|
# dotenv
|
||||||
**Author**: undefined
|
**Author**: ?
|
||||||
**Repo**: git://github.com/motdotla/dotenv.git
|
**Repo**: https://github.commotdotla/dotenv
|
||||||
**License**: BSD-2-Clause
|
**License**: BSD-2-Clause
|
||||||
**Description**: Loads environment variables from .env file
|
**Description**: Loads environment variables from .env file
|
||||||
## License Text
|
## License Text
|
||||||
@@ -303,7 +291,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
# handlebars
|
# handlebars
|
||||||
**Author**: Yehuda Katz
|
**Author**: Yehuda Katz
|
||||||
**Repo**: https://github.com/wycats/handlebars.js.git
|
**Repo**: https://github.com/wycats/handlebars.js
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
|
**Description**: Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
|
||||||
## License Text
|
## License Text
|
||||||
@@ -330,7 +318,7 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
# i18next
|
# i18next
|
||||||
**Author**: Jan Mühlemann <jan.muehlemann@gmail.com> (https://github.com/jamuhl)
|
**Author**: Jan Mühlemann <jan.muehlemann@gmail.com> (https://github.com/jamuhl)
|
||||||
**Repo**: https://github.com/i18next/i18next.git
|
**Repo**: https://github.com/i18next/i18next
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: i18next internationalization framework
|
**Description**: i18next internationalization framework
|
||||||
## License Text
|
## License Text
|
||||||
@@ -358,15 +346,15 @@ SOFTWARE.
|
|||||||
|
|
||||||
|
|
||||||
# i18next-fs-backend
|
# i18next-fs-backend
|
||||||
**Author**: undefined
|
**Author**: ?
|
||||||
**Repo**: git@github.com:i18next/i18next-fs-backend.git
|
**Repo**: git@github.com:i18next/i18next-fs-backend
|
||||||
**License**: undefined
|
**License**: undefined
|
||||||
**Description**: i18next-fs-backend is a backend layer for i18next using in Node.js and for Deno to load translations from the filesystem.
|
**Description**: i18next-fs-backend is a backend layer for i18next using in Node.js and for Deno to load translations from the filesystem.
|
||||||
## License Text
|
## License Text
|
||||||
|
|
||||||
|
|
||||||
# mime-types
|
# mime-types
|
||||||
**Author**: undefined
|
**Author**: ?
|
||||||
**Repo**: jshttp/mime-types
|
**Repo**: jshttp/mime-types
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: The ultimate javascript content-type utility.
|
**Description**: The ultimate javascript content-type utility.
|
||||||
@@ -398,7 +386,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
# pdf-lib
|
# pdf-lib
|
||||||
**Author**: Andrew Dillon <andrew.dillon.j@gmail.com>
|
**Author**: Andrew Dillon <andrew.dillon.j@gmail.com>
|
||||||
**Repo**: git+https://github.com/Hopding/pdf-lib.git
|
**Repo**: git+https://github.com/Hopding/pdf-lib
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Create and modify PDF files with JavaScript
|
**Description**: Create and modify PDF files with JavaScript
|
||||||
## License Text
|
## License Text
|
||||||
@@ -427,7 +415,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
# puppeteer
|
# puppeteer
|
||||||
**Author**: The Chromium Authors
|
**Author**: The Chromium Authors
|
||||||
**Repo**: github:puppeteer/puppeteer
|
**Repo**: https://github.com/puppeteer/puppeteer
|
||||||
**License**: Apache-2.0
|
**License**: Apache-2.0
|
||||||
**Description**: A high-level API to control headless Chrome over the DevTools Protocol
|
**Description**: A high-level API to control headless Chrome over the DevTools Protocol
|
||||||
## License Text
|
## License Text
|
||||||
@@ -636,8 +624,8 @@ SOFTWARE.
|
|||||||
|
|
||||||
|
|
||||||
# reflect-metadata
|
# reflect-metadata
|
||||||
**Author**: [object Object]
|
**Author**: Ron Buckton
|
||||||
**Repo**: https://github.com/rbuckton/reflect-metadata.git
|
**Repo**: https://github.com/rbuckton/reflect-metadata
|
||||||
**License**: Apache-2.0
|
**License**: Apache-2.0
|
||||||
**Description**: Polyfill for Metadata Reflection API
|
**Description**: Polyfill for Metadata Reflection API
|
||||||
## License Text
|
## License Text
|
||||||
@@ -698,8 +686,8 @@ If the Work includes a "NOTICE" text file as part of its distribution, then any
|
|||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
# routing-controllers
|
# routing-controllers
|
||||||
**Author**: [object Object]
|
**Author**: Umed Khudoiberdiev
|
||||||
**Repo**: https://github.com/typestack/routing-controllers.git
|
**Repo**: https://github.com/typestack/routing-controllers
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
|
**Description**: Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
|
||||||
## License Text
|
## License Text
|
||||||
@@ -762,8 +750,8 @@ OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
|
|
||||||
# @types/express
|
# @types/express
|
||||||
**Author**: undefined
|
**Author**: ?
|
||||||
**Repo**: https://github.com/DefinitelyTyped/DefinitelyTyped.git
|
**Repo**: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: TypeScript definitions for Express
|
**Description**: TypeScript definitions for Express
|
||||||
## License Text
|
## License Text
|
||||||
@@ -791,8 +779,8 @@ OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
|
|
||||||
# @types/node
|
# @types/node
|
||||||
**Author**: undefined
|
**Author**: ?
|
||||||
**Repo**: https://github.com/DefinitelyTyped/DefinitelyTyped.git
|
**Repo**: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: TypeScript definitions for Node.js
|
**Description**: TypeScript definitions for Node.js
|
||||||
## License Text
|
## License Text
|
||||||
@@ -820,8 +808,8 @@ OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
|
|
||||||
# @types/puppeteer
|
# @types/puppeteer
|
||||||
**Author**: undefined
|
**Author**: ?
|
||||||
**Repo**: https://github.com/DefinitelyTyped/DefinitelyTyped.git
|
**Repo**: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: TypeScript definitions for puppeteer
|
**Description**: TypeScript definitions for puppeteer
|
||||||
## License Text
|
## License Text
|
||||||
@@ -848,9 +836,38 @@ OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
SOFTWARE
|
SOFTWARE
|
||||||
|
|
||||||
|
|
||||||
|
# auto-changelog
|
||||||
|
**Author**: Pete Cook <pete@cookpete.com> (https://github.com/cookpete)
|
||||||
|
**Repo**: https://github.com/CookPete/auto-changelog
|
||||||
|
**License**: MIT
|
||||||
|
**Description**: Command line tool for generating a changelog from git tags and commit history
|
||||||
|
## License Text
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2017 Pete Cook https://cookpete.com
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
# cp-cli
|
# cp-cli
|
||||||
**Author**: undefined
|
**Author**: ?
|
||||||
**Repo**: git+https://github.com/screendriver/cp-cli.git
|
**Repo**: https://github.com/screendriver/cp-cli
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: A 'cp' CLI util for Node.js
|
**Description**: A 'cp' CLI util for Node.js
|
||||||
## License Text
|
## License Text
|
||||||
@@ -878,16 +895,16 @@ SOFTWARE.
|
|||||||
|
|
||||||
|
|
||||||
# faker
|
# faker
|
||||||
**Author**: undefined
|
**Author**: ?
|
||||||
**Repo**: http://github.com/Marak/Faker.js.git
|
**Repo**: http://github.com/Marak/Faker.js
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Generate massive amounts of fake contextual data
|
**Description**: Generate massive amounts of fake contextual data
|
||||||
## License Text
|
## License Text
|
||||||
|
|
||||||
|
|
||||||
# nodemon
|
# nodemon
|
||||||
**Author**: [object Object]
|
**Author**: Remy Sharp
|
||||||
**Repo**: https://github.com/remy/nodemon.git
|
**Repo**: https://github.com/remy/nodemon
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Simple monitor script for use during development of a node.js app.
|
**Description**: Simple monitor script for use during development of a node.js app.
|
||||||
## License Text
|
## License Text
|
||||||
@@ -915,8 +932,8 @@ SOFTWARE.
|
|||||||
|
|
||||||
|
|
||||||
# release-it
|
# release-it
|
||||||
**Author**: [object Object]
|
**Author**: Lars Kappert
|
||||||
**Repo**: https://github.com/release-it/release-it.git
|
**Repo**: https://github.com/release-it/release-it
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: Generic CLI tool to automate versioning and package publishing related tasks.
|
**Description**: Generic CLI tool to automate versioning and package publishing related tasks.
|
||||||
## License Text
|
## License Text
|
||||||
@@ -945,7 +962,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
# rimraf
|
# rimraf
|
||||||
**Author**: Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)
|
**Author**: Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)
|
||||||
**Repo**: git://github.com/isaacs/rimraf.git
|
**Repo**: git://github.com/isaacs/rimraf
|
||||||
**License**: ISC
|
**License**: ISC
|
||||||
**Description**: A deep deletion module for node (like `rm -rf`)
|
**Description**: A deep deletion module for node (like `rm -rf`)
|
||||||
## License Text
|
## License Text
|
||||||
@@ -966,17 +983,9 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
# start-server-and-test
|
|
||||||
**Author**: Gleb Bahmutov <gleb.bahmutov@gmail.com>
|
|
||||||
**Repo**: https://github.com/bahmutov/start-server-and-test.git
|
|
||||||
**License**: MIT
|
|
||||||
**Description**: Starts server, waits for URL, then runs test command; when the tests end, shuts down server
|
|
||||||
## License Text
|
|
||||||
|
|
||||||
|
|
||||||
# ts-node
|
# ts-node
|
||||||
**Author**: [object Object]
|
**Author**: Blake Embrey
|
||||||
**Repo**: git://github.com/TypeStrong/ts-node.git
|
**Repo**: https://github.comTypeStrong/ts-node
|
||||||
**License**: MIT
|
**License**: MIT
|
||||||
**Description**: TypeScript execution environment and REPL for node.js, with source map support
|
**Description**: TypeScript execution environment and REPL for node.js, with source map support
|
||||||
## License Text
|
## License Text
|
||||||
@@ -1005,7 +1014,7 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
# typescript
|
# typescript
|
||||||
**Author**: Microsoft Corp.
|
**Author**: Microsoft Corp.
|
||||||
**Repo**: https://github.com/Microsoft/TypeScript.git
|
**Repo**: https://github.com/Microsoft/TypeScript
|
||||||
**License**: Apache-2.0
|
**License**: Apache-2.0
|
||||||
**Description**: TypeScript is a language for application scale JavaScript development
|
**Description**: TypeScript is a language for application scale JavaScript development
|
||||||
## License Text
|
## License Text
|
||||||
|
|||||||
188
package.json
188
package.json
@@ -1,92 +1,96 @@
|
|||||||
{
|
{
|
||||||
"name": "@odit/lfk-document-server",
|
"name": "@odit/lfk-document-server",
|
||||||
"version": "0.4.2",
|
"version": "0.6.1",
|
||||||
"description": "The document generation server for the LfK! runner system. This generates certificates, sponsoring aggreements and more",
|
"description": "The document generation server for the LfK! runner system. This generates certificates, sponsoring aggreements and more",
|
||||||
"main": "src/app.ts",
|
"main": "src/app.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nodemon src/app.ts",
|
"dev": "nodemon src/app.ts",
|
||||||
"build": "rimraf ./dist && tsc && cp-cli ./src/templates ./dist/templates && cp-cli ./src/locales ./dist/locales",
|
"build": "rimraf ./dist && tsc && cp-cli ./src/templates ./dist/templates && cp-cli ./src/locales ./dist/locales",
|
||||||
"licenses:export": "license-exporter --markdown",
|
"licenses:export": "license-exporter --markdown",
|
||||||
"release": "release-it --only-version",
|
"changelog:export": "auto-changelog --commit-limit false -p -u --hide-credit",
|
||||||
"translations:sort": "node sort_translations.js",
|
"release": "release-it --only-version",
|
||||||
"test:speed": "start-server-and-test dev http://localhost:4010/docs/openapi.json test:speed:run",
|
"translations:sort": "node sort_translations.js"
|
||||||
"test:speed:run": "ts-node src/tests/speedtest.ts"
|
},
|
||||||
},
|
"repository": {
|
||||||
"repository": {
|
"type": "git",
|
||||||
"type": "git",
|
"url": "git@git.odit.services:lfk/document-server.git"
|
||||||
"url": "git@git.odit.services:lfk/document-server.git"
|
},
|
||||||
},
|
"keywords": [
|
||||||
"keywords": [
|
"odit",
|
||||||
"odit",
|
"lfk",
|
||||||
"lfk",
|
"pdf",
|
||||||
"pdf",
|
"generate"
|
||||||
"generate"
|
],
|
||||||
],
|
"author": {
|
||||||
"author": {
|
"name": "ODIT.Services",
|
||||||
"name": "ODIT.Services",
|
"email": "info@odit.services",
|
||||||
"email": "info@odit.services",
|
"url": "https://odit.services"
|
||||||
"url": "https://odit.services"
|
},
|
||||||
},
|
"contributors": [
|
||||||
"contributors": [
|
{
|
||||||
{
|
"name": "Philipp Dormann",
|
||||||
"name": "Philipp Dormann",
|
"email": "philipp@philippdormann.de",
|
||||||
"email": "philipp@philippdormann.de",
|
"url": "https://philippdormann.de"
|
||||||
"url": "https://philippdormann.de"
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "Nicolai Ort",
|
||||||
"name": "Nicolai Ort",
|
"email": "info@nicolai-ort.com",
|
||||||
"email": "info@nicolai-ort.com",
|
"url": "https://nicolai-ort.com"
|
||||||
"url": "https://nicolai-ort.com"
|
}
|
||||||
}
|
],
|
||||||
],
|
"license": "CC-BY-NC-SA-4.0",
|
||||||
"license": "CC-BY-NC-SA-4.0",
|
"dependencies": {
|
||||||
"dependencies": {
|
"@odit/class-validator-jsonschema": "2.1.1",
|
||||||
"@odit/class-validator-jsonschema": "^2.1.1",
|
"async-helpers": "0.3.17",
|
||||||
"async-helpers": "^0.3.17",
|
"axios": "1.3.4",
|
||||||
"axios": "^0.21.1",
|
"bwip-js": "3.3.0",
|
||||||
"bwip-js": "^2.0.12",
|
"cheerio": "1.0.0-rc.5",
|
||||||
"cheerio": "^1.0.0-rc.5",
|
"class-transformer": "0.3.1",
|
||||||
"class-transformer": "0.3.1",
|
"class-validator": "0.13.1",
|
||||||
"class-validator": "^0.13.1",
|
"consola": "2.15.3",
|
||||||
"consola": "^2.15.0",
|
"cors": "2.8.5",
|
||||||
"cors": "^2.8.5",
|
"dotenv": "16.0.3",
|
||||||
"dotenv": "^8.2.0",
|
"express": "4.18.2",
|
||||||
"express": "^4.17.1",
|
"handlebars": "4.7.7",
|
||||||
"handlebars": "^4.7.6",
|
"i18next": "20.1.0",
|
||||||
"i18next": "^19.8.7",
|
"i18next-fs-backend": "1.1.1",
|
||||||
"i18next-fs-backend": "^1.0.8",
|
"mime-types": "2.1.35",
|
||||||
"mime-types": "^2.1.28",
|
"pdf-lib": "1.17.1",
|
||||||
"pdf-lib": "^1.16.0",
|
"puppeteer": "8.0.0",
|
||||||
"puppeteer": "^7.0.1",
|
"reflect-metadata": "0.1.13",
|
||||||
"reflect-metadata": "^0.1.13",
|
"routing-controllers": "0.9.0-alpha.6",
|
||||||
"routing-controllers": "0.9.0-alpha.6",
|
"routing-controllers-openapi": "2.2.0"
|
||||||
"routing-controllers-openapi": "2.2.0"
|
},
|
||||||
},
|
"devDependencies": {
|
||||||
"devDependencies": {
|
"@odit/license-exporter": "0.0.11",
|
||||||
"@odit/license-exporter": "^0.0.10",
|
"@types/express": "4.17.17",
|
||||||
"@types/express": "^4.17.11",
|
"@types/node": "18.14.0",
|
||||||
"@types/node": "^14.14.22",
|
"@types/puppeteer": "5.4.3",
|
||||||
"@types/puppeteer": "^5.4.3",
|
"auto-changelog": "2.4.0",
|
||||||
"cp-cli": "^2.0.0",
|
"cp-cli": "2.0.0",
|
||||||
"faker": "^5.3.1",
|
"faker": "5.3.1",
|
||||||
"nodemon": "^2.0.7",
|
"nodemon": "2.0.7",
|
||||||
"release-it": "^14.2.2",
|
"release-it": "15.6.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "3.0.2",
|
||||||
"start-server-and-test": "^1.12.0",
|
"ts-node": "9.1.1",
|
||||||
"ts-node": "^9.1.1",
|
"typescript": "4.1.3"
|
||||||
"typescript": "^4.1.3"
|
},
|
||||||
},
|
"release-it": {
|
||||||
"release-it": {
|
"git": {
|
||||||
"git": {
|
"commit": true,
|
||||||
"commit": true,
|
"requireCleanWorkingDir": false,
|
||||||
"requireCleanWorkingDir": false,
|
"commitMessage": "🚀Bumped version to v${version}",
|
||||||
"commitMessage": "🚀Bumped version to v${version}",
|
"requireBranch": "dev",
|
||||||
"requireBranch": "dev",
|
"push": true,
|
||||||
"push": false,
|
"tag": true,
|
||||||
"tag": false
|
"tagName": "v${version}",
|
||||||
},
|
"tagAnnotation": "v${version}"
|
||||||
"npm": {
|
},
|
||||||
"publish": false
|
"npm": {
|
||||||
}
|
"publish": false
|
||||||
}
|
},
|
||||||
}
|
"hooks": {
|
||||||
|
"after:bump": "npm run changelog:export && npm run licenses:export && git add CHANGELOG.md && git add licenses.md"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
4815
pnpm-lock.yaml
generated
Normal file
4815
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,271 +1,308 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import cheerio from "cheerio";
|
import cheerio from "cheerio";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import Handlebars from 'handlebars';
|
import Handlebars from 'handlebars';
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import Backend from 'i18next-fs-backend';
|
import Backend from 'i18next-fs-backend';
|
||||||
import mime from "mime-types";
|
import mime from "mime-types";
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { PDFDocument } from 'pdf-lib';
|
import { PDFDocument } from 'pdf-lib';
|
||||||
import puppeteer from "puppeteer";
|
import puppeteer from "puppeteer";
|
||||||
import { awaitAsyncHandlebarHelpers, helpers } from './asyncHelpers';
|
import { awaitAsyncHandlebarHelpers, helpers } from './asyncHelpers';
|
||||||
import { config } from './config';
|
import { config } from './config';
|
||||||
import { Runner } from './models/Runner';
|
import { CertificateRunner } from './models/CertificateRunner';
|
||||||
import { RunnerCard } from './models/RunnerCard';
|
import { Runner } from './models/Runner';
|
||||||
import { RunnerGroup } from './models/RunnerGroup';
|
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.
|
* 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');
|
export class PdfCreator {
|
||||||
private browser;
|
private templateDir = path.join(__dirname, '/templates');
|
||||||
private static interpolations = { eventname: config.eventname, sponsoring_receipt_minimum_amount: config.sponsoring_receipt_minimum_amount, currency_symbol: config.currency_symbol }
|
private browser;
|
||||||
private static contractsPerRunner = config.contracts_per_runner;
|
private static interpolations = { eventname: config.eventname, sponsoring_receipt_minimum_amount: config.sponsoring_receipt_minimum_amount, currency_symbol: config.currency_symbol }
|
||||||
|
private static contractsPerRunner = config.contracts_per_runner;
|
||||||
/**
|
|
||||||
* Main constructor.
|
/**
|
||||||
* Initializes i18n(ext), Handlebars and puppeteer.
|
* Main constructor.
|
||||||
*/
|
* Initializes i18n(ext), Handlebars and puppeteer.
|
||||||
constructor() {
|
*/
|
||||||
this.init();
|
constructor() {
|
||||||
}
|
this.init();
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Main constructor.
|
/**
|
||||||
* Initializes i18n(ext), Handlebars and puppeteer.
|
* Main constructor.
|
||||||
*/
|
* Initializes i18n(ext), Handlebars and puppeteer.
|
||||||
public async init() {
|
*/
|
||||||
const minimal_args = [
|
public async init() {
|
||||||
'--autoplay-policy=user-gesture-required',
|
const minimal_args = [
|
||||||
'--disable-background-networking',
|
'--autoplay-policy=user-gesture-required',
|
||||||
'--disable-background-timer-throttling',
|
'--disable-background-networking',
|
||||||
'--disable-backgrounding-occluded-windows',
|
'--disable-background-timer-throttling',
|
||||||
'--disable-breakpad',
|
'--disable-backgrounding-occluded-windows',
|
||||||
'--disable-client-side-phishing-detection',
|
'--disable-breakpad',
|
||||||
'--disable-component-update',
|
'--disable-client-side-phishing-detection',
|
||||||
'--disable-default-apps',
|
'--disable-component-update',
|
||||||
'--disable-dev-shm-usage',
|
'--disable-default-apps',
|
||||||
'--disable-domain-reliability',
|
'--disable-dev-shm-usage',
|
||||||
'--disable-extensions',
|
'--disable-domain-reliability',
|
||||||
'--disable-features=AudioServiceOutOfProcess',
|
'--disable-extensions',
|
||||||
'--disable-hang-monitor',
|
'--disable-features=AudioServiceOutOfProcess',
|
||||||
'--disable-ipc-flooding-protection',
|
'--disable-hang-monitor',
|
||||||
'--disable-notifications',
|
'--disable-ipc-flooding-protection',
|
||||||
'--disable-offer-store-unmasked-wallet-cards',
|
'--disable-notifications',
|
||||||
'--disable-popup-blocking',
|
'--disable-offer-store-unmasked-wallet-cards',
|
||||||
'--disable-print-preview',
|
'--disable-popup-blocking',
|
||||||
'--disable-prompt-on-repost',
|
'--disable-print-preview',
|
||||||
'--disable-renderer-backgrounding',
|
'--disable-prompt-on-repost',
|
||||||
'--disable-speech-api',
|
'--disable-renderer-backgrounding',
|
||||||
'--disable-sync',
|
'--disable-speech-api',
|
||||||
'--hide-scrollbars',
|
'--disable-sync',
|
||||||
'--ignore-gpu-blacklist',
|
'--hide-scrollbars',
|
||||||
'--metrics-recording-only',
|
'--ignore-gpu-blacklist',
|
||||||
'--mute-audio',
|
'--metrics-recording-only',
|
||||||
'--no-default-browser-check',
|
'--mute-audio',
|
||||||
'--no-first-run',
|
'--no-default-browser-check',
|
||||||
'--no-pings',
|
'--no-first-run',
|
||||||
'--no-zygote',
|
'--no-pings',
|
||||||
'--password-store=basic',
|
'--no-zygote',
|
||||||
'--use-gl=swiftshader',
|
'--password-store=basic',
|
||||||
'--no-sandbox'
|
'--use-gl=swiftshader',
|
||||||
];
|
'--no-sandbox'
|
||||||
await i18next
|
];
|
||||||
.use(Backend)
|
await i18next
|
||||||
.init({
|
.use(Backend)
|
||||||
fallbackLng: 'en',
|
.init({
|
||||||
lng: 'en',
|
fallbackLng: 'en',
|
||||||
backend: {
|
lng: 'en',
|
||||||
loadPath: path.join(__dirname, '/locales/{{lng}}.json')
|
backend: {
|
||||||
}
|
loadPath: path.join(__dirname, '/locales/{{lng}}.json')
|
||||||
});
|
}
|
||||||
|
});
|
||||||
await Handlebars.registerHelper(helpers);
|
|
||||||
await Handlebars.registerHelper('__',
|
await Handlebars.registerHelper(helpers);
|
||||||
function (str) {
|
await Handlebars.registerHelper('__',
|
||||||
return i18next.t(str, PdfCreator.interpolations).toString();
|
function (str) {
|
||||||
}
|
return i18next.t(str, PdfCreator.interpolations).toString();
|
||||||
);
|
}
|
||||||
await Handlebars.registerHelper('--sponsor',
|
);
|
||||||
function (str) {
|
await Handlebars.registerHelper('--sponsor',
|
||||||
const index = (parseInt(str) % config.sponor_logos.length);
|
function (str) {
|
||||||
if (isNaN(index)) {
|
const index = (parseInt(str) % config.sponor_logos.length);
|
||||||
return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg=="
|
if (isNaN(index)) {
|
||||||
}
|
return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg=="
|
||||||
return config.sponor_logos[index];
|
}
|
||||||
}
|
return config.sponor_logos[index];
|
||||||
);
|
}
|
||||||
this.browser = await puppeteer.launch({ headless: true, args: minimal_args });
|
);
|
||||||
}
|
await Handlebars.registerHelper('--format_kilometers',
|
||||||
|
function (str) {
|
||||||
/**
|
let meters = parseInt(str);
|
||||||
* Generate sponsoring contract pdfs.
|
return ((meters / 1000).toLocaleString("en-EN", { minimumFractionDigits: 2, maximumFractionDigits: 3 }).replace(".", ","));
|
||||||
* @param runner The runner you want to generate the contracts for.
|
}
|
||||||
* @param locale The locale used for the contracts (default:en)
|
);
|
||||||
*/
|
await Handlebars.registerHelper('--format_currency',
|
||||||
public async generateSponsoringContract(runners: Runner[], locale: string = "en", codeformat: string = config.codeformat): Promise<Buffer> {
|
function (str) {
|
||||||
if (runners.length == 1 && Object.keys(runners[0]).length == 0) {
|
let meters = parseInt(str);
|
||||||
runners[0] = this.generateEmptyRunner();
|
return ((meters / 100).toLocaleString("en-EN", { minimumFractionDigits: 2, maximumFractionDigits: 2 }).replace(".", ","));
|
||||||
}
|
}
|
||||||
for (var i = 1; i < PdfCreator.contractsPerRunner; i++) {
|
);
|
||||||
runners = runners.reduce(function (res, current, index, array) {
|
this.browser = await puppeteer.launch({ headless: true, args: minimal_args });
|
||||||
return res.concat([current, current]);
|
}
|
||||||
}, []);
|
|
||||||
}
|
/**
|
||||||
if (runners.length > 50) {
|
* Generate sponsoring contract pdfs.
|
||||||
let pdf_promises = new Array<Promise<Buffer>>();
|
* @param runner The runner you want to generate the contracts for.
|
||||||
let i, j;
|
* @param locale The locale used for the contracts (default:en)
|
||||||
for (i = 0, j = runners.length; i < j; i += 50) {
|
*/
|
||||||
let chunk = runners.slice(i, i + 50);
|
public async generateSponsoringContract(runners: Runner[], locale: string = "en", codeformat: string = config.codeformat): Promise<Buffer> {
|
||||||
pdf_promises.push(this.generateSponsoringContract(chunk, locale));
|
if (runners.length == 1 && Object.keys(runners[0]).length == 0) {
|
||||||
}
|
runners[0] = this.generateEmptyRunner();
|
||||||
const pdfs = await Promise.all(pdf_promises);
|
}
|
||||||
return await this.mergePdfs(pdfs);
|
if (runners.length > 50) {
|
||||||
}
|
let pdf_promises = new Array<Promise<Buffer>>();
|
||||||
await i18next.changeLanguage(locale);
|
let i, j;
|
||||||
const template_source = fs.readFileSync(`${this.templateDir}/sponsoring_contract.html`, 'utf8');
|
for (i = 0, j = runners.length; i < j; i += 50) {
|
||||||
const template = Handlebars.compile(template_source);
|
let chunk = runners.slice(i, i + 50);
|
||||||
let result = template({ runners, codeformat, disclaimer: config.disclaimer_text });
|
pdf_promises.push(this.generateSponsoringContract(chunk, locale));
|
||||||
result = await awaitAsyncHandlebarHelpers(result);
|
}
|
||||||
const pdf = await this.renderPdf(result, { format: "A5", landscape: true });
|
const pdfs = await Promise.all(pdf_promises);
|
||||||
return pdf
|
return await this.mergePdfs(pdfs);
|
||||||
}
|
}
|
||||||
|
for (var i = 1; i < PdfCreator.contractsPerRunner; i++) {
|
||||||
/**
|
runners = runners.reduce(function (res, current, index, array) {
|
||||||
* Generate runner card pdfs.
|
return res.concat([current, current]);
|
||||||
* @param cards The runner cars you want to generate the cards for.
|
}, []);
|
||||||
* @param locale The locale used for the cards (default:en)
|
}
|
||||||
*/
|
await i18next.changeLanguage(locale);
|
||||||
public async generateRunnerCards(cards: RunnerCard[], locale: string = "en", codeformat: string = config.codeformat): Promise<Buffer> {
|
const template_source = fs.readFileSync(`${this.templateDir}/sponsoring_contract.html`, 'utf8');
|
||||||
if (cards.length > 10) {
|
const template = Handlebars.compile(template_source);
|
||||||
let pdf_promises = new Array<Promise<Buffer>>();
|
let result = template({ runners, codeformat, disclaimer: config.disclaimer_text });
|
||||||
let i, j;
|
result = await awaitAsyncHandlebarHelpers(result);
|
||||||
for (i = 0, j = cards.length; i < j; i += 10) {
|
const pdf = await this.renderPdf(result, { format: "A5", landscape: true });
|
||||||
let chunk = cards.slice(i, i + 10);
|
return pdf
|
||||||
pdf_promises.push(this.generateRunnerCards(chunk, locale));
|
}
|
||||||
}
|
|
||||||
const pdfs = await Promise.all(pdf_promises);
|
/**
|
||||||
return await this.mergePdfs(pdfs);
|
* Generate runner card pdfs.
|
||||||
}
|
* @param cards The runner cars you want to generate the cards for.
|
||||||
const cards_swapped = this.swapArrayPairs(cards);
|
* @param locale The locale used for the cards (default:en)
|
||||||
await i18next.changeLanguage(locale);
|
*/
|
||||||
const template_source = fs.readFileSync(`${this.templateDir}/runner_card.html`, 'utf8');
|
public async generateRunnerCards(cards: RunnerCard[], locale: string = "en", codeformat: string = config.codeformat_cards): Promise<Buffer> {
|
||||||
const template = Handlebars.compile(template_source);
|
if (cards.length > 10) {
|
||||||
let result = template({ cards, cards_swapped, eventname: "LfK! 2069", codeformat: "qrcode" })
|
let pdf_promises = new Array<Promise<Buffer>>();
|
||||||
result = await awaitAsyncHandlebarHelpers(result);
|
let i, j;
|
||||||
fs.writeFileSync("lelelelele.tmp", result);
|
for (i = 0, j = cards.length; i < j; i += 10) {
|
||||||
const pdf = await this.renderPdf(result, { format: "A4", landscape: false });
|
let chunk = cards.slice(i, i + 10);
|
||||||
return pdf
|
pdf_promises.push(this.generateRunnerCards(chunk, locale, codeformat));
|
||||||
}
|
}
|
||||||
|
const pdfs = await Promise.all(pdf_promises);
|
||||||
/**
|
return await this.mergePdfs(pdfs);
|
||||||
* Converts all images in html to base64.
|
}
|
||||||
* Works with image files in the template directory or images from urls.
|
const cards_swapped = this.swapArrayPairs(cards);
|
||||||
* @param html The html string whoms images shall get replaced.
|
await i18next.changeLanguage(locale);
|
||||||
*/
|
const template_source = fs.readFileSync(`${this.templateDir}/runner_card.html`, 'utf8');
|
||||||
public async imgToBase64(html): Promise<string> {
|
const template = Handlebars.compile(template_source);
|
||||||
const $ = cheerio.load(html)
|
let result = template({ cards, cards_swapped, eventname: config.eventname, codeformat: codeformat, card_subtitle: config.card_subtitle })
|
||||||
$('img').each(async (index, element) => {
|
result = await awaitAsyncHandlebarHelpers(result);
|
||||||
let imgsrc = $(element).attr("src");
|
const pdf = await this.renderPdf(result, { format: "A4", landscape: false });
|
||||||
if (imgsrc.startsWith("data:image")) {
|
return pdf
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
const img_type = mime.lookup(imgsrc);
|
/**
|
||||||
|
* Generate sponsoring contract pdfs.
|
||||||
if (!(img_type.includes("image"))) {
|
* @param runner The runner you want to generate the contracts for.
|
||||||
throw new Error("File is not image mime type");
|
* @param locale The locale used for the contracts (default:en)
|
||||||
}
|
*/
|
||||||
|
public async generateRunnerCertficates(runners: CertificateRunner[], locale: string = "en"): Promise<Buffer> {
|
||||||
let image;
|
if (runners.length > 50) {
|
||||||
if (imgsrc.startsWith("http")) {
|
let pdf_promises = new Array<Buffer>();
|
||||||
image = (await axios.get(imgsrc)).data;
|
let i, j;
|
||||||
image = Buffer.from(image).toString('base64');
|
for (i = 0, j = runners.length; i < j; i += 50) {
|
||||||
}
|
let chunk = runners.slice(i, i + 50);
|
||||||
else {
|
pdf_promises.push(await this.generateRunnerCertficates(chunk, locale));
|
||||||
if (imgsrc.startsWith("./")) {
|
}
|
||||||
imgsrc = imgsrc.replace("./", "");
|
return await this.mergePdfs(pdf_promises);
|
||||||
}
|
}
|
||||||
image = fs.readFileSync(`${this.templateDir}/${imgsrc}`, { encoding: "base64" });
|
await i18next.changeLanguage(locale);
|
||||||
}
|
const template_source = fs.readFileSync(`${this.templateDir}/runner_certificate.html`, 'utf8');
|
||||||
|
const template = Handlebars.compile(template_source);
|
||||||
image = `data:${img_type};base64,${image}`
|
let result = template({ runners, eventname: config.eventname, currency_symbol: config.currency_symbol, donations_footer_text: config.donations_footer_text });
|
||||||
$(element).attr("src", image)
|
result = await awaitAsyncHandlebarHelpers(result);
|
||||||
})
|
const pdf = await this.renderPdf(result, { format: "A4", landscape: false, printBackground: true });
|
||||||
|
return pdf;
|
||||||
return $.html();
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* Converts all images in html to base64.
|
||||||
* This method manages the creation of pdfs via puppeteer.
|
* Works with image files in the template directory or images from urls.
|
||||||
* @param html The HTML that should get rendered.
|
* @param html The html string whoms images shall get replaced.
|
||||||
* @param options Puppeteer PDF option (eg: {format: "A4"})
|
*/
|
||||||
*/
|
public async imgToBase64(html): Promise<string> {
|
||||||
public async renderPdf(html: string, options): Promise<any> {
|
const $ = cheerio.load(html)
|
||||||
html = await this.imgToBase64(html);
|
|
||||||
let page = await this.browser.newPage();
|
$('img').each(async (index, element) => {
|
||||||
await page.setContent(html);
|
let imgsrc = $(element).attr("src");
|
||||||
const pdf = await page.pdf(options);
|
if (imgsrc.startsWith("data:image")) {
|
||||||
await page.close();
|
return;
|
||||||
return pdf;
|
}
|
||||||
}
|
const img_type = mime.lookup(imgsrc);
|
||||||
|
|
||||||
/**
|
if (!(img_type.includes("image"))) {
|
||||||
* Merges multiple pdfs into one.
|
throw new Error("File is not image mime type");
|
||||||
* @param pdfs The pdfs you want to merge as an buffer array.
|
}
|
||||||
* @returns The merged pdf as a buffer.
|
|
||||||
*/
|
let image;
|
||||||
private async mergePdfs(pdfs: Buffer[]): Promise<Buffer> {
|
if (imgsrc.startsWith("http")) {
|
||||||
const mergedPdf = await PDFDocument.create();
|
image = (await axios.get(imgsrc)).data;
|
||||||
|
image = Buffer.from(image).toString('base64');
|
||||||
for (const pdfBuffer of pdfs) {
|
}
|
||||||
const pdf = await PDFDocument.load(pdfBuffer);
|
else {
|
||||||
const copiedPages = await mergedPdf.copyPages(pdf, pdf.getPageIndices());
|
if (imgsrc.startsWith("./")) {
|
||||||
copiedPages.forEach((page) => {
|
imgsrc = imgsrc.replace("./", "");
|
||||||
mergedPdf.addPage(page);
|
}
|
||||||
});
|
image = fs.readFileSync(`${this.templateDir}/${imgsrc}`, { encoding: "base64" });
|
||||||
}
|
}
|
||||||
|
|
||||||
return <Buffer>(await mergedPdf.save());
|
image = `data:${img_type};base64,${image}`
|
||||||
}
|
$(element).attr("src", image)
|
||||||
|
});
|
||||||
/**
|
|
||||||
* Generates a new dummy runner with halfspaces for all strings.
|
return $.html();
|
||||||
* Can be used to generate empty sponsoring contracts.
|
}
|
||||||
* @returns A new runner object that apears to be empty.
|
|
||||||
*/
|
/**
|
||||||
private generateEmptyRunner(): Runner {
|
* This method manages the creation of pdfs via puppeteer.
|
||||||
let group = new RunnerGroup();
|
* @param html The HTML that should get rendered.
|
||||||
group.id = 0;
|
* @param options Puppeteer PDF option (eg: {format: "A4"})
|
||||||
group.name = " ";
|
*/
|
||||||
let runner = new Runner();
|
public async renderPdf(html: string, options): Promise<any> {
|
||||||
runner.id = 0;
|
html = await this.imgToBase64(html);
|
||||||
runner.firstname = " ";
|
let page = await this.browser.newPage();
|
||||||
runner.lastname = " ";
|
await page.setContent(html);
|
||||||
runner.group = group;
|
const pdf = await page.pdf(options);
|
||||||
return runner;
|
await page.close();
|
||||||
}
|
return pdf;
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 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
|
* Merges multiple pdfs into one.
|
||||||
* This is needed to generate pdfs with front- and backside that get printet on one paper.
|
* @param pdfs The pdfs you want to merge as an buffer array.
|
||||||
* @param array The array which's pairs shall get switched.
|
* @returns The merged pdf as a buffer.
|
||||||
* @returns Array with swapped pairs,
|
*/
|
||||||
*/
|
private async mergePdfs(pdfs: Buffer[]): Promise<Buffer> {
|
||||||
private swapArrayPairs(array): Array<any> {
|
const mergedPdf = await PDFDocument.create();
|
||||||
if (array.length == 1) {
|
|
||||||
return [null, array[0]];
|
for (const pdfBuffer of pdfs) {
|
||||||
}
|
const pdf = await PDFDocument.load(pdfBuffer);
|
||||||
if (array.length == 0) {
|
const copiedPages = await mergedPdf.copyPages(pdf, pdf.getPageIndices());
|
||||||
return null;
|
copiedPages.forEach((page) => {
|
||||||
}
|
mergedPdf.addPage(page);
|
||||||
|
});
|
||||||
const rest = this.swapArrayPairs(array.slice(2))
|
}
|
||||||
if (!rest) {
|
|
||||||
return [array[1], array[0]]
|
return <Buffer>(await mergedPdf.save());
|
||||||
}
|
}
|
||||||
return [array[1], array[0]].concat(rest);
|
|
||||||
}
|
/**
|
||||||
|
* 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -9,11 +9,14 @@ export const config = {
|
|||||||
eventname: process.env.EVENT_NAME || "Please set the event name",
|
eventname: process.env.EVENT_NAME || "Please set the event name",
|
||||||
currency_symbol: process.env.CURRENCY_SYMBOL || "€",
|
currency_symbol: process.env.CURRENCY_SYMBOL || "€",
|
||||||
sponsoring_receipt_minimum_amount: process.env.SPONSORING_RECEIPT_MINIMUM_AMOUNT || "10",
|
sponsoring_receipt_minimum_amount: process.env.SPONSORING_RECEIPT_MINIMUM_AMOUNT || "10",
|
||||||
codeformat: process.env.CODEFORMAT || "qrcode",
|
codeformat: process.env.CODEFORMAT || "code39",
|
||||||
|
codeformat_cards: process.env.CODEFORMAT_CARDS || process.env.CODEFORMAT || "code39",
|
||||||
sponor_logos: getSponsorLogos(),
|
sponor_logos: getSponsorLogos(),
|
||||||
api_key: getApiKey(),
|
api_key: getApiKey(),
|
||||||
disclaimer_text: process.env.DISCLAIMER_TEXT || "",
|
disclaimer_text: process.env.DISCLAIMER_TEXT || "",
|
||||||
|
donations_footer_text: process.env.DONATIONS_FOOTER_TEXT || "",
|
||||||
contracts_per_runner: parseInt(process.env.CONTRACTS_PER_RUNNER) || 1,
|
contracts_per_runner: parseInt(process.env.CONTRACTS_PER_RUNNER) || 1,
|
||||||
|
card_subtitle: process.env.CARD_SUBTITLE || ""
|
||||||
}
|
}
|
||||||
let errors = 0
|
let errors = 0
|
||||||
if (typeof config.internal_port !== "number") {
|
if (typeof config.internal_port !== "number") {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Authorized, Body, JsonController, Post, QueryParam, Res } from 'routing-controllers';
|
import { Authorized, Body, JsonController, Post, QueryParam, Res } from 'routing-controllers';
|
||||||
import { OpenAPI } from 'routing-controllers-openapi';
|
import { OpenAPI } from 'routing-controllers-openapi';
|
||||||
|
import { CertificateRunner } from '../models/CertificateRunner';
|
||||||
import { Runner } from '../models/Runner';
|
import { Runner } from '../models/Runner';
|
||||||
import { RunnerCard } from '../models/RunnerCard';
|
import { RunnerCard } from '../models/RunnerCard';
|
||||||
import { PdfCreator } from '../PdfCreator';
|
import { PdfCreator } from '../PdfCreator';
|
||||||
@@ -37,7 +38,7 @@ export class PdfController {
|
|||||||
|
|
||||||
@Post('/cards')
|
@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." })
|
@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, @QueryParam("download") download: boolean) {
|
async generateCards(@Body({ validate: true, options: { limit: "500mb" } }) cards: RunnerCard | RunnerCard[], @Res() res: any, @QueryParam("locale") locale: string, @QueryParam("codeformat") codeformat: string, @QueryParam("download") download: boolean) {
|
||||||
if (!this.initialized) {
|
if (!this.initialized) {
|
||||||
await this.pdf.init();
|
await this.pdf.init();
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
@@ -46,7 +47,7 @@ export class PdfController {
|
|||||||
cards = [cards];
|
cards = [cards];
|
||||||
}
|
}
|
||||||
cards = this.mapCardGroupNames(cards);
|
cards = this.mapCardGroupNames(cards);
|
||||||
const contracts = await this.pdf.generateRunnerCards(cards, locale);
|
const contracts = await this.pdf.generateRunnerCards(cards, locale, codeformat);
|
||||||
res.setHeader('content-type', 'application/pdf');
|
res.setHeader('content-type', 'application/pdf');
|
||||||
if (download) {
|
if (download) {
|
||||||
res.setHeader('Content-Disposition', 'attachment; filename="cards.pdf"')
|
res.setHeader('Content-Disposition', 'attachment; filename="cards.pdf"')
|
||||||
@@ -54,6 +55,25 @@ export class PdfController {
|
|||||||
return contracts;
|
return contracts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post('/certificates')
|
||||||
|
@OpenAPI({ description: "Generate runner certificate pdfs from certificate 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 generateCertificates(@Body({ validate: true, options: { limit: "500mb" } }) runners: CertificateRunner[], @Res() res: any, @QueryParam("locale") locale: string, @QueryParam("download") download: boolean) {
|
||||||
|
if (!this.initialized) {
|
||||||
|
await this.pdf.init();
|
||||||
|
this.initialized = true;
|
||||||
|
}
|
||||||
|
if (!Array.isArray(runners)) {
|
||||||
|
runners = [runners];
|
||||||
|
}
|
||||||
|
runners = this.mapCertificatRunnersGroupNames(runners)
|
||||||
|
const certificates = await this.pdf.generateRunnerCertficates(runners, locale);
|
||||||
|
res.setHeader('content-type', 'application/pdf');
|
||||||
|
if (download) {
|
||||||
|
res.setHeader('Content-Disposition', 'attachment; filename="certificates.pdf"')
|
||||||
|
}
|
||||||
|
return certificates;
|
||||||
|
}
|
||||||
|
|
||||||
private mapRunnerGroupNames(runners: Runner[]): Runner[] {
|
private mapRunnerGroupNames(runners: Runner[]): Runner[] {
|
||||||
let response = new Array<Runner>();
|
let response = new Array<Runner>();
|
||||||
for (let runner of runners) {
|
for (let runner of runners) {
|
||||||
@@ -68,6 +88,35 @@ export class PdfController {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private mapCertificatRunnersGroupNames(runners: CertificateRunner[]): CertificateRunner[] {
|
||||||
|
let response = new Array<CertificateRunner>();
|
||||||
|
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}`;
|
||||||
|
}
|
||||||
|
runner.donationPerDistanceTotal = 0;
|
||||||
|
if (!Array.isArray(runner.distanceDonations)){
|
||||||
|
runner.distanceDonations = [].concat(runner.distanceDonations)
|
||||||
|
}
|
||||||
|
if (runner.distanceDonations.length > 0) {
|
||||||
|
runner.donationPerDistanceTotal += runner.distanceDonations.reduce(function (sum, current) {
|
||||||
|
return sum + current.amountPerDistance;
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
runner.donationTotal = 0;
|
||||||
|
if (runner.distanceDonations.length > 0) {
|
||||||
|
runner.donationTotal += runner.distanceDonations.reduce(function (sum, current) {
|
||||||
|
return sum + current.amount;
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
response.push(runner)
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
private mapCardGroupNames(cards: RunnerCard[]): RunnerCard[] {
|
private mapCardGroupNames(cards: RunnerCard[]): RunnerCard[] {
|
||||||
let response = new Array<RunnerCard>();
|
let response = new Array<RunnerCard>();
|
||||||
for (let card of cards) {
|
for (let card of cards) {
|
||||||
|
|||||||
@@ -1,20 +1,29 @@
|
|||||||
{
|
{
|
||||||
"address": "Adresse",
|
"address": "Adresse",
|
||||||
"city": "Stadt",
|
"betrag-km": "Betrag/ km",
|
||||||
"date": "Datum",
|
"city": "Stadt",
|
||||||
"firstname": "Vorname",
|
"date": "Datum",
|
||||||
"group": "Team/Klasse",
|
"firstname": "Vorname",
|
||||||
"house_number": "Hausnummer",
|
"fuer-den-guten-zweck-zurueckgelegt": "für den guten Zweck zurückgelegt.",
|
||||||
"id": "ID",
|
"gesamt": "Gesamt",
|
||||||
"lastname": "Nachname",
|
"gesamtbetrag": "Gesamtbetrag",
|
||||||
"location": "Ort",
|
"group": "Team/ Klasse",
|
||||||
"please_use_blockletters": "Bitte in DRUCKBUCHSTABEN schreiben",
|
"hat-beim-eventname": "hat beim {{eventname}}",
|
||||||
"postalcode": "Postleitzahl",
|
"house_number": "Hausnummer",
|
||||||
"signature": "Unterschrift",
|
"id": "ID",
|
||||||
"sponsor": "Sponsor",
|
"lastname": "Nachname",
|
||||||
"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",
|
"location": "Ort",
|
||||||
"sponsoring_amount_per_distance": "mit einem Betrag von _____{{currency_symbol}} pro gelaufenem Kilometer zu unterstützen.",
|
"mit_unterstuetzung_von": "Mit Unterstützung von:",
|
||||||
"sponsoring_subtitle": "Ich/Wir sind bereit anlässlich des {{eventname}}",
|
"please_use_blockletters": "Bitte in DRUCKBUCHSTABEN schreiben",
|
||||||
"sponsoring_title": "Sponsoringerklärung",
|
"postalcode": "Postleitzahl",
|
||||||
"street": "Straße"
|
"signature": "Unterschrift",
|
||||||
|
"sponsor": "Sponsor",
|
||||||
|
"sponsor-in": "Sponsor:in",
|
||||||
|
"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 bin/ Wir sind bereit anlässlich des {{eventname}}",
|
||||||
|
"sponsoring_title": "Sponsoringerklärung",
|
||||||
|
"sponsorings": "Sponsorings",
|
||||||
|
"street": "Straße",
|
||||||
|
"urkunde": "Urkunde"
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,29 @@
|
|||||||
{
|
{
|
||||||
"address": "Address",
|
"address": "Address",
|
||||||
|
"betrag-km": "Amount/ km",
|
||||||
"city": "City",
|
"city": "City",
|
||||||
"date": "date",
|
"date": "date",
|
||||||
"firstname": "First name",
|
"firstname": "First name",
|
||||||
"group": "Team/class",
|
"fuer-den-guten-zweck-zurueckgelegt": "for our good cause at the {{eventname}}",
|
||||||
|
"gesamt": "Combined",
|
||||||
|
"gesamtbetrag": "Total",
|
||||||
|
"group": "Team/ class",
|
||||||
|
"hat-beim-eventname": "Ran",
|
||||||
"house_number": "House number",
|
"house_number": "House number",
|
||||||
|
"id": "ID",
|
||||||
"lastname": "Last name",
|
"lastname": "Last name",
|
||||||
"location": "Location",
|
"location": "Location",
|
||||||
|
"mit_unterstuetzung_von": "Supported by:",
|
||||||
"please_use_blockletters": "Please write in BLOCK LETTERS.",
|
"please_use_blockletters": "Please write in BLOCK LETTERS.",
|
||||||
"postalcode": "Postal code",
|
"postalcode": "Postal code",
|
||||||
"signature": "Signature",
|
"signature": "Signature",
|
||||||
"sponsor": "sponsor",
|
"sponsor": "sponsor",
|
||||||
|
"sponsor-in": "Donor",
|
||||||
"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_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_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_subtitle": "On the occasion of the {{eventname}} I/We want to support",
|
||||||
"sponsoring_title": "Sponsoring contract",
|
"sponsoring_title": "Sponsoring contract",
|
||||||
"street": "Street"
|
"sponsorings": "Donations",
|
||||||
|
"street": "Street",
|
||||||
|
"urkunde": "Certificate"
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
IsArray
|
IsArray, IsNumber, IsOptional
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
import { DistanceDonation } from './DistanceDonation';
|
import { DistanceDonation } from './DistanceDonation';
|
||||||
import { Runner } from './Runner';
|
import { Runner } from './Runner';
|
||||||
@@ -13,4 +13,13 @@ export class CertificateRunner extends Runner {
|
|||||||
*/
|
*/
|
||||||
@IsArray()
|
@IsArray()
|
||||||
distanceDonations: DistanceDonation[];
|
distanceDonations: DistanceDonation[];
|
||||||
|
|
||||||
|
@IsNumber()
|
||||||
|
@IsOptional()
|
||||||
|
donationPerDistanceTotal?: number = 0;
|
||||||
|
|
||||||
|
@IsNumber()
|
||||||
|
@IsOptional()
|
||||||
|
donationTotal?: number = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
src/templates/certficate_background.png
Normal file
BIN
src/templates/certficate_background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
BIN
src/templates/certificate_footer.png
Normal file
BIN
src/templates/certificate_footer.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -33,18 +33,18 @@
|
|||||||
{{#each cards}}
|
{{#each cards}}
|
||||||
<div class="column is-half runnercard">
|
<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 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="text-align: center; margin-top: -1.5rem; font-size: small;">{{../card_subtitle}}</p>
|
||||||
<p style="font-size: small;">Mit unterstützung von:</p>
|
<p style="font-size: small;">{{__ "mit_unterstuetzung_von"}}</p>
|
||||||
<div class="columns" style="height: 6rem; overflow: hidden;">
|
<div class="columns" style="height: 6rem; overflow: hidden;">
|
||||||
<div class="column is-two-thirds">
|
<div class="column is-half">
|
||||||
<!--SPONSOR LOGO HERE-->
|
<!--SPONSOR LOGO HERE-->
|
||||||
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
|
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
|
||||||
src="{{--sponsor this.id}}" />
|
src="{{--sponsor this.id}}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="column is-one-third">
|
<div class="column is-half">
|
||||||
<!--BARCODE HERE-->
|
<!--BARCODE HERE-->
|
||||||
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
|
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
|
||||||
src="{{--bc this.id ../codeformat}}" />
|
src="{{--bc this.code ../codeformat}}" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>{{this.runner.lastname}}, {{this.runner.firstname}} {{this.runner.middlename}}</p>
|
<p>{{this.runner.lastname}}, {{this.runner.firstname}} {{this.runner.middlename}}</p>
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
<div style="height: 2cm; padding: 0 0 2.25cm 0">
|
<div style="height: 2cm; padding: 0 0 2.25cm 0">
|
||||||
<img style="object-fit: cover; max-height: 2cm;" src="{{--sponsor this.id}}" />
|
<img style="object-fit: cover; max-height: 2cm;" src="{{--sponsor this.id}}" />
|
||||||
</div>
|
</div>
|
||||||
<img style="object-fit: cover; max-height: 2.5cm; position: relative;" src="{{--bc this.id ../codeformat}}" />
|
<img style="object-fit: cover; max-height: 2.5cm; position: relative;" src="{{--bc this.code ../codeformat}}" />
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
102
src/templates/runner_certificate.html
Normal file
102
src/templates/runner_certificate.html
Normal file
File diff suppressed because one or more lines are too long
@@ -1,10 +1,15 @@
|
|||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import faker from "faker"
|
import faker from "faker"
|
||||||
|
import { config } from '../config'
|
||||||
|
import { CertificateRunner } from '../models/CertificateRunner'
|
||||||
|
import { DistanceDonation } from '../models/DistanceDonation'
|
||||||
|
import { Donor } from '../models/Donor'
|
||||||
import { Runner } from '../models/Runner'
|
import { Runner } from '../models/Runner'
|
||||||
import { RunnerCard } from '../models/RunnerCard'
|
import { RunnerCard } from '../models/RunnerCard'
|
||||||
import { RunnerGroup } from '../models/RunnerGroup'
|
import { RunnerGroup } from '../models/RunnerGroup'
|
||||||
|
|
||||||
const baseurl = "http://localhost:4010"
|
const baseurl = "http://localhost:4010"
|
||||||
|
const key = config.api_key;
|
||||||
|
|
||||||
axios.interceptors.request.use((config) => {
|
axios.interceptors.request.use((config) => {
|
||||||
config.headers['request-startTime'] = process.hrtime()
|
config.headers['request-startTime'] = process.hrtime()
|
||||||
@@ -46,6 +51,36 @@ function generateCards(amount: number): RunnerCard[] {
|
|||||||
return cards;
|
return cards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generateCertificateRunners(amount: number): CertificateRunner[] {
|
||||||
|
let runners: CertificateRunner[] = new Array<CertificateRunner>();
|
||||||
|
let group = new RunnerGroup();
|
||||||
|
let runner = new CertificateRunner();
|
||||||
|
let donor = new Donor();
|
||||||
|
let donation = new DistanceDonation();
|
||||||
|
for (var i = 0; i < amount; i++) {
|
||||||
|
group.name = faker.company.bsBuzz();
|
||||||
|
group.id = Math.floor(Math.random() * (9999999 - 1) + 1);
|
||||||
|
|
||||||
|
donor.firstname = faker.name.firstName();
|
||||||
|
donor.lastname = faker.name.lastName();
|
||||||
|
donor.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);
|
||||||
|
runner.distance = Math.floor(Math.random() * (9999999 - 1) + 1);
|
||||||
|
|
||||||
|
donation.id = Math.floor(Math.random() * (9999999 - 1) + 1);
|
||||||
|
donation.donor = donor;
|
||||||
|
donation.runner = runner;
|
||||||
|
donation.amountPerDistance = Math.floor(Math.random() * (10000 - 1) + 1);
|
||||||
|
|
||||||
|
runner.distanceDonations = [donation, donation]
|
||||||
|
runners.push(runner);
|
||||||
|
}
|
||||||
|
return runners;
|
||||||
|
}
|
||||||
|
|
||||||
function idToEan13(id): string {
|
function idToEan13(id): string {
|
||||||
const multiply = [1, 3];
|
const multiply = [1, 3];
|
||||||
id = id.toString();
|
id = id.toString();
|
||||||
@@ -64,15 +99,20 @@ function idToEan13(id): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function postContracts(runners: Runner[]): Promise<Measurement> {
|
async function postContracts(runners: Runner[]): Promise<Measurement> {
|
||||||
const res = await axios.post(`${baseurl}/contracts`, runners);
|
const res = await axios.post(`${baseurl}/contracts?key=${key}`, runners);
|
||||||
return new Measurement("contract", runners.length, parseInt(res.headers['request-duration']))
|
return new Measurement("contract", runners.length, parseInt(res.headers['request-duration']))
|
||||||
}
|
}
|
||||||
|
|
||||||
async function postCards(cards: RunnerCard[]): Promise<Measurement> {
|
async function postCards(cards: RunnerCard[]): Promise<Measurement> {
|
||||||
const res = await axios.post(`${baseurl}/cards`, cards);
|
const res = await axios.post(`${baseurl}/cards?key=${key}`, cards);
|
||||||
return new Measurement("card", cards.length, parseInt(res.headers['request-duration']))
|
return new Measurement("card", cards.length, parseInt(res.headers['request-duration']))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function postCertificates(runners: CertificateRunner[]): Promise<Measurement> {
|
||||||
|
const res = await axios.post(`${baseurl}/certificates?key=${key}`, runners);
|
||||||
|
return new Measurement("certificate", runners.length, parseInt(res.headers['request-duration']))
|
||||||
|
}
|
||||||
|
|
||||||
async function testContracts(sizes): Promise<Measurement[]> {
|
async function testContracts(sizes): Promise<Measurement[]> {
|
||||||
let measurements = new Array<Measurement>();
|
let measurements = new Array<Measurement>();
|
||||||
console.log("#### Testing contracts ####");
|
console.log("#### Testing contracts ####");
|
||||||
@@ -97,16 +137,30 @@ async function testCards(sizes): Promise<Measurement[]> {
|
|||||||
return measurements;
|
return measurements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function testCertificates(sizes): Promise<Measurement[]> {
|
||||||
|
let measurements = new Array<Measurement>();
|
||||||
|
console.log("#### Testing Certificates ####");
|
||||||
|
|
||||||
|
for (let size of sizes) {
|
||||||
|
const m = await postCertificates(generateCertificateRunners(size));
|
||||||
|
console.log(m.toString());
|
||||||
|
measurements.push(m);
|
||||||
|
}
|
||||||
|
return measurements;
|
||||||
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const sizes = [0, 1, 10, 50, 100, 200, 500, 1000]
|
const sizes = [1, 10, 50, 100]
|
||||||
console.log("########### Speedtest ###########");
|
console.log("########### Speedtest ###########");
|
||||||
console.log(`Document server version (according to the api): ${(await axios.get("http://localhost:4010/version")).data.version}`);
|
console.log(`Document server version (according to the api): ${(await axios.get("http://localhost:4010/version")).data.version}`);
|
||||||
console.log("####### Running tests #######");
|
console.log("####### Running tests #######");
|
||||||
const contractResults = await testContracts(sizes);
|
const contractResults = await testContracts(sizes);
|
||||||
const cardResults = await testCards(sizes);
|
const cardResults = await testCards(sizes);
|
||||||
|
const certificateResults = await testCertificates(sizes);
|
||||||
console.log("####### Results #######");
|
console.log("####### Results #######");
|
||||||
console.table(contractResults);
|
console.table(contractResults);
|
||||||
console.table(cardResults);
|
console.table(cardResults);
|
||||||
|
console.table(certificateResults);
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
|||||||
Reference in New Issue
Block a user