mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
lint - import/no-relative-parent-imports (#8349)
enable import/no-relative-parent-imports
This commit is contained in:
parent
dfe9205bf6
commit
a4f391930c
@ -23,7 +23,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
'import/resolver': {
|
'import/resolver': {
|
||||||
typescript: {
|
typescript: {
|
||||||
project: ['./tsconfig.json'],
|
project: ['./tsconfig.json', './backend/tsconfig.json'],
|
||||||
},
|
},
|
||||||
node: true,
|
node: true,
|
||||||
},
|
},
|
||||||
@ -52,16 +52,16 @@ module.exports = {
|
|||||||
'import/no-commonjs': 'error',
|
'import/no-commonjs': 'error',
|
||||||
'import/no-import-module-exports': 'error',
|
'import/no-import-module-exports': 'error',
|
||||||
'import/no-nodejs-modules': 'off',
|
'import/no-nodejs-modules': 'off',
|
||||||
'import/unambiguous': 'off', // not compatible with scriptless vue files
|
'import/unambiguous': 'off', // not compatible with .eslintrc.cjs
|
||||||
'import/default': 'error',
|
'import/default': 'error',
|
||||||
// 'import/named': 'error',
|
'import/named': 'off', // has false positives
|
||||||
'import/namespace': 'error',
|
'import/namespace': 'error',
|
||||||
'import/no-absolute-path': 'error',
|
'import/no-absolute-path': 'error',
|
||||||
'import/no-cycle': 'error',
|
'import/no-cycle': 'error',
|
||||||
'import/no-dynamic-require': 'error',
|
'import/no-dynamic-require': 'error',
|
||||||
'import/no-internal-modules': 'off',
|
'import/no-internal-modules': 'off',
|
||||||
'import/no-relative-packages': 'error',
|
'import/no-relative-packages': 'error',
|
||||||
// 'import/no-relative-parent-imports': ['error', { ignore: ['@/*'] }],
|
'import/no-relative-parent-imports': ['error', { ignore: ['@/*'] }],
|
||||||
'import/no-self-import': 'error',
|
'import/no-self-import': 'error',
|
||||||
'import/no-unresolved': 'error',
|
'import/no-unresolved': 'error',
|
||||||
'import/no-useless-path-segments': 'error',
|
'import/no-useless-path-segments': 'error',
|
||||||
@ -72,8 +72,8 @@ module.exports = {
|
|||||||
'import/first': 'error',
|
'import/first': 'error',
|
||||||
'import/group-exports': 'off',
|
'import/group-exports': 'off',
|
||||||
'import/newline-after-import': 'error',
|
'import/newline-after-import': 'error',
|
||||||
// 'import/no-anonymous-default-export': 'error',
|
'import/no-anonymous-default-export': 'off', // not compatible with neode
|
||||||
// 'import/no-default-export': 'error',
|
'import/no-default-export': 'off', // not compatible with neode
|
||||||
'import/no-duplicates': 'error',
|
'import/no-duplicates': 'error',
|
||||||
'import/no-named-default': 'error',
|
'import/no-named-default': 'error',
|
||||||
'import/no-namespace': 'error',
|
'import/no-namespace': 'error',
|
||||||
@ -128,7 +128,10 @@ module.exports = {
|
|||||||
'n/no-restricted-require': 'error',
|
'n/no-restricted-require': 'error',
|
||||||
// 'n/no-sync': 'error',
|
// 'n/no-sync': 'error',
|
||||||
// 'n/no-unpublished-bin': 'error', // part of n/recommended
|
// 'n/no-unpublished-bin': 'error', // part of n/recommended
|
||||||
'n/no-unpublished-import': ['error', { 'allowModules': ['apollo-server-testing', 'rosie', '@faker-js/faker'] }], // part of n/recommended
|
'n/no-unpublished-import': [
|
||||||
|
'error',
|
||||||
|
{ allowModules: ['apollo-server-testing', 'rosie', '@faker-js/faker', 'ts-jest'] },
|
||||||
|
], // part of n/recommended
|
||||||
// 'n/no-unpublished-require': 'error', // part of n/recommended
|
// 'n/no-unpublished-require': 'error', // part of n/recommended
|
||||||
// 'n/no-unsupported-features/es-builtins': 'error', // part of n/recommended
|
// 'n/no-unsupported-features/es-builtins': 'error', // part of n/recommended
|
||||||
// 'n/no-unsupported-features/es-syntax': 'error', // part of n/recommended
|
// 'n/no-unsupported-features/es-syntax': 'error', // part of n/recommended
|
||||||
|
|||||||
26
backend/jest.config.cjs
Normal file
26
backend/jest.config.cjs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/* eslint-disable import/no-commonjs */
|
||||||
|
const { pathsToModuleNameMapper } = require('ts-jest')
|
||||||
|
const requireJSON5 = require('require-json5')
|
||||||
|
const { compilerOptions } = requireJSON5('./tsconfig.json')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
verbose: true,
|
||||||
|
preset: 'ts-jest',
|
||||||
|
collectCoverage: true,
|
||||||
|
collectCoverageFrom: [
|
||||||
|
'**/*.ts',
|
||||||
|
'!**/node_modules/**',
|
||||||
|
'!**/test/**',
|
||||||
|
'!**/build/**',
|
||||||
|
'!**/src/**/?(*.)+(spec|test).ts?(x)',
|
||||||
|
'!**/src/db/**',
|
||||||
|
],
|
||||||
|
coverageThreshold: {
|
||||||
|
global: {
|
||||||
|
lines: 90,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
testMatch: ['**/src/**/?(*.)+(spec|test).ts?(x)'],
|
||||||
|
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
|
||||||
|
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
|
||||||
|
}
|
||||||
@ -1,20 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
verbose: true,
|
|
||||||
preset: 'ts-jest',
|
|
||||||
collectCoverage: true,
|
|
||||||
collectCoverageFrom: [
|
|
||||||
'**/*.ts',
|
|
||||||
'!**/node_modules/**',
|
|
||||||
'!**/test/**',
|
|
||||||
'!**/build/**',
|
|
||||||
'!**/src/**/?(*.)+(spec|test).ts?(x)',
|
|
||||||
'!**/src/db/**'
|
|
||||||
],
|
|
||||||
coverageThreshold: {
|
|
||||||
global: {
|
|
||||||
lines: 90,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
testMatch: ['**/src/**/?(*.)+(spec|test).ts?(x)'],
|
|
||||||
setupFilesAfterEnv: ['<rootDir>/test/setup.ts']
|
|
||||||
}
|
|
||||||
@ -11,14 +11,14 @@
|
|||||||
"__migrate": "migrate --compiler 'ts:./src/db/compiler.ts' --migrations-dir ./src/db/migrations",
|
"__migrate": "migrate --compiler 'ts:./src/db/compiler.ts' --migrations-dir ./src/db/migrations",
|
||||||
"prod:migrate": "migrate --migrations-dir ./build/src/db/migrations --store ./build/src/db/migrate/store.js",
|
"prod:migrate": "migrate --migrations-dir ./build/src/db/migrations --store ./build/src/db/migrate/store.js",
|
||||||
"start": "node build/src/",
|
"start": "node build/src/",
|
||||||
"build": "tsc && ./scripts/build.copy.files.sh",
|
"build": "tsc && tsc-alias && ./scripts/build.copy.files.sh",
|
||||||
"dev": "nodemon --exec ts-node src/ -e js,ts,gql",
|
"dev": "nodemon --exec ts-node --require tsconfig-paths/register src/ -e js,ts,gql",
|
||||||
"dev:debug": "nodemon --exec babel-node --inspect=0.0.0.0:9229 src/ -e js,ts,gql",
|
"dev:debug": "nodemon --exec babel-node --inspect=0.0.0.0:9229 src/ -e js,ts,gql",
|
||||||
"lint": "eslint --max-warnings=0 --ext .js,.ts ./src",
|
"lint": "eslint --max-warnings=0 --ext .js,.ts ./src",
|
||||||
"test": "cross-env NODE_ENV=test NODE_OPTIONS=--max-old-space-size=8192 jest --runInBand --coverage --forceExit --detectOpenHandles",
|
"test": "cross-env NODE_ENV=test NODE_OPTIONS=--max-old-space-size=8192 jest --runInBand --coverage --forceExit --detectOpenHandles",
|
||||||
"db:clean": "ts-node src/db/clean.ts",
|
"db:clean": "ts-node --require tsconfig-paths/register src/db/clean.ts",
|
||||||
"db:reset": "yarn run db:clean",
|
"db:reset": "yarn run db:clean",
|
||||||
"db:seed": "ts-node src/db/seed.ts",
|
"db:seed": "ts-node --require tsconfig-paths/register src/db/seed.ts",
|
||||||
"db:migrate": "yarn run __migrate --store ./src/db/migrate/store.ts",
|
"db:migrate": "yarn run __migrate --store ./src/db/migrate/store.ts",
|
||||||
"db:migrate:create": "yarn run __migrate --template-file ./src/db/migrate/template.ts --date-format 'yyyymmddHHmmss' create"
|
"db:migrate:create": "yarn run __migrate --template-file ./src/db/migrate/template.ts --date-format 'yyyymmddHHmmss' create"
|
||||||
},
|
},
|
||||||
@ -119,9 +119,12 @@
|
|||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"nodemon": "~3.1.9",
|
"nodemon": "~3.1.9",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
|
"require-json5": "^1.3.0",
|
||||||
"rosie": "^2.1.1",
|
"rosie": "^2.1.1",
|
||||||
"ts-jest": "^29.3.1",
|
"ts-jest": "^29.3.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
|
"tsc-alias": "^1.8.14",
|
||||||
|
"tsconfig-paths": "^4.2.0",
|
||||||
"typescript": "^5.8.3"
|
"typescript": "^5.8.3"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# public
|
||||||
|
cp -r public/ build/public/
|
||||||
|
|
||||||
# html files
|
# html files
|
||||||
mkdir -p build/src/middleware/helpers/email/templates/
|
mkdir -p build/src/middleware/helpers/email/templates/
|
||||||
cp -r src/middleware/helpers/email/templates/*.html build/src/middleware/helpers/email/templates/
|
cp -r src/middleware/helpers/email/templates/*.html build/src/middleware/helpers/email/templates/
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable n/no-process-exit */
|
/* eslint-disable n/no-process-exit */
|
||||||
import CONFIG from '../config'
|
import CONFIG from '@config/index'
|
||||||
import { cleanDatabase } from './factories'
|
import { cleanDatabase } from './factories'
|
||||||
|
|
||||||
if (CONFIG.PRODUCTION && !CONFIG.PRODUCTION_DB_CLEAN_ALLOW) {
|
if (CONFIG.PRODUCTION && !CONFIG.PRODUCTION_DB_CLEAN_ALLOW) {
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
/* eslint-disable import/no-commonjs */
|
/* eslint-disable import/no-commonjs */
|
||||||
// eslint-disable-next-line n/no-unpublished-require
|
// eslint-disable-next-line n/no-unpublished-require
|
||||||
const tsNode = require('ts-node')
|
const tsNode = require('ts-node')
|
||||||
|
// eslint-disable-next-line import/no-unassigned-import, import/no-extraneous-dependencies, n/no-unpublished-require
|
||||||
|
require('tsconfig-paths/register')
|
||||||
|
|
||||||
module.exports = tsNode.register
|
module.exports = tsNode.register
|
||||||
|
|||||||
@ -4,8 +4,8 @@ import { hashSync } from 'bcryptjs'
|
|||||||
import { Factory } from 'rosie'
|
import { Factory } from 'rosie'
|
||||||
import { faker } from '@faker-js/faker'
|
import { faker } from '@faker-js/faker'
|
||||||
import { getDriver, getNeode } from './neo4j'
|
import { getDriver, getNeode } from './neo4j'
|
||||||
import CONFIG from '../config/index'
|
import CONFIG from '@config/index'
|
||||||
import generateInviteCode from '../schema/resolvers/helpers/generateInviteCode'
|
import generateInviteCode from '@schema/resolvers/helpers/generateInviteCode'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { getDriver, getNeode } from '../neo4j'
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
import { hashSync } from 'bcryptjs'
|
import { hashSync } from 'bcryptjs'
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
import { categories } from '../../constants/categories'
|
import { categories } from '@constants/categories'
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
const defaultAdmin = {
|
const defaultAdmin = {
|
||||||
email: 'admin@example.org',
|
email: 'admin@example.org',
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = ''
|
export const description = ''
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
/* eslint-disable promise/prefer-await-to-callbacks */
|
/* eslint-disable promise/prefer-await-to-callbacks */
|
||||||
import { throwError, concat } from 'rxjs'
|
import { throwError, concat } from 'rxjs'
|
||||||
import { flatMap, mergeMap, map, catchError, filter } from 'rxjs/operators'
|
import { flatMap, mergeMap, map, catchError, filter } from 'rxjs/operators'
|
||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
import normalizeEmail from '../../schema/resolvers/helpers/normalizeEmail'
|
import normalizeEmail from '@schema/resolvers/helpers/normalizeEmail'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
This migration merges duplicate :User and :EmailAddress nodes. It became
|
This migration merges duplicate :User and :EmailAddress nodes. It became
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable promise/prefer-await-to-callbacks */
|
/* eslint-disable promise/prefer-await-to-callbacks */
|
||||||
import { throwError, concat } from 'rxjs'
|
import { throwError, concat } from 'rxjs'
|
||||||
import { flatMap, mergeMap, map, catchError } from 'rxjs/operators'
|
import { flatMap, mergeMap, map, catchError } from 'rxjs/operators'
|
||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
This migration merges duplicate :Location nodes. It became
|
This migration merges duplicate :Location nodes. It became
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
This migration creates a MUTED relationship between two edges(:User) that have a pre-existing BLOCKED relationship.
|
This migration creates a MUTED relationship between two edges(:User) that have a pre-existing BLOCKED relationship.
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
This migration swaps the value stored in Location.lat with the value
|
This migration swaps the value stored in Location.lat with the value
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description =
|
export const description =
|
||||||
'This migration adds a fulltext index for the tags in order to search for Hasthags.'
|
'This migration adds a fulltext index for the tags in order to search for Hasthags.'
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
We introduced a new node label 'Image' and we need a primary key for it. Best
|
We introduced a new node label 'Image' and we need a primary key for it. Best
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
/* eslint-disable security/detect-non-literal-fs-filename */
|
/* eslint-disable security/detect-non-literal-fs-filename */
|
||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
import { existsSync, createReadStream } from 'node:fs'
|
import { existsSync, createReadStream } from 'node:fs'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import { S3 } from 'aws-sdk'
|
import { S3 } from 'aws-sdk'
|
||||||
import mime from 'mime-types'
|
import mime from 'mime-types'
|
||||||
import s3Configs from '../../config'
|
import s3Configs from '@config/index'
|
||||||
import https from 'https'
|
import https from 'https'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
Refactor all our image properties on posts and users to a dedicated type
|
Refactor all our image properties on posts and users to a dedicated type
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description =
|
export const description =
|
||||||
'We should not maintain obsolete attributes for users who have been deleted.'
|
'We should not maintain obsolete attributes for users who have been deleted.'
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description =
|
export const description =
|
||||||
'We should not maintain obsolete attributes for posts which have been deleted.'
|
'We should not maintain obsolete attributes for posts which have been deleted.'
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable security/detect-non-literal-fs-filename */
|
/* eslint-disable security/detect-non-literal-fs-filename */
|
||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
import { existsSync } from 'node:fs'
|
import { existsSync } from 'node:fs'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
This migration adds the clickedCount property to all posts, setting it to 0.
|
This migration adds the clickedCount property to all posts, setting it to 0.
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
This migration adds the viewedTeaserCount property to all posts, setting it to 0.
|
This migration adds the viewedTeaserCount property to all posts, setting it to 0.
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
export const description =
|
export const description =
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = ''
|
export const description = ''
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
We introduced a new node label 'Group' and we need two primary keys 'id' and 'slug' for it.
|
We introduced a new node label 'Group' and we need two primary keys 'id' and 'slug' for it.
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = ''
|
export const description = ''
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = 'Add to all existing posts the Article label'
|
export const description = 'Add to all existing posts the Article label'
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = 'Add postType property Article to all posts'
|
export const description = 'Add postType property Article to all posts'
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
Transform event start and end date of format 'YYYY-MM-DD HH:MM:SS' in CEST
|
Transform event start and end date of format 'YYYY-MM-DD HH:MM:SS' in CEST
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDriver } from '../neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
All authors observe their posts.
|
All authors observe their posts.
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/* eslint-disable import/no-named-as-default-member */
|
/* eslint-disable import/no-named-as-default-member */
|
||||||
import neo4j from 'neo4j-driver'
|
import neo4j from 'neo4j-driver'
|
||||||
import CONFIG from '../config'
|
import CONFIG from '@config/index'
|
||||||
import Neode from 'neode'
|
import Neode from 'neode'
|
||||||
import models from '../models'
|
import models from '@models/index'
|
||||||
|
|
||||||
let driver
|
let driver
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/* eslint-disable n/no-process-exit */
|
/* eslint-disable n/no-process-exit */
|
||||||
import sample from 'lodash/sample'
|
import sample from 'lodash/sample'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import CONFIG from '../config'
|
import CONFIG from '@config/index'
|
||||||
import createServer from '../server'
|
import createServer from '@src/server'
|
||||||
import { faker } from '@faker-js/faker'
|
import { faker } from '@faker-js/faker'
|
||||||
import Factory from './factories'
|
import Factory from './factories'
|
||||||
import { getNeode, getDriver } from './neo4j'
|
import { getNeode, getDriver } from './neo4j'
|
||||||
@ -10,12 +10,12 @@ import {
|
|||||||
createGroupMutation,
|
createGroupMutation,
|
||||||
joinGroupMutation,
|
joinGroupMutation,
|
||||||
changeGroupMemberRoleMutation,
|
changeGroupMemberRoleMutation,
|
||||||
} from '../graphql/groups'
|
} from '@graphql/groups'
|
||||||
import { createPostMutation } from '../graphql/posts'
|
import { createPostMutation } from '@graphql/posts'
|
||||||
import { createRoomMutation } from '../graphql/rooms'
|
import { createRoomMutation } from '@graphql/rooms'
|
||||||
import { createMessageMutation } from '../graphql/messages'
|
import { createMessageMutation } from '@graphql/messages'
|
||||||
import { createCommentMutation } from '../graphql/comments'
|
import { createCommentMutation } from '@graphql/comments'
|
||||||
import { categories } from '../constants/categories'
|
import { categories } from '@constants/categories'
|
||||||
|
|
||||||
if (CONFIG.PRODUCTION && !CONFIG.PRODUCTION_DB_CLEAN_ALLOW) {
|
if (CONFIG.PRODUCTION && !CONFIG.PRODUCTION_DB_CLEAN_ALLOW) {
|
||||||
throw new Error(`You cannot seed the database in a non-staging and real production environment!`)
|
throw new Error(`You cannot seed the database in a non-staging and real production environment!`)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import Factory, { cleanDatabase } from '../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getDriver, getNeode } from '../db/neo4j'
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
import decode from './decode'
|
import decode from './decode'
|
||||||
import encode from './encode'
|
import encode from './encode'
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import jwt from 'jsonwebtoken'
|
import jwt from 'jsonwebtoken'
|
||||||
import CONFIG from '../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
export default async (driver, authorizationHeader) => {
|
export default async (driver, authorizationHeader) => {
|
||||||
if (!authorizationHeader) return null
|
if (!authorizationHeader) return null
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import encode from './encode'
|
import encode from './encode'
|
||||||
import jwt from 'jsonwebtoken'
|
import jwt from 'jsonwebtoken'
|
||||||
import CONFIG from '../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
describe('encode', () => {
|
describe('encode', () => {
|
||||||
let payload
|
let payload
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import jwt from 'jsonwebtoken'
|
import jwt from 'jsonwebtoken'
|
||||||
import CONFIG from '../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
// Generate an Access Token for the given User ID
|
// Generate an Access Token for the given User ID
|
||||||
export default function encode(user) {
|
export default function encode(user) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import trunc from 'trunc-html'
|
import trunc from 'trunc-html'
|
||||||
import { DESCRIPTION_EXCERPT_HTML_LENGTH } from '../constants/groups'
|
import { DESCRIPTION_EXCERPT_HTML_LENGTH } from '@constants/groups'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Mutation: {
|
Mutation: {
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { cleanDatabase } from '../../db/factories'
|
import { cleanDatabase } from '@db/factories'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
let server
|
let server
|
||||||
let query
|
let query
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import CONFIG from '../../../config'
|
import CONFIG from '@config/index'
|
||||||
import { cleanHtml } from '../cleanHtml'
|
import { cleanHtml } from '@middleware/helpers/cleanHtml'
|
||||||
import nodemailer from 'nodemailer'
|
import nodemailer from 'nodemailer'
|
||||||
import { htmlToText } from 'nodemailer-html-to-text'
|
import { htmlToText } from 'nodemailer-html-to-text'
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import CONFIG from '../../../config'
|
import CONFIG from '@config/index'
|
||||||
import logosWebapp from '../../../config/logos'
|
import logosWebapp from '@config/logos'
|
||||||
import {
|
import {
|
||||||
signupTemplate,
|
signupTemplate,
|
||||||
emailVerificationTemplate,
|
emailVerificationTemplate,
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/* eslint-disable import/no-namespace */
|
/* eslint-disable import/no-namespace */
|
||||||
import mustache from 'mustache'
|
import mustache from 'mustache'
|
||||||
import CONFIG from '../../../config'
|
import CONFIG from '@config/index'
|
||||||
import metadata from '../../../config/metadata'
|
import metadata from '@config//metadata'
|
||||||
import logosWebapp from '../../../config/logos'
|
import logosWebapp from '@config//logos'
|
||||||
|
|
||||||
import * as templates from './templates'
|
import * as templates from './templates'
|
||||||
import * as templatesEN from './templates/en'
|
import * as templatesEN from './templates/en'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable security/detect-object-injection */
|
/* eslint-disable security/detect-object-injection */
|
||||||
import { applyMiddleware } from 'graphql-middleware'
|
import { applyMiddleware } from 'graphql-middleware'
|
||||||
import CONFIG from '../config'
|
import CONFIG from '@config/index'
|
||||||
import softDelete from './softDelete/softDeleteMiddleware'
|
import softDelete from './softDelete/softDeleteMiddleware'
|
||||||
import sluggify from './sluggifyMiddleware'
|
import sluggify from './sluggifyMiddleware'
|
||||||
import excerpt from './excerptMiddleware'
|
import excerpt from './excerptMiddleware'
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
let mutate
|
let mutate
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import LanguageDetect from 'languagedetect'
|
import LanguageDetect from 'languagedetect'
|
||||||
import { removeHtmlTags } from '../helpers/cleanHtml'
|
import { removeHtmlTags } from '@middleware/helpers/cleanHtml'
|
||||||
|
|
||||||
const setPostLanguage = (text, defaultLanguage) => {
|
const setPostLanguage = (text, defaultLanguage) => {
|
||||||
const lngDetector = new LanguageDetect()
|
const lngDetector = new LanguageDetect()
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { sendMail } from '../helpers/email/sendMail'
|
import { sendMail } from '@middleware/helpers/email/sendMail'
|
||||||
import {
|
import {
|
||||||
signupTemplate,
|
signupTemplate,
|
||||||
resetPasswordTemplate,
|
resetPasswordTemplate,
|
||||||
wrongAccountTemplate,
|
wrongAccountTemplate,
|
||||||
emailVerificationTemplate,
|
emailVerificationTemplate,
|
||||||
} from '../helpers/email/templateBuilder'
|
} from '@middleware/helpers/email/templateBuilder'
|
||||||
|
|
||||||
const sendSignupMail = async (resolve, root, args, context, resolveInfo) => {
|
const sendSignupMail = async (resolve, root, args, context, resolveInfo) => {
|
||||||
const { inviteCode } = args
|
const { inviteCode } = args
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer, { pubsub } from '../../server'
|
import createServer, { pubsub } from '@src/server'
|
||||||
import {
|
import {
|
||||||
createGroupMutation,
|
createGroupMutation,
|
||||||
joinGroupMutation,
|
joinGroupMutation,
|
||||||
leaveGroupMutation,
|
leaveGroupMutation,
|
||||||
changeGroupMemberRoleMutation,
|
changeGroupMemberRoleMutation,
|
||||||
removeUserFromGroupMutation,
|
removeUserFromGroupMutation,
|
||||||
} from '../../graphql/groups'
|
} from '@graphql/groups'
|
||||||
import { createMessageMutation } from '../../graphql/messages'
|
import { createMessageMutation } from '@graphql/messages'
|
||||||
import { createRoomMutation } from '../../graphql/rooms'
|
import { createRoomMutation } from '@graphql/rooms'
|
||||||
|
|
||||||
const sendMailMock = jest.fn()
|
const sendMailMock = jest.fn()
|
||||||
jest.mock('../helpers/email/sendMail', () => ({
|
jest.mock('../helpers/email/sendMail', () => ({
|
||||||
|
|||||||
@ -1,11 +1,14 @@
|
|||||||
/* eslint-disable security/detect-object-injection */
|
/* eslint-disable security/detect-object-injection */
|
||||||
// eslint-disable-next-line import/no-cycle
|
// eslint-disable-next-line import/no-cycle
|
||||||
import { pubsub, NOTIFICATION_ADDED } from '../../server'
|
import { pubsub, NOTIFICATION_ADDED } from '@src/server'
|
||||||
import extractMentionedUsers from './mentions/extractMentionedUsers'
|
import extractMentionedUsers from './mentions/extractMentionedUsers'
|
||||||
import { validateNotifyUsers } from '../validation/validationMiddleware'
|
import { validateNotifyUsers } from '@middleware/validation/validationMiddleware'
|
||||||
import { sendMail } from '../helpers/email/sendMail'
|
import { sendMail } from '@middleware/helpers/email/sendMail'
|
||||||
import { chatMessageTemplate, notificationTemplate } from '../helpers/email/templateBuilder'
|
import {
|
||||||
import { isUserOnline } from '../helpers/isUserOnline'
|
chatMessageTemplate,
|
||||||
|
notificationTemplate,
|
||||||
|
} from '@middleware/helpers/email/templateBuilder'
|
||||||
|
import { isUserOnline } from '@middleware/helpers/isUserOnline'
|
||||||
|
|
||||||
const queryNotificationEmails = async (context, notificationUserIds) => {
|
const queryNotificationEmails = async (context, notificationUserIds) => {
|
||||||
if (!(notificationUserIds && notificationUserIds.length)) return []
|
if (!(notificationUserIds && notificationUserIds.length)) return []
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { cleanDatabase } from '../../db/factories'
|
import { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
CONFIG.CATEGORIES_ACTIVE = false
|
CONFIG.CATEGORIES_ACTIVE = false
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { cleanDatabase } from '../db/factories'
|
import { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '../server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '../server'
|
import createServer from '@src/server'
|
||||||
import Factory, { cleanDatabase } from '../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getDriver, getNeode } from '../db/neo4j'
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
import CONFIG from '../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
const instance = getNeode()
|
const instance = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { rule, shield, deny, allow, or, and } from 'graphql-shield'
|
import { rule, shield, deny, allow, or, and } from 'graphql-shield'
|
||||||
import { getNeode } from '../db/neo4j'
|
import { getNeode } from '@db/neo4j'
|
||||||
import CONFIG from '../config'
|
import CONFIG from '@config/index'
|
||||||
import { validateInviteCode } from '../schema/resolvers/transactions/inviteCodes'
|
import { validateInviteCode } from '@schema/resolvers/transactions/inviteCodes'
|
||||||
|
|
||||||
const debug = !!CONFIG.DEBUG
|
const debug = !!CONFIG.DEBUG
|
||||||
const allowExternalErrors = true
|
const allowExternalErrors = true
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { sentry } from 'graphql-middleware-sentry'
|
import { sentry } from 'graphql-middleware-sentry'
|
||||||
import CONFIG from '../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-mutable-exports
|
// eslint-disable-next-line import/no-mutable-exports
|
||||||
let sentryMiddleware: any = (resolve, root, args, context, resolveInfo) =>
|
let sentryMiddleware: any = (resolve, root, args, context, resolveInfo) =>
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { getNeode, getDriver } from '../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { createGroupMutation, updateGroupMutation } from '../graphql/groups'
|
import { createGroupMutation, updateGroupMutation } from '@graphql/groups'
|
||||||
import { createPostMutation } from '../graphql/posts'
|
import { createPostMutation } from '@graphql/posts'
|
||||||
import { signupVerificationMutation } from '../graphql/authentications'
|
import { signupVerificationMutation } from '@graphql/authentications'
|
||||||
|
|
||||||
let authenticatedUser
|
let authenticatedUser
|
||||||
let variables
|
let variables
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Factory, { cleanDatabase } from '../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
let query, aUser, bUser, post, authenticatedUser, variables
|
let query, aUser, bUser, post, authenticatedUser, variables
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import walkRecursive from '../helpers/walkRecursive'
|
import walkRecursive from '@helpers/walkRecursive'
|
||||||
import { cleanHtml } from './helpers/cleanHtml'
|
import { cleanHtml } from './helpers/cleanHtml'
|
||||||
|
|
||||||
// exclamation mark separetes field names, that should not be sanitized
|
// exclamation mark separetes field names, that should not be sanitized
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { cleanDatabase } from '../db/factories'
|
import { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
let mutate, query, authenticatedUser, variables
|
let mutate, query, authenticatedUser, variables
|
||||||
const instance = getNeode()
|
const instance = getNeode()
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getDriver, getNeode } from '../../db/neo4j'
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import fetch from 'node-fetch'
|
|||||||
import fs from 'node:fs'
|
import fs from 'node:fs'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
jest.mock('node-fetch')
|
jest.mock('node-fetch')
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
import { filterPosts, createPostMutation } from '../../graphql/posts'
|
import { filterPosts, createPostMutation } from '@graphql/posts'
|
||||||
|
|
||||||
CONFIG.CATEGORIES_ACTIVE = false
|
CONFIG.CATEGORIES_ACTIVE = false
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getDriver, getNeode } from '../../db/neo4j'
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getNeode } from '../../db/neo4j'
|
import { getNeode } from '@db/neo4j'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import {
|
import {
|
||||||
createGroupMutation,
|
createGroupMutation,
|
||||||
updateGroupMutation,
|
updateGroupMutation,
|
||||||
@ -9,10 +9,10 @@ import {
|
|||||||
removeUserFromGroupMutation,
|
removeUserFromGroupMutation,
|
||||||
groupMembersQuery,
|
groupMembersQuery,
|
||||||
groupQuery,
|
groupQuery,
|
||||||
} from '../../graphql/groups'
|
} from '@graphql/groups'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
import { CATEGORIES_MIN, CATEGORIES_MAX } from '../../constants/categories'
|
import { CATEGORIES_MIN, CATEGORIES_MAX } from '@constants/categories'
|
||||||
import { DESCRIPTION_WITHOUT_HTML_LENGTH_MIN } from '../../constants/groups'
|
import { DESCRIPTION_WITHOUT_HTML_LENGTH_MIN } from '@constants/groups'
|
||||||
import { removeHtmlTags } from '../../middleware/helpers/cleanHtml'
|
import { removeHtmlTags } from '@middleware/helpers/cleanHtml'
|
||||||
import Resolver, {
|
import Resolver, {
|
||||||
removeUndefinedNullValuesFromObject,
|
removeUndefinedNullValuesFromObject,
|
||||||
convertObjectToCypherMapLiteral,
|
convertObjectToCypherMapLiteral,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getMutedUsers } from '../users'
|
import { getMutedUsers } from '@schema/resolvers/users'
|
||||||
import { mergeWith, isArray } from 'lodash'
|
import { mergeWith, isArray } from 'lodash'
|
||||||
|
|
||||||
export const filterForMutedUsers = async (params, context) => {
|
export const filterForMutedUsers = async (params, context) => {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import CONSTANTS_REGISTRATION from '../../../constants/registration'
|
import CONSTANTS_REGISTRATION from '@constants/registration'
|
||||||
|
|
||||||
export default function generateInviteCode() {
|
export default function generateInviteCode() {
|
||||||
// 6 random numbers in [ 0, 35 ] are 36 possible numbers (10 [0-9] + 26 [A-Z])
|
// 6 random numbers in [ 0, 35 ] are 36 possible numbers (10 [0-9] + 26 [A-Z])
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import CONSTANTS_REGISTRATION from '../../../constants/registration'
|
import CONSTANTS_REGISTRATION from '@constants/registration'
|
||||||
|
|
||||||
// TODO: why this is not used in resolver 'requestPasswordReset'?
|
// TODO: why this is not used in resolver 'requestPasswordReset'?
|
||||||
export default function generateNonce() {
|
export default function generateNonce() {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable promise/prefer-await-to-callbacks */
|
/* eslint-disable promise/prefer-await-to-callbacks */
|
||||||
import { deleteImage, mergeImage } from './images'
|
import { deleteImage, mergeImage } from './images'
|
||||||
import { getNeode, getDriver } from '../../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import Factory, { cleanDatabase } from '../../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -6,8 +6,8 @@ import { S3 } from 'aws-sdk'
|
|||||||
import slug from 'slug'
|
import slug from 'slug'
|
||||||
import { existsSync, unlinkSync, createWriteStream } from 'node:fs'
|
import { existsSync, unlinkSync, createWriteStream } from 'node:fs'
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
import { getDriver } from '../../../db/neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
import CONFIG from '../../../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
// const widths = [34, 160, 320, 640, 1024]
|
// const widths = [34, 160, 320, 640, 1024]
|
||||||
const { AWS_ENDPOINT: endpoint, AWS_REGION: region, AWS_BUCKET: Bucket, S3_CONFIGURED } = CONFIG
|
const { AWS_ENDPOINT: endpoint, AWS_REGION: region, AWS_BUCKET: Bucket, S3_CONFIGURED } = CONFIG
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
/* eslint-disable security/detect-non-literal-regexp */
|
/* eslint-disable security/detect-non-literal-regexp */
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getDriver } from '../../db/neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import CONSTANTS_REGISTRATION from '../../constants/registration'
|
import CONSTANTS_REGISTRATION from '@constants/registration'
|
||||||
|
|
||||||
let user
|
let user
|
||||||
let query
|
let query
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
let mutate, authenticatedUser
|
let mutate, authenticatedUser
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import { createRoomMutation, roomQuery } from '../../graphql/rooms'
|
import { createRoomMutation, roomQuery } from '@graphql/rooms'
|
||||||
import { createMessageMutation, messageQuery, markMessagesAsSeen } from '../../graphql/messages'
|
import { createMessageMutation, messageQuery, markMessagesAsSeen } from '@graphql/messages'
|
||||||
import createServer, { pubsub } from '../../server'
|
import createServer, { pubsub } from '@src/server'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { neo4jgraphql } from 'neo4j-graphql-js'
|
|||||||
import Resolver from './helpers/Resolver'
|
import Resolver from './helpers/Resolver'
|
||||||
|
|
||||||
import { getUnreadRoomsCount } from './rooms'
|
import { getUnreadRoomsCount } from './rooms'
|
||||||
import { pubsub, ROOM_COUNT_UPDATED, CHAT_MESSAGE_ADDED } from '../../server'
|
import { pubsub, ROOM_COUNT_UPDATED, CHAT_MESSAGE_ADDED } from '@src/server'
|
||||||
import { withFilter } from 'graphql-subscriptions'
|
import { withFilter } from 'graphql-subscriptions'
|
||||||
|
|
||||||
const setMessagesAsDistributed = async (undistributedMessagesIds, session) => {
|
const setMessagesAsDistributed = async (undistributedMessagesIds, session) => {
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getDriver } from '../../db/neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import {
|
import {
|
||||||
markAsReadMutation,
|
markAsReadMutation,
|
||||||
markAllAsReadMutation,
|
markAllAsReadMutation,
|
||||||
notificationQuery,
|
notificationQuery,
|
||||||
} from '../../graphql/notifications'
|
} from '@graphql/notifications'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
let authenticatedUser
|
let authenticatedUser
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import log from './helpers/databaseLogger'
|
import log from './helpers/databaseLogger'
|
||||||
import { withFilter } from 'graphql-subscriptions'
|
import { withFilter } from 'graphql-subscriptions'
|
||||||
import { pubsub, NOTIFICATION_ADDED } from '../../server'
|
import { pubsub, NOTIFICATION_ADDED } from '@src/server'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Subscription: {
|
Subscription: {
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
import { createPostMutation } from '../../graphql/posts'
|
import { createPostMutation } from '@graphql/posts'
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
CONFIG.CATEGORIES_ACTIVE = false
|
CONFIG.CATEGORIES_ACTIVE = false
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import CONSTANTS_REGISTRATION from '../../constants/registration'
|
import CONSTANTS_REGISTRATION from '@constants/registration'
|
||||||
import createPasswordReset from './helpers/createPasswordReset'
|
import createPasswordReset from './helpers/createPasswordReset'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
import bcrypt from 'bcryptjs'
|
import bcrypt from 'bcryptjs'
|
||||||
import CONSTANTS_REGISTRATION from '../../constants/registration'
|
import CONSTANTS_REGISTRATION from '@constants/registration'
|
||||||
import createPasswordReset from './helpers/createPasswordReset'
|
import createPasswordReset from './helpers/createPasswordReset'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createPostMutation } from '../../graphql/posts'
|
import { createPostMutation } from '@graphql/posts'
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
CONFIG.CATEGORIES_ACTIVE = true
|
CONFIG.CATEGORIES_ACTIVE = true
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { filterInvisiblePosts } from './helpers/filterInvisiblePosts'
|
|||||||
import { filterPostsOfMyGroups } from './helpers/filterPostsOfMyGroups'
|
import { filterPostsOfMyGroups } from './helpers/filterPostsOfMyGroups'
|
||||||
import { validateEventParams } from './helpers/events'
|
import { validateEventParams } from './helpers/events'
|
||||||
import { createOrUpdateLocations } from './users/location'
|
import { createOrUpdateLocations } from './users/location'
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
const maintainPinnedPosts = (params) => {
|
const maintainPinnedPosts = (params) => {
|
||||||
const pinnedPostFilter = { pinned: true }
|
const pinnedPostFilter = { pinned: true }
|
||||||
|
|||||||
@ -1,28 +1,28 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import {
|
import {
|
||||||
createGroupMutation,
|
createGroupMutation,
|
||||||
changeGroupMemberRoleMutation,
|
changeGroupMemberRoleMutation,
|
||||||
leaveGroupMutation,
|
leaveGroupMutation,
|
||||||
} from '../../graphql/groups'
|
} from '@graphql/groups'
|
||||||
import {
|
import {
|
||||||
createPostMutation,
|
createPostMutation,
|
||||||
postQuery,
|
postQuery,
|
||||||
filterPosts,
|
filterPosts,
|
||||||
profilePagePosts,
|
profilePagePosts,
|
||||||
searchPosts,
|
searchPosts,
|
||||||
} from '../../graphql/posts'
|
} from '@graphql/posts'
|
||||||
import { createCommentMutation } from '../../graphql/comments'
|
import { createCommentMutation } from '@graphql/comments'
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
import { DESCRIPTION_WITHOUT_HTML_LENGTH_MIN } from '../../constants/groups'
|
import { DESCRIPTION_WITHOUT_HTML_LENGTH_MIN } from '@constants/groups'
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
import { signupVerificationMutation } from '../../graphql/authentications'
|
import { signupVerificationMutation } from '@graphql/authentications'
|
||||||
|
|
||||||
CONFIG.CATEGORIES_ACTIVE = false
|
CONFIG.CATEGORIES_ACTIVE = false
|
||||||
|
|
||||||
jest.mock('../../constants/groups', () => {
|
jest.mock('@constants/groups', () => {
|
||||||
return {
|
return {
|
||||||
__esModule: true,
|
__esModule: true,
|
||||||
DESCRIPTION_WITHOUT_HTML_LENGTH_MIN: 5,
|
DESCRIPTION_WITHOUT_HTML_LENGTH_MIN: 5,
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getDriver, getNeode } from '../../db/neo4j'
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
import { getNeode } from '../../db/neo4j'
|
import { getNeode } from '@db/neo4j'
|
||||||
import encryptPassword from '../../helpers/encryptPassword'
|
import encryptPassword from '@helpers/encryptPassword'
|
||||||
import generateNonce from './helpers/generateNonce'
|
import generateNonce from './helpers/generateNonce'
|
||||||
import existingEmailAddress from './helpers/existingEmailAddress'
|
import existingEmailAddress from './helpers/existingEmailAddress'
|
||||||
import normalizeEmail from './helpers/normalizeEmail'
|
import normalizeEmail from './helpers/normalizeEmail'
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getDriver, getNeode } from '../../db/neo4j'
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
|
|
||||||
const instance = getNeode()
|
const instance = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const instance = getNeode()
|
const instance = getNeode()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getNeode } from '../../db/neo4j'
|
import { getNeode } from '@db/neo4j'
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import { createRoomMutation, roomQuery, unreadRoomsQuery } from '../../graphql/rooms'
|
import { createRoomMutation, roomQuery, unreadRoomsQuery } from '@graphql/rooms'
|
||||||
import { createMessageMutation } from '../../graphql/messages'
|
import { createMessageMutation } from '@graphql/messages'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { neo4jgraphql } from 'neo4j-graphql-js'
|
import { neo4jgraphql } from 'neo4j-graphql-js'
|
||||||
import Resolver from './helpers/Resolver'
|
import Resolver from './helpers/Resolver'
|
||||||
import { pubsub, ROOM_COUNT_UPDATED } from '../../server'
|
import { pubsub, ROOM_COUNT_UPDATED } from '@src/server'
|
||||||
import { withFilter } from 'graphql-subscriptions'
|
import { withFilter } from 'graphql-subscriptions'
|
||||||
|
|
||||||
export const getUnreadRoomsCount = async (userId, session) => {
|
export const getUnreadRoomsCount = async (userId, session) => {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
let query, authenticatedUser, user
|
let query, authenticatedUser, user
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
let mutate, query, authenticatedUser, variables
|
let mutate, query, authenticatedUser, variables
|
||||||
const instance = getNeode()
|
const instance = getNeode()
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getDriver } from '../../db/neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getNeode } from '../../db/neo4j'
|
import { getNeode } from '@db/neo4j'
|
||||||
import Resolver from './helpers/Resolver'
|
import Resolver from './helpers/Resolver'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
let query, authenticatedUser
|
let query, authenticatedUser
|
||||||
const instance = getNeode()
|
const instance = getNeode()
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '../../server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
let query, authenticatedUser
|
let query, authenticatedUser
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
/* eslint-disable promise/prefer-await-to-callbacks */
|
/* eslint-disable promise/prefer-await-to-callbacks */
|
||||||
import jwt from 'jsonwebtoken'
|
import jwt from 'jsonwebtoken'
|
||||||
import CONFIG from '../../config'
|
import CONFIG from '@config/index'
|
||||||
import Factory, { cleanDatabase } from '../../db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { loginMutation } from '../../graphql/userManagement'
|
import { loginMutation } from '@graphql/userManagement'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer, { context } from '../../server'
|
import createServer, { context } from '@src/server'
|
||||||
import encode from '../../jwt/encode'
|
import encode from '@jwt/encode'
|
||||||
import { getNeode, getDriver } from '../../db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import { categories } from '../../constants/categories'
|
import { categories } from '@constants/categories'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
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