mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 2473-feature-emails-further-design-of-html-emails
This commit is contained in:
commit
704881df8d
2
.github/file-filters.yml
vendored
2
.github/file-filters.yml
vendored
@ -33,7 +33,7 @@ admin: &admin
|
|||||||
dht_node: &dht_node
|
dht_node: &dht_node
|
||||||
- 'dht-node/**/*'
|
- 'dht-node/**/*'
|
||||||
|
|
||||||
docker: &docker
|
docker-compose: &docker-compose
|
||||||
- 'docker-compose.*'
|
- 'docker-compose.*'
|
||||||
|
|
||||||
federation: &federation
|
federation: &federation
|
||||||
|
|||||||
@ -3,14 +3,12 @@ name: Gradido DHT Node Test CI
|
|||||||
on: push
|
on: push
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# only (but most important) job from this workflow required for pull requests
|
|
||||||
# check results serve as run conditions for all other jobs here
|
|
||||||
files-changed:
|
files-changed:
|
||||||
name: Detect File Changes - DHT Node
|
name: Detect File Changes - DHT Node
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
dht_node: ${{ steps.changes.outputs.dht_node }}
|
dht_node: ${{ steps.changes.outputs.dht_node }}
|
||||||
docker: ${{ steps.changes.outputs.docker }}
|
docker-compose: ${{ steps.changes.outputs.docker-compose }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v3.3.0
|
||||||
|
|
||||||
@ -22,12 +20,9 @@ jobs:
|
|||||||
filters: .github/file-filters.yml
|
filters: .github/file-filters.yml
|
||||||
list-files: shell
|
list-files: shell
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: DOCKER BUILD TEST #####################################################
|
|
||||||
##############################################################################
|
|
||||||
build:
|
build:
|
||||||
name: Docker Build Test - DHT Node
|
name: Docker Build Test - DHT Node
|
||||||
if: needs.files-changed.outputs.dht_node == 'true' || needs.files-changed.outputs.docker == 'true'
|
if: needs.files-changed.outputs.dht_node == 'true'
|
||||||
needs: files-changed
|
needs: files-changed
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -45,9 +40,6 @@ jobs:
|
|||||||
name: docker-dht-node-test
|
name: docker-dht-node-test
|
||||||
path: /tmp/dht-node.tar
|
path: /tmp/dht-node.tar
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: LINT ##################################################################
|
|
||||||
##############################################################################
|
|
||||||
lint:
|
lint:
|
||||||
name: Lint - DHT Node
|
name: Lint - DHT Node
|
||||||
if: needs.files-changed.outputs.dht_node == 'true'
|
if: needs.files-changed.outputs.dht_node == 'true'
|
||||||
@ -60,12 +52,9 @@ jobs:
|
|||||||
- name: Lint
|
- name: Lint
|
||||||
run: cd dht-node && yarn && yarn run lint
|
run: cd dht-node && yarn && yarn run lint
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: UNIT TEST #############################################################
|
|
||||||
##############################################################################
|
|
||||||
unit_test:
|
unit_test:
|
||||||
name: Unit Tests - DHT Node
|
name: Unit Tests - DHT Node
|
||||||
if: needs.files-changed.outputs.dht_node == 'true' || needs.files-changed.outputs.docker == 'true'
|
if: needs.files-changed.outputs.dht_node == 'true' || needs.files-changed.outputs.docker-compose == 'true'
|
||||||
needs: [files-changed, build]
|
needs: [files-changed, build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
17
.github/workflows/test_federation.yml
vendored
17
.github/workflows/test_federation.yml
vendored
@ -3,13 +3,11 @@ name: Gradido Federation Test CI
|
|||||||
on: push
|
on: push
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# only (but most important) job from this workflow required for pull requests
|
|
||||||
# check results serve as run conditions for all other jobs here
|
|
||||||
files-changed:
|
files-changed:
|
||||||
name: Detect File Changes - Federation
|
name: Detect File Changes - Federation
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
docker: ${{ steps.changes.outputs.docker }}
|
docker-compose: ${{ steps.changes.outputs.docker-compose }}
|
||||||
federation: ${{ steps.changes.outputs.federation }}
|
federation: ${{ steps.changes.outputs.federation }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v3.3.0
|
||||||
@ -22,12 +20,9 @@ jobs:
|
|||||||
filters: .github/file-filters.yml
|
filters: .github/file-filters.yml
|
||||||
list-files: shell
|
list-files: shell
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: DOCKER BUILD TEST #####################################################
|
|
||||||
##############################################################################
|
|
||||||
build:
|
build:
|
||||||
name: Docker Build Test - Federation
|
name: Docker Build Test - Federation
|
||||||
if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.federation == 'true'
|
if: needs.files-changed.outputs.federation == 'true'
|
||||||
needs: files-changed
|
needs: files-changed
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -45,9 +40,6 @@ jobs:
|
|||||||
name: docker-federation-test
|
name: docker-federation-test
|
||||||
path: /tmp/federation.tar
|
path: /tmp/federation.tar
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: LINT ##################################################################
|
|
||||||
##############################################################################
|
|
||||||
lint:
|
lint:
|
||||||
name: Lint - Federation
|
name: Lint - Federation
|
||||||
if: needs.files-changed.outputs.federation == 'true'
|
if: needs.files-changed.outputs.federation == 'true'
|
||||||
@ -60,12 +52,9 @@ jobs:
|
|||||||
- name: Lint
|
- name: Lint
|
||||||
run: cd federation && yarn && yarn run lint
|
run: cd federation && yarn && yarn run lint
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: UNIT TEST #############################################################
|
|
||||||
##############################################################################
|
|
||||||
unit_test:
|
unit_test:
|
||||||
name: Unit Tests - Federation
|
name: Unit Tests - Federation
|
||||||
if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.federation == 'true'
|
if: needs.files-changed.outputs.docker-compose == 'true' || needs.files-changed.outputs.federation == 'true'
|
||||||
needs: [files-changed, build]
|
needs: [files-changed, build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
64
CHANGELOG.md
64
CHANGELOG.md
@ -4,8 +4,72 @@ All notable changes to this project will be documented in this file. Dates are d
|
|||||||
|
|
||||||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||||
|
|
||||||
|
#### [1.20.0](https://github.com/gradido/gradido/compare/1.19.1...1.20.0)
|
||||||
|
|
||||||
|
- fix(backend): no await for emails [`#2918`](https://github.com/gradido/gradido/pull/2918)
|
||||||
|
- fix(frontend): no receiver on send by link [`#2933`](https://github.com/gradido/gradido/pull/2933)
|
||||||
|
- fix(admin): pagination set currentPage by switch tabs [`#2902`](https://github.com/gradido/gradido/pull/2902)
|
||||||
|
- fix(federation): correct export of the community url [`#2931`](https://github.com/gradido/gradido/pull/2931)
|
||||||
|
- fix(frontend): displayed decay duration [`#2927`](https://github.com/gradido/gradido/pull/2927)
|
||||||
|
- fix(frontend): community tab navigation [`#2928`](https://github.com/gradido/gradido/pull/2928)
|
||||||
|
- fix(frontend): moderator id missing [`#2925`](https://github.com/gradido/gradido/pull/2925)
|
||||||
|
- fix(frontend): reset button send coins [`#2924`](https://github.com/gradido/gradido/pull/2924)
|
||||||
|
- refactor(backend): eslint plugin import export style [`#2908`](https://github.com/gradido/gradido/pull/2908)
|
||||||
|
- fix(backend): vscode intellisense fixes [`#2919`](https://github.com/gradido/gradido/pull/2919)
|
||||||
|
- refactor(backend): eslint import-no-cycle enabled [`#2905`](https://github.com/gradido/gradido/pull/2905)
|
||||||
|
- docs(backend): alias rules and conventions [`#2881`](https://github.com/gradido/gradido/pull/2881)
|
||||||
|
- refactor(backend): get transaction list [`#2923`](https://github.com/gradido/gradido/pull/2923)
|
||||||
|
- feat(backend): previous balance in transaction [`#2914`](https://github.com/gradido/gradido/pull/2914)
|
||||||
|
- refactor(backend): eslint update packages [`#2829`](https://github.com/gradido/gradido/pull/2829)
|
||||||
|
- feat(frontend): send coins via gradido ID [`#2837`](https://github.com/gradido/gradido/pull/2837)
|
||||||
|
- refactor(database): cleanup database [`#2808`](https://github.com/gradido/gradido/pull/2808)
|
||||||
|
- refactor(backend): eslint plugin n + fixes [`#2828`](https://github.com/gradido/gradido/pull/2828)
|
||||||
|
- feat(frontend): add link to download QR-Code [`#2889`](https://github.com/gradido/gradido/pull/2889)
|
||||||
|
- fix(other): delete node_modules and /tmp/yarn--* on start.sh [`#2904`](https://github.com/gradido/gradido/pull/2904)
|
||||||
|
- fix(admin): add confirmation modal for user role change and user (un)deletion [`#2880`](https://github.com/gradido/gradido/pull/2880)
|
||||||
|
- fix(admin): admin open contribution edit button [`#2811`](https://github.com/gradido/gradido/pull/2811)
|
||||||
|
- fix(backend): import order [`#2911`](https://github.com/gradido/gradido/pull/2911)
|
||||||
|
- fix(other): use default values for undefined .env database values [`#2910`](https://github.com/gradido/gradido/pull/2910)
|
||||||
|
- refactor(backend): eslint plugin import + fixes [`#2827`](https://github.com/gradido/gradido/pull/2827)
|
||||||
|
- refactor(backend): missing event tests [`#2900`](https://github.com/gradido/gradido/pull/2900)
|
||||||
|
- refactor(backend): unify event names [`#2799`](https://github.com/gradido/gradido/pull/2799)
|
||||||
|
- feat(backend): events for users [`#2797`](https://github.com/gradido/gradido/pull/2797)
|
||||||
|
- fix(backend): subscription get's email and languages from user [`#2885`](https://github.com/gradido/gradido/pull/2885)
|
||||||
|
- refactor(backend): eslint-plugin-jest + fixes [`#2816`](https://github.com/gradido/gradido/pull/2816)
|
||||||
|
- fix(frontend): fr change ` and ´ to ' [`#2888`](https://github.com/gradido/gradido/pull/2888)
|
||||||
|
- feat(backend): events for transaction links [`#2792`](https://github.com/gradido/gradido/pull/2792)
|
||||||
|
- feat(backend): events for contributions [`#2784`](https://github.com/gradido/gradido/pull/2784)
|
||||||
|
- feat(backend): events for contribution messages [`#2783`](https://github.com/gradido/gradido/pull/2783)
|
||||||
|
- refactor(backend): upgrade coverage to 85% [`#2884`](https://github.com/gradido/gradido/pull/2884)
|
||||||
|
- refactor(backend): add klicktipp-api library [`#2883`](https://github.com/gradido/gradido/pull/2883)
|
||||||
|
- feat(backend): events for contribution links [`#2780`](https://github.com/gradido/gradido/pull/2780)
|
||||||
|
- refactor(backend): separate events in own files [`#2777`](https://github.com/gradido/gradido/pull/2777)
|
||||||
|
- refactor(backend): rename `evenProtocolType` to `eventType` [`#2776`](https://github.com/gradido/gradido/pull/2776)
|
||||||
|
- refactor(other): add yarn installAll on gradido folder [`#2703`](https://github.com/gradido/gradido/pull/2703)
|
||||||
|
- docs(federation): describe the technical federation architecture [`#2716`](https://github.com/gradido/gradido/pull/2716)
|
||||||
|
- refactor(admin): admin list contributions for creation transaction list query [`#2791`](https://github.com/gradido/gradido/pull/2791)
|
||||||
|
- refactor(workflow): separate workflow with file filter for nginx testing [`#2871`](https://github.com/gradido/gradido/pull/2871)
|
||||||
|
- feat(backend): read communities data from database [`#2807`](https://github.com/gradido/gradido/pull/2807)
|
||||||
|
- feat(federation): implement a graphql endpoint to answer getpublickey-request [`#2651`](https://github.com/gradido/gradido/pull/2651)
|
||||||
|
- refactor(workflow): add file filters to dht node and federation workflows [`#2838`](https://github.com/gradido/gradido/pull/2838)
|
||||||
|
- refactor(workflow): separate test workflow for end-to-end tests [`#2836`](https://github.com/gradido/gradido/pull/2836)
|
||||||
|
- refactor(workflow): separate test workflow for frontend [`#2835`](https://github.com/gradido/gradido/pull/2835)
|
||||||
|
- feat(federation): add federation modul to deployment scripts [`#2733`](https://github.com/gradido/gradido/pull/2733)
|
||||||
|
- refactor(database): event table [`#2720`](https://github.com/gradido/gradido/pull/2720)
|
||||||
|
- refactor(workflow): separate test workflow with file change filters for admin interface [`#2734`](https://github.com/gradido/gradido/pull/2734)
|
||||||
|
- fix(admin): fix translation in menu (english) [`#2814`](https://github.com/gradido/gradido/pull/2814)
|
||||||
|
- refactor(workflow): configure jest to directly check coverage to schlanken the test workflows [`#2790`](https://github.com/gradido/gradido/pull/2790)
|
||||||
|
- fix(database): removed commands from package.json not working [`#2805`](https://github.com/gradido/gradido/pull/2805)
|
||||||
|
- fix(other): repair UserProfile.ChangePassword.feature scenario [`#2782`](https://github.com/gradido/gradido/pull/2782)
|
||||||
|
- feat(backend): test double redeem transaction links [`#2788`](https://github.com/gradido/gradido/pull/2788)
|
||||||
|
- feat(backend): admin open creations query [`#2813`](https://github.com/gradido/gradido/pull/2813)
|
||||||
|
- refactor(backend): eslint-plugin-type-graphql + fixes [`#2745`](https://github.com/gradido/gradido/pull/2745)
|
||||||
|
|
||||||
#### [1.19.1](https://github.com/gradido/gradido/compare/1.19.0...1.19.1)
|
#### [1.19.1](https://github.com/gradido/gradido/compare/1.19.0...1.19.1)
|
||||||
|
|
||||||
|
> 10 March 2023
|
||||||
|
|
||||||
|
- chore(other): upgrade version to 1.19.1 [`#2812`](https://github.com/gradido/gradido/pull/2812)
|
||||||
- fix(frontend): admin question clickable [`#2810`](https://github.com/gradido/gradido/pull/2810)
|
- fix(frontend): admin question clickable [`#2810`](https://github.com/gradido/gradido/pull/2810)
|
||||||
- refactor(frontend): change b-img to b-icon send [`#2809`](https://github.com/gradido/gradido/pull/2809)
|
- refactor(frontend): change b-img to b-icon send [`#2809`](https://github.com/gradido/gradido/pull/2809)
|
||||||
- fix(admin): update openCreation in case of tab open. [`#2806`](https://github.com/gradido/gradido/pull/2806)
|
- fix(admin): update openCreation in case of tab open. [`#2806`](https://github.com/gradido/gradido/pull/2806)
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"description": "Administraion Interface for Gradido",
|
"description": "Administraion Interface for Gradido",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"author": "Moriz Wahl",
|
"author": "Moriz Wahl",
|
||||||
"version": "1.19.1",
|
"version": "1.20.0",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ module.exports = {
|
|||||||
node: true,
|
node: true,
|
||||||
},
|
},
|
||||||
parser: '@typescript-eslint/parser',
|
parser: '@typescript-eslint/parser',
|
||||||
plugins: ['prettier', '@typescript-eslint', 'type-graphql', 'jest', 'import', 'n'],
|
plugins: ['prettier', '@typescript-eslint', 'type-graphql', 'jest', 'import', 'n', 'promise'],
|
||||||
extends: [
|
extends: [
|
||||||
'standard',
|
'standard',
|
||||||
'eslint:recommended',
|
'eslint:recommended',
|
||||||
@ -142,6 +142,21 @@ module.exports = {
|
|||||||
'n/prefer-global/url-search-params': 'error',
|
'n/prefer-global/url-search-params': 'error',
|
||||||
'n/prefer-promises/dns': 'error',
|
'n/prefer-promises/dns': 'error',
|
||||||
'n/prefer-promises/fs': 'error',
|
'n/prefer-promises/fs': 'error',
|
||||||
|
// promise
|
||||||
|
'promise/catch-or-return': 'error',
|
||||||
|
'promise/no-return-wrap': 'error',
|
||||||
|
'promise/param-names': 'error',
|
||||||
|
'promise/always-return': 'error',
|
||||||
|
'promise/no-native': 'off',
|
||||||
|
'promise/no-nesting': 'warn',
|
||||||
|
'promise/no-promise-in-callback': 'warn',
|
||||||
|
'promise/no-callback-in-promise': 'warn',
|
||||||
|
'promise/avoid-new': 'warn',
|
||||||
|
'promise/no-new-statics': 'error',
|
||||||
|
'promise/no-return-in-finally': 'warn',
|
||||||
|
'promise/valid-params': 'warn',
|
||||||
|
'promise/prefer-await-to-callbacks': 'error',
|
||||||
|
'promise/no-multiple-resolved': 'error',
|
||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
// only for ts files
|
// only for ts files
|
||||||
|
|||||||
@ -1,9 +1,14 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
semi: false,
|
|
||||||
printWidth: 100,
|
printWidth: 100,
|
||||||
singleQuote: true,
|
|
||||||
trailingComma: "all",
|
|
||||||
tabWidth: 2,
|
tabWidth: 2,
|
||||||
|
useTabs: false,
|
||||||
|
semi: false,
|
||||||
|
singleQuote: true,
|
||||||
|
quoteProps: "as-needed",
|
||||||
|
jsxSingleQuote: true,
|
||||||
|
trailingComma: "all",
|
||||||
bracketSpacing: true,
|
bracketSpacing: true,
|
||||||
|
bracketSameLine: false,
|
||||||
|
arrowParens: "always",
|
||||||
endOfLine: "auto",
|
endOfLine: "auto",
|
||||||
};
|
};
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
"pattern": "yyyy-MM-dd",
|
"pattern": "yyyy-MM-dd",
|
||||||
"layout":
|
"layout":
|
||||||
{
|
{
|
||||||
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
||||||
},
|
},
|
||||||
"keepFileExt" : true,
|
"keepFileExt" : true,
|
||||||
"fileNameSep" : "_",
|
"fileNameSep" : "_",
|
||||||
@ -21,7 +21,7 @@
|
|||||||
"pattern": "yyyy-MM-dd",
|
"pattern": "yyyy-MM-dd",
|
||||||
"layout":
|
"layout":
|
||||||
{
|
{
|
||||||
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
||||||
},
|
},
|
||||||
"keepFileExt" : true,
|
"keepFileExt" : true,
|
||||||
"fileNameSep" : "_",
|
"fileNameSep" : "_",
|
||||||
@ -34,7 +34,7 @@
|
|||||||
"pattern": "yyyy-MM-dd",
|
"pattern": "yyyy-MM-dd",
|
||||||
"layout":
|
"layout":
|
||||||
{
|
{
|
||||||
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
||||||
},
|
},
|
||||||
"keepFileExt" : true,
|
"keepFileExt" : true,
|
||||||
"fileNameSep" : "_",
|
"fileNameSep" : "_",
|
||||||
@ -47,7 +47,7 @@
|
|||||||
"pattern": "yyyy-MM-dd",
|
"pattern": "yyyy-MM-dd",
|
||||||
"layout":
|
"layout":
|
||||||
{
|
{
|
||||||
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
||||||
},
|
},
|
||||||
"keepFileExt" : true,
|
"keepFileExt" : true,
|
||||||
"fileNameSep" : "_",
|
"fileNameSep" : "_",
|
||||||
@ -60,7 +60,7 @@
|
|||||||
"pattern": "yyyy-MM-dd",
|
"pattern": "yyyy-MM-dd",
|
||||||
"layout":
|
"layout":
|
||||||
{
|
{
|
||||||
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m %s"
|
||||||
},
|
},
|
||||||
"keepFileExt" : true,
|
"keepFileExt" : true,
|
||||||
"fileNameSep" : "_",
|
"fileNameSep" : "_",
|
||||||
@ -77,7 +77,7 @@
|
|||||||
"type": "stdout",
|
"type": "stdout",
|
||||||
"layout":
|
"layout":
|
||||||
{
|
{
|
||||||
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"apolloOut":
|
"apolloOut":
|
||||||
@ -85,7 +85,7 @@
|
|||||||
"type": "stdout",
|
"type": "stdout",
|
||||||
"layout":
|
"layout":
|
||||||
{
|
{
|
||||||
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido-backend",
|
"name": "gradido-backend",
|
||||||
"version": "1.19.1",
|
"version": "1.20.0",
|
||||||
"description": "Gradido unified backend providing an API-Service for Gradido Transactions",
|
"description": "Gradido unified backend providing an API-Service for Gradido Transactions",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": "https://github.com/gradido/gradido/backend",
|
"repository": "https://github.com/gradido/gradido/backend",
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||||
@ -9,39 +10,35 @@ import { backendLogger as logger } from '@/server/logger'
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
export const apiPost = async (url: string, payload: unknown): Promise<any> => {
|
export const apiPost = async (url: string, payload: unknown): Promise<any> => {
|
||||||
logger.trace('POST', url, payload)
|
logger.trace('POST', url, payload)
|
||||||
return axios
|
try {
|
||||||
.post(url, payload)
|
const result = await axios.post(url, payload)
|
||||||
.then((result) => {
|
logger.trace('POST-Response', result)
|
||||||
logger.trace('POST-Response', result)
|
if (result.status !== 200) {
|
||||||
if (result.status !== 200) {
|
throw new LogError('HTTP Status Error', result.status)
|
||||||
throw new LogError('HTTP Status Error', result.status)
|
}
|
||||||
}
|
if (result.data.state !== 'success') {
|
||||||
if (result.data.state !== 'success') {
|
throw new LogError(result.data.msg)
|
||||||
throw new Error(result.data.msg)
|
}
|
||||||
}
|
return { success: true, data: result.data }
|
||||||
return { success: true, data: result.data }
|
} catch (error: any) {
|
||||||
})
|
return { success: false, data: error.message }
|
||||||
.catch((error) => {
|
}
|
||||||
return { success: false, data: error.message }
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
export const apiGet = async (url: string): Promise<any> => {
|
export const apiGet = async (url: string): Promise<any> => {
|
||||||
logger.trace('GET: url=' + url)
|
logger.trace('GET: url=' + url)
|
||||||
return axios
|
try {
|
||||||
.get(url)
|
const result = await axios.get(url)
|
||||||
.then((result) => {
|
logger.trace('GET-Response', result)
|
||||||
logger.trace('GET-Response', result)
|
if (result.status !== 200) {
|
||||||
if (result.status !== 200) {
|
throw new LogError('HTTP Status Error', result.status)
|
||||||
throw new LogError('HTTP Status Error', result.status)
|
}
|
||||||
}
|
if (!['success', 'warning'].includes(result.data.state)) {
|
||||||
if (!['success', 'warning'].includes(result.data.state)) {
|
throw new LogError(result.data.msg)
|
||||||
throw new Error(result.data.msg)
|
}
|
||||||
}
|
return { success: true, data: result.data }
|
||||||
return { success: true, data: result.data }
|
} catch (error: any) {
|
||||||
})
|
return { success: false, data: error.message }
|
||||||
.catch((error) => {
|
}
|
||||||
return { success: false, data: error.message }
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,7 +76,7 @@ const email = {
|
|||||||
EMAIL_SENDER: process.env.EMAIL_SENDER || 'info@gradido.net',
|
EMAIL_SENDER: process.env.EMAIL_SENDER || 'info@gradido.net',
|
||||||
EMAIL_PASSWORD: process.env.EMAIL_PASSWORD || '',
|
EMAIL_PASSWORD: process.env.EMAIL_PASSWORD || '',
|
||||||
EMAIL_SMTP_URL: process.env.EMAIL_SMTP_URL || 'mailserver',
|
EMAIL_SMTP_URL: process.env.EMAIL_SMTP_URL || 'mailserver',
|
||||||
EMAIL_SMTP_PORT: process.env.EMAIL_SMTP_PORT || '1025',
|
EMAIL_SMTP_PORT: Number(process.env.EMAIL_SMTP_PORT) || 1025,
|
||||||
// eslint-disable-next-line no-unneeded-ternary
|
// eslint-disable-next-line no-unneeded-ternary
|
||||||
EMAIL_TLS: process.env.EMAIL_TLS === 'false' ? false : true,
|
EMAIL_TLS: process.env.EMAIL_TLS === 'false' ? false : true,
|
||||||
EMAIL_LINK_VERIFICATION:
|
EMAIL_LINK_VERIFICATION:
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { sendEmailTranslated } from './sendEmailTranslated'
|
|||||||
|
|
||||||
CONFIG.EMAIL = false
|
CONFIG.EMAIL = false
|
||||||
CONFIG.EMAIL_SMTP_URL = 'EMAIL_SMTP_URL'
|
CONFIG.EMAIL_SMTP_URL = 'EMAIL_SMTP_URL'
|
||||||
CONFIG.EMAIL_SMTP_PORT = '1234'
|
CONFIG.EMAIL_SMTP_PORT = 1234
|
||||||
CONFIG.EMAIL_USERNAME = 'user'
|
CONFIG.EMAIL_USERNAME = 'user'
|
||||||
CONFIG.EMAIL_PASSWORD = 'pwd'
|
CONFIG.EMAIL_PASSWORD = 'pwd'
|
||||||
CONFIG.EMAIL_TLS = true
|
CONFIG.EMAIL_TLS = true
|
||||||
@ -31,7 +31,7 @@ jest.mock('nodemailer', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('sendEmailTranslated', () => {
|
describe('sendEmailTranslated', () => {
|
||||||
let result: Record<string, unknown> | null
|
let result: Record<string, unknown> | boolean | null
|
||||||
|
|
||||||
describe('config email is false', () => {
|
describe('config email is false', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
import Email from 'email-templates'
|
import Email from 'email-templates'
|
||||||
@ -6,44 +7,46 @@ import i18n from 'i18n'
|
|||||||
import { createTransport } from 'nodemailer'
|
import { createTransport } from 'nodemailer'
|
||||||
|
|
||||||
import { CONFIG } from '@/config'
|
import { CONFIG } from '@/config'
|
||||||
import { LogError } from '@/server/LogError'
|
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
|
||||||
export const sendEmailTranslated = async (params: {
|
export const sendEmailTranslated = async ({
|
||||||
|
receiver,
|
||||||
|
template,
|
||||||
|
locals,
|
||||||
|
}: {
|
||||||
receiver: {
|
receiver: {
|
||||||
to: string
|
to: string
|
||||||
cc?: string
|
cc?: string
|
||||||
}
|
}
|
||||||
template: string
|
template: string
|
||||||
locals: Record<string, unknown>
|
locals: Record<string, unknown>
|
||||||
}): Promise<Record<string, unknown> | null> => {
|
}): Promise<Record<string, unknown> | boolean | null> => {
|
||||||
let resultSend: Record<string, unknown> | null = null
|
|
||||||
|
|
||||||
// TODO: test the calling order of 'i18n.setLocale' for example: language of logging 'en', language of email receiver 'es', reset language of current user 'de'
|
// TODO: test the calling order of 'i18n.setLocale' for example: language of logging 'en', language of email receiver 'es', reset language of current user 'de'
|
||||||
|
|
||||||
// because language of receiver can differ from language of current user who triggers the sending
|
|
||||||
const rememberLocaleToRestore = i18n.getLocale()
|
|
||||||
|
|
||||||
i18n.setLocale('en') // for logging
|
|
||||||
logger.info(
|
|
||||||
`send Email: language=${params.locals.locale} to=${params.receiver.to}` +
|
|
||||||
(params.receiver.cc ? `, cc=${params.receiver.cc}` : '') +
|
|
||||||
`, subject=${i18n.__('emails.' + params.template + '.subject')}`,
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!CONFIG.EMAIL) {
|
if (!CONFIG.EMAIL) {
|
||||||
logger.info(`Emails are disabled via config...`)
|
logger.info(`Emails are disabled via config...`)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// because language of receiver can differ from language of current user who triggers the sending
|
||||||
|
// const rememberLocaleToRestore = i18n.getLocale()
|
||||||
|
|
||||||
|
i18n.setLocale('en') // for logging
|
||||||
|
logger.info(
|
||||||
|
`send Email: language=${locals.locale as string} to=${receiver.to}` +
|
||||||
|
(receiver.cc ? `, cc=${receiver.cc}` : '') +
|
||||||
|
`, subject=${i18n.__('emails.' + template + '.subject')}`,
|
||||||
|
)
|
||||||
|
|
||||||
if (CONFIG.EMAIL_TEST_MODUS) {
|
if (CONFIG.EMAIL_TEST_MODUS) {
|
||||||
logger.info(
|
logger.info(
|
||||||
`Testmodus=ON: change receiver from ${params.receiver.to} to ${CONFIG.EMAIL_TEST_RECEIVER}`,
|
`Testmodus=ON: change receiver from ${receiver.to} to ${CONFIG.EMAIL_TEST_RECEIVER}`,
|
||||||
)
|
)
|
||||||
params.receiver.to = CONFIG.EMAIL_TEST_RECEIVER
|
receiver.to = CONFIG.EMAIL_TEST_RECEIVER
|
||||||
}
|
}
|
||||||
const transport = createTransport({
|
const transport = createTransport({
|
||||||
host: CONFIG.EMAIL_SMTP_URL,
|
host: CONFIG.EMAIL_SMTP_URL,
|
||||||
port: Number(CONFIG.EMAIL_SMTP_PORT),
|
port: CONFIG.EMAIL_SMTP_PORT,
|
||||||
secure: false, // true for 465, false for other ports
|
secure: false, // true for 465, false for other ports
|
||||||
requireTLS: CONFIG.EMAIL_TLS,
|
requireTLS: CONFIG.EMAIL_TLS,
|
||||||
auth: {
|
auth: {
|
||||||
@ -52,7 +55,7 @@ export const sendEmailTranslated = async (params: {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
i18n.setLocale(params.locals.locale as string) // for email
|
i18n.setLocale(locals.locale as string) // for email
|
||||||
|
|
||||||
// TESTING: see 'README.md'
|
// TESTING: see 'README.md'
|
||||||
const email = new Email({
|
const email = new Email({
|
||||||
@ -64,23 +67,16 @@ export const sendEmailTranslated = async (params: {
|
|||||||
// i18n, // is only needed if you don't install i18n
|
// i18n, // is only needed if you don't install i18n
|
||||||
})
|
})
|
||||||
|
|
||||||
// ATTENTION: await is needed, because otherwise on send the email gets send in the language of the current user, because below the language gets reset
|
const resultSend = await email
|
||||||
await email
|
|
||||||
.send({
|
.send({
|
||||||
template: path.join(__dirname, 'templates', params.template),
|
template: path.join(__dirname, 'templates', template),
|
||||||
message: params.receiver,
|
message: receiver,
|
||||||
locals: params.locals, // the 'locale' in here seems not to be used by 'email-template', because it doesn't work if the language isn't set before by 'i18n.setLocale'
|
locals, // the 'locale' in here seems not to be used by 'email-template', because it doesn't work if the language isn't set before by 'i18n.setLocale'
|
||||||
})
|
|
||||||
.then((result: Record<string, unknown>) => {
|
|
||||||
resultSend = result
|
|
||||||
logger.info('Send email successfully !!!')
|
|
||||||
logger.info('Result: ', result)
|
|
||||||
})
|
})
|
||||||
.catch((error: unknown) => {
|
.catch((error: unknown) => {
|
||||||
throw new LogError('Error sending notification email', error)
|
logger.error('Error sending notification email', error)
|
||||||
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
i18n.setLocale(rememberLocaleToRestore)
|
|
||||||
|
|
||||||
return resultSend
|
return resultSend
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export const sendAddedContributionMessageEmail = (data: {
|
|||||||
senderFirstName: string
|
senderFirstName: string
|
||||||
senderLastName: string
|
senderLastName: string
|
||||||
contributionMemo: string
|
contributionMemo: string
|
||||||
}): Promise<Record<string, unknown> | null> => {
|
}): Promise<Record<string, unknown> | boolean | null> => {
|
||||||
return sendEmailTranslated({
|
return sendEmailTranslated({
|
||||||
receiver: {
|
receiver: {
|
||||||
to: `${data.firstName} ${data.lastName} <${data.email}>`,
|
to: `${data.firstName} ${data.lastName} <${data.email}>`,
|
||||||
@ -40,7 +40,7 @@ export const sendAccountActivationEmail = (data: {
|
|||||||
language: string
|
language: string
|
||||||
activationLink: string
|
activationLink: string
|
||||||
timeDurationObject: Record<string, unknown>
|
timeDurationObject: Record<string, unknown>
|
||||||
}): Promise<Record<string, unknown> | null> => {
|
}): Promise<Record<string, unknown> | boolean | null> => {
|
||||||
return sendEmailTranslated({
|
return sendEmailTranslated({
|
||||||
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
||||||
template: 'accountActivation',
|
template: 'accountActivation',
|
||||||
@ -62,7 +62,7 @@ export const sendAccountMultiRegistrationEmail = (data: {
|
|||||||
lastName: string
|
lastName: string
|
||||||
email: string
|
email: string
|
||||||
language: string
|
language: string
|
||||||
}): Promise<Record<string, unknown> | null> => {
|
}): Promise<Record<string, unknown> | boolean | null> => {
|
||||||
return sendEmailTranslated({
|
return sendEmailTranslated({
|
||||||
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
||||||
template: 'accountMultiRegistration',
|
template: 'accountMultiRegistration',
|
||||||
@ -86,7 +86,7 @@ export const sendContributionConfirmedEmail = (data: {
|
|||||||
senderLastName: string
|
senderLastName: string
|
||||||
contributionMemo: string
|
contributionMemo: string
|
||||||
contributionAmount: Decimal
|
contributionAmount: Decimal
|
||||||
}): Promise<Record<string, unknown> | null> => {
|
}): Promise<Record<string, unknown> | boolean | null> => {
|
||||||
return sendEmailTranslated({
|
return sendEmailTranslated({
|
||||||
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
||||||
template: 'contributionConfirmed',
|
template: 'contributionConfirmed',
|
||||||
@ -113,7 +113,7 @@ export const sendContributionDeletedEmail = (data: {
|
|||||||
senderFirstName: string
|
senderFirstName: string
|
||||||
senderLastName: string
|
senderLastName: string
|
||||||
contributionMemo: string
|
contributionMemo: string
|
||||||
}): Promise<Record<string, unknown> | null> => {
|
}): Promise<Record<string, unknown> | boolean | null> => {
|
||||||
return sendEmailTranslated({
|
return sendEmailTranslated({
|
||||||
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
||||||
template: 'contributionDeleted',
|
template: 'contributionDeleted',
|
||||||
@ -139,7 +139,7 @@ export const sendContributionDeniedEmail = (data: {
|
|||||||
senderFirstName: string
|
senderFirstName: string
|
||||||
senderLastName: string
|
senderLastName: string
|
||||||
contributionMemo: string
|
contributionMemo: string
|
||||||
}): Promise<Record<string, unknown> | null> => {
|
}): Promise<Record<string, unknown> | boolean | null> => {
|
||||||
return sendEmailTranslated({
|
return sendEmailTranslated({
|
||||||
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
||||||
template: 'contributionDenied',
|
template: 'contributionDenied',
|
||||||
@ -164,7 +164,7 @@ export const sendResetPasswordEmail = (data: {
|
|||||||
language: string
|
language: string
|
||||||
resetLink: string
|
resetLink: string
|
||||||
timeDurationObject: Record<string, unknown>
|
timeDurationObject: Record<string, unknown>
|
||||||
}): Promise<Record<string, unknown> | null> => {
|
}): Promise<Record<string, unknown> | boolean | null> => {
|
||||||
return sendEmailTranslated({
|
return sendEmailTranslated({
|
||||||
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
||||||
template: 'resetPassword',
|
template: 'resetPassword',
|
||||||
@ -191,7 +191,7 @@ export const sendTransactionLinkRedeemedEmail = (data: {
|
|||||||
senderEmail: string
|
senderEmail: string
|
||||||
transactionMemo: string
|
transactionMemo: string
|
||||||
transactionAmount: Decimal
|
transactionAmount: Decimal
|
||||||
}): Promise<Record<string, unknown> | null> => {
|
}): Promise<Record<string, unknown> | boolean | null> => {
|
||||||
return sendEmailTranslated({
|
return sendEmailTranslated({
|
||||||
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
||||||
template: 'transactionLinkRedeemed',
|
template: 'transactionLinkRedeemed',
|
||||||
@ -220,7 +220,7 @@ export const sendTransactionReceivedEmail = (data: {
|
|||||||
senderLastName: string
|
senderLastName: string
|
||||||
senderEmail: string
|
senderEmail: string
|
||||||
transactionAmount: Decimal
|
transactionAmount: Decimal
|
||||||
}): Promise<Record<string, unknown> | null> => {
|
}): Promise<Record<string, unknown> | boolean | null> => {
|
||||||
return sendEmailTranslated({
|
return sendEmailTranslated({
|
||||||
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
|
||||||
template: 'transactionReceived',
|
template: 'transactionReceived',
|
||||||
|
|||||||
@ -146,7 +146,7 @@ export class ContributionMessageResolver {
|
|||||||
await queryRunner.manager.update(DbContribution, { id: contributionId }, contribution)
|
await queryRunner.manager.update(DbContribution, { id: contributionId }, contribution)
|
||||||
}
|
}
|
||||||
|
|
||||||
await sendAddedContributionMessageEmail({
|
void sendAddedContributionMessageEmail({
|
||||||
firstName: contribution.user.firstName,
|
firstName: contribution.user.firstName,
|
||||||
lastName: contribution.user.lastName,
|
lastName: contribution.user.lastName,
|
||||||
email: contribution.user.emailContact.email,
|
email: contribution.user.emailContact.email,
|
||||||
|
|||||||
@ -149,7 +149,7 @@ export const executeTransaction = async (
|
|||||||
} finally {
|
} finally {
|
||||||
await queryRunner.release()
|
await queryRunner.release()
|
||||||
}
|
}
|
||||||
await sendTransactionReceivedEmail({
|
void sendTransactionReceivedEmail({
|
||||||
firstName: recipient.firstName,
|
firstName: recipient.firstName,
|
||||||
lastName: recipient.lastName,
|
lastName: recipient.lastName,
|
||||||
email: recipient.emailContact.email,
|
email: recipient.emailContact.email,
|
||||||
@ -160,7 +160,7 @@ export const executeTransaction = async (
|
|||||||
transactionAmount: amount,
|
transactionAmount: amount,
|
||||||
})
|
})
|
||||||
if (transactionLink) {
|
if (transactionLink) {
|
||||||
await sendTransactionLinkRedeemedEmail({
|
void sendTransactionLinkRedeemedEmail({
|
||||||
firstName: sender.firstName,
|
firstName: sender.firstName,
|
||||||
lastName: sender.lastName,
|
lastName: sender.lastName,
|
||||||
email: sender.emailContact.email,
|
email: sender.emailContact.email,
|
||||||
|
|||||||
@ -245,7 +245,7 @@ export class UserResolver {
|
|||||||
user.publisherId = publisherId
|
user.publisherId = publisherId
|
||||||
logger.debug('partly faked user', user)
|
logger.debug('partly faked user', user)
|
||||||
|
|
||||||
const emailSent = await sendAccountMultiRegistrationEmail({
|
void sendAccountMultiRegistrationEmail({
|
||||||
firstName: foundUser.firstName, // this is the real name of the email owner, but just "firstName" would be the name of the new registrant which shall not be passed to the outside
|
firstName: foundUser.firstName, // this is the real name of the email owner, but just "firstName" would be the name of the new registrant which shall not be passed to the outside
|
||||||
lastName: foundUser.lastName, // this is the real name of the email owner, but just "lastName" would be the name of the new registrant which shall not be passed to the outside
|
lastName: foundUser.lastName, // this is the real name of the email owner, but just "lastName" would be the name of the new registrant which shall not be passed to the outside
|
||||||
email,
|
email,
|
||||||
@ -258,9 +258,6 @@ export class UserResolver {
|
|||||||
)
|
)
|
||||||
/* uncomment this, when you need the activation link on the console */
|
/* uncomment this, when you need the activation link on the console */
|
||||||
// In case EMails are disabled log the activation link for the user
|
// In case EMails are disabled log the activation link for the user
|
||||||
if (!emailSent) {
|
|
||||||
logger.debug(`Email not send!`)
|
|
||||||
}
|
|
||||||
logger.info('createUser() faked and send multi registration mail...')
|
logger.info('createUser() faked and send multi registration mail...')
|
||||||
|
|
||||||
return user
|
return user
|
||||||
@ -325,8 +322,7 @@ export class UserResolver {
|
|||||||
emailContact.emailVerificationCode.toString(),
|
emailContact.emailVerificationCode.toString(),
|
||||||
).replace(/{code}/g, redeemCode ? '/' + redeemCode : '')
|
).replace(/{code}/g, redeemCode ? '/' + redeemCode : '')
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
void sendAccountActivationEmail({
|
||||||
const emailSent = await sendAccountActivationEmail({
|
|
||||||
firstName,
|
firstName,
|
||||||
lastName,
|
lastName,
|
||||||
email,
|
email,
|
||||||
@ -338,10 +334,6 @@ export class UserResolver {
|
|||||||
|
|
||||||
await EVENT_EMAIL_CONFIRMATION(dbUser)
|
await EVENT_EMAIL_CONFIRMATION(dbUser)
|
||||||
|
|
||||||
if (!emailSent) {
|
|
||||||
logger.debug(`Account confirmation link: ${activationLink}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
await queryRunner.commitTransaction()
|
await queryRunner.commitTransaction()
|
||||||
logger.addContext('user', dbUser.id)
|
logger.addContext('user', dbUser.id)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -392,8 +384,8 @@ export class UserResolver {
|
|||||||
})
|
})
|
||||||
|
|
||||||
logger.info(`optInCode for ${email}=${user.emailContact}`)
|
logger.info(`optInCode for ${email}=${user.emailContact}`)
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const emailSent = await sendResetPasswordEmail({
|
void sendResetPasswordEmail({
|
||||||
firstName: user.firstName,
|
firstName: user.firstName,
|
||||||
lastName: user.lastName,
|
lastName: user.lastName,
|
||||||
email,
|
email,
|
||||||
@ -402,13 +394,6 @@ export class UserResolver {
|
|||||||
timeDurationObject: getTimeDurationObject(CONFIG.EMAIL_CODE_VALID_TIME),
|
timeDurationObject: getTimeDurationObject(CONFIG.EMAIL_CODE_VALID_TIME),
|
||||||
})
|
})
|
||||||
|
|
||||||
/* uncomment this, when you need the activation link on the console */
|
|
||||||
// In case EMails are disabled log the activation link for the user
|
|
||||||
if (!emailSent) {
|
|
||||||
logger.debug(
|
|
||||||
`Reset password link: ${activationLink(user.emailContact.emailVerificationCode)}`,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
logger.info(`forgotPassword(${email}) successful...`)
|
logger.info(`forgotPassword(${email}) successful...`)
|
||||||
await EVENT_EMAIL_FORGOT_PASSWORD(user)
|
await EVENT_EMAIL_FORGOT_PASSWORD(user)
|
||||||
|
|
||||||
@ -804,7 +789,7 @@ export class UserResolver {
|
|||||||
await user.emailContact.save()
|
await user.emailContact.save()
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const emailSent = await sendAccountActivationEmail({
|
void sendAccountActivationEmail({
|
||||||
firstName: user.firstName,
|
firstName: user.firstName,
|
||||||
lastName: user.lastName,
|
lastName: user.lastName,
|
||||||
email,
|
email,
|
||||||
@ -813,10 +798,6 @@ export class UserResolver {
|
|||||||
timeDurationObject: getTimeDurationObject(CONFIG.EMAIL_CODE_VALID_TIME),
|
timeDurationObject: getTimeDurationObject(CONFIG.EMAIL_CODE_VALID_TIME),
|
||||||
})
|
})
|
||||||
|
|
||||||
// In case EMails are disabled log the activation link for the user
|
|
||||||
if (!emailSent) {
|
|
||||||
logger.info(`Account confirmation link: ${activationLink}`)
|
|
||||||
}
|
|
||||||
await EVENT_EMAIL_ADMIN_CONFIRMATION(user, getUser(context))
|
await EVENT_EMAIL_ADMIN_CONFIRMATION(user, getUser(context))
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido-database",
|
"name": "gradido-database",
|
||||||
"version": "1.19.1",
|
"version": "1.20.0",
|
||||||
"description": "Gradido Database Tool to execute database migrations",
|
"description": "Gradido Database Tool to execute database migrations",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": "https://github.com/gradido/gradido/database",
|
"repository": "https://github.com/gradido/gradido/database",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido-dht-node",
|
"name": "gradido-dht-node",
|
||||||
"version": "1.0.0",
|
"version": "1.20.0",
|
||||||
"description": "Gradido dht-node module",
|
"description": "Gradido dht-node module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": "https://github.com/gradido/gradido/",
|
"repository": "https://github.com/gradido/gradido/",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido-federation",
|
"name": "gradido-federation",
|
||||||
"version": "1.0.0",
|
"version": "1.20.0",
|
||||||
"description": "Gradido federation module providing Gradido-Hub-Federation and versioned API for inter community communication",
|
"description": "Gradido federation module providing Gradido-Hub-Federation and versioned API for inter community communication",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": "https://github.com/gradido/gradido/federation",
|
"repository": "https://github.com/gradido/gradido/federation",
|
||||||
@ -45,14 +45,16 @@
|
|||||||
"eslint-plugin-prettier": "^3.4.0",
|
"eslint-plugin-prettier": "^3.4.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"jest": "27.2.4",
|
"jest": "27.2.4",
|
||||||
|
"nodemon": "^2.0.7",
|
||||||
|
"prettier": "^2.3.1",
|
||||||
"ts-jest": "27.0.5",
|
"ts-jest": "27.0.5",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"tsconfig-paths": "^4.1.1",
|
"tsconfig-paths": "^4.1.1",
|
||||||
"nodemon": "^2.0.7",
|
|
||||||
"prettier": "^2.3.1",
|
|
||||||
"typescript": "^4.3.4"
|
"typescript": "^4.3.4"
|
||||||
},
|
},
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
"ignore": ["**/*.test.ts"]
|
"ignore": [
|
||||||
|
"**/*.test.ts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bootstrap-vue-gradido-wallet",
|
"name": "bootstrap-vue-gradido-wallet",
|
||||||
"version": "1.19.1",
|
"version": "1.20.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node run/server.js",
|
"start": "node run/server.js",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido",
|
"name": "gradido",
|
||||||
"version": "1.19.1",
|
"version": "1.20.0",
|
||||||
"description": "Gradido",
|
"description": "Gradido",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": "git@github.com:gradido/gradido.git",
|
"repository": "git@github.com:gradido/gradido.git",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user