bun + hono
This commit is contained in:
parent
e7ad878fb9
commit
f8d97ed19e
30
.dockerignore
Normal file
30
.dockerignore
Normal file
@ -0,0 +1,30 @@
|
||||
# Version control
|
||||
.git
|
||||
.gitignore
|
||||
|
||||
# Dependencies
|
||||
node_modules
|
||||
bun.lockb
|
||||
|
||||
# Environment variables
|
||||
.env
|
||||
.env.*
|
||||
|
||||
# Development files
|
||||
*.log
|
||||
.vscode
|
||||
.idea
|
||||
*.md
|
||||
|
||||
# Build artifacts
|
||||
dist
|
||||
build
|
||||
|
||||
# Docker
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
.dockerignore
|
||||
|
||||
# System files
|
||||
.DS_Store
|
||||
Thumbs.db
|
175
.drone.yml
175
.drone.yml
@ -1,175 +0,0 @@
|
||||
---
|
||||
kind: secret
|
||||
name: docker_username
|
||||
get:
|
||||
path: odit-registry-builder
|
||||
name: username
|
||||
|
||||
---
|
||||
kind: secret
|
||||
name: docker_password
|
||||
get:
|
||||
path: odit-registry-builder
|
||||
name: password
|
||||
|
||||
---
|
||||
kind: secret
|
||||
name: git_ssh
|
||||
get:
|
||||
path: odit-git-bot
|
||||
name: sshkey
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: tests:node_latest
|
||||
clone:
|
||||
disable: true
|
||||
steps:
|
||||
- name: checkout pr
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git clone $DRONE_REMOTE_URL .
|
||||
- git checkout $DRONE_SOURCE_BRANCH
|
||||
- name: run tests
|
||||
image: node:latest
|
||||
commands:
|
||||
- yarn
|
||||
- yarn test:ci
|
||||
trigger:
|
||||
event:
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: build:dev
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: clone
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git clone $DRONE_REMOTE_URL .
|
||||
- git checkout dev
|
||||
- name: build dev
|
||||
image: plugins/docker
|
||||
depends_on: [clone]
|
||||
settings:
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: registry.odit.services/lfk/mailer
|
||||
tags:
|
||||
- dev
|
||||
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/mailer.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/mailer.git
|
||||
skip_verify: true
|
||||
ssh_key:
|
||||
from_secret: git_ssh
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- dev
|
||||
event:
|
||||
- push
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: build:latest
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: clone
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git clone $DRONE_REMOTE_URL .
|
||||
- git checkout dev
|
||||
- git merge main
|
||||
- git checkout main
|
||||
- name: build latest
|
||||
depends_on: ["clone"]
|
||||
image: plugins/docker
|
||||
settings:
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: registry.odit.services/lfk/mailer
|
||||
tags:
|
||||
- latest
|
||||
registry: registry.odit.services
|
||||
mtu: 1000
|
||||
- name: push merge to repo
|
||||
depends_on: ["clone"]
|
||||
image: appleboy/drone-git-push
|
||||
settings:
|
||||
branch: dev
|
||||
commit: false
|
||||
remote: git@git.odit.services:lfk/mailer.git
|
||||
ssh_key:
|
||||
from_secret: git_ssh
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: build:tags
|
||||
|
||||
steps:
|
||||
- name: build $DRONE_TAG
|
||||
image: plugins/docker
|
||||
depends_on: [clone]
|
||||
settings:
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: registry.odit.services/lfk/mailer
|
||||
tags:
|
||||
- '${DRONE_TAG}'
|
||||
registry: registry.odit.services
|
||||
mtu: 1000
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
6
.env.example
Normal file
6
.env.example
Normal file
@ -0,0 +1,6 @@
|
||||
SMTP_HOST=smtp.mailtrap.io
|
||||
SMTP_PORT=2525
|
||||
SMTP_USER=your_smtp_user
|
||||
SMTP_PASS=your_smtp_password
|
||||
EMAIL_FROM=noreply@example.com
|
||||
REDIS_URL=redis://localhost:6379
|
141
.gitignore
vendored
141
.gitignore
vendored
@ -1,140 +1 @@
|
||||
# ---> VisualStudioCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
!/.vscode/*.yml
|
||||
*.code-workspace
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# ---> Node
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Snowpack dependency directory (https://snowpack.dev/)
|
||||
web_modules/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Microbundle cache
|
||||
.rpt2_cache/
|
||||
.rts2_cache_cjs/
|
||||
.rts2_cache_es/
|
||||
.rts2_cache_umd/
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
.parcel-cache
|
||||
|
||||
# Next.js build output
|
||||
.next
|
||||
out
|
||||
|
||||
# Nuxt.js build / generate output
|
||||
.nuxt
|
||||
dist
|
||||
|
||||
# Gatsby files
|
||||
.cache/
|
||||
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||
# public
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# TernJS port file
|
||||
.tern-port
|
||||
|
||||
# Stores VSCode versions used for testing VSCode extensions
|
||||
.vscode-test
|
||||
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
build
|
||||
|
||||
*.sqlite
|
||||
*.sqlite-jurnal
|
||||
/docs
|
||||
lib
|
||||
/oss-attribution
|
||||
*.tmp
|
||||
node_modules
|
||||
|
11
.vscode/extensions.json
vendored
11
.vscode/extensions.json
vendored
@ -1,11 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"2gua.rainbow-brackets",
|
||||
"christian-kohler.npm-intellisense",
|
||||
"remimarsal.prettier-now",
|
||||
"lokalise.i18n-ally",
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"antfu.i18n-ally"
|
||||
]
|
||||
}
|
10
.vscode/i18n-ally-custom-framework.yml
vendored
10
.vscode/i18n-ally-custom-framework.yml
vendored
@ -1,10 +0,0 @@
|
||||
languageIds:
|
||||
- javascript
|
||||
- html
|
||||
- typescript
|
||||
- plaintext
|
||||
keyMatchReg:
|
||||
- '\{\{__ "([a-zA-Z0-9_-]+)"\}\}'
|
||||
monopoly: false
|
||||
refactorTemplates:
|
||||
- '{{__ "$1"}}'
|
31
.vscode/settings.json
vendored
31
.vscode/settings.json
vendored
@ -1,31 +0,0 @@
|
||||
{
|
||||
"editor.formatOnSave": true,
|
||||
"typescript.format.enable": true,
|
||||
"typescript.preferences.quoteStyle": "single",
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "vscode.json-language-features"
|
||||
},
|
||||
"[html]": {
|
||||
"editor.defaultFormatter": "vscode.json-language-features",
|
||||
"editor.formatOnSave": false
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": true,
|
||||
// "source.fixAll": true
|
||||
}
|
||||
},
|
||||
"javascript.preferences.quoteStyle": "single",
|
||||
"javascript.preferences.importModuleSpecifierEnding": "minimal",
|
||||
"typescript.preferences.importModuleSpecifierEnding": "minimal",
|
||||
"typescript.preferences.includePackageJsonAutoImports": "on",
|
||||
"i18n-ally.localesPaths": "src/locales",
|
||||
"i18n-ally.keystyle": "nested",
|
||||
"i18n-ally.extract.keygenStrategy":"slug",
|
||||
"i18n-ally.enabledFrameworks": [
|
||||
"custom"
|
||||
],
|
||||
"i18n-ally.sourceLanguage": "en"
|
||||
|
||||
}
|
137
CHANGELOG.md
137
CHANGELOG.md
@ -1,137 +0,0 @@
|
||||
### Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||
|
||||
#### [v0.1.2](https://git.odit.services/lfk/mailer/compare/v0.1.2...v0.1.2)
|
||||
|
||||
- update runner-welcome mail template [`#15`](https://git.odit.services/lfk/mailer/issues/15)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`e713ef5`](https://git.odit.services/lfk/mailer/commit/e713ef54ef39d4759832ada073cea825b4ef26dc)
|
||||
|
||||
#### [v0.1.2](https://git.odit.services/lfk/mailer/compare/v0.1.1...v0.1.2)
|
||||
|
||||
> 15 April 2021
|
||||
|
||||
- Merge pull request 'Release 0.1.2' (#14) from dev into main [`15b98e8`](https://git.odit.services/lfk/mailer/commit/15b98e83098906005e0f3f0b24313f9cab6ec1af)
|
||||
- Fixed typos and added missing translations🌎 [`8099d2f`](https://git.odit.services/lfk/mailer/commit/8099d2fdbaa8fea6e4fd6a993ac1cfb09e01d14d)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`c8378b6`](https://git.odit.services/lfk/mailer/commit/c8378b66ba512a90ca4386d5a3570f4bb8bea049)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`fbc95be`](https://git.odit.services/lfk/mailer/commit/fbc95be3455eed0d97a124f7df277d0f902e76c9)
|
||||
- 🚀Bumped version to v0.1.2 [`d550059`](https://git.odit.services/lfk/mailer/commit/d5500594945b99e428ac1651afd1fe8a8eeba192)
|
||||
|
||||
#### [v0.1.1](https://git.odit.services/lfk/mailer/compare/v0.1.0...v0.1.1)
|
||||
|
||||
> 31 March 2021
|
||||
|
||||
- Merge pull request 'Release 0.1.1' (#13) from dev into main [`b47660a`](https://git.odit.services/lfk/mailer/commit/b47660af65362d773911e99fa9ebf99340d1a368)
|
||||
- Added mail templates for forgotten selfservice links [`56c3dec`](https://git.odit.services/lfk/mailer/commit/56c3deca574fc4501cc9b51128b4f3b0467d24c9)
|
||||
- Applied Docker MTU fix 🛠 [`f6c03c7`](https://git.odit.services/lfk/mailer/commit/f6c03c7ae218faf8bcdc4108e809ef121b87ef92)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`00e7837`](https://git.odit.services/lfk/mailer/commit/00e78371f3d875460596c24f3544d4e94a896f3c)
|
||||
- Added tests [`91f9a8c`](https://git.odit.services/lfk/mailer/commit/91f9a8cbdecf74a74e68b80f3aec675de59e46d4)
|
||||
- Added translation keys [`1d4d1d1`](https://git.odit.services/lfk/mailer/commit/1d4d1d18d85349b6f877fa5f1df82fe0d9dafe79)
|
||||
- Sorted locales [`9ba4b40`](https://git.odit.services/lfk/mailer/commit/9ba4b4001d35afa49e4eb3232a21784ed443c52e)
|
||||
- 📖New license file version [CI SKIP] [skip ci] [`ab0e41f`](https://git.odit.services/lfk/mailer/commit/ab0e41f73be5ad281d5909d6d8baa4dd882c7cc3)
|
||||
- Updated ci with new kubernetes secrets 🚀🚀🚀 [`7842a3c`](https://git.odit.services/lfk/mailer/commit/7842a3c437a7d028df9e610257f7ccc0c3d8a871)
|
||||
- Added new mailer function [`8da7c55`](https://git.odit.services/lfk/mailer/commit/8da7c55deb5c0b4fccb7f18688613d06dd92df45)
|
||||
- Adjusted tests for mail types [`8271014`](https://git.odit.services/lfk/mailer/commit/8271014a101439ea46233099182eb78da9fdc11c)
|
||||
- Added MailTypes to responses [`0fa94fc`](https://git.odit.services/lfk/mailer/commit/0fa94fc8679b45aa702068ad96097fe18b385a50)
|
||||
- Revert "Now using more images powered by us 🚀🚀🚀" [`d5f2910`](https://git.odit.services/lfk/mailer/commit/d5f29108c479e641db91b2f48ab3cf5da16e9d14)
|
||||
- Now using more images powered by us 🚀🚀🚀 [`c1d8b78`](https://git.odit.services/lfk/mailer/commit/c1d8b781a62ebedafa7f1fa598eab966e91d8b64)
|
||||
- Added endpoint [`9807e61`](https://git.odit.services/lfk/mailer/commit/9807e61fa81a5790fc09f9920905c683ea1c3a79)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`07aeaf6`](https://git.odit.services/lfk/mailer/commit/07aeaf6d6ba46d0bde62141a7ab0f47c9afde565)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`416be79`](https://git.odit.services/lfk/mailer/commit/416be7920cc551bfd2da2ddfc2fdc25367cafc99)
|
||||
- Added translation keys to txt [`44972e4`](https://git.odit.services/lfk/mailer/commit/44972e4a93204aa9f6acbbf29f3012aa8213af77)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`d996d2e`](https://git.odit.services/lfk/mailer/commit/d996d2e85f24c9e3723913bafc8078a13732fc04)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`8996aef`](https://git.odit.services/lfk/mailer/commit/8996aef1523e079aec83b63df99c44173f3a43cc)
|
||||
- 🚀Bumped version to v0.1.1 [`34e0c72`](https://git.odit.services/lfk/mailer/commit/34e0c729b542b026b997f25a33165383ff879222)
|
||||
- Merge pull request 'Now base64-encoding the selfservice tokens👀' (#12) from bugfix/11-selfservice_profile_link into dev [`5ff6f77`](https://git.odit.services/lfk/mailer/commit/5ff6f77dafa6a3a67615fae6d228c31cb8eac6b9)
|
||||
- Changed ci pipeline type to kubernetes [`18c8600`](https://git.odit.services/lfk/mailer/commit/18c8600563c4369321a0e9ba51a09a2fa95198b5)
|
||||
- Dockerfile with cached images 🔥 [`f554718`](https://git.odit.services/lfk/mailer/commit/f55471825ef6833600780cb229148d7b7d122150)
|
||||
- Now base64-encoding the selfservice tokens👀 [`1f58165`](https://git.odit.services/lfk/mailer/commit/1f581650c5164b6b6d6a6fce5e86e64074c1bdf9)
|
||||
- Merge pull request 'Selfservice link forgotten mails feature/5-registration_forgot_mails' (#10) from feature/5-registration_forgot_mails into dev [`f011659`](https://git.odit.services/lfk/mailer/commit/f011659469bd62dffc17e440a6ed42d1fbe7956e)
|
||||
- Added new mailtype enum [`015b25a`](https://git.odit.services/lfk/mailer/commit/015b25a2056fe3537fb8e88539c25c2c9e6ba618)
|
||||
- Fixed typo [`577f321`](https://git.odit.services/lfk/mailer/commit/577f321b3ffcea666eaaa529e86e532702432635)
|
||||
- Renamed templates [`34e30d6`](https://git.odit.services/lfk/mailer/commit/34e30d64929ca7555cee62c4da86d07050b94ff5)
|
||||
|
||||
#### v0.1.0
|
||||
|
||||
> 4 March 2021
|
||||
|
||||
- Merge pull request 'Alpha release 0.1.0' (#9) from dev into main [`e60360c`](https://git.odit.services/lfk/mailer/commit/e60360ccd4f5d6d01b7f20b12e60edc4adb1f75d)
|
||||
- 📖New license file version [CI SKIP] [skip ci] [`10b1312`](https://git.odit.services/lfk/mailer/commit/10b13127aa48f65641d1295b77556a6f74a94625)
|
||||
- Added basic welcome mails [`b3f61f5`](https://git.odit.services/lfk/mailer/commit/b3f61f51e367c10e102e1d53e6c41c8280f6c0c3)
|
||||
- 🚀Bumped version to v0.1.0 [`5e7cfff`](https://git.odit.services/lfk/mailer/commit/5e7cfff41eaf14bf17319319534c7713d9bbf3b9)
|
||||
- Added drone file [`3f21503`](https://git.odit.services/lfk/mailer/commit/3f21503848b14c5f8f2066ab3fd8fe114bf1de41)
|
||||
- 📖New license file version [CI SKIP] [skip ci] [`f11137e`](https://git.odit.services/lfk/mailer/commit/f11137e0c2140cd226d418c284387bc6a9532030)
|
||||
- Added welcome mail tests [`ce87e1f`](https://git.odit.services/lfk/mailer/commit/ce87e1fc03340922c412a431d9595c740a78f42b)
|
||||
- Added reset mail valid tests [`4624250`](https://git.odit.services/lfk/mailer/commit/46242509637e05e6b258b406d0a2a76e5db9ca03)
|
||||
- Added all missing config vars/interpolations [`4994cb0`](https://git.odit.services/lfk/mailer/commit/4994cb0489b168ecc9f18103fdea5e578bb9ef74)
|
||||
- Sorted translations [`1862013`](https://git.odit.services/lfk/mailer/commit/18620133b92baa81272ee084385129b2fb60d234)
|
||||
- Added more info to the readme [`9cb100c`](https://git.odit.services/lfk/mailer/commit/9cb100c7c43b082263f4f58c82554c85d7be8494)
|
||||
- Moved models to their own files [`9ce86eb`](https://git.odit.services/lfk/mailer/commit/9ce86ebef7d11ed0fb674dcf77f1b6dacd934aa4)
|
||||
- Fixed typo [`4b5e24f`](https://git.odit.services/lfk/mailer/commit/4b5e24f3e30db94cf46d6d6362be519343c71a83)
|
||||
- Added test mail tests [`bf9652d`](https://git.odit.services/lfk/mailer/commit/bf9652dcfed3667f9d2e8cfd933963935a621a88)
|
||||
- Added + sorted translations [`6e99ad5`](https://git.odit.services/lfk/mailer/commit/6e99ad5c1ca3a4853a38acae6f0526c0fa54180c)
|
||||
- Added german translations [`e2237d3`](https://git.odit.services/lfk/mailer/commit/e2237d34d39ccaef5600a6eb5d4c555531cb5941)
|
||||
- Added jest config and first tests [`ec939e6`](https://git.odit.services/lfk/mailer/commit/ec939e6c1142e825cdb21555e03d9e026e7cdf3c)
|
||||
- Added langauge keys for pw reset [`7595235`](https://git.odit.services/lfk/mailer/commit/7595235491694e95b11043f2d5e1fa20c65cd43c)
|
||||
- Locales as enums [`d450ecb`](https://git.odit.services/lfk/mailer/commit/d450ecbf7cf8e0b97c46e1f1f57cfcd6f7c30dce)
|
||||
- Added dockerfile and docker-compose [`c0c8046`](https://git.odit.services/lfk/mailer/commit/c0c8046031aeb19b3da5cd292316af54462c0978)
|
||||
- Updated api doc tests to listen on the right endpoint [`f6a53cc`](https://git.odit.services/lfk/mailer/commit/f6a53cc3e47308e84cde13640cb3f614642fd4ca)
|
||||
- Added drone pipeline for automagic tests [`3501a4b`](https://git.odit.services/lfk/mailer/commit/3501a4bef1b6ec73ea0be643e1b4e95ee9874ff9)
|
||||
- Added env var docs to readme [`5314100`](https://git.odit.services/lfk/mailer/commit/5314100065f24cb0902c1ba207b880016abd300e)
|
||||
- Added missing translations [`1ec95a1`](https://git.odit.services/lfk/mailer/commit/1ec95a1fda13bdfdc9c056a4f73578045c77d964)
|
||||
- 📖New license file version [CI SKIP] [skip ci] [`4cde30e`](https://git.odit.services/lfk/mailer/commit/4cde30ef98370069dfad748e12bd720c1b84ad3e)
|
||||
- Merge pull request 'Welcome mails feature/2-welcome_mails' (#7) from feature/2-welcome_mails into dev [`0b96dc8`](https://git.odit.services/lfk/mailer/commit/0b96dc8ba519b42922f1464853d694fc2984cbc0)
|
||||
- Merge pull request 'Added real information to the README feature/3-readme' (#8) from feature/3-readme into dev [`aed676c`](https://git.odit.services/lfk/mailer/commit/aed676c04b6223916b638340b04677fc34c5b6ae)
|
||||
- Added registration mail endpoint [`b3952c3`](https://git.odit.services/lfk/mailer/commit/b3952c39e5f52412c955d6a9cb96f81396e06d82)
|
||||
- Added request class [`056b74c`](https://git.odit.services/lfk/mailer/commit/056b74ce2268185d39554a7d7afeaaf75c4e17a2)
|
||||
- Added reset mail request model [`5812a48`](https://git.odit.services/lfk/mailer/commit/5812a485ee2e23e8d0bb15bedbebdf7734817865)
|
||||
- Now accepting reset mail class [`7445223`](https://git.odit.services/lfk/mailer/commit/7445223f1e6782536157d09cddcad9c942b72e7d)
|
||||
- Added ci status [`e48f830`](https://git.odit.services/lfk/mailer/commit/e48f830c08900a9c9e4451d16a25f3ef3d9485e4)
|
||||
- Merge pull request 'Added tests for the mail endpoints feature/4-tests' (#6) from feature/4-tests into dev [`7473931`](https://git.odit.services/lfk/mailer/commit/7473931f2705bbdff7a15b74f8d1f39228694697)
|
||||
- Merge pull request 'Initial release 0.0.1' (#1) from dev into main [`1d3901a`](https://git.odit.services/lfk/mailer/commit/1d3901ae8f9a0c4675cacd7d0c44c547a06985d4)
|
||||
- Added basic loaders/files/dirs [`4e80aa8`](https://git.odit.services/lfk/mailer/commit/4e80aa8a32911ca9697e411f82e8923977ae8216)
|
||||
- Added the old mail templates [`c5f2532`](https://git.odit.services/lfk/mailer/commit/c5f2532504768ee26c170e4f4d84bc25a87c63cc)
|
||||
- Initial commit [`907b989`](https://git.odit.services/lfk/mailer/commit/907b989d534dab098cc6013f5954203bc9a37510)
|
||||
- Added language keys for test mails [`8ab80fd`](https://git.odit.services/lfk/mailer/commit/8ab80fd7ed19f90c51a3f15f90d23e33c451df8e)
|
||||
- Added basic files and depedencies [`4e5d5ae`](https://git.odit.services/lfk/mailer/commit/4e5d5ae31171a9b60e684694e04b840a92abbe50)
|
||||
- Added basic mailer that can send pw reset mails [`279a9ca`](https://git.odit.services/lfk/mailer/commit/279a9ca946ec028e7003df4f3f78ce80f5e455b4)
|
||||
- Added basic config [`9c2f465`](https://git.odit.services/lfk/mailer/commit/9c2f465b99b8610047b5f5b4b8d6707e6d6ee8bd)
|
||||
- Now generateing api key via eng_gen script [`17f5876`](https://git.odit.services/lfk/mailer/commit/17f5876d738bcc461f7b4fac907cb8bb9bc13aa5)
|
||||
- Added function for sending test mail [`602600d`](https://git.odit.services/lfk/mailer/commit/602600db895a01ca72182e3e2d6094a5e20d4b85)
|
||||
- Added basic apispec generator [`124c7a5`](https://git.odit.services/lfk/mailer/commit/124c7a5d1544686dc4fd6e2eaf50e519c2fe0a49)
|
||||
- Added app startup file [`53daae9`](https://git.odit.services/lfk/mailer/commit/53daae956da47008312e45a49d445f5674c33551)
|
||||
- Added basic mail controller [`972b09d`](https://git.odit.services/lfk/mailer/commit/972b09d8ca4cf250e308340a4ba59f741de77801)
|
||||
- Added ans sorted translations [`3f5b77d`](https://git.odit.services/lfk/mailer/commit/3f5b77dc8e085fc25b4b5cc9ffa054ee8ec5bd6b)
|
||||
- Added the usual middlewares [`e0523db`](https://git.odit.services/lfk/mailer/commit/e0523db739f772166c0bf895d0d40435848f4600)
|
||||
- Added function for generateing test envs [`fc37d14`](https://git.odit.services/lfk/mailer/commit/fc37d146209f6561cc1642774f1ef3a9cadb39f8)
|
||||
- Added ans sorted translations [`aedcbd5`](https://git.odit.services/lfk/mailer/commit/aedcbd5f56692c522c356c9c05cd6b5e13c87b3a)
|
||||
- Sorted translations [`a84500c`](https://git.odit.services/lfk/mailer/commit/a84500ca1b240c72a69d47f9b35adea7a288c23a)
|
||||
- Added success response [`895e346`](https://git.odit.services/lfk/mailer/commit/895e346e599a93ac32c90318197a890fd0599513)
|
||||
- Added status controller [`aa28601`](https://git.odit.services/lfk/mailer/commit/aa286013a146fe2ad11c1601bef529ad956a9fed)
|
||||
- Fixed broken formatting [`dc3bab3`](https://git.odit.services/lfk/mailer/commit/dc3bab324704005490aaffcd62f18e660c4315c8)
|
||||
- Added mail errors [`c5fe167`](https://git.odit.services/lfk/mailer/commit/c5fe1671a2e1325740a29c93f2fe2dbb76579391)
|
||||
- Added basic jest packages and scripts [`fa9d0e5`](https://git.odit.services/lfk/mailer/commit/fa9d0e5790a6d7ba9d4490bc016e0f9afde49ec8)
|
||||
- Updated comments [`d77670f`](https://git.odit.services/lfk/mailer/commit/d77670fb7023aae86b7039684a6b059ee91bf17d)
|
||||
- Added custom i18n ally framework [`264af07`](https://git.odit.services/lfk/mailer/commit/264af075f306675e4247fbcadebfcdab8fa0ba3b)
|
||||
- Added stuff to gitignore [`21fab5d`](https://git.odit.services/lfk/mailer/commit/21fab5d53a7f228fa4ef64e53c64fe5324b0ec17)
|
||||
- Fixed json [`a1fbabd`](https://git.odit.services/lfk/mailer/commit/a1fbabdee8f414498c5efd95d5d87f41ef3cc28e)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`7c16dd1`](https://git.odit.services/lfk/mailer/commit/7c16dd1b447369c87f2e3a487ec2a3f1fc8451c5)
|
||||
- Disabled html autoformatting [`6c5996e`](https://git.odit.services/lfk/mailer/commit/6c5996e1e514ad9b2294316088c34e44255ae895)
|
||||
- Added nodemailer dependencies [`87d7175`](https://git.odit.services/lfk/mailer/commit/87d7175f962e8810c98fc72a9bb0fc19ef9e2c22)
|
||||
- Added initial translation [`48aa076`](https://git.odit.services/lfk/mailer/commit/48aa076e08b7c32bf53b86c942b129d7f366d93b)
|
||||
- Updated consola [`9323cec`](https://git.odit.services/lfk/mailer/commit/9323cecf944dde0b5c187059ded0fe576a0e6758)
|
||||
- Added eventname to config [`a62f9c6`](https://git.odit.services/lfk/mailer/commit/a62f9c683dd09303af47e2ed4e8df60bb2df3121)
|
||||
- Added test watch mode [`38cffc2`](https://git.odit.services/lfk/mailer/commit/38cffc20490fe10b4e4bc4d88a8377562cd1545a)
|
||||
- Added email address verification [`9b5c0b8`](https://git.odit.services/lfk/mailer/commit/9b5c0b8f0630ddaeb78e0d319692985d91a6db76)
|
||||
- Fixed argument bug [`6a803c0`](https://git.odit.services/lfk/mailer/commit/6a803c04ab2065db60a13b1aa3333fdfe252f1ab)
|
||||
- Added env generation script [`01f5001`](https://git.odit.services/lfk/mailer/commit/01f500135518a628cca9f2a51e25f9ef94b99fa2)
|
||||
- Not ignoring i18n ally framework any more [`92494ea`](https://git.odit.services/lfk/mailer/commit/92494eaf6cea490a2c87ebc8f4d14e52d7d9ed0c)
|
||||
- Added copyright owner to config [`806cc81`](https://git.odit.services/lfk/mailer/commit/806cc814c39fbe9e09eda87660e076eade1c8b01)
|
||||
- Adjusted mail title [`314ceac`](https://git.odit.services/lfk/mailer/commit/314ceaca9d1ff8423c027a9457e6c8d8520272a4)
|
||||
- Fixed inerpolation [`f8b9b18`](https://git.odit.services/lfk/mailer/commit/f8b9b188ae47adbc2a11a68274e9d2db3eb6b692)
|
||||
- Changed wording [`940acab`](https://git.odit.services/lfk/mailer/commit/940acab77015eced94e5273d4d0a824653665098)
|
||||
- Updated interpolations [`0926f31`](https://git.odit.services/lfk/mailer/commit/0926f31fac183a7064aac1679babc57f3b3681c8)
|
||||
- Added empty locale files [`0438df3`](https://git.odit.services/lfk/mailer/commit/0438df3bd18c4c424d0db4c269f3ce9f40eb97e5)
|
||||
- Removed eventname from config [`691d61b`](https://git.odit.services/lfk/mailer/commit/691d61bd3c40ded3d617a8569dab51e7728ee8ce)
|
||||
- Added eventname to config [`9bdb307`](https://git.odit.services/lfk/mailer/commit/9bdb3072aa318f5621443b839c6d1067d80b3580)
|
||||
- Moved scripts to own scripts folder [`22195c1`](https://git.odit.services/lfk/mailer/commit/22195c11dd825f83d8415445e2ee82aaa53a83cd)
|
35
Dockerfile
35
Dockerfile
@ -1,16 +1,21 @@
|
||||
# Typescript Build
|
||||
FROM registry.odit.services/hub/library/node:14.15.1-alpine3.12
|
||||
FROM oven/bun:1.1.36-slim
|
||||
# FROM oven/bun:1.0.25
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json ./
|
||||
RUN npm i -g pnpm
|
||||
RUN pnpm i
|
||||
COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN pnpm run build
|
||||
# final image
|
||||
FROM registry.odit.services/hub/library/node:14.15.1-alpine3.12
|
||||
COPY package.json ./
|
||||
RUN npm i -g pnpm
|
||||
RUN pnpm i --prod
|
||||
COPY --from=0 /app/dist dist
|
||||
ENTRYPOINT ["node", "dist/app.js"]
|
||||
|
||||
# Copy package files
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json .
|
||||
RUN bun i
|
||||
# COPY package.json bun.lockb ./
|
||||
# RUN bun install --frozen-lockfile
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Expose the application port
|
||||
EXPOSE 3000
|
||||
|
||||
# Start the application
|
||||
CMD ["bun", "run", "start"]
|
362
LICENSE
362
LICENSE
@ -1,362 +0,0 @@
|
||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Creative
|
||||
Commons Corporation ("Creative Commons") is not a law firm and does not provide
|
||||
legal services or legal advice. Distribution of Creative Commons public licenses
|
||||
does not create a lawyer-client or other relationship. Creative Commons makes
|
||||
its licenses and related information available on an "as-is" basis. Creative
|
||||
Commons gives no warranties regarding its licenses, any material licensed
|
||||
under their terms and conditions, or any related information. Creative Commons
|
||||
disclaims all liability for damages resulting from their use to the fullest
|
||||
extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and conditions
|
||||
that creators and other rights holders may use to share original works of
|
||||
authorship and other material subject to copyright and certain other rights
|
||||
specified in the public license below. The following considerations are for
|
||||
informational purposes only, are not exhaustive, and do not form part of our
|
||||
licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are intended for use by
|
||||
those authorized to give the public permission to use material in ways otherwise
|
||||
restricted by copyright and certain other rights. Our licenses are irrevocable.
|
||||
Licensors should read and understand the terms and conditions of the license
|
||||
they choose before applying it. Licensors should also secure all rights necessary
|
||||
before applying our licenses so that the public can reuse the material as
|
||||
expected. Licensors should clearly mark any material not subject to the license.
|
||||
This includes other CC-licensed material, or material used under an exception
|
||||
or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public licenses, a licensor
|
||||
grants the public permission to use the licensed material under specified
|
||||
terms and conditions. If the licensor's permission is not necessary for any
|
||||
reason–for example, because of any applicable exception or limitation to copyright–then
|
||||
that use is not regulated by the license. Our licenses grant only permissions
|
||||
under copyright and certain other rights that a licensor has authority to
|
||||
grant. Use of the licensed material may still be restricted for other reasons,
|
||||
including because others have copyright or other rights in the material. A
|
||||
licensor may make special requests, such as asking that all changes be marked
|
||||
or described. Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More considerations for the public
|
||||
: wiki.creativecommons.org/Considerations_for_licensees
|
||||
|
||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public
|
||||
License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree to
|
||||
be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike
|
||||
4.0 International Public License ("Public License"). To the extent this Public
|
||||
License may be interpreted as a contract, You are granted the Licensed Rights
|
||||
in consideration of Your acceptance of these terms and conditions, and the
|
||||
Licensor grants You such rights in consideration of benefits the Licensor
|
||||
receives from making the Licensed Material available under these terms and
|
||||
conditions.
|
||||
|
||||
Section 1 – Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar Rights
|
||||
that is derived from or based upon the Licensed Material and in which the
|
||||
Licensed Material is translated, altered, arranged, transformed, or otherwise
|
||||
modified in a manner requiring permission under the Copyright and Similar
|
||||
Rights held by the Licensor. For purposes of this Public License, where the
|
||||
Licensed Material is a musical work, performance, or sound recording, Adapted
|
||||
Material is always produced where the Licensed Material is synched in timed
|
||||
relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright and Similar
|
||||
Rights in Your contributions to Adapted Material in accordance with the terms
|
||||
and conditions of this Public License.
|
||||
|
||||
c. BY-NC-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses,
|
||||
approved by Creative Commons as essentially the equivalent of this Public
|
||||
License.
|
||||
|
||||
d. Copyright and Similar Rights means copyright and/or similar rights closely
|
||||
related to copyright including, without limitation, performance, broadcast,
|
||||
sound recording, and Sui Generis Database Rights, without regard to how the
|
||||
rights are labeled or categorized. For purposes of this Public License, the
|
||||
rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
|
||||
|
||||
e. Effective Technological Measures means those measures that, in the absence
|
||||
of proper authority, may not be circumvented under laws fulfilling obligations
|
||||
under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996,
|
||||
and/or similar international agreements.
|
||||
|
||||
f. Exceptions and Limitations means fair use, fair dealing, and/or any other
|
||||
exception or limitation to Copyright and Similar Rights that applies to Your
|
||||
use of the Licensed Material.
|
||||
|
||||
g. License Elements means the license attributes listed in the name of a Creative
|
||||
Commons Public License. The License Elements of this Public License are Attribution,
|
||||
NonCommercial, and ShareAlike.
|
||||
|
||||
h. Licensed Material means the artistic or literary work, database, or other
|
||||
material to which the Licensor applied this Public License.
|
||||
|
||||
i. Licensed Rights means the rights granted to You subject to the terms and
|
||||
conditions of this Public License, which are limited to all Copyright and
|
||||
Similar Rights that apply to Your use of the Licensed Material and that the
|
||||
Licensor has authority to license.
|
||||
|
||||
j. Licensor means the individual(s) or entity(ies) granting rights under this
|
||||
Public License.
|
||||
|
||||
k. NonCommercial means not primarily intended for or directed towards commercial
|
||||
advantage or monetary compensation. For purposes of this Public License, the
|
||||
exchange of the Licensed Material for other material subject to Copyright
|
||||
and Similar Rights by digital file-sharing or similar means is NonCommercial
|
||||
provided there is no payment of monetary compensation in connection with the
|
||||
exchange.
|
||||
|
||||
l. Share means to provide material to the public by any means or process that
|
||||
requires permission under the Licensed Rights, such as reproduction, public
|
||||
display, public performance, distribution, dissemination, communication, or
|
||||
importation, and to make material available to the public including in ways
|
||||
that members of the public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
m. Sui Generis Database Rights means rights other than copyright resulting
|
||||
from Directive 96/9/EC of the European Parliament and of the Council of 11
|
||||
March 1996 on the legal protection of databases, as amended and/or succeeded,
|
||||
as well as other essentially equivalent rights anywhere in the world.
|
||||
|
||||
n. You means the individual or entity exercising the Licensed Rights under
|
||||
this Public License. Your has a corresponding meaning.
|
||||
|
||||
Section 2 – Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License, the Licensor
|
||||
hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive,
|
||||
irrevocable license to exercise the Licensed Rights in the Licensed Material
|
||||
to:
|
||||
|
||||
A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial
|
||||
purposes only; and
|
||||
|
||||
B. produce, reproduce, and Share Adapted Material for NonCommercial purposes
|
||||
only.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions
|
||||
and Limitations apply to Your use, this Public License does not apply, and
|
||||
You do not need to comply with its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section 6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The Licensor authorizes
|
||||
You to exercise the Licensed Rights in all media and formats whether now known
|
||||
or hereafter created, and to make technical modifications necessary to do
|
||||
so. The Licensor waives and/or agrees not to assert any right or authority
|
||||
to forbid You from making technical modifications necessary to exercise the
|
||||
Licensed Rights, including technical modifications necessary to circumvent
|
||||
Effective Technological Measures. For purposes of this Public License, simply
|
||||
making modifications authorized by this Section 2(a)(4) never produces Adapted
|
||||
Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed
|
||||
Material automatically receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this Public License.
|
||||
|
||||
B. Additional offer from the Licensor – Adapted Material. Every recipient
|
||||
of Adapted Material from You automatically receives an offer from the Licensor
|
||||
to exercise the Licensed Rights in the Adapted Material under the conditions
|
||||
of the Adapter's License You apply.
|
||||
|
||||
C. No downstream restrictions. You may not offer or impose any additional
|
||||
or different terms or conditions on, or apply any Effective Technological
|
||||
Measures to, the Licensed Material if doing so restricts exercise of the Licensed
|
||||
Rights by any recipient of the Licensed Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or may be construed
|
||||
as permission to assert or imply that You are, or that Your use of the Licensed
|
||||
Material is, connected with, or sponsored, endorsed, or granted official status
|
||||
by, the Licensor or others designated to receive attribution as provided in
|
||||
Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not licensed under this
|
||||
Public License, nor are publicity, privacy, and/or other similar personality
|
||||
rights; however, to the extent possible, the Licensor waives and/or agrees
|
||||
not to assert any such rights held by the Licensor to the limited extent necessary
|
||||
to allow You to exercise the Licensed Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to collect royalties
|
||||
from You for the exercise of the Licensed Rights, whether directly or through
|
||||
a collecting society under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly reserves any right
|
||||
to collect such royalties, including when the Licensed Material is used other
|
||||
than for NonCommercial purposes.
|
||||
|
||||
Section 3 – License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the following
|
||||
conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified form), You must:
|
||||
|
||||
A. retain the following if it is supplied by the Licensor with the Licensed
|
||||
Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed Material and any others
|
||||
designated to receive attribution, in any reasonable manner requested by the
|
||||
Licensor (including by pseudonym if designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of warranties;
|
||||
|
||||
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
|
||||
|
||||
B. indicate if You modified the Licensed Material and retain an indication
|
||||
of any previous modifications; and
|
||||
|
||||
C. indicate the Licensed Material is licensed under this Public License, and
|
||||
include the text of, or the URI or hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner
|
||||
based on the medium, means, and context in which You Share the Licensed Material.
|
||||
For example, it may be reasonable to satisfy the conditions by providing a
|
||||
URI or hyperlink to a resource that includes the required information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the information required
|
||||
by Section 3(a)(1)(A) to the extent reasonably practicable.
|
||||
|
||||
b. ShareAlike.In addition to the conditions in Section 3(a), if You Share
|
||||
Adapted Material You produce, the following conditions also apply.
|
||||
|
||||
1. The Adapter's License You apply must be a Creative Commons license with
|
||||
the same License Elements, this version or later, or a BY-NC-SA Compatible
|
||||
License.
|
||||
|
||||
2. You must include the text of, or the URI or hyperlink to, the Adapter's
|
||||
License You apply. You may satisfy this condition in any reasonable manner
|
||||
based on the medium, means, and context in which You Share Adapted Material.
|
||||
|
||||
3. You may not offer or impose any additional or different terms or conditions
|
||||
on, or apply any Effective Technological Measures to, Adapted Material that
|
||||
restrict exercise of the rights granted under the Adapter's License You apply.
|
||||
|
||||
Section 4 – Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that apply to
|
||||
Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract,
|
||||
reuse, reproduce, and Share all or a substantial portion of the contents of
|
||||
the database for NonCommercial purposes only;
|
||||
|
||||
b. if You include all or a substantial portion of the database contents in
|
||||
a database in which You have Sui Generis Database Rights, then the database
|
||||
in which You have Sui Generis Database Rights (but not its individual contents)
|
||||
is Adapted Material, including for purposes of Section 3(b); and
|
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share all or
|
||||
a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not replace
|
||||
Your obligations under this Public License where the Licensed Rights include
|
||||
other Copyright and Similar Rights.
|
||||
|
||||
Section 5 – Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. Unless otherwise separately undertaken by the Licensor, to the extent possible,
|
||||
the Licensor offers the Licensed Material as-is and as-available, and makes
|
||||
no representations or warranties of any kind concerning the Licensed Material,
|
||||
whether express, implied, statutory, or other. This includes, without limitation,
|
||||
warranties of title, merchantability, fitness for a particular purpose, non-infringement,
|
||||
absence of latent or other defects, accuracy, or the presence or absence of
|
||||
errors, whether or not known or discoverable. Where disclaimers of warranties
|
||||
are not allowed in full or in part, this disclaimer may not apply to You.
|
||||
|
||||
b. To the extent possible, in no event will the Licensor be liable to You
|
||||
on any legal theory (including, without limitation, negligence) or otherwise
|
||||
for any direct, special, indirect, incidental, consequential, punitive, exemplary,
|
||||
or other losses, costs, expenses, or damages arising out of this Public License
|
||||
or use of the Licensed Material, even if the Licensor has been advised of
|
||||
the possibility of such losses, costs, expenses, or damages. Where a limitation
|
||||
of liability is not allowed in full or in part, this limitation may not apply
|
||||
to You.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided above
|
||||
shall be interpreted in a manner that, to the extent possible, most closely
|
||||
approximates an absolute disclaimer and waiver of all liability.
|
||||
|
||||
Section 6 – Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and Similar Rights
|
||||
licensed here. However, if You fail to comply with this Public License, then
|
||||
Your rights under this Public License terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under Section
|
||||
6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided it is cured
|
||||
within 30 days of Your discovery of the violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any right the
|
||||
Licensor may have to seek remedies for Your violations of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the Licensed Material
|
||||
under separate terms or conditions or stop distributing the Licensed Material
|
||||
at any time; however, doing so will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
|
||||
|
||||
Section 7 – Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different terms or
|
||||
conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the Licensed
|
||||
Material not stated herein are separate from and independent of the terms
|
||||
and conditions of this Public License.
|
||||
|
||||
Section 8 – Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and shall not
|
||||
be interpreted to, reduce, limit, restrict, or impose conditions on any use
|
||||
of the Licensed Material that could lawfully be made without permission under
|
||||
this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is deemed
|
||||
unenforceable, it shall be automatically reformed to the minimum extent necessary
|
||||
to make it enforceable. If the provision cannot be reformed, it shall be severed
|
||||
from this Public License without affecting the enforceability of the remaining
|
||||
terms and conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no failure
|
||||
to comply consented to unless expressly agreed to by the Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted as a limitation
|
||||
upon, or waiver of, any privileges and immunities that apply to the Licensor
|
||||
or You, including from the legal processes of any jurisdiction or authority.
|
||||
|
||||
Creative Commons is not a party to its public licenses. Notwithstanding, Creative
|
||||
Commons may elect to apply one of its public licenses to material it publishes
|
||||
and in those instances will be considered the "Licensor." The text of the
|
||||
Creative Commons public licenses is dedicated to the public domain under the
|
||||
CC0 Public Domain Dedication. Except for the limited purpose of indicating
|
||||
that material is shared under a Creative Commons public license or as otherwise
|
||||
permitted by the Creative Commons policies published at creativecommons.org/policies,
|
||||
Creative Commons does not authorize the use of the trademark "Creative Commons"
|
||||
or any other trademark or logo of Creative Commons without its prior written
|
||||
consent including, without limitation, in connection with any unauthorized
|
||||
modifications to any of its public licenses or any other arrangements, understandings,
|
||||
or agreements concerning use of licensed material. For the avoidance of doubt,
|
||||
this paragraph does not form part of the public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
74
README.md
74
README.md
@ -1,74 +0,0 @@
|
||||
# @lfk/mailer
|
||||
[](https://ci.odit.services/lfk/mailer)
|
||||
|
||||
Handles mail generation and sending (pw reset, welcome mail, etc)
|
||||
|
||||
## Dev Setup 🛠
|
||||
> Local dev setup
|
||||
|
||||
1. Rename the .env.example file to .env (you can adjust app port and other settings, if needed) or generate a example env with `yarn && yarn test:generate_env`.
|
||||
2. Install Dependencies
|
||||
```bash
|
||||
yarn
|
||||
```
|
||||
3. Start the server
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
## Templates
|
||||
> The mailer uses html and plaintext templates to generate various mails.
|
||||
> The templates are stored in src/templates by default.
|
||||
|
||||
We provide a set of default templates that we use for the ["Lauf für Kaya!" charity run](https://lauf-fuer-kaya.de).
|
||||
We use handlebars for templateing utilizing i18next for translation - the i18n string format in the templates is : `{{__ "string"}}`
|
||||
You can provide your own templates by replacing the ones we provided before compiling the project or by simply mounting your custom templates into the docker container.
|
||||
|
||||
The server currently needs the following templates to work:
|
||||
* pw-reset.html
|
||||
* pw-reset.txt
|
||||
* test.html
|
||||
* test.txt
|
||||
* welcome_runner.html
|
||||
* welcome_runner.txt
|
||||
|
||||
| Name | Type | Default | Description
|
||||
| - | - | - | -
|
||||
| APP_PORT | Number | 4010 | The port the backend server listens on. Is optional.
|
||||
| NODE_ENV | String | dev | The apps env - influences debug info.
|
||||
| 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_URL | String(url) | "http://localhost:8080" | The URL ponting to the base (root) of the lfk runner system.
|
||||
| MAIL_SERVER | String(FQDN) | None | The mailserver (smtp) used to send mails via nodemailer.
|
||||
| MAIL_PORT | Number | 25 | The mailserver's port (smtp).
|
||||
| MAIL_USER | String | None | The username used to authenticate against the mailserver.
|
||||
| MAIL_PASSWORD | String | None | The password used to authenticate against the mailserver.
|
||||
| MAIL_FROM | String | None | The mail address that mails get sent from.
|
||||
| PRIVACY_URL | String | "/privacy" | The url path that get's attached to the app url to link to the privacy page.
|
||||
| IMPRINT_URL | String | "/imprint" | The url path that get's attached to the app url to link to the imprint page.
|
||||
| COPYRIGHT_OWNER | String | "LfK!" | Text that gets inserted as the "copyright by" owner in the mails.
|
||||
| EVENT_NAME | String | "Testing 4 Kaya" | The event's name - used to generate the mail text.
|
||||
| CONTACT_MAIL | String(email) | MAIL_FROM | Contact mail address listed at the bottom of some mail templates.
|
||||
|
||||
## Recommended Editor
|
||||
|
||||
[Visual Studio Code](https://code.visualstudio.com/)
|
||||
|
||||
### Recommended Extensions
|
||||
|
||||
* will be automatically recommended via ./vscode/extensions.json
|
||||
* we also provide a config for i18n-ally in the .vscode folder
|
||||
|
||||
## Staging
|
||||
### Branches & Tags
|
||||
* vX.Y.Z: Release tags created from the main branch
|
||||
* The version numbers follow the semver standard
|
||||
* A new release tag automaticly triggers the release ci pipeline
|
||||
* main: Protected "release" branch
|
||||
* The latest tag of the docker image get's build from this
|
||||
* New releases get created as tags from this
|
||||
* dev: Current dev branch for merging the different feature branches and bugfixes
|
||||
* The dev tag of the docker image get's build from this
|
||||
* Only push minor changes to this branch!
|
||||
* To merge a feature branch into this please create a pull request
|
||||
* feature/xyz: Feature branches - nameing scheme: `feature/issueid-title`
|
||||
* bugfix/xyz: Branches for bugfixes - nameing scheme:`bugfix/issueid-title`
|
@ -1,9 +1,28 @@
|
||||
version: "3"
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mailer:
|
||||
app:
|
||||
build: .
|
||||
ports:
|
||||
- 4010:4010
|
||||
- "3000:3000"
|
||||
environment:
|
||||
APP_PORT: 4010
|
||||
NODE_ENV: production
|
||||
- NODE_ENV=production
|
||||
- REDIS_URL=redis://redis:6379
|
||||
- SMTP_HOST=${SMTP_HOST:-smtp.mailtrap.io}
|
||||
- SMTP_PORT=${SMTP_PORT:-2525}
|
||||
- SMTP_USER=${SMTP_USER}
|
||||
- SMTP_PASS=${SMTP_PASS}
|
||||
- EMAIL_FROM=${EMAIL_FROM:-noreply@example.com}
|
||||
depends_on:
|
||||
- redis
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
command: redis-server --appendonly yes
|
||||
|
||||
volumes:
|
||||
redis_data:
|
@ -1,4 +0,0 @@
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
};
|
833
licenses.md
833
licenses.md
@ -1,833 +0,0 @@
|
||||
# @odit/class-validator-jsonschema
|
||||
**Author**: Aleksi Pekkala <aleksipekkala@gmail.com>
|
||||
**Repo**: git@github.com:epiphone/class-validator-jsonschema.git
|
||||
**License**: MIT
|
||||
**Description**: Convert class-validator-decorated classes into JSON schema
|
||||
## License Text
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Aleksi Pekkala
|
||||
|
||||
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.
|
||||
|
||||
|
||||
# class-transformer
|
||||
**Author**: [object Object]
|
||||
**Repo**: https://github.com/typestack/class-transformer.git
|
||||
**License**: MIT
|
||||
**Description**: Proper decorator-based transformation / serialization / deserialization of plain javascript objects to class constructors
|
||||
## License Text
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2015-2020 Umed Khudoiberdiev
|
||||
|
||||
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.
|
||||
|
||||
# class-validator
|
||||
**Author**: TypeStack contributors
|
||||
**Repo**: https://github.com/typestack/class-validator.git
|
||||
**License**: MIT
|
||||
**Description**: Decorator-based property validation for classes.
|
||||
## License Text
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2015-2020 TypeStack
|
||||
|
||||
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.
|
||||
|
||||
# consola
|
||||
**Author**: undefined
|
||||
**Repo**: nuxt/consola
|
||||
**License**: MIT
|
||||
**Description**: Elegant Console Logger for Node.js and Browser
|
||||
## License Text
|
||||
|
||||
|
||||
# cors
|
||||
**Author**: Troy Goode <troygoode@gmail.com> (https://github.com/troygoode/)
|
||||
**Repo**: expressjs/cors
|
||||
**License**: MIT
|
||||
**Description**: Node.js CORS middleware
|
||||
## License Text
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2013 Troy Goode <troygoode@gmail.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.
|
||||
|
||||
|
||||
# dotenv
|
||||
**Author**: undefined
|
||||
**Repo**: git://github.com/motdotla/dotenv.git
|
||||
**License**: BSD-2-Clause
|
||||
**Description**: Loads environment variables from .env file
|
||||
## License Text
|
||||
Copyright (c) 2015, Scott Motte
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
# express
|
||||
**Author**: TJ Holowaychuk <tj@vision-media.ca>
|
||||
**Repo**: expressjs/express
|
||||
**License**: MIT
|
||||
**Description**: Fast, unopinionated, minimalist web framework
|
||||
## License Text
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2009-2014 TJ Holowaychuk <tj@vision-media.ca>
|
||||
Copyright (c) 2013-2014 Roman Shtylman <shtylman+expressjs@gmail.com>
|
||||
Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.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.
|
||||
|
||||
|
||||
# handlebars
|
||||
**Author**: Yehuda Katz
|
||||
**Repo**: https://github.com/wycats/handlebars.js.git
|
||||
**License**: MIT
|
||||
**Description**: Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
|
||||
## License Text
|
||||
Copyright (C) 2011-2019 by Yehuda Katz
|
||||
|
||||
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.
|
||||
|
||||
|
||||
# i18next
|
||||
**Author**: Jan Mühlemann <jan.muehlemann@gmail.com> (https://github.com/jamuhl)
|
||||
**Repo**: https://github.com/i18next/i18next.git
|
||||
**License**: MIT
|
||||
**Description**: i18next internationalization framework
|
||||
## License Text
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 i18next
|
||||
|
||||
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.
|
||||
|
||||
|
||||
# i18next-fs-backend
|
||||
**Author**: undefined
|
||||
**Repo**: git@github.com:i18next/i18next-fs-backend.git
|
||||
**License**: MIT
|
||||
**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
|
||||
|
||||
|
||||
# nodemailer
|
||||
**Author**: Andris Reinman
|
||||
**Repo**: https://github.com/nodemailer/nodemailer.git
|
||||
**License**: MIT
|
||||
**Description**: Easy as cake e-mail sending from your Node.js applications
|
||||
## License Text
|
||||
Copyright (c) 2011-2019 Andris Reinman
|
||||
|
||||
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 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.
|
||||
|
||||
|
||||
# reflect-metadata
|
||||
**Author**: [object Object]
|
||||
**Repo**: https://github.com/rbuckton/reflect-metadata.git
|
||||
**License**: Apache-2.0
|
||||
**Description**: Polyfill for Metadata Reflection API
|
||||
## License Text
|
||||
Apache License
|
||||
|
||||
Version 2.0, January 2004
|
||||
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
# routing-controllers
|
||||
**Author**: [object Object]
|
||||
**Repo**: https://github.com/typestack/routing-controllers.git
|
||||
**License**: MIT
|
||||
**Description**: Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
|
||||
## License Text
|
||||
|
||||
|
||||
# routing-controllers-openapi
|
||||
**Author**: Aleksi Pekkala <aleksipekkala@gmail.com>
|
||||
**Repo**: git@github.com:epiphone/routing-controllers-openapi
|
||||
**License**: MIT
|
||||
**Description**: Runtime OpenAPI v3 spec generation for routing-controllers
|
||||
## License Text
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Aleksi Pekkala
|
||||
|
||||
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.
|
||||
|
||||
|
||||
# @odit/license-exporter
|
||||
**Author**: ODIT.Services
|
||||
**Repo**: https://git.odit.services/odit/license-exporter
|
||||
**License**: MIT
|
||||
**Description**: A simple license crawler for crediting open source work
|
||||
## License Text
|
||||
MIT License Copyright (c) 2020 ODIT.Services (info@odit.services)
|
||||
|
||||
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 (including the next
|
||||
paragraph) 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.
|
||||
|
||||
|
||||
# @types/express
|
||||
**Author**: undefined
|
||||
**Repo**: https://github.com/DefinitelyTyped/DefinitelyTyped.git
|
||||
**License**: MIT
|
||||
**Description**: TypeScript definitions for Express
|
||||
## License Text
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
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
|
||||
|
||||
|
||||
# @types/jest
|
||||
**Author**: undefined
|
||||
**Repo**: https://github.com/DefinitelyTyped/DefinitelyTyped.git
|
||||
**License**: MIT
|
||||
**Description**: TypeScript definitions for Jest
|
||||
## License Text
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
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
|
||||
|
||||
|
||||
# @types/node
|
||||
**Author**: undefined
|
||||
**Repo**: https://github.com/DefinitelyTyped/DefinitelyTyped.git
|
||||
**License**: MIT
|
||||
**Description**: TypeScript definitions for Node.js
|
||||
## License Text
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
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
|
||||
|
||||
|
||||
# @types/nodemailer
|
||||
**Author**: undefined
|
||||
**Repo**: https://github.com/DefinitelyTyped/DefinitelyTyped.git
|
||||
**License**: MIT
|
||||
**Description**: TypeScript definitions for Nodemailer
|
||||
## License Text
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
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
|
||||
|
||||
|
||||
# axios
|
||||
**Author**: Matt Zabriskie
|
||||
**Repo**: https://github.com/axios/axios.git
|
||||
**License**: MIT
|
||||
**Description**: Promise based HTTP client for the browser and node.js
|
||||
## License Text
|
||||
Copyright (c) 2014-present Matt Zabriskie
|
||||
|
||||
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
|
||||
**Author**: undefined
|
||||
**Repo**: git+https://github.com/screendriver/cp-cli.git
|
||||
**License**: MIT
|
||||
**Description**: A 'cp' CLI util for Node.js
|
||||
## License Text
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Christian Rackerseder
|
||||
|
||||
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.
|
||||
|
||||
|
||||
# jest
|
||||
**Author**: undefined
|
||||
**Repo**: https://github.com/facebook/jest
|
||||
**License**: MIT
|
||||
**Description**: Delightful JavaScript Testing.
|
||||
## License Text
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
# nodemon
|
||||
**Author**: [object Object]
|
||||
**Repo**: https://github.com/remy/nodemon.git
|
||||
**License**: MIT
|
||||
**Description**: Simple monitor script for use during development of a Node.js app.
|
||||
## License Text
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2010 - present, Remy Sharp, https://remysharp.com <remy@remysharp.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.
|
||||
|
||||
|
||||
# release-it
|
||||
**Author**: [object Object]
|
||||
**Repo**: https://github.com/release-it/release-it.git
|
||||
**License**: MIT
|
||||
**Description**: Generic CLI tool to automate versioning and package publishing related tasks.
|
||||
## License Text
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Lars Kappert
|
||||
|
||||
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.
|
||||
|
||||
|
||||
# rimraf
|
||||
**Author**: Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)
|
||||
**Repo**: git://github.com/isaacs/rimraf.git
|
||||
**License**: ISC
|
||||
**Description**: A deep deletion module for node (like `rm -rf`)
|
||||
## License Text
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
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
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 bahmutov
|
||||
|
||||
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.
|
||||
|
||||
|
||||
# ts-jest
|
||||
**Author**: Kulshekhar Kabra <kulshekhar@users.noreply.github.com> (https://github.com/kulshekhar)
|
||||
**Repo**: git+https://github.com/kulshekhar/ts-jest.git
|
||||
**License**: MIT
|
||||
**Description**: A preprocessor with source maps support to help use TypeScript with Jest
|
||||
## License Text
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016-2018
|
||||
|
||||
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.
|
||||
|
||||
|
||||
# ts-node
|
||||
**Author**: [object Object]
|
||||
**Repo**: git://github.com/TypeStrong/ts-node.git
|
||||
**License**: MIT
|
||||
**Description**: TypeScript execution environment and REPL for node.js, with source map support
|
||||
## License Text
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.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.
|
||||
|
||||
|
||||
# typescript
|
||||
**Author**: Microsoft Corp.
|
||||
**Repo**: https://github.com/Microsoft/TypeScript.git
|
||||
**License**: Apache-2.0
|
||||
**Description**: TypeScript is a language for application scale JavaScript development
|
||||
## License Text
|
||||
Apache License
|
||||
|
||||
Version 2.0, January 2004
|
||||
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
99
package.json
99
package.json
@ -1,92 +1,23 @@
|
||||
{
|
||||
"name": "@odit/lfk-mailer",
|
||||
"version": "0.1.2",
|
||||
"description": "The document mailer for the LfK! runner system. This generates and sends mails (password reset, welcome, ...)",
|
||||
"main": "src/app.ts",
|
||||
"name": "email-microservice",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "nodemon src/app.ts",
|
||||
"build": "rimraf ./dist && tsc && cp-cli ./src/templates ./dist/templates && cp-cli ./src/locales ./dist/locales",
|
||||
"licenses:export": "license-exporter --markdown",
|
||||
"release": "release-it --only-version",
|
||||
"translations:sort": "node ./scripts/sort_translations.js",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watchAll",
|
||||
"test:generate_env": "ts-node ./scripts/create_testenv.ts",
|
||||
"test:ci": "npm run test:generate_env && npm run test:ci:run",
|
||||
"test:ci:run": "start-server-and-test dev http://localhost:4010/docs/openapi.json test"
|
||||
"dev": "bun --watch src/index.ts",
|
||||
"start": "bun src/index.ts"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@git.odit.services:lfk/mailer.git"
|
||||
},
|
||||
"keywords": [
|
||||
"odit",
|
||||
"lfk",
|
||||
"mail",
|
||||
"node"
|
||||
],
|
||||
"author": {
|
||||
"name": "ODIT.Services",
|
||||
"email": "info@odit.services",
|
||||
"url": "https://odit.services"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Philipp Dormann",
|
||||
"email": "philipp@philippdormann.de",
|
||||
"url": "https://philippdormann.de"
|
||||
},
|
||||
{
|
||||
"name": "Nicolai Ort",
|
||||
"email": "info@nicolai-ort.com",
|
||||
"url": "https://nicolai-ort.com"
|
||||
}
|
||||
],
|
||||
"license": "CC-BY-NC-SA-4.0",
|
||||
"dependencies": {
|
||||
"@odit/class-validator-jsonschema": "^2.1.1",
|
||||
"class-transformer": "0.3.1",
|
||||
"class-validator": "^0.13.1",
|
||||
"consola": "^2.15.3",
|
||||
"cors": "^2.8.5",
|
||||
"dotenv": "^8.2.0",
|
||||
"express": "^4.17.1",
|
||||
"handlebars": "^4.7.6",
|
||||
"i18next": "^19.8.7",
|
||||
"i18next-fs-backend": "^1.0.8",
|
||||
"nodemailer": "^6.5.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"routing-controllers": "0.9.0-alpha.6",
|
||||
"routing-controllers-openapi": "2.2.0"
|
||||
"@hono/node-server": "^1.3.3",
|
||||
"@hono/swagger-ui": "^0.2.1",
|
||||
"@hono/zod-openapi": "^0.9.5",
|
||||
"@hono/zod-validator": "^0.1.11",
|
||||
"bullmq": "^5.1.1",
|
||||
"hono": "^4.0.0",
|
||||
"ioredis": "^5.3.2",
|
||||
"zod": "^3.22.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@odit/license-exporter": "^0.0.10",
|
||||
"@types/express": "^4.17.11",
|
||||
"@types/jest": "^26.0.20",
|
||||
"@types/node": "^14.14.22",
|
||||
"@types/nodemailer": "^6.4.0",
|
||||
"axios": "^0.21.1",
|
||||
"cp-cli": "^2.0.0",
|
||||
"jest": "^26.6.3",
|
||||
"nodemon": "^2.0.7",
|
||||
"release-it": "^14.2.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"start-server-and-test": "^1.12.0",
|
||||
"ts-jest": "^26.5.2",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.1.3"
|
||||
},
|
||||
"release-it": {
|
||||
"git": {
|
||||
"commit": true,
|
||||
"requireCleanWorkingDir": false,
|
||||
"commitMessage": "🚀Bumped version to v${version}",
|
||||
"requireBranch": "dev",
|
||||
"push": false,
|
||||
"tag": false
|
||||
},
|
||||
"npm": {
|
||||
"publish": false
|
||||
}
|
||||
"@types/node": "^20.10.4",
|
||||
"bun-types": "latest"
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
import consola from "consola";
|
||||
import fs from "fs";
|
||||
import nodemailer from "nodemailer";
|
||||
|
||||
|
||||
nodemailer.createTestAccount((err, account) => {
|
||||
if (err) {
|
||||
console.error('Failed to create a testing account. ' + err.message);
|
||||
return process.exit(1);
|
||||
}
|
||||
let apikey = '';
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const charactersLength = characters.length;
|
||||
for (var i = 0; i < 64; i++) {
|
||||
apikey += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
const env = `
|
||||
NODE_ENV=dev
|
||||
MAIL_SERVER=${account.smtp.host}
|
||||
MAIL_PORT=${account.smtp.port}
|
||||
MAIL_USER=${account.user}
|
||||
MAIL_PASSWORD=${account.pass}
|
||||
MAIL_FROM=${account.user}
|
||||
API_KEY=${apikey}
|
||||
`
|
||||
|
||||
try {
|
||||
fs.writeFileSync("./.env", env, { encoding: "utf-8" });
|
||||
consola.success("Exported ci env to .env");
|
||||
} catch (error) {
|
||||
consola.error("Couldn't export the ci env");
|
||||
}
|
||||
|
||||
});
|
@ -1,16 +0,0 @@
|
||||
const fs = require('fs');
|
||||
// get all language files
|
||||
const files = fs.readdirSync('./src/locales/');
|
||||
files.forEach((f) => {
|
||||
// read file as object
|
||||
const unordered = JSON.parse(fs.readFileSync(`src/locales/${f}`));
|
||||
// order object by keys alpabetically A-Z
|
||||
const ordered = Object.keys(unordered).sort().reduce((obj, key) => {
|
||||
obj[key] = unordered[key];
|
||||
return obj;
|
||||
}, {});
|
||||
// format output as json for commit diff compatibility
|
||||
const out = JSON.stringify(ordered, 0, 4);
|
||||
// write output file
|
||||
fs.writeFileSync(`src/locales/${f}`, out);
|
||||
});
|
198
src/Mailer.ts
198
src/Mailer.ts
@ -1,198 +0,0 @@
|
||||
import fs from "fs";
|
||||
import Handlebars from 'handlebars';
|
||||
import i18next from "i18next";
|
||||
import Backend from 'i18next-fs-backend';
|
||||
import nodemailer from 'nodemailer';
|
||||
import { MailOptions } from 'nodemailer/lib/json-transport';
|
||||
import Mail from 'nodemailer/lib/mailer';
|
||||
import path from 'path';
|
||||
import { config } from './config';
|
||||
import { MailServerConfigError } from './errors/MailErrors';
|
||||
|
||||
|
||||
/**
|
||||
* This class is responsible for all mail sending.
|
||||
* This uses the html and plaintext templates from src/templates.
|
||||
*/
|
||||
export class Mailer {
|
||||
private transport: Mail;
|
||||
private static interpolations = { copyright_owner: config.copyright_owner, event_name: config.event_name, contact_mail: config.contact_mail }
|
||||
|
||||
/**
|
||||
* Main constructor.
|
||||
* Initializes i18n(ext), Handlebars and puppeteer.
|
||||
*/
|
||||
constructor() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main constructor.
|
||||
* Initializes i18n(ext), Handlebars and puppeteer.
|
||||
*/
|
||||
public async init() {
|
||||
await i18next
|
||||
.use(Backend)
|
||||
.init({
|
||||
fallbackLng: 'en',
|
||||
lng: 'en',
|
||||
backend: {
|
||||
loadPath: path.join(__dirname, '/locales/{{lng}}.json')
|
||||
}
|
||||
});
|
||||
await Handlebars.registerHelper('__',
|
||||
function (str) {
|
||||
return i18next.t(str, Mailer.interpolations).toString();
|
||||
}
|
||||
);
|
||||
this.transport = nodemailer.createTransport({
|
||||
host: config.mail_server,
|
||||
port: config.mail_port,
|
||||
auth: {
|
||||
user: config.mail_user,
|
||||
pass: config.mail_password
|
||||
}
|
||||
});
|
||||
|
||||
this.transport.verify(function (error, success) {
|
||||
if (error) {
|
||||
throw new MailServerConfigError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for sending a reset mail from the reset mail template.
|
||||
* @param to_address The address the mail will be sent to. Should always get pulled from a user object.
|
||||
* @param token The requested password reset token - will be combined with the app_url to generate a password reset link.
|
||||
*/
|
||||
public async sendResetMail(to_address: string, token: string, locale: string = "en") {
|
||||
await i18next.changeLanguage(locale);
|
||||
|
||||
const replacements = {
|
||||
recipient_mail: to_address,
|
||||
copyright_owner: config.copyright_owner,
|
||||
link_imprint: `${config.app_url}/imprint`,
|
||||
link_privacy: `${config.app_url}/privacy`,
|
||||
reset_link: `${config.app_url}/reset/${(Buffer.from(token)).toString("base64")}`
|
||||
}
|
||||
|
||||
const template_html = Handlebars.compile(fs.readFileSync(__dirname + '/templates/pw-reset.html', { encoding: 'utf8' }));
|
||||
const template_txt = Handlebars.compile(fs.readFileSync(__dirname + '/templates/pw-reset.txt', { encoding: 'utf8' }));
|
||||
const body_html = template_html(replacements);
|
||||
const body_txt = template_txt(replacements);
|
||||
|
||||
const mail: MailOptions = {
|
||||
to: to_address,
|
||||
subject: i18next.t("lfk-password-reset", Mailer.interpolations).toString(),
|
||||
text: body_txt,
|
||||
html: body_html
|
||||
};
|
||||
await this.sendMail(mail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for sending a test mail from the test mail template.
|
||||
* @param to_address The address the mail will be sent to - usually the FROM address.
|
||||
*/
|
||||
public async sendTestMail(locale: string = "en") {
|
||||
await i18next.changeLanguage(locale);
|
||||
const to_address: string = config.mail_from;
|
||||
const replacements = {
|
||||
recipient_mail: to_address,
|
||||
copyright_owner: config.copyright_owner,
|
||||
link_imprint: `${config.app_url}/imprint`,
|
||||
link_privacy: `${config.app_url}/privacy`
|
||||
}
|
||||
|
||||
const template_html = Handlebars.compile(fs.readFileSync(__dirname + '/templates/test.html', { encoding: 'utf8' }));
|
||||
const template_txt = Handlebars.compile(fs.readFileSync(__dirname + '/templates/test.txt', { encoding: 'utf8' }));
|
||||
const body_html = template_html(replacements);
|
||||
const body_txt = template_txt(replacements);
|
||||
|
||||
const mail: MailOptions = {
|
||||
to: to_address,
|
||||
subject: i18next.t("test-mail", Mailer.interpolations).toString(),
|
||||
text: body_txt,
|
||||
html: body_html
|
||||
};
|
||||
await this.sendMail(mail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for sending a reset mail from the reset mail template.
|
||||
* @param to_address The address the mail will be sent to. Should always get pulled from a runner object.
|
||||
* @param token The runner's selfservice token - will be combined with the app_url to generate a selfservice profile link.
|
||||
*/
|
||||
public async sendWelcomeMail(to_address: string, token: string, locale: string = "en") {
|
||||
await i18next.changeLanguage(locale);
|
||||
token = Buffer.from(token).toString("base64");
|
||||
|
||||
const replacements = {
|
||||
recipient_mail: to_address,
|
||||
copyright_owner: config.copyright_owner,
|
||||
link_imprint: `${config.app_url}/imprint`,
|
||||
link_privacy: `${config.app_url}/privacy`,
|
||||
selfservice_link: `${config.app_url}/selfservice/profile/${token}`,
|
||||
forgot_link: `${config.app_url}/selfservice/`,
|
||||
contact_mail: config.contact_mail,
|
||||
event_name: config.event_name
|
||||
}
|
||||
|
||||
const template_html = Handlebars.compile(fs.readFileSync(__dirname + '/templates/welcome_runner.html', { encoding: 'utf8' }));
|
||||
const template_txt = Handlebars.compile(fs.readFileSync(__dirname + '/templates/welcome_runner.txt', { encoding: 'utf8' }));
|
||||
const body_html = template_html(replacements);
|
||||
const body_txt = template_txt(replacements);
|
||||
|
||||
const mail: MailOptions = {
|
||||
to: to_address,
|
||||
subject: i18next.t("event_name-registration", Mailer.interpolations).toString(),
|
||||
text: body_txt,
|
||||
html: body_html
|
||||
};
|
||||
await this.sendMail(mail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for sending a selfservice link forgotten mail from the runner_forgot template.
|
||||
* @param to_address The address the mail will be sent to. Should always get pulled from a runner object.
|
||||
* @param token The runner's selfservice token - will be combined with the app_url to generate a selfservice profile link.
|
||||
*/
|
||||
public async sendSelfserviceForgottenMail(to_address: string, token: string, locale: string = "en") {
|
||||
await i18next.changeLanguage(locale);
|
||||
token = Buffer.from(token).toString("base64");
|
||||
|
||||
const replacements = {
|
||||
recipient_mail: to_address,
|
||||
copyright_owner: config.copyright_owner,
|
||||
link_imprint: `${config.app_url}/imprint`,
|
||||
link_privacy: `${config.app_url}/privacy`,
|
||||
selfservice_link: `${config.app_url}/selfservice/profile/${token}`,
|
||||
forgot_link: `${config.app_url}/selfservice/`,
|
||||
contact_mail: config.contact_mail,
|
||||
event_name: config.event_name
|
||||
}
|
||||
|
||||
const template_html = Handlebars.compile(fs.readFileSync(__dirname + '/templates/runner_forgot.html', { encoding: 'utf8' }));
|
||||
const template_txt = Handlebars.compile(fs.readFileSync(__dirname + '/templates/runner_forgot.txt', { encoding: 'utf8' }));
|
||||
const body_html = template_html(replacements);
|
||||
const body_txt = template_txt(replacements);
|
||||
|
||||
const mail: MailOptions = {
|
||||
to: to_address,
|
||||
subject: i18next.t("your-event_name-profile", Mailer.interpolations).toString(),
|
||||
text: body_txt,
|
||||
html: body_html
|
||||
};
|
||||
await this.sendMail(mail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper function for sending a mail via this object's transporter.
|
||||
* @param mail MailOptions object containing the
|
||||
*/
|
||||
public async sendMail(mail: MailOptions) {
|
||||
mail.from = config.mail_from;
|
||||
await this.transport.sendMail(mail);
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
import { MetadataArgsStorage } from 'routing-controllers';
|
||||
import { routingControllersToSpec } from 'routing-controllers-openapi';
|
||||
import { config } from './config';
|
||||
|
||||
/**
|
||||
* This function generates a the openapi spec from route metadata and type schemas.
|
||||
* @param storage MetadataArgsStorage object generated by routing-controllers.
|
||||
* @param schemas MetadataArgsStorage object generated by class-validator-jsonschema.
|
||||
*/
|
||||
export function generateSpec(storage: MetadataArgsStorage, schemas) {
|
||||
return routingControllersToSpec(
|
||||
storage,
|
||||
{},
|
||||
{
|
||||
components: {
|
||||
schemas,
|
||||
"securitySchemes": {
|
||||
"AuthToken": {
|
||||
"type": "apiKey",
|
||||
"in": "query",
|
||||
"name": "key",
|
||||
description: "A simple api key. See the README's env section for more details."
|
||||
}
|
||||
}
|
||||
},
|
||||
info: {
|
||||
description: "The the API for the LfK! mailer.",
|
||||
title: "LfK! mailer API",
|
||||
version: config.version
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
31
src/app.ts
31
src/app.ts
@ -1,31 +0,0 @@
|
||||
import consola from "consola";
|
||||
import "reflect-metadata";
|
||||
import { createExpressServer } from "routing-controllers";
|
||||
import { config, e as errors } from './config';
|
||||
import loaders from "./loaders/index";
|
||||
import AuthChecker from './middlewares/AuthChecker';
|
||||
import { ErrorHandler } from './middlewares/ErrorHandler';
|
||||
|
||||
const CONTROLLERS_FILE_EXTENSION = process.env.NODE_ENV === 'production' ? 'js' : 'ts';
|
||||
const app = createExpressServer({
|
||||
middlewares: [ErrorHandler],
|
||||
authorizationChecker: AuthChecker,
|
||||
development: config.development,
|
||||
cors: true,
|
||||
controllers: [`${__dirname}/controllers/*.${CONTROLLERS_FILE_EXTENSION}`],
|
||||
});
|
||||
|
||||
async function main() {
|
||||
await loaders(app);
|
||||
app.listen(config.internal_port, () => {
|
||||
consola.success(
|
||||
`⚡️[server]: Server is running at http://localhost:${config.internal_port}`
|
||||
);
|
||||
});
|
||||
}
|
||||
if (errors === 0) {
|
||||
main();
|
||||
} else {
|
||||
consola.error("error");
|
||||
// something's wrong
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
import consola from "consola";
|
||||
import { config as configDotenv } from 'dotenv';
|
||||
|
||||
configDotenv();
|
||||
export const config = {
|
||||
internal_port: parseInt(process.env.APP_PORT) || 4010,
|
||||
development: process.env.NODE_ENV === "production",
|
||||
version: process.env.VERSION || require('../package.json').version,
|
||||
api_key: getApiKey(),
|
||||
app_url: process.env.APP_URL || "http://localhost:8080",
|
||||
mail_server: process.env.MAIL_SERVER,
|
||||
mail_port: Number(process.env.MAIL_PORT) || 25,
|
||||
mail_user: process.env.MAIL_USER,
|
||||
mail_password: process.env.MAIL_PASSWORD,
|
||||
mail_from: process.env.MAIL_FROM,
|
||||
privacy_url: process.env.PRIVACY_URL || "/privacy",
|
||||
imprint_url: process.env.IMPRINT_URL || "/imprint",
|
||||
copyright_owner: process.env.COPYRIGHT_OWNER || "LfK!",
|
||||
event_name: process.env.EVENT_NAME || "Testing 4 Kaya!",
|
||||
contact_mail: process.env.CONTACT_MAIL || process.env.MAIL_FROM,
|
||||
}
|
||||
let errors = 0
|
||||
if (typeof config.internal_port !== "number") {
|
||||
errors++
|
||||
}
|
||||
if (typeof config.development !== "boolean") {
|
||||
errors++
|
||||
}
|
||||
|
||||
function getApiKey(): string {
|
||||
const key = process.env.API_KEY;
|
||||
if (!key) {
|
||||
consola.info("No API key set - generating a random one...");
|
||||
let result = '';
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const charactersLength = characters.length;
|
||||
for (var i = 0; i < 64; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
consola.info(`API KEY: ${result}`)
|
||||
return result;
|
||||
}
|
||||
if (key.length < 64) {
|
||||
consola.error(`API key is too short - minimum: 64, current: ${key.length}`)
|
||||
throw new Error("API_KEY too short.")
|
||||
}
|
||||
return key
|
||||
}
|
||||
export let e = errors
|
14
src/config/env.ts
Normal file
14
src/config/env.ts
Normal file
@ -0,0 +1,14 @@
|
||||
export const config = {
|
||||
smtp: {
|
||||
host: process.env.SMTP_HOST || 'smtp.mailtrap.io',
|
||||
port: Number(process.env.SMTP_PORT) || 2525,
|
||||
user: process.env.SMTP_USER || '',
|
||||
pass: process.env.SMTP_PASS || ''
|
||||
},
|
||||
email: {
|
||||
from: process.env.EMAIL_FROM || 'noreply@example.com'
|
||||
},
|
||||
redis: {
|
||||
url: process.env.REDIS_URL || 'redis://localhost:6379'
|
||||
}
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
import { Authorized, Body, JsonController, Post, QueryParam } from 'routing-controllers';
|
||||
import { OpenAPI } from 'routing-controllers-openapi';
|
||||
import { Mailer } from '../Mailer';
|
||||
import { locales } from '../models/LocaleEnum';
|
||||
import { MailTypes } from '../models/MailTypeEnum';
|
||||
import { ResetMail } from '../models/ResetMail';
|
||||
import { SuccessResponse } from '../models/SuccessResponse';
|
||||
import { WelcomeMail } from '../models/WelcomeMail';
|
||||
|
||||
/**
|
||||
* The mail controller handels all endpoints concerning Mail sending.
|
||||
*/
|
||||
@JsonController()
|
||||
@Authorized()
|
||||
@OpenAPI({ security: [{ "AuthToken": [] }] })
|
||||
export class MailController {
|
||||
private mailer: Mailer = new Mailer();
|
||||
private initialized: boolean = false;
|
||||
|
||||
@Post('/reset')
|
||||
@OpenAPI({ description: "Sends reset mails", parameters: [{ in: "query", name: "locale", schema: { type: "string", enum: ["de", "en"] } }] })
|
||||
async sendReset(@Body({ validate: true }) mailOptions: ResetMail, @QueryParam("locale") locale: locales) {
|
||||
if (!this.initialized) {
|
||||
await this.mailer.init();
|
||||
this.initialized = true;
|
||||
}
|
||||
try {
|
||||
this.mailer.sendResetMail(mailOptions.address, mailOptions.resetKey, locale?.toString())
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
return new SuccessResponse(MailTypes.PASSWORD_RESET, locale);
|
||||
}
|
||||
|
||||
@Post('/test')
|
||||
@OpenAPI({ description: "Sends test mails", parameters: [{ in: "query", name: "locale", schema: { type: "string", enum: ["de", "en"] } }] })
|
||||
async sendTest(@QueryParam("locale") locale: locales) {
|
||||
if (!this.initialized) {
|
||||
await this.mailer.init();
|
||||
this.initialized = true;
|
||||
}
|
||||
try {
|
||||
this.mailer.sendTestMail(locale?.toString())
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
throw error;
|
||||
}
|
||||
return new SuccessResponse(MailTypes.TEST, locale);
|
||||
}
|
||||
|
||||
@Post('/registration')
|
||||
@OpenAPI({ description: "Sends registration welcome mails", parameters: [{ in: "query", name: "locale", schema: { type: "string", enum: ["de", "en"] } }] })
|
||||
async sendRegistrationWelcome(@Body({ validate: true }) mailOptions: WelcomeMail, @QueryParam("locale") locale: locales) {
|
||||
if (!this.initialized) {
|
||||
await this.mailer.init();
|
||||
this.initialized = true;
|
||||
}
|
||||
try {
|
||||
this.mailer.sendWelcomeMail(mailOptions.address, mailOptions.selfserviceToken, locale?.toString())
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
throw error;
|
||||
}
|
||||
return new SuccessResponse(MailTypes.RUNNER_WELCOME, locale);
|
||||
}
|
||||
|
||||
@Post('/registration_forgot')
|
||||
@OpenAPI({ description: "Sends selfservice link forgotten mails", parameters: [{ in: "query", name: "locale", schema: { type: "string", enum: ["de", "en"] } }] })
|
||||
async sendSelfserviceForgotten(@Body({ validate: true }) mailOptions: WelcomeMail, @QueryParam("locale") locale: locales) {
|
||||
if (!this.initialized) {
|
||||
await this.mailer.init();
|
||||
this.initialized = true;
|
||||
}
|
||||
try {
|
||||
this.mailer.sendSelfserviceForgottenMail(mailOptions.address, mailOptions.selfserviceToken, locale?.toString())
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
throw error;
|
||||
}
|
||||
return new SuccessResponse(MailTypes.RUNNER_FORGOT, locale);
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
import { Get, JsonController } from 'routing-controllers';
|
||||
import { OpenAPI } from 'routing-controllers-openapi';
|
||||
import { config } from '../config';
|
||||
|
||||
/**
|
||||
* The statuscontroller provides simple endpoints concerning basic information about the server.
|
||||
*/
|
||||
@JsonController()
|
||||
export class StatusController {
|
||||
@Get('/version')
|
||||
@OpenAPI({ description: "A very basic endpoint that just returns the curent package version." })
|
||||
getVersion() {
|
||||
return {
|
||||
"version": config.version
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
import { IsString } from 'class-validator'
|
||||
|
||||
/**
|
||||
* Error to throw when a permission couldn't be found.
|
||||
*/
|
||||
export class MailServerConfigError extends Error {
|
||||
@IsString()
|
||||
name = "MailServerConfigError"
|
||||
|
||||
@IsString()
|
||||
message = "The SMTP server you provided couldn't be reached!"
|
||||
}
|
21
src/index.ts
Normal file
21
src/index.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { Hono } from 'hono'
|
||||
import { logger } from 'hono/logger'
|
||||
import { prettyJSON } from 'hono/pretty-json'
|
||||
import { emailRouter } from './routes/email'
|
||||
import { createSwaggerUI } from './swagger'
|
||||
|
||||
const app = new Hono()
|
||||
|
||||
app.use('*', logger())
|
||||
app.use('*', prettyJSON())
|
||||
|
||||
app.route('/api/v1/email', emailRouter)
|
||||
app.get('/swagger', createSwaggerUI())
|
||||
|
||||
const port = process.env.PORT || 3000
|
||||
console.log(`Server is running on port ${port}`)
|
||||
|
||||
export default {
|
||||
port,
|
||||
fetch: app.fetch
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
import { Application } from "express";
|
||||
/**
|
||||
* Loader for express related configurations.
|
||||
* Configures proxy trusts, globally used middlewares and other express features.
|
||||
*/
|
||||
export default async (app: Application) => {
|
||||
app.enable('trust proxy');
|
||||
app.disable('x-powered-by');
|
||||
app.disable('x-served-by');
|
||||
return app;
|
||||
};
|
@ -1,13 +0,0 @@
|
||||
import { Application } from "express";
|
||||
import expressLoader from "./express";
|
||||
import openapiLoader from "./openapi";
|
||||
|
||||
/**
|
||||
* Index Loader that executes the other loaders in the right order.
|
||||
* This basicly exists for abstraction and a overall better dev experience.
|
||||
*/
|
||||
export default async (app: Application) => {
|
||||
await openapiLoader(app);
|
||||
await expressLoader(app);
|
||||
return app;
|
||||
};
|
@ -1,24 +0,0 @@
|
||||
import { validationMetadatasToSchemas } from "@odit/class-validator-jsonschema";
|
||||
import express, { Application } from "express";
|
||||
import path from 'path';
|
||||
import { getMetadataArgsStorage } from "routing-controllers";
|
||||
import { generateSpec } from '../apispec';
|
||||
|
||||
/**
|
||||
* Loader for everything openapi related - from creating the schema to serving it via a static route and swaggerUiExpress.
|
||||
* All auth schema related stuff also has to be configured here
|
||||
*/
|
||||
export default async (app: Application) => {
|
||||
const storage = getMetadataArgsStorage();
|
||||
const schemas = validationMetadatasToSchemas({
|
||||
refPointerPrefix: "#/components/schemas/",
|
||||
});
|
||||
|
||||
//Spec creation based on the previously created schemas
|
||||
const spec = generateSpec(storage, schemas);
|
||||
app.get(["/docs/openapi.json", "/docs/swagger.json"], (req, res) => {
|
||||
res.json(spec);
|
||||
});
|
||||
app.use('/docs', express.static(path.join(__dirname, '../static/docs'), { index: "index.html", extensions: ['html'] }));
|
||||
return app;
|
||||
};
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"a-password-reset-for-your-account-got-requested": "Ein Passwort Reset wurde für dein Konto beantragt.",
|
||||
"all-rights-reserved": "Alle Rechte vorbehalten",
|
||||
"event_name-registration": "{{event_name}} Registrierung",
|
||||
"if-you-didnt-register-yourself-you-should-contact-us-to-get-your-data-removed-from-our-systems": "Solltest du dich nicht selbst registriert haben, sende uns bitte eine Mail und wir entfernen deine Daten aus unserem System: ",
|
||||
"if-you-didnt-request-the-reset-please-ignore-this-mail": "Solltest du den Reset nicht beantragt haben kannst du diese Mail einfach ignorieren.",
|
||||
"if-you-ever-loose-the-link-you-can-request-a-new-one-by-visiting-our-website": "Auf unserer Website kannst du jederzeit einen neuen Login-Link beantragen:",
|
||||
"imprint": "Impressum",
|
||||
"lfk-mail-test": "{{copyright_owner}} - Mail test",
|
||||
"lfk-password-reset": "{{copyright_owner}} - Passwort zurücksetzen",
|
||||
"password-reset": "Passwort zurücksetzen",
|
||||
"privacy": "Datenschutz",
|
||||
"reset-password": "Passwort zurücksetzen",
|
||||
"test-mail": "Test mail",
|
||||
"thank-you-for-requesting-a-new-link-to-your-event_name-runner-profile": "Danke, dass du einen neuen Profillink für das {{event_name}} Läuferstem beantragt hast.",
|
||||
"thanks-for-registering-and-welcome-to-the-event_name": "Vielen Dank für die Registrierung beim {{event_name}}",
|
||||
"the-only-thing-you-have-to-do-now-is-to-bring-your-registration-code-with-you": "Bitte bringe deinen Registrierungscode zum Lauf am 21.04.2023 mit.",
|
||||
"this-is-a-test-mail-triggered-by-an-admin-in-the-lfk-backend": "Das ist eine Testmail, die von einem Admin im LfK! Backend erzeugt wurde.",
|
||||
"this-mail-was-sent-to-recipient_mail-because-someone-request-a-mail-test-for-this-mail-address": "Du bekommst diese Mail, weil jemand eine Testmail für deine Mail-Adresse angefragt hat.",
|
||||
"this-mail-was-sent-to-you-because-someone-request-a-password-reset-for-a-account-linked-to-the-mail-address": "Du bekommst diese E-Mail, weil jemand einen Passwort-Reset für deinen Account beantragt hat.",
|
||||
"this-mail-was-sent-to-you-because-someone-requested-a-new-link-to-access-your-profile-for-the-event_name": "Diese E-Mail wurde an dich gesendet, weil jemand einen neuen Link angefordert hat, um auf dein {{event_name}} Profil zuzugreifen.",
|
||||
"this-mail-was-sent-to-you-because-someone-used-your-mail-address-to-register-themselfes-for-the-event_name": "Du bekommst diese Mail, weil jemand deine E-Mail-Adresse verwendet hat, um sich beim {{event_name}} zu registrieren.",
|
||||
"to-prevent-spam-you-can-only-request-a-new-link-every-24hrs": "Um Spam zu vermeiden, kannst du nur alle 24 Stunden einen neuen Link anfordern.",
|
||||
"view-my-data": "Meine Daten",
|
||||
"we-successfully-processed-your-registration": "Wir haben deine Registrierung erfolgreich verarbeitet.",
|
||||
"welcome": "Willkommen",
|
||||
"you-can-view-your-registration-code-lap-times-and-much-more-by-visiting-our-selfservice": "Deinen Registrierungscode, Rundenzeiten und vieles mehr kannst du im Selfservice einsehen:",
|
||||
"your-event_name-profile": "Dein {{event_name}} Profil",
|
||||
"your-password-wont-be-changed-until-you-click-the-reset-link-below-and-set-a-new-one": "Dein Passwort wird erst zurückgesetzt, wenn du den Reset-Link öffnest und ein neues Passwort setzt.",
|
||||
"your-profile": "Dein Profil"
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"a-password-reset-for-your-account-got-requested": "A password reset for your account got requested.",
|
||||
"all-rights-reserved": "All rights reserved.",
|
||||
"event_name-registration": "{{event_name}} Registration",
|
||||
"if-you-didnt-register-yourself-you-should-contact-us-to-get-your-data-removed-from-our-systems": "If you didn't register yourself you should contact us to get your data removed from our systems:",
|
||||
"if-you-didnt-request-the-reset-please-ignore-this-mail": "If you didn't request the reset please ignore this mail.",
|
||||
"if-you-ever-loose-the-link-you-can-request-a-new-one-by-visiting-our-website": "If you ever loose the link you can request a new one by visiting our website:",
|
||||
"imprint": "Imprint",
|
||||
"lfk-mail-test": "{{copyright_owner}} - Mail test",
|
||||
"lfk-password-reset": "{{copyright_owner}} - Password reset",
|
||||
"password-reset": "Password reset",
|
||||
"privacy": "Privacy",
|
||||
"reset-password": "Reset password",
|
||||
"test-mail": "Test mail",
|
||||
"thank-you-for-requesting-a-new-link-to-your-event_name-runner-profile": "Thank you for requesting a new link to your {{event_name}} runner profile.",
|
||||
"thanks-for-registering-and-welcome-to-the-event_name": "Thanks for registering and welcome to the {{event_name}}!",
|
||||
"the-only-thing-you-have-to-do-now-is-to-bring-your-registration-code-with-you": "The only thing you have to do now is to bring your registration code with you.",
|
||||
"this-is-a-test-mail-triggered-by-an-admin-in-the-lfk-backend": "This is a test mail triggered by an admin in the LfK! backend.",
|
||||
"this-mail-was-sent-to-recipient_mail-because-someone-request-a-mail-test-for-this-mail-address": "This mail was sent to you because someone request a mail test for this mail address.",
|
||||
"this-mail-was-sent-to-you-because-someone-request-a-password-reset-for-a-account-linked-to-the-mail-address": "This mail was sent to you because someone request a password reset for a account linked to the mail address.",
|
||||
"this-mail-was-sent-to-you-because-someone-requested-a-new-link-to-access-your-profile-for-the-event_name": "This mail was sent to you, because someone requested a new link to access your profile for the {{event_name}}.",
|
||||
"this-mail-was-sent-to-you-because-someone-used-your-mail-address-to-register-themselfes-for-the-event_name": "This mail was sent to you, because someone used your mail address to register themselves for the {{event_name}}",
|
||||
"to-prevent-spam-you-can-only-request-a-new-link-every-24hrs": "To prevent spam you can only request a new link every 24hrs.",
|
||||
"view-my-data": "View my data",
|
||||
"we-successfully-processed-your-registration": "We successfully processed your registration.",
|
||||
"welcome": "Welcome",
|
||||
"you-can-view-your-registration-code-lap-times-and-much-more-by-visiting-our-selfservice": "You can view your registration code, lap times and much more by visiting our selfservice:",
|
||||
"your-event_name-profile": "Your {{event_name}} profile",
|
||||
"your-password-wont-be-changed-until-you-click-the-reset-link-below-and-set-a-new-one": "Your password won't be changed until you click the reset link below and set a new one.",
|
||||
"your-profile": "Your profile"
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
import { Action } from "routing-controllers";
|
||||
import { config } from '../config';
|
||||
|
||||
/**
|
||||
* Handles authentication via jwt's (Bearer authorization header) for all api endpoints using the @Authorized decorator.
|
||||
* @param action Routing-Controllers action object that provides request and response objects among other stuff.
|
||||
* @param permissions The permissions that the endpoint using @Authorized requires.
|
||||
*/
|
||||
const AuthChecker = async (action: Action) => {
|
||||
const provided_token = action.request.query.key;
|
||||
return provided_token == config.api_key;
|
||||
}
|
||||
|
||||
export default AuthChecker
|
@ -1,14 +0,0 @@
|
||||
import { ExpressErrorMiddlewareInterface, Middleware } from "routing-controllers";
|
||||
|
||||
/**
|
||||
* Our Error handling middlware that returns our custom httperrors to the user.
|
||||
*/
|
||||
@Middleware({ type: "after" })
|
||||
export class ErrorHandler implements ExpressErrorMiddlewareInterface {
|
||||
public error(error: any, request: any, response: any, next: (err: any) => any) {
|
||||
if (response.headersSent) {
|
||||
return;
|
||||
}
|
||||
response.json(error);
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
export enum locales {
|
||||
de = "de",
|
||||
en = "en"
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
export enum MailTypes {
|
||||
PASSWORD_RESET = "PASSWORD_RESET",
|
||||
RUNNER_FORGOT = "RUNNER_FORGOT",
|
||||
RUNNER_WELCOME = "RUNNER_WELCOME",
|
||||
TEST = "TEST"
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
/**
|
||||
* Simple reset mail request class for validation and easier handling.
|
||||
*/
|
||||
export class ResetMail {
|
||||
|
||||
@IsString()
|
||||
@IsEmail()
|
||||
@IsNotEmpty()
|
||||
address: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
resetKey: string;
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
import { IsBoolean, IsString } from 'class-validator';
|
||||
import { locales } from './LocaleEnum';
|
||||
import { MailTypes } from './MailTypeEnum';
|
||||
|
||||
/**
|
||||
* Simple success response class to make everyone happy :)
|
||||
*/
|
||||
export class SuccessResponse {
|
||||
|
||||
@IsBoolean()
|
||||
success: boolean = true;
|
||||
|
||||
@IsString()
|
||||
message: string = "Sent!"
|
||||
|
||||
@IsString()
|
||||
locale: locales;
|
||||
|
||||
@IsString()
|
||||
type: MailTypes;
|
||||
|
||||
constructor(type: MailTypes, locale?: locales) {
|
||||
this.type = type;
|
||||
this.locale = locale || locales.en;
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
/**
|
||||
* Simple welcome mail request class for validation and easier handling.
|
||||
*/
|
||||
export class WelcomeMail {
|
||||
|
||||
@IsString()
|
||||
@IsEmail()
|
||||
@IsNotEmpty()
|
||||
address: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
selfserviceToken: string;
|
||||
}
|
61
src/queues/email.queue.ts
Normal file
61
src/queues/email.queue.ts
Normal file
@ -0,0 +1,61 @@
|
||||
import { Queue, Worker, QueueEvents } from 'bullmq'
|
||||
import { EmailService } from '../services/email'
|
||||
import { config } from '../config/env'
|
||||
import Redis from 'ioredis'
|
||||
|
||||
interface EmailJob {
|
||||
to: string
|
||||
subject: string
|
||||
html: string
|
||||
text: string
|
||||
}
|
||||
|
||||
const connection = new Redis(config.redis.url, {
|
||||
maxRetriesPerRequest: null
|
||||
})
|
||||
|
||||
export const emailQueue = new Queue<EmailJob>('email', {
|
||||
connection,
|
||||
defaultJobOptions: {
|
||||
attempts: 3,
|
||||
backoff: {
|
||||
type: 'exponential',
|
||||
delay: 1000
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const worker = new Worker<EmailJob>(
|
||||
'email',
|
||||
async (job) => {
|
||||
const emailService = new EmailService()
|
||||
await emailService.sendEmail(job.data)
|
||||
},
|
||||
{
|
||||
connection,
|
||||
concurrency: 5,
|
||||
limiter: {
|
||||
max: 100,
|
||||
duration: 1000 * 60 // 100 emails per minute
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const queueEvents = new QueueEvents('email', { connection })
|
||||
|
||||
worker.on('completed', (job) => {
|
||||
console.log(`Email job ${job.id} completed`)
|
||||
})
|
||||
|
||||
worker.on('failed', (job, error) => {
|
||||
console.error(`Email job ${job?.id} failed:`, error)
|
||||
})
|
||||
|
||||
queueEvents.on('waiting', ({ jobId }) => {
|
||||
console.log(`Job ${jobId} is waiting`)
|
||||
})
|
||||
|
||||
process.on('SIGTERM', async () => {
|
||||
await worker.close()
|
||||
await connection.quit()
|
||||
})
|
47
src/routes/email.ts
Normal file
47
src/routes/email.ts
Normal file
@ -0,0 +1,47 @@
|
||||
import { Hono } from 'hono'
|
||||
import { zValidator } from '@hono/zod-validator'
|
||||
import { z } from 'zod'
|
||||
import { EmailService } from '../services/email'
|
||||
import { getEmailTemplate } from '../templates'
|
||||
import { Language } from '../types'
|
||||
|
||||
const emailRouter = new Hono()
|
||||
const emailService = new EmailService()
|
||||
|
||||
const sendEmailSchema = z.object({
|
||||
to: z.string().email(),
|
||||
subject: z.string(),
|
||||
templateName: z.string(),
|
||||
language: z.enum(['en', 'de']),
|
||||
data: z.record(z.any())
|
||||
})
|
||||
|
||||
emailRouter.post('/', zValidator('json', sendEmailSchema), async (c) => {
|
||||
const { to, subject, templateName, language, data } = c.req.valid('json')
|
||||
|
||||
try {
|
||||
const template = getEmailTemplate(templateName, language as Language)
|
||||
await emailService.sendEmail({
|
||||
to,
|
||||
subject,
|
||||
html: template.html(data),
|
||||
text: template.text(data)
|
||||
})
|
||||
|
||||
return c.json({ success: true })
|
||||
} catch (error) {
|
||||
return c.json({ success: false, error: (error as Error).message }, 400)
|
||||
}
|
||||
})
|
||||
|
||||
// Add queue status endpoint
|
||||
emailRouter.get('/status', async (c) => {
|
||||
try {
|
||||
const status = await emailService.getQueueStatus()
|
||||
return c.json(status)
|
||||
} catch (error) {
|
||||
return c.json({ error: (error as Error).message }, 500)
|
||||
}
|
||||
})
|
||||
|
||||
export { emailRouter }
|
43
src/services/email.ts
Normal file
43
src/services/email.ts
Normal file
@ -0,0 +1,43 @@
|
||||
import { emailQueue } from '../queues/email.queue'
|
||||
import { config } from '../config/env'
|
||||
|
||||
interface EmailOptions {
|
||||
to: string
|
||||
subject: string
|
||||
html: string
|
||||
text: string
|
||||
}
|
||||
|
||||
export class EmailService {
|
||||
async sendEmail(options: EmailOptions): Promise<void> {
|
||||
const email = {
|
||||
from: config.email.from,
|
||||
...options
|
||||
}
|
||||
|
||||
// Add to queue instead of sending directly
|
||||
await emailQueue.add('send-email', email, {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: 1000
|
||||
})
|
||||
|
||||
// Log for development
|
||||
await Bun.write('emails.log', JSON.stringify(email) + '\n', { append: true })
|
||||
}
|
||||
|
||||
async getQueueStatus() {
|
||||
const [waiting, active, completed, failed] = await Promise.all([
|
||||
emailQueue.getWaitingCount(),
|
||||
emailQueue.getActiveCount(),
|
||||
emailQueue.getCompletedCount(),
|
||||
emailQueue.getFailedCount()
|
||||
])
|
||||
|
||||
return {
|
||||
waiting,
|
||||
active,
|
||||
completed,
|
||||
failed
|
||||
}
|
||||
}
|
||||
}
|
@ -1,156 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>API Docs</title>
|
||||
<style>
|
||||
:root {
|
||||
--bg-color: #fff;
|
||||
--bg-secondary-color: #f3f3f6;
|
||||
--color-primary: #14854f;
|
||||
--color-lightGrey: #d2d6dd;
|
||||
--color-grey: #747681;
|
||||
--color-darkGrey: #3f4144;
|
||||
--color-error: #d43939;
|
||||
--color-success: #28bd14;
|
||||
--grid-maxWidth: 120rem;
|
||||
--grid-gutter: 2rem;
|
||||
--font-size: 1.6rem;
|
||||
--font-color: #333;
|
||||
--font-family-sans: -apple-system, BlinkMacSystemFont, Avenir, "Avenir Next", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
||||
--font-family-mono: monaco, "Consolas", "Lucida Console", monospace
|
||||
}
|
||||
|
||||
html {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
font-size: 62.5%;
|
||||
line-height: 1.15;
|
||||
-ms-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%
|
||||
}
|
||||
|
||||
*,
|
||||
:after,
|
||||
:before {
|
||||
-webkit-box-sizing: inherit;
|
||||
box-sizing: inherit
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--bg-color);
|
||||
line-height: 1.6;
|
||||
font-size: var(--font-size);
|
||||
color: var(--font-color);
|
||||
font-family: Segoe UI, Helvetica Neue, sans-serif;
|
||||
font-family: var(--font-family-sans);
|
||||
margin: 0;
|
||||
padding: 0
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-weight: 500;
|
||||
margin: .35em 0 .7em
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.5em
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-primary);
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
a:hover:not(.button) {
|
||||
opacity: .75
|
||||
}
|
||||
|
||||
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=color]):not([type=button]):not([type=reset]):not(:disabled):hover {
|
||||
border-color: var(--color-grey)
|
||||
}
|
||||
|
||||
::-webkit-input-placeholder {
|
||||
color: #bdbfc4
|
||||
}
|
||||
|
||||
::-moz-placeholder {
|
||||
color: #bdbfc4
|
||||
}
|
||||
|
||||
:-ms-input-placeholder {
|
||||
color: #bdbfc4
|
||||
}
|
||||
|
||||
::-ms-input-placeholder {
|
||||
color: #bdbfc4
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex
|
||||
}
|
||||
|
||||
.tabs a {
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
.tabs>a {
|
||||
padding: 1rem 2rem;
|
||||
-webkit-box-flex: 0;
|
||||
-ms-flex: 0 1 auto;
|
||||
flex: 0 1 auto;
|
||||
color: var(--color-darkGrey);
|
||||
border-bottom: 2px solid var(--color-lightGrey);
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.tabs>a:hover {
|
||||
opacity: 1;
|
||||
border-bottom: 2px solid var(--color-darkGrey)
|
||||
}
|
||||
|
||||
.is-vertical-align {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center
|
||||
}
|
||||
|
||||
.is-center {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center
|
||||
}
|
||||
|
||||
.is-center {
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="hero">
|
||||
<div class="logo is-center is-vertical-align">
|
||||
<h3>API Docs</h3>
|
||||
</div>
|
||||
<nav class="tabs is-center">
|
||||
<a href="./redoc">ReDoc</a>
|
||||
<a href="./swaggerui">SwaggerUI</a>
|
||||
<a href="./rapidoc">RapiDoc</a>
|
||||
<a href="./openapi.json">Raw Spec (json)</a>
|
||||
</nav>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
220
src/static/docs/rapidoc-min.js
vendored
220
src/static/docs/rapidoc-min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,12 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script type="module" src="./rapidoc-min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<rapi-doc
|
||||
spec-url="/docs/openapi.json"
|
||||
> </rapi-doc>
|
||||
</body>
|
||||
</html>
|
@ -1,18 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>ReDoc</title>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<redoc spec-url='/docs/openapi.json'></redoc>
|
||||
<script src="./redoc.standalone.js"> </script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,58 +0,0 @@
|
||||
<!-- HTML for static distribution bundle build -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Swagger UI</title>
|
||||
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
|
||||
<style>
|
||||
html
|
||||
{
|
||||
box-sizing: border-box;
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after
|
||||
{
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
margin:0;
|
||||
background: #fafafa;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
|
||||
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
|
||||
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
// Begin Swagger UI call region
|
||||
const ui = SwaggerUIBundle({
|
||||
url: "/docs/openapi.json",
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true,
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
layout: "StandaloneLayout"
|
||||
})
|
||||
// End Swagger UI call region
|
||||
|
||||
window.ui = ui
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
124
src/swagger.ts
Normal file
124
src/swagger.ts
Normal file
@ -0,0 +1,124 @@
|
||||
import { OpenAPIHono } from '@hono/zod-openapi'
|
||||
import { swaggerUI } from '@hono/swagger-ui'
|
||||
|
||||
const openapi = new OpenAPIHono()
|
||||
|
||||
const routes = {
|
||||
'/api/v1/email': {
|
||||
post: {
|
||||
summary: 'Send an email',
|
||||
requestBody: {
|
||||
required: true,
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: {
|
||||
type: 'object',
|
||||
required: ['to', 'subject', 'templateName', 'language', 'data'],
|
||||
properties: {
|
||||
to: {
|
||||
type: 'string',
|
||||
format: 'email'
|
||||
},
|
||||
subject: {
|
||||
type: 'string'
|
||||
},
|
||||
templateName: {
|
||||
type: 'string'
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
enum: ['en', 'de']
|
||||
},
|
||||
data: {
|
||||
type: 'object'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
responses: {
|
||||
'200': {
|
||||
description: 'Email queued successfully',
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
success: {
|
||||
type: 'boolean'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'400': {
|
||||
description: 'Bad request or email queueing failed',
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
success: {
|
||||
type: 'boolean'
|
||||
},
|
||||
error: {
|
||||
type: 'string'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
get: {
|
||||
path: '/status',
|
||||
summary: 'Get email queue status',
|
||||
responses: {
|
||||
'200': {
|
||||
description: 'Queue status retrieved successfully',
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
waiting: {
|
||||
type: 'number'
|
||||
},
|
||||
active: {
|
||||
type: 'number'
|
||||
},
|
||||
completed: {
|
||||
type: 'number'
|
||||
},
|
||||
failed: {
|
||||
type: 'number'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const apiDoc = {
|
||||
openapi: '3.0.0',
|
||||
info: {
|
||||
title: 'Email Microservice API',
|
||||
version: '1.0.0',
|
||||
description: 'API for sending templated emails in multiple languages'
|
||||
},
|
||||
paths: routes
|
||||
}
|
||||
|
||||
export const createSwaggerUI = () => {
|
||||
return swaggerUI({
|
||||
url: '/api/docs',
|
||||
spec: apiDoc
|
||||
})
|
||||
}
|
16
src/templates/index.ts
Normal file
16
src/templates/index.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { Language } from '../types'
|
||||
import { welcomeTemplate } from './welcome'
|
||||
import { passwordResetTemplate } from './password-reset'
|
||||
|
||||
const templates = {
|
||||
welcome: welcomeTemplate,
|
||||
passwordReset: passwordResetTemplate
|
||||
}
|
||||
|
||||
export function getEmailTemplate(name: string, language: Language) {
|
||||
const template = templates[name as keyof typeof templates]
|
||||
if (!template) {
|
||||
throw new Error(`Template ${name} not found`)
|
||||
}
|
||||
return template[language]
|
||||
}
|
63
src/templates/password-reset.ts
Normal file
63
src/templates/password-reset.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import { Language } from '../types'
|
||||
|
||||
interface PasswordResetTemplateData {
|
||||
name: string
|
||||
resetLink: string
|
||||
expiresIn: string
|
||||
}
|
||||
|
||||
const en = {
|
||||
html: (data: PasswordResetTemplateData) => `
|
||||
<h1>Password Reset Request</h1>
|
||||
<p>Hello ${data.name},</p>
|
||||
<p>We received a request to reset your password. Click the link below to create a new password:</p>
|
||||
<a href="${data.resetLink}" style="display: inline-block; background: #007bff; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px; margin: 15px 0;">Reset Password</a>
|
||||
<p>This link will expire in ${data.expiresIn}.</p>
|
||||
<p>If you didn't request this password reset, please ignore this email or contact support if you have concerns.</p>
|
||||
<p>Best regards,<br>Your Support Team</p>
|
||||
`,
|
||||
text: (data: PasswordResetTemplateData) => `
|
||||
Password Reset Request
|
||||
|
||||
Hello ${data.name},
|
||||
|
||||
We received a request to reset your password. Use the following link to create a new password:
|
||||
${data.resetLink}
|
||||
|
||||
This link will expire in ${data.expiresIn}.
|
||||
|
||||
If you didn't request this password reset, please ignore this email or contact support if you have concerns.
|
||||
|
||||
Best regards,
|
||||
Your Support Team
|
||||
`
|
||||
}
|
||||
|
||||
const de = {
|
||||
html: (data: PasswordResetTemplateData) => `
|
||||
<h1>Anfrage zum Zurücksetzen des Passworts</h1>
|
||||
<p>Hallo ${data.name},</p>
|
||||
<p>Wir haben eine Anfrage zum Zurücksetzen Ihres Passworts erhalten. Klicken Sie auf den untenstehenden Link, um ein neues Passwort zu erstellen:</p>
|
||||
<a href="${data.resetLink}" style="display: inline-block; background: #007bff; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px; margin: 15px 0;">Passwort zurücksetzen</a>
|
||||
<p>Dieser Link läuft in ${data.expiresIn} ab.</p>
|
||||
<p>Falls Sie diese Anfrage nicht gestellt haben, ignorieren Sie bitte diese E-Mail oder kontaktieren Sie den Support, wenn Sie Bedenken haben.</p>
|
||||
<p>Mit freundlichen Grüßen,<br>Ihr Support-Team</p>
|
||||
`,
|
||||
text: (data: PasswordResetTemplateData) => `
|
||||
Anfrage zum Zurücksetzen des Passworts
|
||||
|
||||
Hallo ${data.name},
|
||||
|
||||
Wir haben eine Anfrage zum Zurücksetzen Ihres Passworts erhalten. Verwenden Sie den folgenden Link, um ein neues Passwort zu erstellen:
|
||||
${data.resetLink}
|
||||
|
||||
Dieser Link läuft in ${data.expiresIn} ab.
|
||||
|
||||
Falls Sie diese Anfrage nicht gestellt haben, ignorieren Sie bitte diese E-Mail oder kontaktieren Sie den Support, wenn Sie Bedenken haben.
|
||||
|
||||
Mit freundlichen Grüßen,
|
||||
Ihr Support-Team
|
||||
`
|
||||
}
|
||||
|
||||
export const passwordResetTemplate: Record<Language, typeof en> = { en, de }
|
@ -1,384 +0,0 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml">
|
||||
<head>
|
||||
<title>{{__ "lfk-password-reset"}}</title> <!-- The title tag shows in email notifications, like Android 4.4. -->
|
||||
<meta charset="utf-8"> <!-- utf-8 works for most cases -->
|
||||
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
|
||||
<meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
|
||||
<meta name="format-detection" content="telephone=no,address=no,email=no,date=no,url=no"> <!-- Tell iOS not to automatically link certain text strings. -->
|
||||
|
||||
<!-- CSS Reset : BEGIN -->
|
||||
<style>
|
||||
/* What it does: Remove spaces around the email design added by some email clients. */
|
||||
/* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
|
||||
html,
|
||||
body {
|
||||
margin: 0 auto !important;
|
||||
padding: 0 !important;
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* What it does: Stops email clients resizing small text. */
|
||||
* {
|
||||
-ms-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
/* What it does: Centers email on Android 4.4 */
|
||||
div[style*="margin: 16px 0"] {
|
||||
margin:0 !important;
|
||||
}
|
||||
|
||||
/* What it does: Stops Outlook from adding extra spacing to tables. */
|
||||
table,
|
||||
td {
|
||||
mso-table-lspace: 0pt !important;
|
||||
mso-table-rspace: 0pt !important;
|
||||
}
|
||||
|
||||
/* What it does: Fixes webkit padding issue. */
|
||||
table {
|
||||
border: 0;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse
|
||||
}
|
||||
|
||||
/* What it does: Forces Samsung Android mail clients to use the entire viewport. */
|
||||
#MessageViewBody,
|
||||
#MessageWebViewDiv{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* What it does: Uses a better rendering method when resizing images in IE. */
|
||||
img {
|
||||
-ms-interpolation-mode:bicubic;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Windows 10 Mail from underlining links despite inline CSS. Styles for underlined links should be inline. */
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* What it does: A work-around for email clients automatically linking certain text strings. */
|
||||
/* iOS */
|
||||
a[x-apple-data-detectors],
|
||||
.unstyle-auto-detected-links a,
|
||||
.aBn {
|
||||
border-bottom: 0 !important;
|
||||
cursor: default !important;
|
||||
color: inherit !important;
|
||||
text-decoration: none !important;
|
||||
font-size: inherit !important;
|
||||
font-family: inherit !important;
|
||||
font-weight: inherit !important;
|
||||
line-height: inherit !important;
|
||||
}
|
||||
u + #body a, /* Gmail */
|
||||
#MessageViewBody a /* Samsung Mail */
|
||||
{
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
font-weight: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Gmail from changing the text color in conversation threads. */
|
||||
.im {
|
||||
color: inherit !important;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Gmail from displaying an download button on large, non-linked images. */
|
||||
.a6S {
|
||||
display: none !important;
|
||||
opacity: 0.01 !important;
|
||||
}
|
||||
/* If the above doesn't work, add a .g-img class to any image in question. */
|
||||
img.g-img + div {
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
/* What it does: Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89 */
|
||||
/* Create one of these media queries for each additional viewport size you'd like to fix */
|
||||
|
||||
/* iPhone 4, 4S, 5, 5S, 5C, and 5SE */
|
||||
@media only screen and (min-device-width: 320px) and (max-device-width: 374px) {
|
||||
u ~ div .email-container {
|
||||
min-width: 320px !important;
|
||||
}
|
||||
}
|
||||
/* iPhone 6, 6S, 7, 8, and X */
|
||||
@media only screen and (min-device-width: 375px) and (max-device-width: 413px) {
|
||||
u ~ div .email-container {
|
||||
min-width: 375px !important;
|
||||
}
|
||||
}
|
||||
/* iPhone 6+, 7+, and 8+ */
|
||||
@media only screen and (min-device-width: 414px) {
|
||||
u ~ div .email-container {
|
||||
min-width: 414px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!-- What it does: Helps DPI scaling in Outlook 2007-2013 -->
|
||||
<!--[if gte mso 9]>
|
||||
<xml>
|
||||
<o:OfficeDocumentSettings>
|
||||
<o:AllowPNG/>
|
||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||
</o:OfficeDocumentSettings>
|
||||
</xml>
|
||||
<![endif]-->
|
||||
|
||||
<!-- CSS Reset : END -->
|
||||
|
||||
<!-- Progressive Enhancements : BEGIN -->
|
||||
<style>
|
||||
/* What it does: Hover styles for buttons and tags */
|
||||
.s-btn__primary:hover {
|
||||
background: #0077CC !important;
|
||||
border-color: #0077CC !important;
|
||||
}
|
||||
.s-btn__white:hover {
|
||||
background: #EFF0F1 !important;
|
||||
border-color: #EFF0F1 !important;
|
||||
}
|
||||
.s-btn__outlined:hover {
|
||||
background: rgba(0,119,204,.05) !important;
|
||||
color: #005999 !important;
|
||||
}
|
||||
.s-tag:hover,
|
||||
.post-tag:hover {
|
||||
border-color: #cee0ed !important;
|
||||
background: #cee0ed !important;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown links that we can't write inline CSS for. */
|
||||
.has-markdown a,
|
||||
.has-markdown a:visited {
|
||||
color: #0077CC !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown code blocks that we can't write inline CSS for. */
|
||||
code {
|
||||
padding: 1px 5px;
|
||||
background-color: #EFF0F1;
|
||||
color: #242729;
|
||||
font-size: 13px;
|
||||
line-height: inherit;
|
||||
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif;
|
||||
}
|
||||
pre {
|
||||
margin: 0 0 15px;
|
||||
line-height: 17px;
|
||||
background-color: #EFF0F1;
|
||||
padding: 4px 8px;
|
||||
border-radius: 3px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
pre code {
|
||||
margin: 0 0 15px;
|
||||
padding: 0;
|
||||
line-height: 17px;
|
||||
background-color: none;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown blockquotes that we can't write inline CSS for. */
|
||||
blockquote {
|
||||
margin: 0 0 15px;
|
||||
padding: 4px 10px;
|
||||
background-color: #FFF8DC;
|
||||
border-left: 2px solid #ffeb8e;
|
||||
}
|
||||
blockquote p {
|
||||
padding: 4px 0;
|
||||
margin: 0;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* What it does: Rounds corners in email clients that support it */
|
||||
.bar {
|
||||
border-radius: 5px;
|
||||
}
|
||||
.btr {
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
.bbr {
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 680px) {
|
||||
/* What it does: Forces table cells into full-width rows. */
|
||||
.stack-column,
|
||||
.stack-column-center {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
direction: ltr !important;
|
||||
}
|
||||
/* And center justify these ones. */
|
||||
.stack-column-center {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
/* Hides things in small viewports. */
|
||||
.hide-on-mobile {
|
||||
display: none !important;
|
||||
max-height: 0 !important;
|
||||
overflow: hidden !important;
|
||||
visibility: hidden !important;
|
||||
}
|
||||
|
||||
/* What it does: Utility classes to reduce spacing for smaller viewports. */
|
||||
.sm-p-none {padding: 0 !important;}
|
||||
.sm-pt-none {padding-top: 0 !important;}
|
||||
.sm-pb-none {padding-bottom: 0 !important;}
|
||||
.sm-pr-none {padding-right: 0 !important;}
|
||||
.sm-pl-none {padding-left: 0 !important;}
|
||||
.sm-px-none {padding-left: 0 !important; padding-right: 0 !important;}
|
||||
.sm-py-none {padding-top: 0 !important; padding-bottom: 0 !important;}
|
||||
|
||||
.sm-p {padding: 20px !important;}
|
||||
.sm-pt {padding-top: 20px !important;}
|
||||
.sm-pb {padding-bottom: 20px !important;}
|
||||
.sm-pr {padding-right: 20px !important;}
|
||||
.sm-pl {padding-left: 20px !important;}
|
||||
.sm-px {padding-left: 20px !important; padding-right: 20px !important;}
|
||||
.sm-py {padding-top: 20px !important; padding-bottom: 20px !important;}
|
||||
.sm-mb {margin-bottom: 20px !important;}
|
||||
|
||||
/* What it does: Utility classes to kill border radius for smaller viewports. Used mainly on the email's main container(s). */
|
||||
.bar,
|
||||
.btr,
|
||||
.bbr {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!-- Progressive Enhancements : END -->
|
||||
</head>
|
||||
|
||||
<!--
|
||||
The email background color is defined in three places, just below. If you change one, remember to change the others.
|
||||
1. body tag: for most email clients
|
||||
2. center tag: for Gmail and Inbox mobile apps and web versions of Gmail, GSuite, Inbox, Yahoo, AOL, Libero, Comcast, freenet, Mail.ru, Orange.fr
|
||||
3. mso conditional: For Windows 10 Mail
|
||||
-->
|
||||
<body width="100%" style="margin: 0; padding: 0 !important; background: #f3f3f5; mso-line-height-rule: exactly;">
|
||||
<center style="width: 100%; background: #f3f3f5;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #f3f3f5;">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Visually Hidden Preview Text : BEGIN -->
|
||||
<div style="display: none; font-size: 1px; line-height: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;">
|
||||
{{__ "lfk-password-reset"}}
|
||||
</div>
|
||||
<!-- Visually Hidden Preview Text : END -->
|
||||
|
||||
<div class="email-container" style="max-width: 680px; margin: 0 auto;">
|
||||
<!--[if mso]>
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="680" align="center">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 680px; width:100%">
|
||||
<tr>
|
||||
<td style="padding: 30px; background-color: #ffffff;" class="sm-p bar">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tr>
|
||||
<td style="padding-bottom: 15px; font-family: arial, sans-serif; font-size: 15px; line-height: 21px; color: #3C3F44; text-align: left;">
|
||||
<h1 style="font-weight: bold; font-size: 27px; line-height: 27px; color: #0C0D0E; margin: 0 0 15px 0;">LfK!</h1>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 15px; font-family: arial, sans-serif; font-size: 15px; line-height: 21px; color: #3C3F44; text-align: left;">
|
||||
<h1 style="font-weight: bold; font-size: 21px; line-height: 21px; color: #0C0D0E; margin: 0 0 15px 0;">{{__ "password-reset"}}</h1>
|
||||
<p style="margin: 0 0 15px;" class="has-markdown">{{__ "a-password-reset-for-your-account-got-requested"}}<br><b>{{__ "if-you-didnt-request-the-reset-please-ignore-this-mail"}}</b><br>{{__ "your-password-wont-be-changed-until-you-click-the-reset-link-below-and-set-a-new-one"}}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Button Row : BEGIN -->
|
||||
<tr>
|
||||
<td>
|
||||
<!-- Button : BEGIN -->
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
|
||||
<tr>
|
||||
<td class="s-btn s-btn__primary" style="border-radius: 4px; background: #0095ff;">
|
||||
<a class="s-btn s-btn__primary" href="{{reset_link}}" target="_parent" style="background: #0095FF; border: 1px solid #0077cc; box-shadow: inset 0 1px 0 0 rgba(102,191,255,.75); font-family: arial, sans-serif; font-size: 17px; line-height: 17px; color: #ffffff; text-align: center; text-decoration: none; padding: 13px 17px; display: block; border-radius: 4px; white-space: nowrap;">{{__ "reset-password"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- Button : END -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Button Row : END -->
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-----------------------------
|
||||
|
||||
EMAIL BODY : END
|
||||
|
||||
------------------------------>
|
||||
|
||||
<!-- Footer : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding: 30px;" class="sm-p">
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
||||
<!-- Subscription Info : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding-bottom: 10px; font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
Copyright © {{copyright_owner}}. {{__ "all-rights-reserved"}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
<a href="{{link_imprint}}"
|
||||
style="color: #9199A1; text-decoration: underline;">{{__ "imprint"}}</a>
|
||||
<a href="{{link_privacy}}" style="color: #9199A1; text-decoration: underline;">{{__ "privacy"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Subscription Info : BEGIN -->
|
||||
<!-- HR line : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding: 30px 0;" width="100%" class="sm-py">
|
||||
<table aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%">
|
||||
<tr>
|
||||
<td height="1" width="100%" style="font-size: 0; line-height: 0; border-top: 1px solid #D6D8DB;"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- HR line : END -->
|
||||
<tr>
|
||||
<td style="padding-bottom: 5px; font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">{{__ "this-mail-was-sent-to-you-because-someone-request-a-password-reset-for-a-account-linked-to-the-mail-address"}}</td>
|
||||
</tr>
|
||||
<!-- Sender Info : END -->
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Footer : END -->
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
@ -1,12 +0,0 @@
|
||||
{{__ "lfk-password-reset"}}
|
||||
|
||||
{{__ "a-password-reset-for-your-account-got-requested"}}
|
||||
{{__ "if-you-didnt-request-the-reset-please-ignore-this-mail"}}
|
||||
{{__ "your-password-wont-be-changed-until-you-click-the-reset-link-below-and-set-a-new-one"}}
|
||||
|
||||
{{__ "reset-password"}}: {{reset_link}}
|
||||
|
||||
|
||||
Copyright © {{copyright_owner}}. {{__ "all-rights-reserved"}}.
|
||||
{{__ "imprint"}}: {{link_imprint}} | {{__ "privacy"}}: {{link_privacy}}
|
||||
{{__ "this-mail-was-sent-to-you-because-someone-request-a-password-reset-for-a-account-linked-to-the-mail-address"}}
|
@ -1,396 +0,0 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml">
|
||||
<head>
|
||||
<title>{{__ "your-event_name-profile"}}<title> <!-- The title tag shows in email notifications, like Android 4.4. -->
|
||||
<meta charset="utf-8"> <!-- utf-8 works for most cases -->
|
||||
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
|
||||
<meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
|
||||
<meta name="format-detection" content="telephone=no,address=no,email=no,date=no,url=no"> <!-- Tell iOS not to automatically link certain text strings. -->
|
||||
|
||||
<!-- CSS Reset : BEGIN -->
|
||||
<style>
|
||||
/* What it does: Remove spaces around the email design added by some email clients. */
|
||||
/* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
|
||||
html,
|
||||
body {
|
||||
margin: 0 auto !important;
|
||||
padding: 0 !important;
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* What it does: Stops email clients resizing small text. */
|
||||
* {
|
||||
-ms-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
/* What it does: Centers email on Android 4.4 */
|
||||
div[style*="margin: 16px 0"] {
|
||||
margin:0 !important;
|
||||
}
|
||||
|
||||
/* What it does: Stops Outlook from adding extra spacing to tables. */
|
||||
table,
|
||||
td {
|
||||
mso-table-lspace: 0pt !important;
|
||||
mso-table-rspace: 0pt !important;
|
||||
}
|
||||
|
||||
/* What it does: Fixes webkit padding issue. */
|
||||
table {
|
||||
border: 0;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse
|
||||
}
|
||||
|
||||
/* What it does: Forces Samsung Android mail clients to use the entire viewport. */
|
||||
#MessageViewBody,
|
||||
#MessageWebViewDiv{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* What it does: Uses a better rendering method when resizing images in IE. */
|
||||
img {
|
||||
-ms-interpolation-mode:bicubic;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Windows 10 Mail from underlining links despite inline CSS. Styles for underlined links should be inline. */
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* What it does: A work-around for email clients automatically linking certain text strings. */
|
||||
/* iOS */
|
||||
a[x-apple-data-detectors],
|
||||
.unstyle-auto-detected-links a,
|
||||
.aBn {
|
||||
border-bottom: 0 !important;
|
||||
cursor: default !important;
|
||||
color: inherit !important;
|
||||
text-decoration: none !important;
|
||||
font-size: inherit !important;
|
||||
font-family: inherit !important;
|
||||
font-weight: inherit !important;
|
||||
line-height: inherit !important;
|
||||
}
|
||||
u + #body a, /* Gmail */
|
||||
#MessageViewBody a /* Samsung Mail */
|
||||
{
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
font-weight: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Gmail from changing the text color in conversation threads. */
|
||||
.im {
|
||||
color: inherit !important;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Gmail from displaying an download button on large, non-linked images. */
|
||||
.a6S {
|
||||
display: none !important;
|
||||
opacity: 0.01 !important;
|
||||
}
|
||||
/* If the above doesn't work, add a .g-img class to any image in question. */
|
||||
img.g-img + div {
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
/* What it does: Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89 */
|
||||
/* Create one of these media queries for each additional viewport size you'd like to fix */
|
||||
|
||||
/* iPhone 4, 4S, 5, 5S, 5C, and 5SE */
|
||||
@media only screen and (min-device-width: 320px) and (max-device-width: 374px) {
|
||||
u ~ div .email-container {
|
||||
min-width: 320px !important;
|
||||
}
|
||||
}
|
||||
/* iPhone 6, 6S, 7, 8, and X */
|
||||
@media only screen and (min-device-width: 375px) and (max-device-width: 413px) {
|
||||
u ~ div .email-container {
|
||||
min-width: 375px !important;
|
||||
}
|
||||
}
|
||||
/* iPhone 6+, 7+, and 8+ */
|
||||
@media only screen and (min-device-width: 414px) {
|
||||
u ~ div .email-container {
|
||||
min-width: 414px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!-- What it does: Helps DPI scaling in Outlook 2007-2013 -->
|
||||
<!--[if gte mso 9]>
|
||||
<xml>
|
||||
<o:OfficeDocumentSettings>
|
||||
<o:AllowPNG/>
|
||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||
</o:OfficeDocumentSettings>
|
||||
</xml>
|
||||
<![endif]-->
|
||||
|
||||
<!-- CSS Reset : END -->
|
||||
|
||||
<!-- Progressive Enhancements : BEGIN -->
|
||||
<style>
|
||||
/* What it does: Hover styles for buttons and tags */
|
||||
.s-btn__primary:hover {
|
||||
background: #0077CC !important;
|
||||
border-color: #0077CC !important;
|
||||
}
|
||||
.s-btn__white:hover {
|
||||
background: #EFF0F1 !important;
|
||||
border-color: #EFF0F1 !important;
|
||||
}
|
||||
.s-btn__outlined:hover {
|
||||
background: rgba(0,119,204,.05) !important;
|
||||
color: #005999 !important;
|
||||
}
|
||||
.s-tag:hover,
|
||||
.post-tag:hover {
|
||||
border-color: #cee0ed !important;
|
||||
background: #cee0ed !important;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown links that we can't write inline CSS for. */
|
||||
.has-markdown a,
|
||||
.has-markdown a:visited {
|
||||
color: #0077CC !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown code blocks that we can't write inline CSS for. */
|
||||
code {
|
||||
padding: 1px 5px;
|
||||
background-color: #EFF0F1;
|
||||
color: #242729;
|
||||
font-size: 13px;
|
||||
line-height: inherit;
|
||||
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif;
|
||||
}
|
||||
pre {
|
||||
margin: 0 0 15px;
|
||||
line-height: 17px;
|
||||
background-color: #EFF0F1;
|
||||
padding: 4px 8px;
|
||||
border-radius: 3px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
pre code {
|
||||
margin: 0 0 15px;
|
||||
padding: 0;
|
||||
line-height: 17px;
|
||||
background-color: none;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown blockquotes that we can't write inline CSS for. */
|
||||
blockquote {
|
||||
margin: 0 0 15px;
|
||||
padding: 4px 10px;
|
||||
background-color: #FFF8DC;
|
||||
border-left: 2px solid #ffeb8e;
|
||||
}
|
||||
blockquote p {
|
||||
padding: 4px 0;
|
||||
margin: 0;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* What it does: Rounds corners in email clients that support it */
|
||||
.bar {
|
||||
border-radius: 5px;
|
||||
}
|
||||
.btr {
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
.bbr {
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 680px) {
|
||||
/* What it does: Forces table cells into full-width rows. */
|
||||
.stack-column,
|
||||
.stack-column-center {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
direction: ltr !important;
|
||||
}
|
||||
/* And center justify these ones. */
|
||||
.stack-column-center {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
/* Hides things in small viewports. */
|
||||
.hide-on-mobile {
|
||||
display: none !important;
|
||||
max-height: 0 !important;
|
||||
overflow: hidden !important;
|
||||
visibility: hidden !important;
|
||||
}
|
||||
|
||||
/* What it does: Utility classes to reduce spacing for smaller viewports. */
|
||||
.sm-p-none {padding: 0 !important;}
|
||||
.sm-pt-none {padding-top: 0 !important;}
|
||||
.sm-pb-none {padding-bottom: 0 !important;}
|
||||
.sm-pr-none {padding-right: 0 !important;}
|
||||
.sm-pl-none {padding-left: 0 !important;}
|
||||
.sm-px-none {padding-left: 0 !important; padding-right: 0 !important;}
|
||||
.sm-py-none {padding-top: 0 !important; padding-bottom: 0 !important;}
|
||||
|
||||
.sm-p {padding: 20px !important;}
|
||||
.sm-pt {padding-top: 20px !important;}
|
||||
.sm-pb {padding-bottom: 20px !important;}
|
||||
.sm-pr {padding-right: 20px !important;}
|
||||
.sm-pl {padding-left: 20px !important;}
|
||||
.sm-px {padding-left: 20px !important; padding-right: 20px !important;}
|
||||
.sm-py {padding-top: 20px !important; padding-bottom: 20px !important;}
|
||||
.sm-mb {margin-bottom: 20px !important;}
|
||||
|
||||
/* What it does: Utility classes to kill border radius for smaller viewports. Used mainly on the email's main container(s). */
|
||||
.bar,
|
||||
.btr,
|
||||
.bbr {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!-- Progressive Enhancements : END -->
|
||||
</head>
|
||||
|
||||
<!--
|
||||
The email background color is defined in three places, just below. If you change one, remember to change the others.
|
||||
1. body tag: for most email clients
|
||||
2. center tag: for Gmail and Inbox mobile apps and web versions of Gmail, GSuite, Inbox, Yahoo, AOL, Libero, Comcast, freenet, Mail.ru, Orange.fr
|
||||
3. mso conditional: For Windows 10 Mail
|
||||
-->
|
||||
<body width="100%" style="margin: 0; padding: 0 !important; background: #f3f3f5; mso-line-height-rule: exactly;">
|
||||
<center style="width: 100%; background: #f3f3f5;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #f3f3f5;">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Visually Hidden Preview Text : BEGIN -->
|
||||
<div style="display: none; font-size: 1px; line-height: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;">
|
||||
{{__ "your-event_name-profile"}}
|
||||
</div>
|
||||
<!-- Visually Hidden Preview Text : END -->
|
||||
|
||||
<div class="email-container" style="max-width: 680px; margin: 0 auto;">
|
||||
<!--[if mso]>
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="680" align="center">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 680px; width:100%">
|
||||
<tr>
|
||||
<td style="padding: 30px; background-color: #ffffff;" class="sm-p bar">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tr>
|
||||
<td style="padding-bottom: 15px; font-family: arial, sans-serif; font-size: 15px; line-height: 21px; color: #3C3F44; text-align: left;">
|
||||
<h1 style="font-weight: bold; font-size: 27px; line-height: 27px; color: #0C0D0E; margin: 0 0 15px 0;">{{event_name}}</h1>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 15px; font-family: arial, sans-serif; font-size: 15px; line-height: 21px; color: #3C3F44; text-align: left;">
|
||||
<h1 style="font-weight: bold; font-size: 21px; line-height: 21px; color: #0C0D0E; margin: 0 0 15px 0;">{{__ "your-profile"}}</h1>
|
||||
<p style="margin: 0 0 15px;" class="has-markdown">
|
||||
{{__ "thank-you-for-requesting-a-new-link-to-your-event_name-runner-profile"}}<br>
|
||||
{{__ "you-can-view-your-registration-code-lap-times-and-much-more-by-visiting-our-selfservice"}}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Button Row : BEGIN -->
|
||||
<tr>
|
||||
<td>
|
||||
<!-- Button : BEGIN -->
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
|
||||
<tr>
|
||||
<td class="s-btn s-btn__primary" style="border-radius: 4px; background: #0095ff;">
|
||||
<a class="s-btn s-btn__primary" href="{{selfservice_link}}" target="_parent" style="background: #0095FF; border: 1px solid #0077cc; box-shadow: inset 0 1px 0 0 rgba(102,191,255,.75); font-family: arial, sans-serif; font-size: 17px; line-height: 17px; color: #ffffff; text-align: center; text-decoration: none; padding: 13px 17px; display: block; border-radius: 4px; white-space: nowrap;">{{__ "view-my-data"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- Button : END -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 15px; font-family: arial, sans-serif; font-size: 15px; line-height: 21px; color: #3C3F44; text-align: left;">
|
||||
<p>Link: <a href="{{selfservice_link}}">{{selfservice_link}}</a><br>
|
||||
{{__ "if-you-ever-loose-the-link-you-can-request-a-new-one-by-visiting-our-website"}} <a href="{{forgot_link}}">{{forgot_link}}</a></p></td>
|
||||
</tr>
|
||||
<!-- Button Row : END -->
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-----------------------------
|
||||
|
||||
EMAIL BODY : END
|
||||
|
||||
------------------------------>
|
||||
|
||||
<!-- Footer : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding: 30px;" class="sm-p">
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
||||
<!-- Subscription Info : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding-bottom: 10px; font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
Copyright © {{copyright_owner}}. {{__ "all-rights-reserved"}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
<a href="{{link_imprint}}"
|
||||
style="color: #9199A1; text-decoration: underline;">{{__ "imprint"}}</a>
|
||||
<a href="{{link_privacy}}" style="color: #9199A1; text-decoration: underline;">{{__ "privacy"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Subscription Info : BEGIN -->
|
||||
<!-- HR line : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding: 30px 0;" width="100%" class="sm-py">
|
||||
<table aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%">
|
||||
<tr>
|
||||
<td height="1" width="100%" style="font-size: 0; line-height: 0; border-top: 1px solid #D6D8DB;"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- HR line : END -->
|
||||
<tr>
|
||||
<td style="padding-bottom: 5px; font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
{{__ "this-mail-was-sent-to-you-because-someone-requested-a-new-link-to-access-your-profile-for-the-event_name"}}<br>
|
||||
{{__ "to-prevent-spam-you-can-only-request-a-new-link-every-24hrs"}}<br>
|
||||
{{__ "if-you-didnt-register-yourself-you-should-contact-us-to-get-your-data-removed-from-our-systems"}} <a href="mailto:{{contact_mail}}">{{contact_mail}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Sender Info : END -->
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Footer : END -->
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
@ -1,15 +0,0 @@
|
||||
{{__ "your-event_name-profile"}}
|
||||
|
||||
{{__ "thank-you-for-requesting-a-new-link-to-your-event_name-runner-profile"}}
|
||||
{{__ "you-can-view-your-registration-code-lap-times-and-much-more-by-visiting-our-selfservice"}}
|
||||
|
||||
{{selfservice_link}}
|
||||
|
||||
{{__ "if-you-ever-loose-the-link-you-can-request-a-new-one-by-visiting-our-website"}} {{forgot_link}}
|
||||
|
||||
|
||||
Copyright © {{copyright_owner}}. {{__ "all-rights-reserved"}}.
|
||||
{{__ "imprint"}}: {{link_imprint}} | {{__ "privacy"}}: {{link_privacy}}
|
||||
{{__ "this-mail-was-sent-to-you-because-someone-requested-a-new-link-to-access-your-profile-for-the-event_name"}}
|
||||
{{__ "to-prevent-spam-you-can-only-request-a-new-link-every-24hrs"}}
|
||||
{{__ "if-you-didnt-register-yourself-you-should-contact-us-to-get-your-data-removed-from-our-systems"}} {{contact_mail}}
|
@ -1,450 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office"
|
||||
xmlns:v="urn:schemas-microsoft-com:vml">
|
||||
|
||||
<head>
|
||||
<title>{{__ "lfk-mail-test"}}</title> <!-- The title tag shows in email notifications, like Android 4.4. -->
|
||||
<meta charset="utf-8"> <!-- utf-8 works for most cases -->
|
||||
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
|
||||
<meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
|
||||
<meta name="format-detection" content="telephone=no,address=no,email=no,date=no,url=no">
|
||||
<!-- Tell iOS not to automatically link certain text strings. -->
|
||||
|
||||
<!-- CSS Reset : BEGIN -->
|
||||
<style>
|
||||
/* What it does: Remove spaces around the email design added by some email clients. */
|
||||
/* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
|
||||
html,
|
||||
body {
|
||||
margin: 0 auto !important;
|
||||
padding: 0 !important;
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* What it does: Stops email clients resizing small text. */
|
||||
* {
|
||||
-ms-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
/* What it does: Centers email on Android 4.4 */
|
||||
div[style*="margin: 16px 0"] {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
/* What it does: Stops Outlook from adding extra spacing to tables. */
|
||||
table,
|
||||
td {
|
||||
mso-table-lspace: 0pt !important;
|
||||
mso-table-rspace: 0pt !important;
|
||||
}
|
||||
|
||||
/* What it does: Fixes webkit padding issue. */
|
||||
table {
|
||||
border: 0;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse
|
||||
}
|
||||
|
||||
/* What it does: Forces Samsung Android mail clients to use the entire viewport. */
|
||||
#MessageViewBody,
|
||||
#MessageWebViewDiv {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* What it does: Uses a better rendering method when resizing images in IE. */
|
||||
img {
|
||||
-ms-interpolation-mode: bicubic;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Windows 10 Mail from underlining links despite inline CSS. Styles for underlined links should be inline. */
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* What it does: A work-around for email clients automatically linking certain text strings. */
|
||||
/* iOS */
|
||||
a[x-apple-data-detectors],
|
||||
.unstyle-auto-detected-links a,
|
||||
.aBn {
|
||||
border-bottom: 0 !important;
|
||||
cursor: default !important;
|
||||
color: inherit !important;
|
||||
text-decoration: none !important;
|
||||
font-size: inherit !important;
|
||||
font-family: inherit !important;
|
||||
font-weight: inherit !important;
|
||||
line-height: inherit !important;
|
||||
}
|
||||
|
||||
u+#body a,
|
||||
/* Gmail */
|
||||
#MessageViewBody a
|
||||
|
||||
/* Samsung Mail */
|
||||
{
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
font-weight: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Gmail from changing the text color in conversation threads. */
|
||||
.im {
|
||||
color: inherit !important;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Gmail from displaying an download button on large, non-linked images. */
|
||||
.a6S {
|
||||
display: none !important;
|
||||
opacity: 0.01 !important;
|
||||
}
|
||||
|
||||
/* If the above doesn't work, add a .g-img class to any image in question. */
|
||||
img.g-img+div {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* What it does: Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89 */
|
||||
/* Create one of these media queries for each additional viewport size you'd like to fix */
|
||||
|
||||
/* iPhone 4, 4S, 5, 5S, 5C, and 5SE */
|
||||
@media only screen and (min-device-width: 320px) and (max-device-width: 374px) {
|
||||
u~div .email-container {
|
||||
min-width: 320px !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* iPhone 6, 6S, 7, 8, and X */
|
||||
@media only screen and (min-device-width: 375px) and (max-device-width: 413px) {
|
||||
u~div .email-container {
|
||||
min-width: 375px !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* iPhone 6+, 7+, and 8+ */
|
||||
@media only screen and (min-device-width: 414px) {
|
||||
u~div .email-container {
|
||||
min-width: 414px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!-- What it does: Helps DPI scaling in Outlook 2007-2013 -->
|
||||
<!--[if gte mso 9]>
|
||||
<xml>
|
||||
<o:OfficeDocumentSettings>
|
||||
<o:AllowPNG/>
|
||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||
</o:OfficeDocumentSettings>
|
||||
</xml>
|
||||
<![endif]-->
|
||||
|
||||
<!-- CSS Reset : END -->
|
||||
|
||||
<!-- Progressive Enhancements : BEGIN -->
|
||||
<style>
|
||||
/* What it does: Hover styles for buttons and tags */
|
||||
.s-btn__primary:hover {
|
||||
background: #0077CC !important;
|
||||
border-color: #0077CC !important;
|
||||
}
|
||||
|
||||
.s-btn__white:hover {
|
||||
background: #EFF0F1 !important;
|
||||
border-color: #EFF0F1 !important;
|
||||
}
|
||||
|
||||
.s-btn__outlined:hover {
|
||||
background: rgba(0, 119, 204, .05) !important;
|
||||
color: #005999 !important;
|
||||
}
|
||||
|
||||
.s-tag:hover,
|
||||
.post-tag:hover {
|
||||
border-color: #cee0ed !important;
|
||||
background: #cee0ed !important;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown links that we can't write inline CSS for. */
|
||||
.has-markdown a,
|
||||
.has-markdown a:visited {
|
||||
color: #0077CC !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown code blocks that we can't write inline CSS for. */
|
||||
code {
|
||||
padding: 1px 5px;
|
||||
background-color: #EFF0F1;
|
||||
color: #242729;
|
||||
font-size: 13px;
|
||||
line-height: inherit;
|
||||
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin: 0 0 15px;
|
||||
line-height: 17px;
|
||||
background-color: #EFF0F1;
|
||||
padding: 4px 8px;
|
||||
border-radius: 3px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
pre code {
|
||||
margin: 0 0 15px;
|
||||
padding: 0;
|
||||
line-height: 17px;
|
||||
background-color: none;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown blockquotes that we can't write inline CSS for. */
|
||||
blockquote {
|
||||
margin: 0 0 15px;
|
||||
padding: 4px 10px;
|
||||
background-color: #FFF8DC;
|
||||
border-left: 2px solid #ffeb8e;
|
||||
}
|
||||
|
||||
blockquote p {
|
||||
padding: 4px 0;
|
||||
margin: 0;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* What it does: Rounds corners in email clients that support it */
|
||||
.bar {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.btr {
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
|
||||
.bbr {
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 680px) {
|
||||
|
||||
/* What it does: Forces table cells into full-width rows. */
|
||||
.stack-column,
|
||||
.stack-column-center {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
direction: ltr !important;
|
||||
}
|
||||
|
||||
/* And center justify these ones. */
|
||||
.stack-column-center {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
/* Hides things in small viewports. */
|
||||
.hide-on-mobile {
|
||||
display: none !important;
|
||||
max-height: 0 !important;
|
||||
overflow: hidden !important;
|
||||
visibility: hidden !important;
|
||||
}
|
||||
|
||||
/* What it does: Utility classes to reduce spacing for smaller viewports. */
|
||||
.sm-p-none {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.sm-pt-none {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.sm-pb-none {
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.sm-pr-none {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
.sm-pl-none {
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
.sm-px-none {
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
.sm-py-none {
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.sm-p {
|
||||
padding: 20px !important;
|
||||
}
|
||||
|
||||
.sm-pt {
|
||||
padding-top: 20px !important;
|
||||
}
|
||||
|
||||
.sm-pb {
|
||||
padding-bottom: 20px !important;
|
||||
}
|
||||
|
||||
.sm-pr {
|
||||
padding-right: 20px !important;
|
||||
}
|
||||
|
||||
.sm-pl {
|
||||
padding-left: 20px !important;
|
||||
}
|
||||
|
||||
.sm-px {
|
||||
padding-left: 20px !important;
|
||||
padding-right: 20px !important;
|
||||
}
|
||||
|
||||
.sm-py {
|
||||
padding-top: 20px !important;
|
||||
padding-bottom: 20px !important;
|
||||
}
|
||||
|
||||
.sm-mb {
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
|
||||
/* What it does: Utility classes to kill border radius for smaller viewports. Used mainly on the email's main container(s). */
|
||||
.bar,
|
||||
.btr,
|
||||
.bbr {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!-- Progressive Enhancements : END -->
|
||||
</head>
|
||||
|
||||
<!--
|
||||
The email background color is defined in three places, just below. If you change one, remember to change the others.
|
||||
1. body tag: for most email clients
|
||||
2. center tag: for Gmail and Inbox mobile apps and web versions of Gmail, GSuite, Inbox, Yahoo, AOL, Libero, Comcast, freenet, Mail.ru, Orange.fr
|
||||
3. mso conditional: For Windows 10 Mail
|
||||
-->
|
||||
|
||||
<body width="100%" style="margin: 0; padding: 0 !important; background: #f3f3f5; mso-line-height-rule: exactly;">
|
||||
<center style="width: 100%; background: #f3f3f5;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #f3f3f5;">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Visually Hidden Preview Text : BEGIN -->
|
||||
<div
|
||||
style="display: none; font-size: 1px; line-height: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;">
|
||||
{{__ "lfk-mail-test"}}
|
||||
</div>
|
||||
<!-- Visually Hidden Preview Text : END -->
|
||||
|
||||
<div class="email-container" style="max-width: 680px; margin: 0 auto;">
|
||||
<!--[if mso]>
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="680" align="center">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 680px; width:100%">
|
||||
<tr>
|
||||
<td style="padding: 30px; background-color: #ffffff;" class="sm-p bar">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tr>
|
||||
<td
|
||||
style="padding-bottom: 15px; font-family: arial, sans-serif; font-size: 15px; line-height: 21px; color: #3C3F44; text-align: left;">
|
||||
<h1
|
||||
style="font-weight: bold; font-size: 27px; line-height: 27px; color: #0C0D0E; margin: 0 0 15px 0;">
|
||||
LfK!</h1>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
style="padding-bottom: 15px; font-family: arial, sans-serif; font-size: 15px; line-height: 21px; color: #3C3F44; text-align: left;">
|
||||
<h1
|
||||
style="font-weight: bold; font-size: 21px; line-height: 21px; color: #0C0D0E; margin: 0 0 15px 0;">
|
||||
{{__ "test-mail"}}</h1>
|
||||
<p style="margin: 0 0 15px;" class="has-markdown">{{__ "this-is-a-test-mail-triggered-by-an-admin-in-the-lfk-backend"}}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-----------------------------
|
||||
|
||||
EMAIL BODY : END
|
||||
|
||||
------------------------------>
|
||||
|
||||
<!-- Footer : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding: 30px;" class="sm-p">
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
||||
<!-- Subscription Info : BEGIN -->
|
||||
<tr>
|
||||
<td
|
||||
style="padding-bottom: 10px; font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
Copyright © {{copyright_owner}}. {{__ "all-rights-reserved"}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
style="font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
<a href="{{link_imprint}}" style="color: #9199A1; text-decoration: underline;">{{__ "imprint"}}</a>
|
||||
<a href="{{link_privacy}}" style="color: #9199A1; text-decoration: underline;">{{__ "privacy"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Subscription Info : BEGIN -->
|
||||
<!-- HR line : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding: 30px 0;" width="100%" class="sm-py">
|
||||
<table aria-hidden="true" border="0" cellpadding="0" cellspacing="0"
|
||||
role="presentation" style="width:100%">
|
||||
<tr>
|
||||
<td height="1" width="100%"
|
||||
style="font-size: 0; line-height: 0; border-top: 1px solid #D6D8DB;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- HR line : END -->
|
||||
<tr>
|
||||
<td
|
||||
style="padding-bottom: 5px; font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
{{__ "this-mail-was-sent-to-recipient_mail-because-someone-request-a-mail-test-for-this-mail-address"}}
|
||||
</tr>
|
||||
<!-- Sender Info : END -->
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Footer : END -->
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</center>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,7 +0,0 @@
|
||||
{{__ "lfk-mail-test"}}.
|
||||
|
||||
{{__ "this-is-a-test-mail-triggered-by-an-admin-in-the-lfk-backend"}}
|
||||
|
||||
Copyright © {{copyright_owner}}. {{__ "all-rights-reserved"}}.
|
||||
{{__ "imprint"}}: {{link_imprint}} | {{__ "privacy"}}: {{link_privacy}}
|
||||
{{__ "this-mail-was-sent-to-recipient_mail-because-someone-request-a-mail-test-for-this-mail-address"}}
|
36
src/templates/welcome.ts
Normal file
36
src/templates/welcome.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import { Language } from '../types'
|
||||
|
||||
interface WelcomeTemplateData {
|
||||
name: string
|
||||
activationLink: string
|
||||
}
|
||||
|
||||
const en = {
|
||||
html: (data: WelcomeTemplateData) => `
|
||||
<h1>Welcome ${data.name}!</h1>
|
||||
<p>Thank you for joining us. Please click the link below to activate your account:</p>
|
||||
<a href="${data.activationLink}">Activate Account</a>
|
||||
`,
|
||||
text: (data: WelcomeTemplateData) => `
|
||||
Welcome ${data.name}!
|
||||
|
||||
Thank you for joining us. Please use the following link to activate your account:
|
||||
${data.activationLink}
|
||||
`
|
||||
}
|
||||
|
||||
const de = {
|
||||
html: (data: WelcomeTemplateData) => `
|
||||
<h1>Willkommen ${data.name}!</h1>
|
||||
<p>Danke, dass Sie sich bei uns registriert haben. Bitte klicken Sie auf den Link unten, um Ihr Konto zu aktivieren:</p>
|
||||
<a href="${data.activationLink}">Konto aktivieren</a>
|
||||
`,
|
||||
text: (data: WelcomeTemplateData) => `
|
||||
Willkommen ${data.name}!
|
||||
|
||||
Danke, dass Sie sich bei uns registriert haben. Bitte verwenden Sie den folgenden Link, um Ihr Konto zu aktivieren:
|
||||
${data.activationLink}
|
||||
`
|
||||
}
|
||||
|
||||
export const welcomeTemplate: Record<Language, typeof en> = { en, de }
|
@ -1,397 +0,0 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml">
|
||||
<head>
|
||||
<title>{{__ "event_name-registration"}}</title> <!-- The title tag shows in email notifications, like Android 4.4. -->
|
||||
<meta charset="utf-8"> <!-- utf-8 works for most cases -->
|
||||
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
|
||||
<meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
|
||||
<meta name="format-detection" content="telephone=no,address=no,email=no,date=no,url=no"> <!-- Tell iOS not to automatically link certain text strings. -->
|
||||
|
||||
<!-- CSS Reset : BEGIN -->
|
||||
<style>
|
||||
/* What it does: Remove spaces around the email design added by some email clients. */
|
||||
/* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
|
||||
html,
|
||||
body {
|
||||
margin: 0 auto !important;
|
||||
padding: 0 !important;
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* What it does: Stops email clients resizing small text. */
|
||||
* {
|
||||
-ms-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
/* What it does: Centers email on Android 4.4 */
|
||||
div[style*="margin: 16px 0"] {
|
||||
margin:0 !important;
|
||||
}
|
||||
|
||||
/* What it does: Stops Outlook from adding extra spacing to tables. */
|
||||
table,
|
||||
td {
|
||||
mso-table-lspace: 0pt !important;
|
||||
mso-table-rspace: 0pt !important;
|
||||
}
|
||||
|
||||
/* What it does: Fixes webkit padding issue. */
|
||||
table {
|
||||
border: 0;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse
|
||||
}
|
||||
|
||||
/* What it does: Forces Samsung Android mail clients to use the entire viewport. */
|
||||
#MessageViewBody,
|
||||
#MessageWebViewDiv{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* What it does: Uses a better rendering method when resizing images in IE. */
|
||||
img {
|
||||
-ms-interpolation-mode:bicubic;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Windows 10 Mail from underlining links despite inline CSS. Styles for underlined links should be inline. */
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* What it does: A work-around for email clients automatically linking certain text strings. */
|
||||
/* iOS */
|
||||
a[x-apple-data-detectors],
|
||||
.unstyle-auto-detected-links a,
|
||||
.aBn {
|
||||
border-bottom: 0 !important;
|
||||
cursor: default !important;
|
||||
color: inherit !important;
|
||||
text-decoration: none !important;
|
||||
font-size: inherit !important;
|
||||
font-family: inherit !important;
|
||||
font-weight: inherit !important;
|
||||
line-height: inherit !important;
|
||||
}
|
||||
u + #body a, /* Gmail */
|
||||
#MessageViewBody a /* Samsung Mail */
|
||||
{
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
font-weight: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Gmail from changing the text color in conversation threads. */
|
||||
.im {
|
||||
color: inherit !important;
|
||||
}
|
||||
|
||||
/* What it does: Prevents Gmail from displaying an download button on large, non-linked images. */
|
||||
.a6S {
|
||||
display: none !important;
|
||||
opacity: 0.01 !important;
|
||||
}
|
||||
/* If the above doesn't work, add a .g-img class to any image in question. */
|
||||
img.g-img + div {
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
/* What it does: Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89 */
|
||||
/* Create one of these media queries for each additional viewport size you'd like to fix */
|
||||
|
||||
/* iPhone 4, 4S, 5, 5S, 5C, and 5SE */
|
||||
@media only screen and (min-device-width: 320px) and (max-device-width: 374px) {
|
||||
u ~ div .email-container {
|
||||
min-width: 320px !important;
|
||||
}
|
||||
}
|
||||
/* iPhone 6, 6S, 7, 8, and X */
|
||||
@media only screen and (min-device-width: 375px) and (max-device-width: 413px) {
|
||||
u ~ div .email-container {
|
||||
min-width: 375px !important;
|
||||
}
|
||||
}
|
||||
/* iPhone 6+, 7+, and 8+ */
|
||||
@media only screen and (min-device-width: 414px) {
|
||||
u ~ div .email-container {
|
||||
min-width: 414px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!-- What it does: Helps DPI scaling in Outlook 2007-2013 -->
|
||||
<!--[if gte mso 9]>
|
||||
<xml>
|
||||
<o:OfficeDocumentSettings>
|
||||
<o:AllowPNG/>
|
||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||
</o:OfficeDocumentSettings>
|
||||
</xml>
|
||||
<![endif]-->
|
||||
|
||||
<!-- CSS Reset : END -->
|
||||
|
||||
<!-- Progressive Enhancements : BEGIN -->
|
||||
<style>
|
||||
/* What it does: Hover styles for buttons and tags */
|
||||
.s-btn__primary:hover {
|
||||
background: #0077CC !important;
|
||||
border-color: #0077CC !important;
|
||||
}
|
||||
.s-btn__white:hover {
|
||||
background: #EFF0F1 !important;
|
||||
border-color: #EFF0F1 !important;
|
||||
}
|
||||
.s-btn__outlined:hover {
|
||||
background: rgba(0,119,204,.05) !important;
|
||||
color: #005999 !important;
|
||||
}
|
||||
.s-tag:hover,
|
||||
.post-tag:hover {
|
||||
border-color: #cee0ed !important;
|
||||
background: #cee0ed !important;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown links that we can't write inline CSS for. */
|
||||
.has-markdown a,
|
||||
.has-markdown a:visited {
|
||||
color: #0077CC !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown code blocks that we can't write inline CSS for. */
|
||||
code {
|
||||
padding: 1px 5px;
|
||||
background-color: #EFF0F1;
|
||||
color: #242729;
|
||||
font-size: 13px;
|
||||
line-height: inherit;
|
||||
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif;
|
||||
}
|
||||
pre {
|
||||
margin: 0 0 15px;
|
||||
line-height: 17px;
|
||||
background-color: #EFF0F1;
|
||||
padding: 4px 8px;
|
||||
border-radius: 3px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
pre code {
|
||||
margin: 0 0 15px;
|
||||
padding: 0;
|
||||
line-height: 17px;
|
||||
background-color: none;
|
||||
}
|
||||
|
||||
/* What it does: Styles markdown blockquotes that we can't write inline CSS for. */
|
||||
blockquote {
|
||||
margin: 0 0 15px;
|
||||
padding: 4px 10px;
|
||||
background-color: #FFF8DC;
|
||||
border-left: 2px solid #ffeb8e;
|
||||
}
|
||||
blockquote p {
|
||||
padding: 4px 0;
|
||||
margin: 0;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* What it does: Rounds corners in email clients that support it */
|
||||
.bar {
|
||||
border-radius: 5px;
|
||||
}
|
||||
.btr {
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
.bbr {
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 680px) {
|
||||
/* What it does: Forces table cells into full-width rows. */
|
||||
.stack-column,
|
||||
.stack-column-center {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
direction: ltr !important;
|
||||
}
|
||||
/* And center justify these ones. */
|
||||
.stack-column-center {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
/* Hides things in small viewports. */
|
||||
.hide-on-mobile {
|
||||
display: none !important;
|
||||
max-height: 0 !important;
|
||||
overflow: hidden !important;
|
||||
visibility: hidden !important;
|
||||
}
|
||||
|
||||
/* What it does: Utility classes to reduce spacing for smaller viewports. */
|
||||
.sm-p-none {padding: 0 !important;}
|
||||
.sm-pt-none {padding-top: 0 !important;}
|
||||
.sm-pb-none {padding-bottom: 0 !important;}
|
||||
.sm-pr-none {padding-right: 0 !important;}
|
||||
.sm-pl-none {padding-left: 0 !important;}
|
||||
.sm-px-none {padding-left: 0 !important; padding-right: 0 !important;}
|
||||
.sm-py-none {padding-top: 0 !important; padding-bottom: 0 !important;}
|
||||
|
||||
.sm-p {padding: 20px !important;}
|
||||
.sm-pt {padding-top: 20px !important;}
|
||||
.sm-pb {padding-bottom: 20px !important;}
|
||||
.sm-pr {padding-right: 20px !important;}
|
||||
.sm-pl {padding-left: 20px !important;}
|
||||
.sm-px {padding-left: 20px !important; padding-right: 20px !important;}
|
||||
.sm-py {padding-top: 20px !important; padding-bottom: 20px !important;}
|
||||
.sm-mb {margin-bottom: 20px !important;}
|
||||
|
||||
/* What it does: Utility classes to kill border radius for smaller viewports. Used mainly on the email's main container(s). */
|
||||
.bar,
|
||||
.btr,
|
||||
.bbr {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!-- Progressive Enhancements : END -->
|
||||
</head>
|
||||
|
||||
<!--
|
||||
The email background color is defined in three places, just below. If you change one, remember to change the others.
|
||||
1. body tag: for most email clients
|
||||
2. center tag: for Gmail and Inbox mobile apps and web versions of Gmail, GSuite, Inbox, Yahoo, AOL, Libero, Comcast, freenet, Mail.ru, Orange.fr
|
||||
3. mso conditional: For Windows 10 Mail
|
||||
-->
|
||||
<body width="100%" style="margin: 0; padding: 0 !important; background: #f3f3f5; mso-line-height-rule: exactly;">
|
||||
<center style="width: 100%; background: #f3f3f5;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #f3f3f5;">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Visually Hidden Preview Text : BEGIN -->
|
||||
<div style="display: none; font-size: 1px; line-height: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;">
|
||||
{{__ "event_name-registration"}}
|
||||
</div>
|
||||
<!-- Visually Hidden Preview Text : END -->
|
||||
|
||||
<div class="email-container" style="max-width: 680px; margin: 0 auto;">
|
||||
<!--[if mso]>
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="680" align="center">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 680px; width:100%">
|
||||
<tr>
|
||||
<td style="padding: 30px; background-color: #ffffff;" class="sm-p bar">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tr>
|
||||
<td style="padding-bottom: 15px; font-family: arial, sans-serif; font-size: 15px; line-height: 21px; color: #3C3F44; text-align: left;">
|
||||
<h1 style="font-weight: bold; font-size: 27px; line-height: 27px; color: #0C0D0E; margin: 0 0 15px 0;">{{event_name}}</h1>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 15px; font-family: arial, sans-serif; font-size: 15px; line-height: 21px; color: #3C3F44; text-align: left;">
|
||||
<h1 style="font-weight: bold; font-size: 21px; line-height: 21px; color: #0C0D0E; margin: 0 0 15px 0;">{{__ "welcome"}}</h1>
|
||||
<p style="margin: 0 0 15px;" class="has-markdown">
|
||||
{{__ "thanks-for-registering-and-welcome-to-the-event_name"}} <br>
|
||||
{{__ "we-successfully-processed-your-registration"}}<br><br>
|
||||
{{__ "the-only-thing-you-have-to-do-now-is-to-bring-your-registration-code-with-you"}}<br>
|
||||
{{__ "you-can-view-your-registration-code-lap-times-and-much-more-by-visiting-our-selfservice"}}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Button Row : BEGIN -->
|
||||
<tr>
|
||||
<td>
|
||||
<!-- Button : BEGIN -->
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
|
||||
<tr>
|
||||
<td class="s-btn s-btn__primary" style="border-radius: 4px; background: #0095ff;">
|
||||
<a class="s-btn s-btn__primary" href="{{selfservice_link}}" target="_parent" style="background: #0095FF; border: 1px solid #0077cc; box-shadow: inset 0 1px 0 0 rgba(102,191,255,.75); font-family: arial, sans-serif; font-size: 17px; line-height: 17px; color: #ffffff; text-align: center; text-decoration: none; padding: 13px 17px; display: block; border-radius: 4px; white-space: nowrap;">{{__ "view-my-data"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- Button : END -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 15px; font-family: arial, sans-serif; font-size: 15px; line-height: 21px; color: #3C3F44; text-align: left;">
|
||||
<p>Link: <a href="{{selfservice_link}}">{{selfservice_link}}</a><br>
|
||||
{{__ "if-you-ever-loose-the-link-you-can-request-a-new-one-by-visiting-our-website"}} <a href="{{forgot_link}}">{{forgot_link}}</a></p></td>
|
||||
</tr>
|
||||
<!-- Button Row : END -->
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-----------------------------
|
||||
|
||||
EMAIL BODY : END
|
||||
|
||||
------------------------------>
|
||||
|
||||
<!-- Footer : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding: 30px;" class="sm-p">
|
||||
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
||||
<!-- Subscription Info : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding-bottom: 10px; font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
Copyright © {{copyright_owner}}. {{__ "all-rights-reserved"}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
<a href="{{link_imprint}}"
|
||||
style="color: #9199A1; text-decoration: underline;">{{__ "imprint"}}</a>
|
||||
<a href="{{link_privacy}}" style="color: #9199A1; text-decoration: underline;">{{__ "privacy"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Subscription Info : BEGIN -->
|
||||
<!-- HR line : BEGIN -->
|
||||
<tr>
|
||||
<td style="padding: 30px 0;" width="100%" class="sm-py">
|
||||
<table aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%">
|
||||
<tr>
|
||||
<td height="1" width="100%" style="font-size: 0; line-height: 0; border-top: 1px solid #D6D8DB;"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- HR line : END -->
|
||||
<tr>
|
||||
<td style="padding-bottom: 5px; font-size: 12px; line-height: 15px; font-family: arial, sans-serif; color: #9199A1; text-align: left;">
|
||||
{{__ "this-mail-was-sent-to-you-because-someone-used-your-mail-address-to-register-themselfes-for-the-event_name"}}.<br>
|
||||
{{__ "if-you-didnt-register-yourself-you-should-contact-us-to-get-your-data-removed-from-our-systems"}} <a href="mailto:{{contact_mail}}">{{contact_mail}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Sender Info : END -->
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Footer : END -->
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
@ -1,17 +0,0 @@
|
||||
{{__ "event_name-registration"}}
|
||||
|
||||
{{__ "thanks-for-registering-and-welcome-to-the-event_name"}}
|
||||
{{__ "we-successfully-processed-your-registration"}}
|
||||
|
||||
{{__ "the-only-thing-you-have-to-do-now-is-to-bring-your-registration-code-with-you"}}
|
||||
{{__ "you-can-view-your-registration-code-lap-times-and-much-more-by-visiting-our-selfservice"}}
|
||||
|
||||
{{selfservice_link}}
|
||||
|
||||
{{__ "if-you-ever-loose-the-link-you-can-request-a-new-one-by-visiting-our-website"}} {{forgot_link}}
|
||||
|
||||
|
||||
Copyright © {{copyright_owner}}. {{__ "all-rights-reserved"}}.
|
||||
{{__ "imprint"}}: {{link_imprint}} | {{__ "privacy"}}: {{link_privacy}}
|
||||
{{__ "this-mail-was-sent-to-you-because-someone-used-your-mail-address-to-register-themselfes-for-the-event_name"}}
|
||||
{{__ "if-you-didnt-register-yourself-you-should-contact-us-to-get-your-data-removed-from-our-systems"}} {{contact_mail}}
|
@ -1,34 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { config } from '../config';
|
||||
const base = "http://localhost:" + config.internal_port
|
||||
|
||||
describe('GET /docs/openapi.json', () => {
|
||||
it('OpenAPI Spec is availdable 200', async () => {
|
||||
const res = await axios.get(base + '/docs/openapi.json');
|
||||
expect(res.status).toEqual(200);
|
||||
});
|
||||
});
|
||||
describe('GET /docs/swagger.json', () => {
|
||||
it('OpenAPI Spec is availdable 200', async () => {
|
||||
const res = await axios.get(base + '/docs/swagger.json');
|
||||
expect(res.status).toEqual(200);
|
||||
});
|
||||
});
|
||||
describe('GET /docs/swaggerui', () => {
|
||||
it('swaggerui is availdable 200', async () => {
|
||||
const res = await axios.get(base + '/docs/swaggerui');
|
||||
expect(res.status).toEqual(200);
|
||||
});
|
||||
});
|
||||
describe('GET /docs/redoc', () => {
|
||||
it('redoc is availdable 200', async () => {
|
||||
const res = await axios.get(base + '/docs/redoc');
|
||||
expect(res.status).toEqual(200);
|
||||
});
|
||||
});
|
||||
describe('GET /docs/rapidoc', () => {
|
||||
it('rapidoc is availdable 200', async () => {
|
||||
const res = await axios.get(base + '/docs/rapidoc');
|
||||
expect(res.status).toEqual(200);
|
||||
});
|
||||
});
|
@ -1,75 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { config } from '../config';
|
||||
const base = "http://localhost:" + config.internal_port
|
||||
|
||||
const axios_config = {
|
||||
validateStatus: undefined
|
||||
};
|
||||
|
||||
describe('POST /reset without auth', () => {
|
||||
it('Post without auth should return 401', async () => {
|
||||
const res = await axios.post(base + '/reset', null, axios_config);
|
||||
expect(res.status).toEqual(401);
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /reset with auth but wrong body', () => {
|
||||
it('Post with auth but no body should return 400', async () => {
|
||||
const res = await axios.post(base + '/reset?key=' + config.api_key, null, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
it('Post with auth but no mail should return 400', async () => {
|
||||
const res = await axios.post(base + '/reset?key=' + config.api_key, { resetKey: "test" }, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
it('Post with auth but no reset key should return 400', async () => {
|
||||
const res = await axios.post(base + '/reset?key=' + config.api_key, { address: "test@dev.lauf-fuer-kaya.de" }, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
it('Post with auth but invalid mail should return 400', async () => {
|
||||
const res = await axios.post(base + '/reset?key=' + config.api_key, { resetKey: "test", address: "testdev.l.de" }, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /reset with auth and vaild body', () => {
|
||||
it('Post with auth, body and no locale should return 200', async () => {
|
||||
const res = await axios.post(base + '/reset?key=' + config.api_key, {
|
||||
resetKey: "test",
|
||||
address: "test@dev.lauf-fuer-kaya.de"
|
||||
}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "en",
|
||||
type: "PASSWORD_RESET"
|
||||
})
|
||||
});
|
||||
it('Post with auth, body and locale=en should return 200', async () => {
|
||||
const res = await axios.post(base + '/reset?locale=en&key=' + config.api_key, {
|
||||
resetKey: "test",
|
||||
address: "test@dev.lauf-fuer-kaya.de"
|
||||
}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "en",
|
||||
type: "PASSWORD_RESET"
|
||||
})
|
||||
});
|
||||
it('Post with auth, body and locale=de should return 200', async () => {
|
||||
const res = await axios.post(base + '/reset?locale=de&key=' + config.api_key, {
|
||||
resetKey: "test",
|
||||
address: "test@dev.lauf-fuer-kaya.de"
|
||||
}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "de",
|
||||
type: "PASSWORD_RESET"
|
||||
})
|
||||
});
|
||||
});
|
@ -1,75 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { config } from '../config';
|
||||
const base = "http://localhost:" + config.internal_port
|
||||
|
||||
const axios_config = {
|
||||
validateStatus: undefined
|
||||
};
|
||||
|
||||
describe('POST /registration_forgot without auth', () => {
|
||||
it('Post without auth should return 401', async () => {
|
||||
const res = await axios.post(base + '/registration_forgot', null, axios_config);
|
||||
expect(res.status).toEqual(401);
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /registration_forgot with auth but wrong body', () => {
|
||||
it('Post with auth but no body should return 400', async () => {
|
||||
const res = await axios.post(base + '/registration_forgot?key=' + config.api_key, null, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
it('Post with auth but no mail should return 400', async () => {
|
||||
const res = await axios.post(base + '/registration_forgot?key=' + config.api_key, { selfserviceToken: "test" }, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
it('Post with auth but no reset key should return 400', async () => {
|
||||
const res = await axios.post(base + '/registration_forgot?key=' + config.api_key, { address: "test@dev.lauf-fuer-kaya.de" }, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
it('Post with auth but invalid mail should return 400', async () => {
|
||||
const res = await axios.post(base + '/registration_forgot?key=' + config.api_key, { selfserviceToken: "test", address: "testdev.l.de" }, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /reset with auth and vaild body', () => {
|
||||
it('Post with auth, body and no locale should return 200', async () => {
|
||||
const res = await axios.post(base + '/registration_forgot?key=' + config.api_key, {
|
||||
selfserviceToken: "test",
|
||||
address: "test@dev.lauf-fuer-kaya.de"
|
||||
}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "en",
|
||||
type: "RUNNER_FORGOT"
|
||||
})
|
||||
});
|
||||
it('Post with auth, body and locale=en should return 200', async () => {
|
||||
const res = await axios.post(base + '/registration_forgot?locale=en&key=' + config.api_key, {
|
||||
selfserviceToken: "test",
|
||||
address: "test@dev.lauf-fuer-kaya.de"
|
||||
}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "en",
|
||||
type: "RUNNER_FORGOT"
|
||||
})
|
||||
});
|
||||
it('Post with auth, body and locale=de should return 200', async () => {
|
||||
const res = await axios.post(base + '/registration_forgot?locale=de&key=' + config.api_key, {
|
||||
selfserviceToken: "test",
|
||||
address: "test@dev.lauf-fuer-kaya.de"
|
||||
}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "de",
|
||||
type: "RUNNER_FORGOT"
|
||||
})
|
||||
});
|
||||
});
|
@ -1,75 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { config } from '../config';
|
||||
const base = "http://localhost:" + config.internal_port
|
||||
|
||||
const axios_config = {
|
||||
validateStatus: undefined
|
||||
};
|
||||
|
||||
describe('POST /registration without auth', () => {
|
||||
it('Post without auth should return 401', async () => {
|
||||
const res = await axios.post(base + '/registration', null, axios_config);
|
||||
expect(res.status).toEqual(401);
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /registration with auth but wrong body', () => {
|
||||
it('Post with auth but no body should return 400', async () => {
|
||||
const res = await axios.post(base + '/registration?key=' + config.api_key, null, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
it('Post with auth but no mail should return 400', async () => {
|
||||
const res = await axios.post(base + '/registration?key=' + config.api_key, { selfserviceToken: "test" }, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
it('Post with auth but no reset key should return 400', async () => {
|
||||
const res = await axios.post(base + '/registration?key=' + config.api_key, { address: "test@dev.lauf-fuer-kaya.de" }, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
it('Post with auth but invalid mail should return 400', async () => {
|
||||
const res = await axios.post(base + '/registration?key=' + config.api_key, { selfserviceToken: "test", address: "testdev.l.de" }, axios_config);
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /reset with auth and vaild body', () => {
|
||||
it('Post with auth, body and no locale should return 200', async () => {
|
||||
const res = await axios.post(base + '/registration?key=' + config.api_key, {
|
||||
selfserviceToken: "test",
|
||||
address: "test@dev.lauf-fuer-kaya.de"
|
||||
}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "en",
|
||||
type: "RUNNER_WELCOME"
|
||||
})
|
||||
});
|
||||
it('Post with auth, body and locale=en should return 200', async () => {
|
||||
const res = await axios.post(base + '/registration?locale=en&key=' + config.api_key, {
|
||||
selfserviceToken: "test",
|
||||
address: "test@dev.lauf-fuer-kaya.de"
|
||||
}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "en",
|
||||
type: "RUNNER_WELCOME"
|
||||
})
|
||||
});
|
||||
it('Post with auth, body and locale=de should return 200', async () => {
|
||||
const res = await axios.post(base + '/registration?locale=de&key=' + config.api_key, {
|
||||
selfserviceToken: "test",
|
||||
address: "test@dev.lauf-fuer-kaya.de"
|
||||
}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "de",
|
||||
type: "RUNNER_WELCOME"
|
||||
})
|
||||
});
|
||||
});
|
@ -1,47 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { config } from '../config';
|
||||
const base = "http://localhost:" + config.internal_port
|
||||
|
||||
const axios_config = {
|
||||
validateStatus: undefined
|
||||
};
|
||||
|
||||
describe('POST /test without auth', () => {
|
||||
it('Post without auth should return 401', async () => {
|
||||
const res = await axios.post(base + '/test', null, axios_config);
|
||||
expect(res.status).toEqual(401);
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /test with auth', () => {
|
||||
it('Post with auth and no locale should return 200', async () => {
|
||||
const res = await axios.post(base + '/test?key=' + config.api_key, null, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "en",
|
||||
type: "TEST"
|
||||
})
|
||||
});
|
||||
it('Post with auth and locale=en should return 200', async () => {
|
||||
const res = await axios.post(base + '/test?locale=en&key=' + config.api_key, null, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "en",
|
||||
type: "TEST"
|
||||
})
|
||||
});
|
||||
it('Post with auth and locale=de should return 200', async () => {
|
||||
const res = await axios.post(base + '/test?locale=de&key=' + config.api_key, null, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.data).toEqual({
|
||||
success: true,
|
||||
message: "Sent!",
|
||||
locale: "de",
|
||||
type: "TEST"
|
||||
})
|
||||
});
|
||||
});
|
6
src/types.ts
Normal file
6
src/types.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export type Language = 'en' | 'de'
|
||||
|
||||
export interface EmailTemplate {
|
||||
html: (data: any) => string
|
||||
text: (data: any) => string
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
"esModuleInterop": true,
|
||||
"strict": false,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"sourceMap": false
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user