mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fixes
This commit is contained in:
parent
9febdbf81b
commit
721ccecd12
@ -1,4 +1,4 @@
|
|||||||
import jwt from 'jsonwebtoken'
|
import { verify, sign } from 'jsonwebtoken'
|
||||||
import CONFIG from '@/config/'
|
import CONFIG from '@/config/'
|
||||||
import { CustomJwtPayload } from './CustomJwtPayload'
|
import { CustomJwtPayload } from './CustomJwtPayload'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
@ -6,14 +6,14 @@ import LogError from '@/server/LogError'
|
|||||||
export const decode = (token: string): CustomJwtPayload | null => {
|
export const decode = (token: string): CustomJwtPayload | null => {
|
||||||
if (!token) throw new LogError('401 Unauthorized')
|
if (!token) throw new LogError('401 Unauthorized')
|
||||||
try {
|
try {
|
||||||
return <CustomJwtPayload>jwt.verify(token, CONFIG.JWT_SECRET)
|
return <CustomJwtPayload>verify(token, CONFIG.JWT_SECRET)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encode = (gradidoID: string): string => {
|
export const encode = (gradidoID: string): string => {
|
||||||
const token = jwt.sign({ gradidoID }, CONFIG.JWT_SECRET, {
|
const token = sign({ gradidoID }, CONFIG.JWT_SECRET, {
|
||||||
expiresIn: CONFIG.JWT_EXPIRES_IN,
|
expiresIn: CONFIG.JWT_EXPIRES_IN,
|
||||||
})
|
})
|
||||||
return token
|
return token
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// ATTENTION: DO NOT PUT ANY SECRETS IN HERE (or the .env)
|
// ATTENTION: DO NOT PUT ANY SECRETS IN HERE (or the .env)
|
||||||
|
|
||||||
import dotenv from 'dotenv'
|
import dotenv from 'dotenv'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
dotenv.config()
|
dotenv.config()
|
||||||
|
|
||||||
Decimal.set({
|
Decimal.set({
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { testEnvironment } from '@test/helpers'
|
import { testEnvironment } from '@test/helpers'
|
||||||
import { logger, i18n as localization } from '@test/testSetup'
|
import { logger, i18n as localization } from '@test/testSetup'
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
import { decimalSeparatorByLanguage } from '@/util/utilities'
|
import { decimalSeparatorByLanguage } from '@/util/utilities'
|
||||||
import { sendEmailTranslated } from './sendEmailTranslated'
|
import { sendEmailTranslated } from './sendEmailTranslated'
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { EventProtocol as DbEvent } from '@entity/EventProtocol'
|
import { EventProtocol as DbEvent } from '@entity/EventProtocol'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { EventProtocolType } from './EventProtocolType'
|
import { EventProtocolType } from './EventProtocolType'
|
||||||
|
|
||||||
export const Event = (
|
export const Event = (
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field, InputType } from 'type-graphql'
|
import { ArgsType, Field, InputType } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field, Int } from 'type-graphql'
|
import { ArgsType, Field, Int } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
export default class AdminUpdateContributionArgs {
|
export default class AdminUpdateContributionArgs {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field, InputType } from 'type-graphql'
|
import { ArgsType, Field, InputType } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field, Int } from 'type-graphql'
|
import { ArgsType, Field, Int } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
export default class ContributionLinkArgs {
|
export default class ContributionLinkArgs {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field } from 'type-graphql'
|
import { ArgsType, Field } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
export default class TransactionLinkArgs {
|
export default class TransactionLinkArgs {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field } from 'type-graphql'
|
import { ArgsType, Field } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
export default class TransactionSendArgs {
|
export default class TransactionSendArgs {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field } from 'type-graphql'
|
import { ObjectType, Field } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class AdminUpdateContribution {
|
export class AdminUpdateContribution {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int, Float } from 'type-graphql'
|
import { ObjectType, Field, Int, Float } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class Balance {
|
export class Balance {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class DynamicStatisticsFields {
|
export class DynamicStatisticsFields {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { Contribution as dbContribution } from '@entity/Contribution'
|
import { Contribution as dbContribution } from '@entity/Contribution'
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { ContributionLink as dbContributionLink } from '@entity/ContributionLink'
|
import { ContributionLink as dbContributionLink } from '@entity/ContributionLink'
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
interface DecayInterface {
|
interface DecayInterface {
|
||||||
balance: Decimal
|
balance: Decimal
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class OpenCreation {
|
export class OpenCreation {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
import { Decay } from './Decay'
|
import { Decay } from './Decay'
|
||||||
import { Transaction as dbTransaction } from '@entity/Transaction'
|
import { Transaction as dbTransaction } from '@entity/Transaction'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
||||||
import { User } from './User'
|
import { User } from './User'
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||||
import { User } from './User'
|
import { User } from './User'
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { Contribution } from '@entity/Contribution'
|
import { Contribution } from '@entity/Contribution'
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { Resolver, Query, Ctx, Authorized } from 'type-graphql'
|
import { Resolver, Query, Ctx, Authorized } from 'type-graphql'
|
||||||
import { getCustomRepository } from '@dbTools/typeorm'
|
import { getCustomRepository } from '@dbTools/typeorm'
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { logger } from '@test/testSetup'
|
import { logger } from '@test/testSetup'
|
||||||
import { GraphQLError } from 'graphql'
|
import { GraphQLError } from 'graphql'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { Resolver, Args, Arg, Authorized, Mutation, Query, Int } from 'type-graphql'
|
import { Resolver, Args, Arg, Authorized, Mutation, Query, Int } from 'type-graphql'
|
||||||
import { MoreThan, IsNull } from '@dbTools/typeorm'
|
import { MoreThan, IsNull } from '@dbTools/typeorm'
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||||
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
||||||
import { stephenHawking } from '@/seeds/users/stephen-hawking'
|
import { stephenHawking } from '@/seeds/users/stephen-hawking'
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { Arg, Args, Authorized, Ctx, Int, Mutation, Query, Resolver } from 'type-graphql'
|
import { Arg, Args, Authorized, Ctx, Int, Mutation, Query, Resolver } from 'type-graphql'
|
||||||
import { IsNull, getConnection } from '@dbTools/typeorm'
|
import { IsNull, getConnection } from '@dbTools/typeorm'
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { Resolver, Query, Authorized, FieldResolver } from 'type-graphql'
|
import { Resolver, Query, Authorized, FieldResolver } from 'type-graphql'
|
||||||
import { getConnection } from '@dbTools/typeorm'
|
import { getConnection } from '@dbTools/typeorm'
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import { listTransactionLinksAdmin } from '@/seeds/graphql/queries'
|
|||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
|
import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { GraphQLError } from 'graphql'
|
import { GraphQLError } from 'graphql'
|
||||||
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
||||||
import { logger } from '@test/testSetup'
|
import { logger } from '@test/testSetup'
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { randomBytes } from 'crypto'
|
import { randomBytes } from 'crypto'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { getConnection } from '@dbTools/typeorm'
|
import { getConnection } from '@dbTools/typeorm'
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { EventProtocolType } from '@/event/EventProtocolType'
|
import { EventProtocolType } from '@/event/EventProtocolType'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable new-cap */
|
/* eslint-disable new-cap */
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||||
|
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { Resolver, Query, Args, Authorized, Ctx, Mutation } from 'type-graphql'
|
import { Resolver, Query, Args, Authorized, Ctx, Mutation } from 'type-graphql'
|
||||||
import { getCustomRepository, getConnection, In } from '@dbTools/typeorm'
|
import { getCustomRepository, getConnection, In } from '@dbTools/typeorm'
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
export const MAX_CREATION_AMOUNT = new Decimal(1000)
|
export const MAX_CREATION_AMOUNT = new Decimal(1000)
|
||||||
export const FULL_CREATION_AVAILABLE = [
|
export const FULL_CREATION_AVAILABLE = [
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||||
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import LogError from '@/server/LogError'
|
|||||||
import { backendLogger as logger } from '@/server/logger'
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
import { getConnection } from '@dbTools/typeorm'
|
import { getConnection } from '@dbTools/typeorm'
|
||||||
import { Contribution } from '@entity/Contribution'
|
import { Contribution } from '@entity/Contribution'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { FULL_CREATION_AVAILABLE, MAX_CREATION_AMOUNT } from '../const/const'
|
import { FULL_CREATION_AVAILABLE, MAX_CREATION_AMOUNT } from '../const/const'
|
||||||
|
|
||||||
interface CreationMap {
|
interface CreationMap {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { GraphQLScalarType, Kind } from 'graphql'
|
import { GraphQLScalarType, Kind } from 'graphql'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
export default new GraphQLScalarType({
|
export default new GraphQLScalarType({
|
||||||
name: 'Decimal',
|
name: 'Decimal',
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import path from 'path'
|
|||||||
|
|
||||||
import isAuthorized from './directive/isAuthorized'
|
import isAuthorized from './directive/isAuthorized'
|
||||||
import DecimalScalar from './scalar/Decimal'
|
import DecimalScalar from './scalar/Decimal'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
const schema = async (): Promise<GraphQLSchema> => {
|
const schema = async (): Promise<GraphQLSchema> => {
|
||||||
return buildSchema({
|
return buildSchema({
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import gql from 'graphql-tag'
|
import { gql } from 'graphql-tag'
|
||||||
|
|
||||||
export const subscribeNewsletter = gql`
|
export const subscribeNewsletter = gql`
|
||||||
mutation ($email: String!, $language: String!) {
|
mutation ($email: String!, $language: String!) {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import gql from 'graphql-tag'
|
import { gql } from 'graphql-tag'
|
||||||
|
|
||||||
export const verifyLogin = gql`
|
export const verifyLogin = gql`
|
||||||
query {
|
query {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { Role } from '@/auth/Role'
|
import { Role } from '@/auth/Role'
|
||||||
import { User as dbUser } from '@entity/User'
|
import { User as dbUser } from '@entity/User'
|
||||||
import { Transaction as dbTransaction } from '@entity/Transaction'
|
import { Transaction as dbTransaction } from '@entity/Transaction'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { ExpressContext } from 'apollo-server-express'
|
import { ExpressContext } from 'apollo-server-express'
|
||||||
import LogError from './LogError'
|
import LogError from './LogError'
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
|
|
||||||
import { ApolloServer } from 'apollo-server-express'
|
import { ApolloServer } from 'apollo-server-express'
|
||||||
import express, { Express } from 'express'
|
import express, { Express, json, urlencoded } from 'express'
|
||||||
|
|
||||||
// database
|
// database
|
||||||
import connection from '@/typeorm/connection'
|
import connection from '@/typeorm/connection'
|
||||||
@ -66,9 +66,9 @@ const createServer = async (
|
|||||||
app.use(cors)
|
app.use(cors)
|
||||||
|
|
||||||
// bodyparser json
|
// bodyparser json
|
||||||
app.use(express.json())
|
app.use(json())
|
||||||
// bodyparser urlencoded for elopage
|
// bodyparser urlencoded for elopage
|
||||||
app.use(express.urlencoded({ extended: true }))
|
app.use(urlencoded({ extended: true }))
|
||||||
|
|
||||||
// i18n
|
// i18n
|
||||||
app.use(localization.init)
|
app.use(localization.init)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* 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 */
|
||||||
import log4js from 'log4js'
|
import { configure, getLogger } from 'log4js'
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
|
|
||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
@ -10,11 +10,11 @@ const options = JSON.parse(readFileSync(CONFIG.LOG4JS_CONFIG, 'utf-8'))
|
|||||||
options.categories.backend.level = CONFIG.LOG_LEVEL
|
options.categories.backend.level = CONFIG.LOG_LEVEL
|
||||||
options.categories.apollo.level = CONFIG.LOG_LEVEL
|
options.categories.apollo.level = CONFIG.LOG_LEVEL
|
||||||
|
|
||||||
log4js.configure(options)
|
configure(options)
|
||||||
|
|
||||||
const apolloLogger = log4js.getLogger('apollo')
|
const apolloLogger = getLogger('apollo')
|
||||||
const backendLogger = log4js.getLogger('backend')
|
const backendLogger = getLogger('backend')
|
||||||
const klickTippLogger = log4js.getLogger('klicktipp')
|
const klickTippLogger = getLogger('klicktipp')
|
||||||
|
|
||||||
backendLogger.addContext('user', 'unknown')
|
backendLogger.addContext('user', 'unknown')
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
import { Repository, EntityRepository } from '@dbTools/typeorm'
|
import { Repository, EntityRepository } from '@dbTools/typeorm'
|
||||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
@EntityRepository(dbTransactionLink)
|
@EntityRepository(dbTransactionLink)
|
||||||
export class TransactionLinkRepository extends Repository<dbTransactionLink> {
|
export class TransactionLinkRepository extends Repository<dbTransactionLink> {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import 'reflect-metadata' // This might be wise to load in a test setup file
|
import 'reflect-metadata' // This might be wise to load in a test setup file
|
||||||
import { decayFormula, calculateDecay } from './decay'
|
import { decayFormula, calculateDecay } from './decay'
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
import { Decay } from '@model/Decay'
|
import { Decay } from '@model/Decay'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import i18n from 'i18n'
|
import i18n from 'i18n'
|
||||||
|
|
||||||
export const objectValuesToArray = (obj: { [x: string]: string }): Array<string> => {
|
export const objectValuesToArray = (obj: { [x: string]: string }): Array<string> => {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { calculateDecay } from './decay'
|
import { calculateDecay } from './decay'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { Decay } from '@model/Decay'
|
import { Decay } from '@model/Decay'
|
||||||
import { getCustomRepository } from '@dbTools/typeorm'
|
import { getCustomRepository } from '@dbTools/typeorm'
|
||||||
import { TransactionLinkRepository } from '@repository/TransactionLink'
|
import { TransactionLinkRepository } from '@repository/TransactionLink'
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { Transaction as dbTransaction } from '@entity/Transaction'
|
|||||||
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
||||||
import { calculateDecay } from './decay'
|
import { calculateDecay } from './decay'
|
||||||
import { User } from '@model/User'
|
import { User } from '@model/User'
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
const defaultModelFunctions = {
|
const defaultModelFunctions = {
|
||||||
hasId: function (): boolean {
|
hasId: function (): boolean {
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||||
|
|
||||||
import Decimal from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
expect.extend({
|
expect.extend({
|
||||||
decimalEqual(received, value) {
|
decimalEqual(received, value) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user