mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
auto applied changes from biome
This commit is contained in:
parent
1e26cd607d
commit
3ff399064b
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -1,5 +1,8 @@
|
||||
{
|
||||
"git.ignoreLimitWarning": true,
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
},
|
||||
"sqltools.connections": [
|
||||
{
|
||||
"mysqlOptions": {
|
||||
|
||||
@ -1,125 +1,125 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
||||
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
|
||||
"files": {
|
||||
"ignoreUnknown": false,
|
||||
"ignore": ["build", "node_modules", "coverage"],
|
||||
"include": ["./src/**/*.js", "./src/**/*.ts"]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"useEditorconfig": true,
|
||||
"formatWithErrors": false,
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2,
|
||||
"lineEnding": "lf",
|
||||
"lineWidth": 100,
|
||||
"attributePosition": "auto",
|
||||
"bracketSpacing": true
|
||||
},
|
||||
"organizeImports": { "enabled": true },
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": false,
|
||||
"complexity": {
|
||||
"noExtraBooleanCast": "error",
|
||||
"noMultipleSpacesInRegularExpressionLiterals": "error",
|
||||
"noUselessCatch": "error",
|
||||
"noUselessConstructor": "error",
|
||||
"noUselessLoneBlockStatements": "error",
|
||||
"noUselessRename": "error",
|
||||
"noUselessTernary": "error",
|
||||
"noUselessUndefinedInitialization": "error",
|
||||
"noVoid": "error",
|
||||
"noWith": "error",
|
||||
"useLiteralKeys": "error",
|
||||
"useRegexLiterals": "error"
|
||||
},
|
||||
"correctness": {
|
||||
"noConstAssign": "error",
|
||||
"noConstantCondition": "error",
|
||||
"noEmptyCharacterClassInRegex": "error",
|
||||
"noEmptyPattern": "error",
|
||||
"noGlobalObjectCalls": "error",
|
||||
"noInnerDeclarations": "error",
|
||||
"noInvalidConstructorSuper": "error",
|
||||
"noInvalidUseBeforeDeclaration": "error",
|
||||
"noNewSymbol": "error",
|
||||
"noNodejsModules": "off",
|
||||
"noNonoctalDecimalEscape": "error",
|
||||
"noPrecisionLoss": "error",
|
||||
"noSelfAssign": "error",
|
||||
"noSetterReturn": "error",
|
||||
"noSwitchDeclarations": "error",
|
||||
"noUndeclaredVariables": "error",
|
||||
"noUnreachable": "error",
|
||||
"noUnreachableSuper": "error",
|
||||
"noUnsafeFinally": "error",
|
||||
"noUnsafeOptionalChaining": "error",
|
||||
"noUnusedLabels": "error",
|
||||
"noUnusedVariables": "error",
|
||||
"useArrayLiterals": "error",
|
||||
"useIsNan": "error",
|
||||
"useValidForDirection": "error",
|
||||
"useYield": "error"
|
||||
},
|
||||
"security": { "noGlobalEval": "error" },
|
||||
"style": {
|
||||
"noCommaOperator": "error",
|
||||
"noDefaultExport": "error",
|
||||
"noVar": "warn",
|
||||
"noYodaExpression": "error",
|
||||
"useBlockStatements": "error",
|
||||
"useConsistentBuiltinInstantiation": "error",
|
||||
"useConst": "error",
|
||||
"useSingleVarDeclarator": "error"
|
||||
},
|
||||
"suspicious": {
|
||||
"noAsyncPromiseExecutor": "error",
|
||||
"noCatchAssign": "error",
|
||||
"noClassAssign": "error",
|
||||
"noCompareNegZero": "error",
|
||||
"noConsole": "error",
|
||||
"noControlCharactersInRegex": "error",
|
||||
"noDebugger": "error",
|
||||
"noDoubleEquals": "error",
|
||||
"noDuplicateCase": "error",
|
||||
"noDuplicateClassMembers": "error",
|
||||
"noDuplicateObjectKeys": "error",
|
||||
"noDuplicateParameters": "error",
|
||||
"noEmptyBlockStatements": "error",
|
||||
"noFallthroughSwitchClause": "error",
|
||||
"noFunctionAssign": "error",
|
||||
"noGlobalAssign": "error",
|
||||
"noImportAssign": "error",
|
||||
"noMisleadingCharacterClass": "error",
|
||||
"noPrototypeBuiltins": "error",
|
||||
"noRedeclare": "error",
|
||||
"noSelfCompare": "error",
|
||||
"noShadowRestrictedNames": "error",
|
||||
"noSparseArray": "error",
|
||||
"noUnsafeNegation": "error",
|
||||
"useDefaultSwitchClauseLast": "error",
|
||||
"useGetterReturn": "error",
|
||||
"useValidTypeof": "error"
|
||||
}
|
||||
},
|
||||
"ignore": ["**/node_modules", "**/*.min.js", "**/build", "**/coverage"]
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"jsxQuoteStyle": "single",
|
||||
"quoteProperties": "asNeeded",
|
||||
"trailingCommas": "all",
|
||||
"semicolons": "asNeeded",
|
||||
"arrowParentheses": "always",
|
||||
"bracketSameLine": false,
|
||||
"quoteStyle": "single",
|
||||
"attributePosition": "auto",
|
||||
"bracketSpacing": true
|
||||
},
|
||||
"globals": [
|
||||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
||||
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
|
||||
"files": {
|
||||
"ignoreUnknown": false,
|
||||
"ignore": ["build", "node_modules", "coverage"],
|
||||
"include": ["./src/**/*.js", "./src/**/*.ts"]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"useEditorconfig": true,
|
||||
"formatWithErrors": false,
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2,
|
||||
"lineEnding": "lf",
|
||||
"lineWidth": 100,
|
||||
"attributePosition": "auto",
|
||||
"bracketSpacing": true
|
||||
},
|
||||
"organizeImports": { "enabled": true },
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": false,
|
||||
"complexity": {
|
||||
"noExtraBooleanCast": "error",
|
||||
"noMultipleSpacesInRegularExpressionLiterals": "error",
|
||||
"noUselessCatch": "error",
|
||||
"noUselessConstructor": "error",
|
||||
"noUselessLoneBlockStatements": "error",
|
||||
"noUselessRename": "error",
|
||||
"noUselessTernary": "error",
|
||||
"noUselessUndefinedInitialization": "error",
|
||||
"noVoid": "error",
|
||||
"noWith": "error",
|
||||
"useLiteralKeys": "error",
|
||||
"useRegexLiterals": "error"
|
||||
},
|
||||
"correctness": {
|
||||
"noConstAssign": "error",
|
||||
"noConstantCondition": "error",
|
||||
"noEmptyCharacterClassInRegex": "error",
|
||||
"noEmptyPattern": "error",
|
||||
"noGlobalObjectCalls": "error",
|
||||
"noInnerDeclarations": "error",
|
||||
"noInvalidConstructorSuper": "error",
|
||||
"noInvalidUseBeforeDeclaration": "error",
|
||||
"noNewSymbol": "error",
|
||||
"noNodejsModules": "off",
|
||||
"noNonoctalDecimalEscape": "error",
|
||||
"noPrecisionLoss": "error",
|
||||
"noSelfAssign": "error",
|
||||
"noSetterReturn": "error",
|
||||
"noSwitchDeclarations": "error",
|
||||
"noUndeclaredVariables": "error",
|
||||
"noUnreachable": "error",
|
||||
"noUnreachableSuper": "error",
|
||||
"noUnsafeFinally": "error",
|
||||
"noUnsafeOptionalChaining": "error",
|
||||
"noUnusedLabels": "error",
|
||||
"noUnusedVariables": "error",
|
||||
"useArrayLiterals": "error",
|
||||
"useIsNan": "error",
|
||||
"useValidForDirection": "error",
|
||||
"useYield": "error"
|
||||
},
|
||||
"security": { "noGlobalEval": "error" },
|
||||
"style": {
|
||||
"noCommaOperator": "error",
|
||||
"noDefaultExport": "error",
|
||||
"noVar": "warn",
|
||||
"noYodaExpression": "error",
|
||||
"useBlockStatements": "error",
|
||||
"useConsistentBuiltinInstantiation": "error",
|
||||
"useConst": "error",
|
||||
"useSingleVarDeclarator": "error"
|
||||
},
|
||||
"suspicious": {
|
||||
"noAsyncPromiseExecutor": "error",
|
||||
"noCatchAssign": "error",
|
||||
"noClassAssign": "error",
|
||||
"noCompareNegZero": "error",
|
||||
"noConsole": "error",
|
||||
"noControlCharactersInRegex": "error",
|
||||
"noDebugger": "error",
|
||||
"noDoubleEquals": "error",
|
||||
"noDuplicateCase": "error",
|
||||
"noDuplicateClassMembers": "error",
|
||||
"noDuplicateObjectKeys": "error",
|
||||
"noDuplicateParameters": "error",
|
||||
"noEmptyBlockStatements": "error",
|
||||
"noFallthroughSwitchClause": "error",
|
||||
"noFunctionAssign": "error",
|
||||
"noGlobalAssign": "error",
|
||||
"noImportAssign": "error",
|
||||
"noMisleadingCharacterClass": "error",
|
||||
"noPrototypeBuiltins": "error",
|
||||
"noRedeclare": "error",
|
||||
"noSelfCompare": "error",
|
||||
"noShadowRestrictedNames": "error",
|
||||
"noSparseArray": "error",
|
||||
"noUnsafeNegation": "error",
|
||||
"useDefaultSwitchClauseLast": "error",
|
||||
"useGetterReturn": "error",
|
||||
"useValidTypeof": "error"
|
||||
}
|
||||
},
|
||||
"ignore": ["**/node_modules", "**/*.min.js", "**/build", "**/coverage"]
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"jsxQuoteStyle": "single",
|
||||
"quoteProperties": "asNeeded",
|
||||
"trailingCommas": "all",
|
||||
"semicolons": "asNeeded",
|
||||
"arrowParentheses": "always",
|
||||
"bracketSameLine": false,
|
||||
"quoteStyle": "single",
|
||||
"attributePosition": "auto",
|
||||
"bracketSpacing": true
|
||||
},
|
||||
"globals": [
|
||||
"document",
|
||||
"navigator",
|
||||
"window",
|
||||
@ -127,21 +127,21 @@
|
||||
"test",
|
||||
"it",
|
||||
"expect",
|
||||
"beforeAll",
|
||||
"beforeEach",
|
||||
"afterAll",
|
||||
"afterEach",
|
||||
"jest"
|
||||
],
|
||||
"parser": {
|
||||
"unsafeParameterDecoratorsEnabled": true
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"include": ["*.ts", "*.tsx"],
|
||||
"linter": { "rules": { "complexity": { "noVoid": "error" } } }
|
||||
},
|
||||
{ "include": ["*.test.ts"], "linter": { "rules": {} } }
|
||||
]
|
||||
"beforeAll",
|
||||
"beforeEach",
|
||||
"afterAll",
|
||||
"afterEach",
|
||||
"jest"
|
||||
],
|
||||
"parser": {
|
||||
"unsafeParameterDecoratorsEnabled": true
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"include": ["*.ts", "*.tsx"],
|
||||
"linter": { "rules": { "complexity": { "noVoid": "error" } } }
|
||||
},
|
||||
{ "include": ["*.test.ts"], "linter": { "rules": {} } }
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||
import { gql, GraphQLClient } from 'graphql-request'
|
||||
import { GraphQLClient, gql } from 'graphql-request'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
import { TransactionTypeId } from '@/graphql/enum/TransactionTypeId'
|
||||
|
||||
@ -12,8 +12,8 @@ import { User as DbUser } from '@entity/User'
|
||||
import { CONFIG } from '@/config'
|
||||
import { getHomeCommunity } from '@/graphql/resolver/util/communities'
|
||||
import { sendUserToGms } from '@/graphql/resolver/util/sendUserToGms'
|
||||
import { createServer } from '@/server/createServer'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { createServer } from '@/server/createServer'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
CONFIG.EMAIL = false
|
||||
|
||||
@ -4,8 +4,8 @@ import { User } from '@entity/User'
|
||||
import { CONFIG } from '@/config'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
import { Connection } from '@/typeorm/connection'
|
||||
import { checkDBVersion } from '@/typeorm/DBVersion'
|
||||
import { Connection } from '@/typeorm/connection'
|
||||
|
||||
import { HumHubClient } from './HumHubClient'
|
||||
import { GetUser } from './model/GetUser'
|
||||
|
||||
@ -7,58 +7,58 @@ import { GetUser } from './model/GetUser'
|
||||
const defaultUser = communityDbUser
|
||||
|
||||
describe('isHumhubUserIdenticalToDbUser', () => {
|
||||
beforeEach(() => {
|
||||
defaultUser.firstName = 'first name'
|
||||
defaultUser.lastName = 'last name'
|
||||
defaultUser.alias = 'alias'
|
||||
defaultUser.emailContact.email = 'email@gmail.com'
|
||||
defaultUser.language = 'en'
|
||||
})
|
||||
beforeEach(() => {
|
||||
defaultUser.firstName = 'first name'
|
||||
defaultUser.lastName = 'last name'
|
||||
defaultUser.alias = 'alias'
|
||||
defaultUser.emailContact.email = 'email@gmail.com'
|
||||
defaultUser.language = 'en'
|
||||
})
|
||||
|
||||
it('Should return true because humhubUser was created from entity user', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(true)
|
||||
})
|
||||
it('Should return true because humhubUser was created from entity user', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(true)
|
||||
})
|
||||
|
||||
it('Should return false because first name differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
humhubUser.profile.firstname = 'changed first name'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
it('Should return false because last name differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
humhubUser.profile.lastname = 'changed last name'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
it('Should return false because username differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
humhubUser.account.username = 'changed username'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
it('Should return false because first name differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
humhubUser.profile.firstname = 'changed first name'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
it('Should return false because last name differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
humhubUser.profile.lastname = 'changed last name'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
it('Should return false because username differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
humhubUser.account.username = 'changed username'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
|
||||
it('Should return false because email differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
humhubUser.account.email = 'new@gmail.com'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
it('Should return false because email differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
humhubUser.account.email = 'new@gmail.com'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
|
||||
it('Should return false because language differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
humhubUser.account.language = 'de'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
it('Should return false because language differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
humhubUser.account.language = 'de'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
|
||||
it('Should return false because gradido_address differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
// eslint-disable-next-line camelcase
|
||||
humhubUser.profile.gradido_address = 'changed gradido address'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
it('Should return false because gradido_address differ', () => {
|
||||
const humhubUser = new GetUser(defaultUser, 1)
|
||||
// eslint-disable-next-line camelcase
|
||||
humhubUser.profile.gradido_address = 'changed gradido address'
|
||||
const result = isHumhubUserIdenticalToDbUser(humhubUser, defaultUser)
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
@ -3,7 +3,7 @@ import { User } from '@entity/User'
|
||||
import { UserContact } from '@entity/UserContact'
|
||||
|
||||
import { GetUser } from './model/GetUser'
|
||||
import { syncUser, ExecutedHumhubAction } from './syncUser'
|
||||
import { ExecutedHumhubAction, syncUser } from './syncUser'
|
||||
|
||||
jest.mock('@/apis/humhub/HumHubClient')
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@ import { User } from '@entity/User'
|
||||
|
||||
import { LogError } from '@/server/LogError'
|
||||
|
||||
import { isHumhubUserIdenticalToDbUser } from './compareHumhubUserDbUser'
|
||||
import { HumHubClient } from './HumHubClient'
|
||||
import { isHumhubUserIdenticalToDbUser } from './compareHumhubUserDbUser'
|
||||
import { GetUser } from './model/GetUser'
|
||||
import { PostUser } from './model/PostUser'
|
||||
|
||||
|
||||
@ -100,11 +100,11 @@ const email = {
|
||||
EMAIL_LINK_OVERVIEW: COMMUNITY_URL + (process.env.EMAIL_LINK_OVERVIEW_PATH ?? '/overview'),
|
||||
// time in minutes a optin code is valid
|
||||
EMAIL_CODE_VALID_TIME: process.env.EMAIL_CODE_VALID_TIME
|
||||
? parseInt(process.env.EMAIL_CODE_VALID_TIME) ?? 1440
|
||||
? (parseInt(process.env.EMAIL_CODE_VALID_TIME) ?? 1440)
|
||||
: 1440,
|
||||
// time in minutes that must pass to request a new optin code
|
||||
EMAIL_CODE_REQUEST_TIME: process.env.EMAIL_CODE_REQUEST_TIME
|
||||
? parseInt(process.env.EMAIL_CODE_REQUEST_TIME) ?? 10
|
||||
? (parseInt(process.env.EMAIL_CODE_REQUEST_TIME) ?? 10)
|
||||
: 10,
|
||||
}
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import {
|
||||
COMMUNITY_NAME,
|
||||
COMMUNITY_URL,
|
||||
COMMUNITY_DESCRIPTION,
|
||||
COMMUNITY_NAME,
|
||||
COMMUNITY_SUPPORT_MAIL,
|
||||
COMMUNITY_URL,
|
||||
DB_DATABASE,
|
||||
DB_HOST,
|
||||
DB_PASSWORD,
|
||||
DB_PORT,
|
||||
DB_USER,
|
||||
DB_VERSION,
|
||||
DB_DATABASE,
|
||||
DECAY_START_TIME,
|
||||
GDT_API_URL,
|
||||
GDT_ACTIVE,
|
||||
GDT_API_URL,
|
||||
GMS_ACTIVE,
|
||||
GRAPHIQL,
|
||||
HUMHUB_ACTIVE,
|
||||
|
||||
@ -54,8 +54,8 @@ export class PublishNameLogic {
|
||||
return publishNameType === PublishNameType.PUBLISH_NAME_FULL
|
||||
? this.user.lastName
|
||||
: publishNameType === PublishNameType.PUBLISH_NAME_FIRST_INITIAL
|
||||
? this.user.lastName.charAt(0)
|
||||
: ''
|
||||
? this.user.lastName.charAt(0)
|
||||
: ''
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,8 +84,8 @@ export class PublishNameLogic {
|
||||
return this.isUsernameFromAlias(publishNameType)
|
||||
? this.getUsernameFromAlias()
|
||||
: this.isUsernameFromInitials(publishNameType)
|
||||
? this.getUsernameFromInitials()
|
||||
: (this.getFirstName(publishNameType) + ' ' + this.getLastName(publishNameType)).trim()
|
||||
? this.getUsernameFromInitials()
|
||||
: (this.getFirstName(publishNameType) + ' ' + this.getLastName(publishNameType)).trim()
|
||||
}
|
||||
|
||||
public getUsernameFromInitials(): string {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { createTransport } from 'nodemailer'
|
||||
|
||||
import { logger, i18n } from '@test/testSetup'
|
||||
import { i18n, logger } from '@test/testSetup'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
|
||||
|
||||
@ -7,23 +7,23 @@ import { ApolloServerTestClient } from 'apollo-server-testing'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
|
||||
import { testEnvironment } from '@test/helpers'
|
||||
import { logger, i18n as localization } from '@test/testSetup'
|
||||
import { i18n as localization, logger } from '@test/testSetup'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
|
||||
// eslint-disable-next-line import/no-namespace
|
||||
import * as sendEmailTranslatedApi from './sendEmailTranslated'
|
||||
import {
|
||||
sendAddedContributionMessageEmail,
|
||||
sendAccountActivationEmail,
|
||||
sendAccountMultiRegistrationEmail,
|
||||
sendAddedContributionMessageEmail,
|
||||
sendContributionChangedByModeratorEmail,
|
||||
sendContributionConfirmedEmail,
|
||||
sendContributionDeniedEmail,
|
||||
sendContributionDeletedEmail,
|
||||
sendContributionDeniedEmail,
|
||||
sendResetPasswordEmail,
|
||||
sendTransactionLinkRedeemedEmail,
|
||||
sendTransactionReceivedEmail,
|
||||
sendContributionChangedByModeratorEmail,
|
||||
} from './sendEmailVariants'
|
||||
|
||||
const testMailServerHost = 'localhost'
|
||||
|
||||
@ -11,7 +11,7 @@ import { ApolloServerTestClient } from 'apollo-server-testing'
|
||||
import { GraphQLClient } from 'graphql-request'
|
||||
import { Response } from 'graphql-request/dist/types'
|
||||
|
||||
import { testEnvironment, cleanDB } from '@test/helpers'
|
||||
import { cleanDB, testEnvironment } from '@test/helpers'
|
||||
import { logger } from '@test/testSetup'
|
||||
|
||||
import { validateCommunities } from './validateCommunities'
|
||||
|
||||
@ -3,10 +3,10 @@ import { Decimal } from 'decimal.js-light'
|
||||
import { ArgsType, Field, Int } from 'type-graphql'
|
||||
|
||||
import {
|
||||
CONTRIBUTIONLINK_NAME_MAX_CHARS,
|
||||
CONTRIBUTIONLINK_NAME_MIN_CHARS,
|
||||
MEMO_MAX_CHARS,
|
||||
MEMO_MIN_CHARS,
|
||||
CONTRIBUTIONLINK_NAME_MIN_CHARS,
|
||||
CONTRIBUTIONLINK_NAME_MAX_CHARS,
|
||||
} from '@/graphql/resolver/const/const'
|
||||
import { isValidDateString } from '@/graphql/validator/DateString'
|
||||
import { IsPositiveDecimal } from '@/graphql/validator/Decimal'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { IsInt, IsString, IsEnum } from 'class-validator'
|
||||
import { ArgsType, Field, Int, InputType } from 'type-graphql'
|
||||
import { IsEnum, IsInt, IsString } from 'class-validator'
|
||||
import { ArgsType, Field, InputType, Int } from 'type-graphql'
|
||||
|
||||
import { ContributionMessageType } from '@enum/ContributionMessageType'
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable type-graphql/invalid-nullable-input-type */
|
||||
import { IsPositive, IsEnum } from 'class-validator'
|
||||
import { ArgsType, Field, Int, InputType } from 'type-graphql'
|
||||
import { IsEnum, IsPositive } from 'class-validator'
|
||||
import { ArgsType, Field, InputType, Int } from 'type-graphql'
|
||||
|
||||
import { Order } from '@enum/Order'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { IsBoolean, IsPositive, IsString } from 'class-validator'
|
||||
import { Field, ArgsType, Int, InputType } from 'type-graphql'
|
||||
import { ArgsType, Field, InputType, Int } from 'type-graphql'
|
||||
|
||||
import { ContributionStatus } from '@enum/ContributionStatus'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { IsPositive, IsEnum } from 'class-validator'
|
||||
import { ArgsType, Field, Int, InputType } from 'type-graphql'
|
||||
import { IsEnum, IsPositive } from 'class-validator'
|
||||
import { ArgsType, Field, InputType, Int } from 'type-graphql'
|
||||
|
||||
import { RoleNames } from '@enum/RoleNames'
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { MaxLength, MinLength, IsString } from 'class-validator'
|
||||
import { IsString, MaxLength, MinLength } from 'class-validator'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ArgsType, Field } from 'type-graphql'
|
||||
|
||||
|
||||
@ -7,15 +7,15 @@ import { INALIENABLE_RIGHTS } from '@/auth/INALIENABLE_RIGHTS'
|
||||
import { decode, encode } from '@/auth/JWT'
|
||||
import { RIGHTS } from '@/auth/RIGHTS'
|
||||
import {
|
||||
ROLE_UNAUTHORIZED,
|
||||
ROLE_USER,
|
||||
ROLE_ADMIN,
|
||||
ROLE_DLT_CONNECTOR,
|
||||
ROLE_MODERATOR,
|
||||
ROLE_MODERATOR_AI,
|
||||
ROLE_DLT_CONNECTOR,
|
||||
ROLE_UNAUTHORIZED,
|
||||
ROLE_USER,
|
||||
} from '@/auth/ROLES'
|
||||
import { Context } from '@/server/context'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { Context } from '@/server/context'
|
||||
|
||||
export const isAuthorized: AuthChecker<Context> = async ({ context }, rights) => {
|
||||
context.role = ROLE_UNAUTHORIZED // unauthorized user
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { IsString, IsOptional, MaxLength, IsNumber, IsBoolean, IsUrl } from 'class-validator'
|
||||
import { InputType, Field, Int } from 'type-graphql'
|
||||
import { IsBoolean, IsNumber, IsOptional, IsString, IsUrl, MaxLength } from 'class-validator'
|
||||
import { Field, InputType, Int } from 'type-graphql'
|
||||
|
||||
@InputType()
|
||||
export class ProjectBrandingInput {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Point } from '@dbTools/typeorm'
|
||||
import { Community as DbCommunity } from '@entity/Community'
|
||||
import { FederatedCommunity as DbFederatedCommunity } from '@entity/FederatedCommunity'
|
||||
import { ObjectType, Field } from 'type-graphql'
|
||||
import { Field, ObjectType } from 'type-graphql'
|
||||
|
||||
import { Point2Location } from '@/graphql/resolver/util/Location2Point'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field } from 'type-graphql'
|
||||
import { Field, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class AdminUpdateContribution {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field, Int, Float } from 'type-graphql'
|
||||
import { Field, Float, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class Balance {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ObjectType, Field } from 'type-graphql'
|
||||
import { Field, ObjectType } from 'type-graphql'
|
||||
|
||||
import { Message } from '@/apis/openai/model/Message'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Community as DbCommunity } from '@entity/Community'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class Community {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class DynamicStatisticsFields {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Contribution as dbContribution } from '@entity/Contribution'
|
||||
import { User as DbUser } from '@entity/User'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
import { User } from './User'
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ContributionLink as dbContributionLink } from '@entity/ContributionLink'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
import { ContributionLink } from '@model/ContributionLink'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
interface DecayInterface {
|
||||
balance: Decimal
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { FederatedCommunity as DbFederatedCommunity } from '@entity/FederatedCommunity'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
import { ensureUrlEndsWithSlash } from '@/util/utilities'
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { ObjectType, Field, Float, Int } from 'type-graphql'
|
||||
import { Field, Float, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
import { GdtEntryType } from '@enum/GdtEntryType'
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ObjectType, Field, Int, Float } from 'type-graphql'
|
||||
import { Field, Float, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
import { GdtEntry } from './GdtEntry'
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ObjectType, Field } from 'type-graphql'
|
||||
import { Field, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class KlickTipp {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class OpenCreation {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class Pagination {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ProjectBranding as dbProjectBranding } from '@entity/ProjectBranding'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class ProjectBranding {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
import { Space as HumhubSpace } from '@/apis/humhub/model/Space'
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ObjectType, Field } from 'type-graphql'
|
||||
import { Field, ObjectType } from 'type-graphql'
|
||||
|
||||
import { SpacesResponse } from '@/apis/humhub/model/SpacesResponse'
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Transaction as dbTransaction } from '@entity/Transaction'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
||||
|
||||
@ -46,7 +46,7 @@ export class Transaction {
|
||||
this.linkedTransactionId = transaction.linkedTransactionId ?? null
|
||||
this.linkId = transaction.contribution
|
||||
? transaction.contribution.contributionLinkId
|
||||
: transaction.transactionLinkId ?? null
|
||||
: (transaction.transactionLinkId ?? null)
|
||||
this.previousBalance =
|
||||
transaction.previousTransaction?.balance.toDecimalPlaces(2, Decimal.ROUND_DOWN) ??
|
||||
new Decimal(0)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ObjectType, Field } from 'type-graphql'
|
||||
import { Field, ObjectType } from 'type-graphql'
|
||||
|
||||
import { Balance } from './Balance'
|
||||
import { Transaction } from './Transaction'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Contribution } from '@entity/Contribution'
|
||||
import { User } from '@entity/User'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class UnconfirmedContribution {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Point } from '@dbTools/typeorm'
|
||||
import { User as dbUser } from '@entity/User'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
import { GmsPublishLocationType } from '@enum/GmsPublishLocationType'
|
||||
import { PublishNameType } from '@enum/PublishNameType'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { User } from '@entity/User'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class UserAdmin {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { UserContact as DbUserContact } from '@entity/UserContact'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import { Field, Int, ObjectType } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class UserContact {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { Resolver, Mutation, Authorized, Ctx, Arg, Query } from 'type-graphql'
|
||||
import { Arg, Authorized, Ctx, Mutation, Query, Resolver } from 'type-graphql'
|
||||
|
||||
import { OpenaiMessage } from '@input/OpenaiMessage'
|
||||
import { ChatGptMessage } from '@model/ChatGptMessage'
|
||||
|
||||
import { Message } from '@/apis/openai/model/Message'
|
||||
import { OpenaiClient } from '@/apis/openai/OpenaiClient'
|
||||
import { Message } from '@/apis/openai/model/Message'
|
||||
import { RIGHTS } from '@/auth/RIGHTS'
|
||||
import { Context } from '@/server/context'
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import { IsNull } from '@dbTools/typeorm'
|
||||
import { Transaction as dbTransaction } from '@entity/Transaction'
|
||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { Resolver, Query, Ctx, Authorized } from 'type-graphql'
|
||||
import { Authorized, Ctx, Query, Resolver } from 'type-graphql'
|
||||
|
||||
import { Balance } from '@model/Balance'
|
||||
|
||||
|
||||
@ -13,16 +13,16 @@ import { GraphQLError } from 'graphql/error/GraphQLError'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
import { cleanDB, testEnvironment } from '@test/helpers'
|
||||
import { logger, i18n as localization } from '@test/testSetup'
|
||||
import { i18n as localization, logger } from '@test/testSetup'
|
||||
|
||||
import { userFactory } from '@/seeds/factory/user'
|
||||
import { login, updateHomeCommunityQuery } from '@/seeds/graphql/mutations'
|
||||
import {
|
||||
allCommunities,
|
||||
getCommunities,
|
||||
communitiesQuery,
|
||||
getHomeCommunityQuery,
|
||||
getCommunities,
|
||||
getCommunityByIdentifierQuery,
|
||||
getHomeCommunityQuery,
|
||||
} from '@/seeds/graphql/queries'
|
||||
import { peterLustig } from '@/seeds/users/peter-lustig'
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { IsNull, Not } from '@dbTools/typeorm'
|
||||
import { Community as DbCommunity } from '@entity/Community'
|
||||
import { FederatedCommunity as DbFederatedCommunity } from '@entity/FederatedCommunity'
|
||||
import { Resolver, Query, Authorized, Mutation, Args, Arg } from 'type-graphql'
|
||||
import { Arg, Args, Authorized, Mutation, Query, Resolver } from 'type-graphql'
|
||||
|
||||
import { Paginated } from '@arg/Paginated'
|
||||
import { EditCommunityInput } from '@input/EditCommunityInput'
|
||||
@ -12,13 +12,13 @@ import { FederatedCommunity } from '@model/FederatedCommunity'
|
||||
import { RIGHTS } from '@/auth/RIGHTS'
|
||||
import { LogError } from '@/server/LogError'
|
||||
|
||||
import { Location2Point } from './util/Location2Point'
|
||||
import {
|
||||
getAllCommunities,
|
||||
getCommunityByIdentifier,
|
||||
getCommunityByUuid,
|
||||
getHomeCommunity,
|
||||
} from './util/communities'
|
||||
import { Location2Point } from './util/Location2Point'
|
||||
|
||||
@Resolver()
|
||||
export class CommunityResolver {
|
||||
|
||||
@ -7,15 +7,15 @@ import { ApolloServerTestClient } from 'apollo-server-testing'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { GraphQLError } from 'graphql'
|
||||
|
||||
import { cleanDB, testEnvironment, resetToken } from '@test/helpers'
|
||||
import { cleanDB, resetToken, testEnvironment } from '@test/helpers'
|
||||
import { logger } from '@test/testSetup'
|
||||
|
||||
import { EventType } from '@/event/Events'
|
||||
import { userFactory } from '@/seeds/factory/user'
|
||||
import {
|
||||
login,
|
||||
createContributionLink,
|
||||
deleteContributionLink,
|
||||
login,
|
||||
updateContributionLink,
|
||||
} from '@/seeds/graphql/mutations'
|
||||
import { listContributionLinks } from '@/seeds/graphql/queries'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { MoreThan, IsNull } from '@dbTools/typeorm'
|
||||
import { IsNull, MoreThan } from '@dbTools/typeorm'
|
||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||
import { Resolver, Args, Arg, Authorized, Mutation, Query, Int, Ctx } from 'type-graphql'
|
||||
import { Arg, Args, Authorized, Ctx, Int, Mutation, Query, Resolver } from 'type-graphql'
|
||||
|
||||
import { ContributionLinkArgs } from '@arg/ContributionLinkArgs'
|
||||
import { Paginated } from '@arg/Paginated'
|
||||
@ -14,8 +14,8 @@ import {
|
||||
EVENT_ADMIN_CONTRIBUTION_LINK_DELETE,
|
||||
EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE,
|
||||
} from '@/event/Events'
|
||||
import { Context, getUser } from '@/server/context'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { Context, getUser } from '@/server/context'
|
||||
|
||||
import { transactionLinkCode as contributionLinkCode } from './TransactionLinkResolver'
|
||||
import { isStartEndDateValid } from './util/creations'
|
||||
|
||||
@ -11,7 +11,7 @@ import { GraphQLError } from 'graphql'
|
||||
|
||||
import { ContributionStatus } from '@enum/ContributionStatus'
|
||||
import { cleanDB, resetToken, testEnvironment } from '@test/helpers'
|
||||
import { logger, i18n as localization } from '@test/testSetup'
|
||||
import { i18n as localization, logger } from '@test/testSetup'
|
||||
|
||||
import { sendAddedContributionMessageEmail } from '@/emails/sendEmailVariants'
|
||||
import { EventType } from '@/event/Events'
|
||||
@ -22,7 +22,7 @@ import {
|
||||
createContributionMessage,
|
||||
login,
|
||||
} from '@/seeds/graphql/mutations'
|
||||
import { listContributionMessages, adminListContributionMessages } from '@/seeds/graphql/queries'
|
||||
import { adminListContributionMessages, listContributionMessages } from '@/seeds/graphql/queries'
|
||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
||||
import { peterLustig } from '@/seeds/users/peter-lustig'
|
||||
|
||||
@ -18,8 +18,8 @@ import {
|
||||
EVENT_CONTRIBUTION_MESSAGE_CREATE,
|
||||
} from '@/event/Events'
|
||||
import { UpdateUnconfirmedContributionContext } from '@/interactions/updateUnconfirmedContribution/UpdateUnconfirmedContribution.context'
|
||||
import { Context, getUser } from '@/server/context'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { Context, getUser } from '@/server/context'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
import { findContributionMessages } from './util/findContributionMessages'
|
||||
|
||||
@ -16,12 +16,12 @@ import { ContributionStatus } from '@enum/ContributionStatus'
|
||||
import { Order } from '@enum/Order'
|
||||
import {
|
||||
cleanDB,
|
||||
resetToken,
|
||||
testEnvironment,
|
||||
contributionDateFormatter,
|
||||
resetEntity,
|
||||
resetToken,
|
||||
testEnvironment,
|
||||
} from '@test/helpers'
|
||||
import { logger, i18n as localization } from '@test/testSetup'
|
||||
import { i18n as localization, logger } from '@test/testSetup'
|
||||
|
||||
import {
|
||||
sendContributionConfirmedEmail,
|
||||
@ -33,22 +33,22 @@ import { creations } from '@/seeds/creation/index'
|
||||
import { creationFactory } from '@/seeds/factory/creation'
|
||||
import { userFactory } from '@/seeds/factory/user'
|
||||
import {
|
||||
adminCreateContribution,
|
||||
adminCreateContributionMessage,
|
||||
adminDeleteContribution,
|
||||
adminUpdateContribution,
|
||||
confirmContribution,
|
||||
createContribution,
|
||||
updateContribution,
|
||||
deleteContribution,
|
||||
denyContribution,
|
||||
confirmContribution,
|
||||
adminCreateContribution,
|
||||
adminUpdateContribution,
|
||||
adminDeleteContribution,
|
||||
login,
|
||||
logout,
|
||||
adminCreateContributionMessage,
|
||||
updateContribution,
|
||||
} from '@/seeds/graphql/mutations'
|
||||
import {
|
||||
adminListContributions,
|
||||
listAllContributions,
|
||||
listContributions,
|
||||
adminListContributions,
|
||||
} from '@/seeds/graphql/queries'
|
||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
||||
|
||||
@ -43,25 +43,25 @@ import {
|
||||
sendContributionDeniedEmail,
|
||||
} from '@/emails/sendEmailVariants'
|
||||
import {
|
||||
EVENT_ADMIN_CONTRIBUTION_CONFIRM,
|
||||
EVENT_ADMIN_CONTRIBUTION_CREATE,
|
||||
EVENT_ADMIN_CONTRIBUTION_DELETE,
|
||||
EVENT_ADMIN_CONTRIBUTION_DENY,
|
||||
EVENT_ADMIN_CONTRIBUTION_UPDATE,
|
||||
EVENT_CONTRIBUTION_CREATE,
|
||||
EVENT_CONTRIBUTION_DELETE,
|
||||
EVENT_CONTRIBUTION_UPDATE,
|
||||
EVENT_ADMIN_CONTRIBUTION_CREATE,
|
||||
EVENT_ADMIN_CONTRIBUTION_UPDATE,
|
||||
EVENT_ADMIN_CONTRIBUTION_DELETE,
|
||||
EVENT_ADMIN_CONTRIBUTION_CONFIRM,
|
||||
EVENT_ADMIN_CONTRIBUTION_DENY,
|
||||
} from '@/event/Events'
|
||||
import { UpdateUnconfirmedContributionContext } from '@/interactions/updateUnconfirmedContribution/UpdateUnconfirmedContribution.context'
|
||||
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { Context, getClientTimezoneOffset, getUser } from '@/server/context'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
import { calculateDecay } from '@/util/decay'
|
||||
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
||||
import { calculateDecay } from '@/util/decay'
|
||||
import { fullName } from '@/util/utilities'
|
||||
|
||||
import { findContribution } from './util/contributions'
|
||||
import { getUserCreation, validateContribution, getOpenCreations } from './util/creations'
|
||||
import { getOpenCreations, getUserCreation, validateContribution } from './util/creations'
|
||||
import { extractGraphQLFields, extractGraphQLFieldsForSelect } from './util/extractGraphQLFields'
|
||||
import { findContributions } from './util/findContributions'
|
||||
import { getLastTransaction } from './util/getLastTransaction'
|
||||
|
||||
@ -5,11 +5,11 @@ import { User as DbUser } from '@entity/User'
|
||||
import { ApolloServerTestClient } from 'apollo-server-testing'
|
||||
import { GraphQLError } from 'graphql'
|
||||
|
||||
import { testEnvironment, cleanDB } from '@test/helpers'
|
||||
import { cleanDB, testEnvironment } from '@test/helpers'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
import { writeHomeCommunityEntry } from '@/seeds/community'
|
||||
import { createUser, setPassword, forgotPassword } from '@/seeds/graphql/mutations'
|
||||
import { createUser, forgotPassword, setPassword } from '@/seeds/graphql/mutations'
|
||||
import { queryOptIn } from '@/seeds/graphql/queries'
|
||||
|
||||
let mutate: ApolloServerTestClient['mutate'],
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
import { Resolver, Query, Args, Ctx, Authorized, Arg, Int, Float } from 'type-graphql'
|
||||
import { Arg, Args, Authorized, Ctx, Float, Int, Query, Resolver } from 'type-graphql'
|
||||
|
||||
import { Paginated } from '@arg/Paginated'
|
||||
import { Order } from '@enum/Order'
|
||||
@ -12,8 +12,8 @@ import { GdtEntryList } from '@model/GdtEntryList'
|
||||
import { apiGet, apiPost } from '@/apis/HttpRequest'
|
||||
import { RIGHTS } from '@/auth/RIGHTS'
|
||||
import { CONFIG } from '@/config'
|
||||
import { Context, getUser } from '@/server/context'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { Context, getUser } from '@/server/context'
|
||||
|
||||
@Resolver()
|
||||
export class GdtResolver {
|
||||
|
||||
@ -8,7 +8,7 @@ import { UserContact } from '@entity/UserContact'
|
||||
import { GraphQLError } from 'graphql'
|
||||
|
||||
import { cleanDB, resetToken, testEnvironment } from '@test/helpers'
|
||||
import { logger, i18n as localization } from '@test/testSetup'
|
||||
import { i18n as localization, logger } from '@test/testSetup'
|
||||
|
||||
import { EventType } from '@/event/Events'
|
||||
import { userFactory } from '@/seeds/factory/user'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Resolver, Authorized, Mutation, Ctx } from 'type-graphql'
|
||||
import { Authorized, Ctx, Mutation, Resolver } from 'type-graphql'
|
||||
|
||||
import { unsubscribe, subscribe } from '@/apis/KlicktippController'
|
||||
import { subscribe, unsubscribe } from '@/apis/KlicktippController'
|
||||
import { RIGHTS } from '@/auth/RIGHTS'
|
||||
import { EVENT_NEWSLETTER_SUBSCRIBE, EVENT_NEWSLETTER_UNSUBSCRIBE } from '@/event/Events'
|
||||
import { Context, getUser } from '@/server/context'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ProjectBranding as DbProjectBranding } from '@entity/ProjectBranding'
|
||||
import { Resolver, Query, Mutation, Arg, Int, Authorized, ID } from 'type-graphql'
|
||||
import { Arg, Authorized, ID, Int, Mutation, Query, Resolver } from 'type-graphql'
|
||||
|
||||
import { ProjectBrandingInput } from '@input/ProjectBrandingInput'
|
||||
import { ProjectBranding } from '@model/ProjectBranding'
|
||||
|
||||
@ -5,7 +5,7 @@ import { getConnection } from '@dbTools/typeorm'
|
||||
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||
import { User as DbUser } from '@entity/User'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { Resolver, Query, Authorized, FieldResolver } from 'type-graphql'
|
||||
import { Authorized, FieldResolver, Query, Resolver } from 'type-graphql'
|
||||
|
||||
import { CommunityStatistics, DynamicStatisticsFields } from '@model/CommunityStatistics'
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ import { Decimal } from 'decimal.js-light'
|
||||
import { GraphQLError } from 'graphql'
|
||||
|
||||
import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
|
||||
import { cleanDB, testEnvironment, resetToken, resetEntity } from '@test/helpers'
|
||||
import { cleanDB, resetEntity, resetToken, testEnvironment } from '@test/helpers'
|
||||
import { logger } from '@test/testSetup'
|
||||
|
||||
import { EventType } from '@/event/Events'
|
||||
@ -21,14 +21,14 @@ import { creationFactory } from '@/seeds/factory/creation'
|
||||
import { transactionLinkFactory } from '@/seeds/factory/transactionLink'
|
||||
import { userFactory } from '@/seeds/factory/user'
|
||||
import {
|
||||
login,
|
||||
createContributionLink,
|
||||
redeemTransactionLink,
|
||||
confirmContribution,
|
||||
createContribution,
|
||||
updateContribution,
|
||||
createContributionLink,
|
||||
createTransactionLink,
|
||||
deleteTransactionLink,
|
||||
confirmContribution,
|
||||
login,
|
||||
redeemTransactionLink,
|
||||
updateContribution,
|
||||
} from '@/seeds/graphql/mutations'
|
||||
import { listTransactionLinksAdmin } from '@/seeds/graphql/queries'
|
||||
import { transactionLinks } from '@/seeds/transactionLink/index'
|
||||
|
||||
@ -7,7 +7,7 @@ import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||
import { User as DbUser } from '@entity/User'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { Resolver, Args, Arg, Authorized, Ctx, Mutation, Query, Int } from 'type-graphql'
|
||||
import { Arg, Args, Authorized, Ctx, Int, Mutation, Query, Resolver } from 'type-graphql'
|
||||
|
||||
import { Paginated } from '@arg/Paginated'
|
||||
import { TransactionLinkArgs } from '@arg/TransactionLinkArgs'
|
||||
@ -29,12 +29,12 @@ import {
|
||||
EVENT_TRANSACTION_LINK_DELETE,
|
||||
EVENT_TRANSACTION_LINK_REDEEM,
|
||||
} from '@/event/Events'
|
||||
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { Context, getClientTimezoneOffset, getUser } from '@/server/context'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
import { calculateDecay } from '@/util/decay'
|
||||
import { TRANSACTION_LINK_LOCK } from '@/util/TRANSACTION_LINK_LOCK'
|
||||
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
||||
import { TRANSACTION_LINK_LOCK } from '@/util/TRANSACTION_LINK_LOCK'
|
||||
import { calculateDecay } from '@/util/decay'
|
||||
import { fullName } from '@/util/utilities'
|
||||
import { calculateBalance } from '@/util/validate'
|
||||
|
||||
|
||||
@ -20,9 +20,9 @@ import { logger } from '@test/testSetup'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
import { EventType } from '@/event/Events'
|
||||
import { SendCoinsClient } from '@/federation/client/1_0/SendCoinsClient'
|
||||
import { SendCoinsArgs } from '@/federation/client/1_0/model/SendCoinsArgs'
|
||||
import { SendCoinsResult } from '@/federation/client/1_0/model/SendCoinsResult'
|
||||
import { SendCoinsClient } from '@/federation/client/1_0/SendCoinsClient'
|
||||
import { userFactory } from '@/seeds/factory/user'
|
||||
import {
|
||||
confirmContribution,
|
||||
|
||||
@ -2,14 +2,14 @@
|
||||
/* eslint-disable new-cap */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import { getConnection, In, IsNull } from '@dbTools/typeorm'
|
||||
import { In, IsNull, getConnection } from '@dbTools/typeorm'
|
||||
import { Community as DbCommunity } from '@entity/Community'
|
||||
import { PendingTransaction as DbPendingTransaction } from '@entity/PendingTransaction'
|
||||
import { Transaction as dbTransaction } from '@entity/Transaction'
|
||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||
import { User as dbUser } from '@entity/User'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
import { Resolver, Query, Args, Authorized, Ctx, Mutation } from 'type-graphql'
|
||||
import { Args, Authorized, Ctx, Mutation, Query, Resolver } from 'type-graphql'
|
||||
|
||||
import { Paginated } from '@arg/Paginated'
|
||||
import { TransactionSendArgs } from '@arg/TransactionSendArgs'
|
||||
@ -28,14 +28,14 @@ import {
|
||||
} from '@/emails/sendEmailVariants'
|
||||
import { EVENT_TRANSACTION_RECEIVE, EVENT_TRANSACTION_SEND } from '@/event/Events'
|
||||
import { SendCoinsResult } from '@/federation/client/1_0/model/SendCoinsResult'
|
||||
import { Context, getUser } from '@/server/context'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { Context, getUser } from '@/server/context'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
import { communityUser } from '@/util/communityUser'
|
||||
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
||||
import { communityUser } from '@/util/communityUser'
|
||||
import { fullName } from '@/util/utilities'
|
||||
import { calculateBalance } from '@/util/validate'
|
||||
import { virtualLinkTransaction, virtualDecayTransaction } from '@/util/virtualTransactions'
|
||||
import { virtualDecayTransaction, virtualLinkTransaction } from '@/util/virtualTransactions'
|
||||
|
||||
import { BalanceResolver } from './BalanceResolver'
|
||||
import { GdtResolver } from './GdtResolver'
|
||||
|
||||
@ -23,8 +23,8 @@ import { RoleNames } from '@enum/RoleNames'
|
||||
import { UserContactType } from '@enum/UserContactType'
|
||||
import { ContributionLink } from '@model/ContributionLink'
|
||||
import { Location } from '@model/Location'
|
||||
import { testEnvironment, headerPushMock, resetToken, cleanDB } from '@test/helpers'
|
||||
import { logger, i18n as localization } from '@test/testSetup'
|
||||
import { cleanDB, headerPushMock, resetToken, testEnvironment } from '@test/helpers'
|
||||
import { i18n as localization, logger } from '@test/testSetup'
|
||||
|
||||
import { subscribe } from '@/apis/KlicktippController'
|
||||
import { CONFIG } from '@/config'
|
||||
@ -42,26 +42,26 @@ import { contributionLinkFactory } from '@/seeds/factory/contributionLink'
|
||||
import { transactionLinkFactory } from '@/seeds/factory/transactionLink'
|
||||
import { userFactory } from '@/seeds/factory/user'
|
||||
import {
|
||||
confirmContribution,
|
||||
createContribution,
|
||||
createUser,
|
||||
deleteUser,
|
||||
forgotPassword,
|
||||
login,
|
||||
logout,
|
||||
createUser,
|
||||
setPassword,
|
||||
forgotPassword,
|
||||
updateUserInfos,
|
||||
createContribution,
|
||||
confirmContribution,
|
||||
setUserRole,
|
||||
deleteUser,
|
||||
unDeleteUser,
|
||||
sendActivationEmail,
|
||||
setPassword,
|
||||
setUserRole,
|
||||
unDeleteUser,
|
||||
updateUserInfos,
|
||||
} from '@/seeds/graphql/mutations'
|
||||
import {
|
||||
verifyLogin,
|
||||
checkUsername,
|
||||
queryOptIn,
|
||||
searchAdminUsers,
|
||||
searchUsers,
|
||||
user as userQuery,
|
||||
checkUsername,
|
||||
verifyLogin,
|
||||
} from '@/seeds/graphql/queries'
|
||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
import { getConnection, In, Point } from '@dbTools/typeorm'
|
||||
import { In, Point, getConnection } from '@dbTools/typeorm'
|
||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||
import { ProjectBranding } from '@entity/ProjectBranding'
|
||||
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||
@ -12,17 +12,17 @@ import { UserLoggingView } from '@logging/UserLogging.view'
|
||||
import { GraphQLResolveInfo } from 'graphql'
|
||||
import i18n from 'i18n'
|
||||
import {
|
||||
Resolver,
|
||||
Query,
|
||||
Args,
|
||||
Arg,
|
||||
Args,
|
||||
Authorized,
|
||||
Ctx,
|
||||
Mutation,
|
||||
Int,
|
||||
Root,
|
||||
FieldResolver,
|
||||
Info,
|
||||
Int,
|
||||
Mutation,
|
||||
Query,
|
||||
Resolver,
|
||||
Root,
|
||||
} from 'type-graphql'
|
||||
import { IRestResponse } from 'typed-rest-client'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
@ -42,15 +42,15 @@ import { SearchAdminUsersResult } from '@model/AdminUser'
|
||||
// import { Location } from '@model/Location'
|
||||
import { GmsUserAuthenticationResult } from '@model/GmsUserAuthenticationResult'
|
||||
import { User } from '@model/User'
|
||||
import { UserAdmin, SearchUsersResult } from '@model/UserAdmin'
|
||||
import { SearchUsersResult, UserAdmin } from '@model/UserAdmin'
|
||||
import { UserContact } from '@model/UserContact'
|
||||
import { UserLocationResult } from '@model/UserLocationResult'
|
||||
|
||||
import { subscribe } from '@/apis/KlicktippController'
|
||||
import { HumHubClient } from '@/apis/humhub/HumHubClient'
|
||||
import { Account as HumhubAccount } from '@/apis/humhub/model/Account'
|
||||
import { GetUser } from '@/apis/humhub/model/GetUser'
|
||||
import { PostUser } from '@/apis/humhub/model/PostUser'
|
||||
import { subscribe } from '@/apis/KlicktippController'
|
||||
import { encode } from '@/auth/JWT'
|
||||
import { RIGHTS } from '@/auth/RIGHTS'
|
||||
import { CONFIG } from '@/config'
|
||||
@ -60,25 +60,25 @@ import {
|
||||
sendResetPasswordEmail,
|
||||
} from '@/emails/sendEmailVariants'
|
||||
import {
|
||||
EVENT_ADMIN_USER_DELETE,
|
||||
EVENT_ADMIN_USER_ROLE_SET,
|
||||
EVENT_ADMIN_USER_UNDELETE,
|
||||
EVENT_EMAIL_ACCOUNT_MULTIREGISTRATION,
|
||||
EVENT_EMAIL_ADMIN_CONFIRMATION,
|
||||
EVENT_EMAIL_CONFIRMATION,
|
||||
EVENT_EMAIL_FORGOT_PASSWORD,
|
||||
EVENT_USER_ACTIVATE_ACCOUNT,
|
||||
EVENT_USER_INFO_UPDATE,
|
||||
EVENT_USER_LOGIN,
|
||||
EVENT_USER_LOGOUT,
|
||||
EVENT_USER_REGISTER,
|
||||
Event,
|
||||
EventType,
|
||||
EVENT_USER_LOGIN,
|
||||
EVENT_EMAIL_ACCOUNT_MULTIREGISTRATION,
|
||||
EVENT_EMAIL_CONFIRMATION,
|
||||
EVENT_USER_REGISTER,
|
||||
EVENT_USER_ACTIVATE_ACCOUNT,
|
||||
EVENT_EMAIL_ADMIN_CONFIRMATION,
|
||||
EVENT_USER_LOGOUT,
|
||||
EVENT_EMAIL_FORGOT_PASSWORD,
|
||||
EVENT_USER_INFO_UPDATE,
|
||||
EVENT_ADMIN_USER_ROLE_SET,
|
||||
EVENT_ADMIN_USER_DELETE,
|
||||
EVENT_ADMIN_USER_UNDELETE,
|
||||
} from '@/event/Events'
|
||||
import { isValidPassword } from '@/password/EncryptorUtils'
|
||||
import { encryptPassword, verifyPassword } from '@/password/PasswordEncryptor'
|
||||
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { Context, getClientTimezoneOffset, getUser } from '@/server/context'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
import { communityDbUser } from '@/util/communityUser'
|
||||
import { hasElopageBuys } from '@/util/hasElopageBuys'
|
||||
@ -89,6 +89,7 @@ import random from 'random-bigint'
|
||||
import { randombytes_random } from 'sodium-native'
|
||||
|
||||
import { FULL_CREATION_AVAILABLE } from './const/const'
|
||||
import { Location2Point, Point2Location } from './util/Location2Point'
|
||||
import { authenticateGmsUserPlayground } from './util/authenticateGmsUserPlayground'
|
||||
import { getHomeCommunity } from './util/communities'
|
||||
import { compareGmsRelevantUserSettings } from './util/compareGmsRelevantUserSettings'
|
||||
@ -97,8 +98,7 @@ import { extractGraphQLFieldsForSelect } from './util/extractGraphQLFields'
|
||||
import { findUserByIdentifier } from './util/findUserByIdentifier'
|
||||
import { findUsers } from './util/findUsers'
|
||||
import { getKlicktippState } from './util/getKlicktippState'
|
||||
import { Location2Point, Point2Location } from './util/Location2Point'
|
||||
import { setUserRole, deleteUserRole } from './util/modifyUserRole'
|
||||
import { deleteUserRole, setUserRole } from './util/modifyUserRole'
|
||||
import { sendUserToGms } from './util/sendUserToGms'
|
||||
import { syncHumhub } from './util/syncHumhub'
|
||||
import { validateAlias } from './util/validateAlias'
|
||||
|
||||
@ -8,17 +8,17 @@ import { Decimal } from 'decimal.js-light'
|
||||
import { GraphQLError } from 'graphql'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
import { cleanDB, testEnvironment, contributionDateFormatter } from '@test/helpers'
|
||||
import { cleanDB, contributionDateFormatter, testEnvironment } from '@test/helpers'
|
||||
|
||||
import { creationFactory, nMonthsBefore } from '@/seeds/factory/creation'
|
||||
import { userFactory } from '@/seeds/factory/user'
|
||||
import {
|
||||
confirmContribution,
|
||||
createContribution,
|
||||
createTransactionLink,
|
||||
redeemTransactionLink,
|
||||
login,
|
||||
createContributionLink,
|
||||
createTransactionLink,
|
||||
login,
|
||||
redeemTransactionLink,
|
||||
sendCoins,
|
||||
} from '@/seeds/graphql/mutations'
|
||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||
|
||||
@ -3,11 +3,11 @@ import { Contribution } from '@entity/Contribution'
|
||||
import { User } from '@entity/User'
|
||||
import { ApolloServerTestClient } from 'apollo-server-testing'
|
||||
|
||||
import { testEnvironment, cleanDB, contributionDateFormatter } from '@test/helpers'
|
||||
import { cleanDB, contributionDateFormatter, testEnvironment } from '@test/helpers'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
import { userFactory } from '@/seeds/factory/user'
|
||||
import { login, createContribution, adminCreateContribution } from '@/seeds/graphql/mutations'
|
||||
import { adminCreateContribution, createContribution, login } from '@/seeds/graphql/mutations'
|
||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||
import { peterLustig } from '@/seeds/users/peter-lustig'
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ObjectLiteral, SelectQueryBuilder } from '@dbTools/typeorm'
|
||||
import { GraphQLResolveInfo } from 'graphql'
|
||||
import {
|
||||
parseResolveInfo,
|
||||
ResolveTree,
|
||||
parseResolveInfo,
|
||||
simplifyParsedResolveInfoFragmentWithType,
|
||||
} from 'graphql-parse-resolve-info'
|
||||
|
||||
|
||||
@ -24,8 +24,8 @@ export const findUserByIdentifier = async (
|
||||
const communityWhere: FindOptionsWhere<Community> = isURL(communityIdentifier)
|
||||
? { url: communityIdentifier }
|
||||
: isUUID4(communityIdentifier)
|
||||
? { communityUuid: communityIdentifier }
|
||||
: { name: communityIdentifier }
|
||||
? { communityUuid: communityIdentifier }
|
||||
: { name: communityIdentifier }
|
||||
|
||||
if (validate(identifier) && version(identifier) === 4) {
|
||||
user = await DbUser.findOne({
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { IsNull, Not, Like } from '@dbTools/typeorm'
|
||||
import { IsNull, Like, Not } from '@dbTools/typeorm'
|
||||
import { User as DbUser } from '@entity/User'
|
||||
|
||||
import { SearchUsersFilters } from '@arg/SearchUsersFilters'
|
||||
|
||||
@ -5,10 +5,10 @@ import { User as dbUser } from '@entity/User'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
import { SendCoinsArgs } from '@/federation/client/1_0/model/SendCoinsArgs'
|
||||
import { SendCoinsResult } from '@/federation/client/1_0/model/SendCoinsResult'
|
||||
// eslint-disable-next-line camelcase
|
||||
import { SendCoinsClient as V1_0_SendCoinsClient } from '@/federation/client/1_0/SendCoinsClient'
|
||||
import { SendCoinsArgs } from '@/federation/client/1_0/model/SendCoinsArgs'
|
||||
import { SendCoinsResult } from '@/federation/client/1_0/model/SendCoinsResult'
|
||||
import { SendCoinsClientFactory } from '@/federation/client/SendCoinsClientFactory'
|
||||
import { PendingTransactionState } from '@/graphql/enum/PendingTransactionState'
|
||||
import { TransactionTypeId } from '@/graphql/enum/TransactionTypeId'
|
||||
|
||||
@ -17,8 +17,8 @@ import { GraphQLClient } from 'graphql-request'
|
||||
import { Response } from 'graphql-request/dist/types'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
import { testEnvironment, cleanDB } from '@test/helpers'
|
||||
import { logger, i18n as localization } from '@test/testSetup'
|
||||
import { cleanDB, testEnvironment } from '@test/helpers'
|
||||
import { i18n as localization, logger } from '@test/testSetup'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
import { TransactionTypeId } from '@/graphql/enum/TransactionTypeId'
|
||||
|
||||
@ -12,8 +12,8 @@ import { Decimal } from 'decimal.js-light'
|
||||
import { PendingTransactionState } from '@/graphql/enum/PendingTransactionState'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
import { calculateSenderBalance } from '@/util/calculateSenderBalance'
|
||||
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
||||
import { calculateSenderBalance } from '@/util/calculateSenderBalance'
|
||||
|
||||
import { getLastTransaction } from './getLastTransaction'
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { MoreThan, IsNull } from '@dbTools/typeorm'
|
||||
import { IsNull, MoreThan } from '@dbTools/typeorm'
|
||||
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||
import { User as DbUser } from '@entity/User'
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@ import { Connection } from '@dbTools/typeorm'
|
||||
import { User } from '@entity/User'
|
||||
import { ApolloServerTestClient } from 'apollo-server-testing'
|
||||
|
||||
import { testEnvironment, cleanDB } from '@test/helpers'
|
||||
import { logger, i18n as localization } from '@test/testSetup'
|
||||
import { cleanDB, testEnvironment } from '@test/helpers'
|
||||
import { i18n as localization, logger } from '@test/testSetup'
|
||||
|
||||
import { userFactory } from '@/seeds/factory/user'
|
||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { registerDecorator, ValidationOptions } from 'class-validator'
|
||||
import { ValidationOptions, registerDecorator } from 'class-validator'
|
||||
|
||||
import { ContributionStatus } from '@enum/ContributionStatus'
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { registerDecorator, ValidationOptions, ValidationArguments } from 'class-validator'
|
||||
import { ValidationArguments, ValidationOptions, registerDecorator } from 'class-validator'
|
||||
|
||||
export function isValidDateString(validationOptions?: ValidationOptions) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { registerDecorator, ValidationOptions, ValidationArguments } from 'class-validator'
|
||||
import { ValidationArguments, ValidationOptions, registerDecorator } from 'class-validator'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
|
||||
export function IsPositiveDecimal(validationOptions?: ValidationOptions) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { registerDecorator, ValidationOptions, ValidationArguments } from 'class-validator'
|
||||
import { ValidationArguments, ValidationOptions, registerDecorator } from 'class-validator'
|
||||
|
||||
import { Location } from '@model/Location'
|
||||
|
||||
|
||||
@ -6,8 +6,8 @@ import { Role } from '@/auth/Role'
|
||||
import { ContributionLogic } from '@/data/Contribution.logic'
|
||||
import { ContributionMessageBuilder } from '@/data/ContributionMessage.builder'
|
||||
import { ContributionStatus } from '@/graphql/enum/ContributionStatus'
|
||||
import { Context, getClientTimezoneOffset } from '@/server/context'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { Context, getClientTimezoneOffset } from '@/server/context'
|
||||
|
||||
export abstract class AbstractUnconfirmedContributionRole {
|
||||
private availableCreationSums?: Decimal[]
|
||||
|
||||
@ -17,7 +17,10 @@ import { AbstractUnconfirmedContributionRole } from './AbstractUnconfirmedContri
|
||||
* Admins and Moderators are currently not allowed to comment her own contributions with the admin/moderator role
|
||||
*/
|
||||
export class UnconfirmedContributionAdminAddMessageRole extends AbstractUnconfirmedContributionRole {
|
||||
public constructor(contribution: Contribution, private updateData: ContributionMessageArgs) {
|
||||
public constructor(
|
||||
contribution: Contribution,
|
||||
private updateData: ContributionMessageArgs,
|
||||
) {
|
||||
super(contribution, contribution.amount, contribution.contributionDate)
|
||||
logger.debug('use UnconfirmedContributionAdminAddMessageRole')
|
||||
}
|
||||
|
||||
@ -14,7 +14,10 @@ import { AbstractUnconfirmedContributionRole } from './AbstractUnconfirmedContri
|
||||
* independent from there role, because the own contribution can only be edited in user role
|
||||
*/
|
||||
export class UnconfirmedContributionUserRole extends AbstractUnconfirmedContributionRole {
|
||||
public constructor(contribution: Contribution, private updateData: ContributionArgs) {
|
||||
public constructor(
|
||||
contribution: Contribution,
|
||||
private updateData: ContributionArgs,
|
||||
) {
|
||||
super(contribution, updateData.amount, new Date(updateData.creationDate))
|
||||
logger.debug('use UnconfirmedContributionUserRole')
|
||||
}
|
||||
|
||||
@ -15,7 +15,10 @@ import { AbstractUnconfirmedContributionRole } from './AbstractUnconfirmedContri
|
||||
* independent from there role, because the own contribution can only be commented in user role
|
||||
*/
|
||||
export class UnconfirmedContributionUserAddMessageRole extends AbstractUnconfirmedContributionRole {
|
||||
public constructor(contribution: Contribution, private updateData: ContributionMessageArgs) {
|
||||
public constructor(
|
||||
contribution: Contribution,
|
||||
private updateData: ContributionMessageArgs,
|
||||
) {
|
||||
super(contribution, contribution.amount, contribution.contributionDate)
|
||||
logger.debug('use UnconfirmedContributionUserAddMessageRole')
|
||||
}
|
||||
|
||||
@ -7,8 +7,8 @@ import { AdminUpdateContributionArgs } from '@arg/AdminUpdateContributionArgs'
|
||||
import { ContributionArgs } from '@arg/ContributionArgs'
|
||||
|
||||
import { ContributionMessageArgs } from '@/graphql/arg/ContributionMessageArgs'
|
||||
import { Context } from '@/server/context'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { Context } from '@/server/context'
|
||||
|
||||
import { AbstractUnconfirmedContributionRole } from './AbstractUnconfirmedContribution.role'
|
||||
import { UnconfirmedContributionAdminRole } from './UnconfirmedContributionAdmin.role'
|
||||
|
||||
@ -4,15 +4,15 @@ import { CONFIG } from '@/config'
|
||||
|
||||
import {
|
||||
crypto_box_SEEDBYTES,
|
||||
crypto_hash_sha512_init,
|
||||
crypto_hash_sha512_update,
|
||||
crypto_hash_sha512_final,
|
||||
crypto_hash_sha512_BYTES,
|
||||
crypto_hash_sha512_STATEBYTES,
|
||||
crypto_shorthash_BYTES,
|
||||
crypto_pwhash_SALTBYTES,
|
||||
crypto_hash_sha512_final,
|
||||
crypto_hash_sha512_init,
|
||||
crypto_hash_sha512_update,
|
||||
crypto_pwhash,
|
||||
crypto_pwhash_SALTBYTES,
|
||||
crypto_shorthash,
|
||||
crypto_shorthash_BYTES,
|
||||
} from 'sodium-native'
|
||||
|
||||
export const SecretKeyCryptographyCreateKey = (
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { User } from '@entity/User'
|
||||
|
||||
// import { logger } from '@test/testSetup' getting error "jest is not defined"
|
||||
import { getUserCryptographicSalt, SecretKeyCryptographyCreateKey } from './EncryptorUtils'
|
||||
import { SecretKeyCryptographyCreateKey, getUserCryptographicSalt } from './EncryptorUtils'
|
||||
|
||||
export const encryptPassword = async (dbUser: User, password: string): Promise<bigint> => {
|
||||
const salt = getUserCryptographicSalt(dbUser)
|
||||
|
||||
@ -11,19 +11,19 @@ import { LogError } from '@/server/LogError'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
import {
|
||||
crypto_shorthash_KEYBYTES,
|
||||
crypto_box_SEEDBYTES,
|
||||
crypto_hash_sha512_init,
|
||||
crypto_hash_sha512_update,
|
||||
crypto_hash_sha512_final,
|
||||
crypto_hash_sha512_BYTES,
|
||||
crypto_hash_sha512_STATEBYTES,
|
||||
crypto_shorthash_BYTES,
|
||||
crypto_pwhash_SALTBYTES,
|
||||
crypto_hash_sha512_final,
|
||||
crypto_hash_sha512_init,
|
||||
crypto_hash_sha512_update,
|
||||
crypto_pwhash,
|
||||
crypto_shorthash,
|
||||
crypto_pwhash_OPSLIMIT_MIN,
|
||||
crypto_pwhash_MEMLIMIT_MIN,
|
||||
crypto_pwhash_OPSLIMIT_MIN,
|
||||
crypto_pwhash_SALTBYTES,
|
||||
crypto_shorthash,
|
||||
crypto_shorthash_BYTES,
|
||||
crypto_shorthash_KEYBYTES,
|
||||
} from 'sodium-native'
|
||||
|
||||
const SecretKeyCryptographyCreateKeyMock = (
|
||||
|
||||
@ -6,7 +6,7 @@ import { ApolloServerTestClient } from 'apollo-server-testing'
|
||||
import { ContributionLink } from '@model/ContributionLink'
|
||||
|
||||
import { ContributionLinkInterface } from '@/seeds/contributionLink/ContributionLinkInterface'
|
||||
import { login, createContributionLink } from '@/seeds/graphql/mutations'
|
||||
import { createContributionLink, login } from '@/seeds/graphql/mutations'
|
||||
|
||||
export const contributionLinkFactory = async (
|
||||
client: ApolloServerTestClient,
|
||||
|
||||
@ -8,7 +8,7 @@ import { ApolloServerTestClient } from 'apollo-server-testing'
|
||||
|
||||
import { findUserByEmail } from '@/graphql/resolver/UserResolver'
|
||||
import { CreationInterface } from '@/seeds/creation/CreationInterface'
|
||||
import { login, createContribution, confirmContribution } from '@/seeds/graphql/mutations'
|
||||
import { confirmContribution, createContribution, login } from '@/seeds/graphql/mutations'
|
||||
|
||||
export const nMonthsBefore = (date: Date, months = 1): string => {
|
||||
return new Date(date.getFullYear(), date.getMonth() - months, 1).toISOString()
|
||||
|
||||
@ -4,7 +4,7 @@ import { TransactionLink } from '@entity/TransactionLink'
|
||||
import { ApolloServerTestClient } from 'apollo-server-testing'
|
||||
|
||||
import { transactionLinkExpireDate } from '@/graphql/resolver/TransactionLinkResolver'
|
||||
import { login, createTransactionLink } from '@/seeds/graphql/mutations'
|
||||
import { createTransactionLink, login } from '@/seeds/graphql/mutations'
|
||||
import { TransactionLinkInterface } from '@/seeds/transactionLink/TransactionLinkInterface'
|
||||
|
||||
export const transactionLinkFactory = async (
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
import { entities } from '@entity/index'
|
||||
import { createTestClient } from 'apollo-server-testing'
|
||||
import { name, internet, datatype } from 'faker'
|
||||
import { datatype, internet, name } from 'faker'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
import { createServer } from '@/server/createServer'
|
||||
|
||||
@ -10,8 +10,8 @@ import { Logger } from 'log4js'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
import { schema } from '@/graphql/schema'
|
||||
import { Connection } from '@/typeorm/connection'
|
||||
import { checkDBVersion } from '@/typeorm/DBVersion'
|
||||
import { Connection } from '@/typeorm/connection'
|
||||
import { elopageWebhook } from '@/webhook/elopage'
|
||||
import { gmsWebhook } from '@/webhook/gms'
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// TODO This is super weird - since the entities are defined in another project they have their own globals.
|
||||
// We cannot use our connection here, but must use the external typeorm installation
|
||||
import { Connection as DbConnection, createConnection, FileLogger } from '@dbTools/typeorm'
|
||||
import { Connection as DbConnection, FileLogger, createConnection } from '@dbTools/typeorm'
|
||||
import { entities } from '@entity/index'
|
||||
|
||||
import { CONFIG } from '@/config'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
import { SaveOptions, RemoveOptions } from '@dbTools/typeorm'
|
||||
import { RemoveOptions, SaveOptions } from '@dbTools/typeorm'
|
||||
import { User as dbUser } from '@entity/User'
|
||||
import { UserContact } from '@entity/UserContact'
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
|
||||
import { decayFormula, calculateDecay } from './decay'
|
||||
import { calculateDecay, decayFormula } from './decay'
|
||||
|
||||
describe('utils/decay', () => {
|
||||
describe('decayFormula', () => {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user