mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
refactor(backend): lint - import/order (#8350)
* lint - import/no-relative-parent-imports fix build error * fix md * lint import/order enabled rule import/order and fixed impot order in each file
This commit is contained in:
parent
a4f391930c
commit
f782032563
@ -78,30 +78,30 @@ module.exports = {
|
|||||||
'import/no-named-default': 'error',
|
'import/no-named-default': 'error',
|
||||||
'import/no-namespace': 'error',
|
'import/no-namespace': 'error',
|
||||||
'import/no-unassigned-import': 'error',
|
'import/no-unassigned-import': 'error',
|
||||||
// 'import/order': [
|
'import/order': [
|
||||||
// 'error',
|
'error',
|
||||||
// {
|
{
|
||||||
// groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
|
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
|
||||||
// 'newlines-between': 'always',
|
'newlines-between': 'always',
|
||||||
// pathGroups: [
|
pathGroups: [
|
||||||
// {
|
{
|
||||||
// pattern: '@?*/**',
|
pattern: '@?*/**',
|
||||||
// group: 'external',
|
group: 'external',
|
||||||
// position: 'after',
|
position: 'after',
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// pattern: '@/**',
|
pattern: '@/**',
|
||||||
// group: 'external',
|
group: 'external',
|
||||||
// position: 'after',
|
position: 'after',
|
||||||
// },
|
},
|
||||||
// ],
|
],
|
||||||
// alphabetize: {
|
alphabetize: {
|
||||||
// order: 'asc' /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */,
|
order: 'asc' /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */,
|
||||||
// caseInsensitive: true /* ignore case. Options: [true, false] */,
|
caseInsensitive: true /* ignore case. Options: [true, false] */,
|
||||||
// },
|
},
|
||||||
// distinctGroup: true,
|
distinctGroup: true,
|
||||||
// },
|
},
|
||||||
// ],
|
],
|
||||||
'import/prefer-default-export': 'off',
|
'import/prefer-default-export': 'off',
|
||||||
|
|
||||||
// n
|
// n
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* eslint-disable n/no-unpublished-require */
|
/* eslint-disable n/no-unpublished-require */
|
||||||
/* eslint-disable n/no-missing-require */
|
/* eslint-disable n/no-missing-require */
|
||||||
import { config } from 'dotenv'
|
import { config } from 'dotenv'
|
||||||
|
|
||||||
import emails from './emails'
|
import emails from './emails'
|
||||||
import metadata from './metadata'
|
import metadata from './metadata'
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable n/no-process-exit */
|
/* eslint-disable n/no-process-exit */
|
||||||
import CONFIG from '@config/index'
|
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,12 +1,14 @@
|
|||||||
import { v4 as uuid } from 'uuid'
|
import { faker } from '@faker-js/faker'
|
||||||
import slugify from 'slug'
|
|
||||||
import { hashSync } from 'bcryptjs'
|
import { hashSync } from 'bcryptjs'
|
||||||
import { Factory } from 'rosie'
|
import { Factory } from 'rosie'
|
||||||
import { faker } from '@faker-js/faker'
|
import slugify from 'slug'
|
||||||
import { getDriver, getNeode } from './neo4j'
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
import generateInviteCode from '@schema/resolvers/helpers/generateInviteCode'
|
import generateInviteCode from '@schema/resolvers/helpers/generateInviteCode'
|
||||||
|
|
||||||
|
import { getDriver, getNeode } from './neo4j'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|
||||||
const uniqueImageUrl = (imageUrl) => {
|
const uniqueImageUrl = (imageUrl) => {
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
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 CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
import { categories } from '@constants/categories'
|
||||||
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
|
|
||||||
const defaultAdmin = {
|
const defaultAdmin = {
|
||||||
email: 'admin@example.org',
|
email: 'admin@example.org',
|
||||||
|
|||||||
@ -2,6 +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, filter } from 'rxjs/operators'
|
import { flatMap, mergeMap, map, catchError, filter } from 'rxjs/operators'
|
||||||
|
|
||||||
import { getDriver } from '@db/neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
import normalizeEmail from '@schema/resolvers/helpers/normalizeEmail'
|
import normalizeEmail from '@schema/resolvers/helpers/normalizeEmail'
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +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 '@db/neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
/* eslint-disable security/detect-non-literal-fs-filename */
|
/* eslint-disable security/detect-non-literal-fs-filename */
|
||||||
import { getDriver } from '@db/neo4j'
|
import https from 'https'
|
||||||
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/index'
|
import s3Configs from '@config/index'
|
||||||
import https from 'https'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
Upload all image files to a S3 compatible object storage in order to reduce
|
Upload all image files to a S3 compatible object storage in order to reduce
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
/* eslint-disable security/detect-non-literal-fs-filename */
|
/* eslint-disable security/detect-non-literal-fs-filename */
|
||||||
import { getDriver } from '@db/neo4j'
|
|
||||||
import { existsSync } from 'node:fs'
|
import { existsSync } from 'node:fs'
|
||||||
|
|
||||||
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description = `
|
export const description = `
|
||||||
In this review:
|
In this review:
|
||||||
https://github.com/Human-Connection/Human-Connection/pull/3262#discussion_r398634249
|
https://github.com/Human-Connection/Human-Connection/pull/3262#discussion_r398634249
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { getDriver } from '@db/neo4j'
|
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
export const description =
|
export const description =
|
||||||
'This migration adds a Donations node with default settings to the database.'
|
'This migration adds a Donations node with default settings to the database.'
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +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/index'
|
|
||||||
import Neode from 'neode'
|
import Neode from 'neode'
|
||||||
|
|
||||||
|
import CONFIG from '@config/index'
|
||||||
import models from '@models/index'
|
import models from '@models/index'
|
||||||
|
|
||||||
let driver
|
let driver
|
||||||
|
|||||||
@ -1,21 +1,23 @@
|
|||||||
/* eslint-disable n/no-process-exit */
|
/* eslint-disable n/no-process-exit */
|
||||||
import sample from 'lodash/sample'
|
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
import CONFIG from '@config/index'
|
|
||||||
import createServer from '@src/server'
|
|
||||||
import { faker } from '@faker-js/faker'
|
import { faker } from '@faker-js/faker'
|
||||||
import Factory from './factories'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import { getNeode, getDriver } from './neo4j'
|
import sample from 'lodash/sample'
|
||||||
|
|
||||||
|
import CONFIG from '@config/index'
|
||||||
|
import { categories } from '@constants/categories'
|
||||||
|
import { createCommentMutation } from '@graphql/comments'
|
||||||
import {
|
import {
|
||||||
createGroupMutation,
|
createGroupMutation,
|
||||||
joinGroupMutation,
|
joinGroupMutation,
|
||||||
changeGroupMemberRoleMutation,
|
changeGroupMemberRoleMutation,
|
||||||
} from '@graphql/groups'
|
} from '@graphql/groups'
|
||||||
|
import { createMessageMutation } from '@graphql/messages'
|
||||||
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 createServer from '@src/server'
|
||||||
import { createCommentMutation } from '@graphql/comments'
|
|
||||||
import { categories } from '@constants/categories'
|
import Factory from './factories'
|
||||||
|
import { getNeode, getDriver } from './neo4j'
|
||||||
|
|
||||||
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 createServer from './server'
|
|
||||||
import CONFIG from './config'
|
import CONFIG from './config'
|
||||||
|
import createServer from './server'
|
||||||
|
|
||||||
const { server, httpServer } = createServer()
|
const { server, httpServer } = createServer()
|
||||||
const url = new URL(CONFIG.GRAPHQL_URI)
|
const url = new URL(CONFIG.GRAPHQL_URI)
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
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,4 +1,5 @@
|
|||||||
import jwt from 'jsonwebtoken'
|
import jwt from 'jsonwebtoken'
|
||||||
|
|
||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
export default async (driver, authorizationHeader) => {
|
export default async (driver, authorizationHeader) => {
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import encode from './encode'
|
|
||||||
import jwt from 'jsonwebtoken'
|
import jwt from 'jsonwebtoken'
|
||||||
|
|
||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
|
import encode from './encode'
|
||||||
|
|
||||||
describe('encode', () => {
|
describe('encode', () => {
|
||||||
let payload
|
let payload
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import jwt from 'jsonwebtoken'
|
import jwt from 'jsonwebtoken'
|
||||||
|
|
||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
// Generate an Access Token for the given User ID
|
// Generate an Access Token for the given User ID
|
||||||
|
|||||||
@ -1,4 +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 {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import gql from 'graphql-tag'
|
|
||||||
import { cleanDatabase } from '@db/factories'
|
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable security/detect-unsafe-regex */
|
/* eslint-disable security/detect-unsafe-regex */
|
||||||
import sanitizeHtml from 'sanitize-html'
|
|
||||||
import linkifyHtml from 'linkify-html'
|
import linkifyHtml from 'linkify-html'
|
||||||
|
import sanitizeHtml from 'sanitize-html'
|
||||||
|
|
||||||
export const removeHtmlTags = (input) => {
|
export const removeHtmlTags = (input) => {
|
||||||
return sanitizeHtml(input, {
|
return sanitizeHtml(input, {
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import CONFIG from '@config/index'
|
|
||||||
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'
|
||||||
|
|
||||||
|
import CONFIG from '@config/index'
|
||||||
|
import { cleanHtml } from '@middleware/helpers/cleanHtml'
|
||||||
|
|
||||||
const hasEmailConfig = CONFIG.SMTP_HOST && CONFIG.SMTP_PORT
|
const hasEmailConfig = CONFIG.SMTP_HOST && CONFIG.SMTP_PORT
|
||||||
const hasAuthData = CONFIG.SMTP_USERNAME && CONFIG.SMTP_PASSWORD
|
const hasAuthData = CONFIG.SMTP_USERNAME && CONFIG.SMTP_PASSWORD
|
||||||
const hasDKIMData =
|
const hasDKIMData =
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
import logosWebapp from '@config/logos'
|
import logosWebapp from '@config/logos'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
signupTemplate,
|
signupTemplate,
|
||||||
emailVerificationTemplate,
|
emailVerificationTemplate,
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
/* eslint-disable import/no-namespace */
|
/* eslint-disable import/no-namespace */
|
||||||
import mustache from 'mustache'
|
import mustache from 'mustache'
|
||||||
import CONFIG from '@config/index'
|
|
||||||
import metadata from '@config//metadata'
|
|
||||||
import logosWebapp from '@config//logos'
|
import logosWebapp from '@config//logos'
|
||||||
|
import metadata from '@config//metadata'
|
||||||
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
import * as templates from './templates'
|
import * as templates from './templates'
|
||||||
import * as templatesEN from './templates/en'
|
|
||||||
import * as templatesDE from './templates/de'
|
import * as templatesDE from './templates/de'
|
||||||
|
import * as templatesEN from './templates/en'
|
||||||
|
|
||||||
const from = CONFIG.EMAIL_DEFAULT_SENDER
|
const from = CONFIG.EMAIL_DEFAULT_SENDER
|
||||||
const welcomeImageUrl = new URL(logosWebapp.LOGO_WELCOME_PATH, CONFIG.CLIENT_URI)
|
const welcomeImageUrl = new URL(logosWebapp.LOGO_WELCOME_PATH, CONFIG.CLIENT_URI)
|
||||||
|
|||||||
@ -1,22 +1,24 @@
|
|||||||
/* 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/index'
|
import CONFIG from '@config/index'
|
||||||
import softDelete from './softDelete/softDeleteMiddleware'
|
|
||||||
import sluggify from './sluggifyMiddleware'
|
import chatMiddleware from './chatMiddleware'
|
||||||
import excerpt from './excerptMiddleware'
|
import excerpt from './excerptMiddleware'
|
||||||
import xss from './xssMiddleware'
|
import hashtags from './hashtags/hashtagsMiddleware'
|
||||||
import permissions from './permissionsMiddleware'
|
|
||||||
import includedFields from './includedFieldsMiddleware'
|
import includedFields from './includedFieldsMiddleware'
|
||||||
import orderBy from './orderByMiddleware'
|
import languages from './languages/languages'
|
||||||
import validation from './validation/validationMiddleware'
|
import login from './login/loginMiddleware'
|
||||||
// eslint-disable-next-line import/no-cycle
|
// eslint-disable-next-line import/no-cycle
|
||||||
import notifications from './notifications/notificationsMiddleware'
|
import notifications from './notifications/notificationsMiddleware'
|
||||||
import hashtags from './hashtags/hashtagsMiddleware'
|
import orderBy from './orderByMiddleware'
|
||||||
import login from './login/loginMiddleware'
|
import permissions from './permissionsMiddleware'
|
||||||
import sentry from './sentryMiddleware'
|
import sentry from './sentryMiddleware'
|
||||||
import languages from './languages/languages'
|
import sluggify from './sluggifyMiddleware'
|
||||||
|
import softDelete from './softDelete/softDeleteMiddleware'
|
||||||
import userInteractions from './userInteractions'
|
import userInteractions from './userInteractions'
|
||||||
import chatMiddleware from './chatMiddleware'
|
import validation from './validation/validationMiddleware'
|
||||||
|
import xss from './xssMiddleware'
|
||||||
|
|
||||||
export default (schema) => {
|
export default (schema) => {
|
||||||
const middlewares = {
|
const middlewares = {
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
|
|
||||||
let mutate
|
let mutate
|
||||||
let authenticatedUser
|
let authenticatedUser
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import LanguageDetect from 'languagedetect'
|
import LanguageDetect from 'languagedetect'
|
||||||
|
|
||||||
import { removeHtmlTags } from '@middleware/helpers/cleanHtml'
|
import { removeHtmlTags } from '@middleware/helpers/cleanHtml'
|
||||||
|
|
||||||
const setPostLanguage = (text, defaultLanguage) => {
|
const setPostLanguage = (text, defaultLanguage) => {
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import gql from 'graphql-tag'
|
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer, { pubsub } from '@src/server'
|
|
||||||
import {
|
import {
|
||||||
createGroupMutation,
|
createGroupMutation,
|
||||||
joinGroupMutation,
|
joinGroupMutation,
|
||||||
@ -12,6 +12,7 @@ import {
|
|||||||
} 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'
|
||||||
|
import createServer, { pubsub } from '@src/server'
|
||||||
|
|
||||||
const sendMailMock = jest.fn()
|
const sendMailMock = jest.fn()
|
||||||
jest.mock('../helpers/email/sendMail', () => ({
|
jest.mock('../helpers/email/sendMail', () => ({
|
||||||
|
|||||||
@ -1,14 +1,15 @@
|
|||||||
/* eslint-disable security/detect-object-injection */
|
/* eslint-disable security/detect-object-injection */
|
||||||
// eslint-disable-next-line import/no-cycle
|
|
||||||
import { pubsub, NOTIFICATION_ADDED } from '@src/server'
|
|
||||||
import extractMentionedUsers from './mentions/extractMentionedUsers'
|
|
||||||
import { validateNotifyUsers } from '@middleware/validation/validationMiddleware'
|
|
||||||
import { sendMail } from '@middleware/helpers/email/sendMail'
|
import { sendMail } from '@middleware/helpers/email/sendMail'
|
||||||
import {
|
import {
|
||||||
chatMessageTemplate,
|
chatMessageTemplate,
|
||||||
notificationTemplate,
|
notificationTemplate,
|
||||||
} from '@middleware/helpers/email/templateBuilder'
|
} from '@middleware/helpers/email/templateBuilder'
|
||||||
import { isUserOnline } from '@middleware/helpers/isUserOnline'
|
import { isUserOnline } from '@middleware/helpers/isUserOnline'
|
||||||
|
import { validateNotifyUsers } from '@middleware/validation/validationMiddleware'
|
||||||
|
// eslint-disable-next-line import/no-cycle
|
||||||
|
import { pubsub, NOTIFICATION_ADDED } from '@src/server'
|
||||||
|
|
||||||
|
import extractMentionedUsers from './mentions/extractMentionedUsers'
|
||||||
|
|
||||||
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 { createTestClient } from 'apollo-server-testing'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import CONFIG from '@config/index'
|
||||||
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 '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
|
|
||||||
import CONFIG from '@config/index'
|
|
||||||
|
|
||||||
CONFIG.CATEGORIES_ACTIVE = false
|
CONFIG.CATEGORIES_ACTIVE = false
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
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 createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '@src/server'
|
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getDriver, getNeode } from '@db/neo4j'
|
|
||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const instance = getNeode()
|
const instance = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,6 +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 CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
import { getNeode } from '@db/neo4j'
|
||||||
import { validateInviteCode } from '@schema/resolvers/transactions/inviteCodes'
|
import { validateInviteCode } from '@schema/resolvers/transactions/inviteCodes'
|
||||||
|
|
||||||
const debug = !!CONFIG.DEBUG
|
const debug = !!CONFIG.DEBUG
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { sentry } from 'graphql-middleware-sentry'
|
import { sentry } from 'graphql-middleware-sentry'
|
||||||
|
|
||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-mutable-exports
|
// eslint-disable-next-line import/no-mutable-exports
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import { getNeode, getDriver } from '@db/neo4j'
|
|
||||||
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 { getNeode, getDriver } from '@db/neo4j'
|
||||||
|
import { signupVerificationMutation } from '@graphql/authentications'
|
||||||
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 createServer from '@src/server'
|
||||||
|
|
||||||
let authenticatedUser
|
let authenticatedUser
|
||||||
let variables
|
let variables
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
|
|
||||||
let query, aUser, bUser, post, authenticatedUser, variables
|
let query, aUser, bUser, post, authenticatedUser, variables
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
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 createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
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,6 +1,7 @@
|
|||||||
import { makeAugmentedSchema } from 'neo4j-graphql-js'
|
import { makeAugmentedSchema } from 'neo4j-graphql-js'
|
||||||
import typeDefs from './types'
|
|
||||||
import resolvers from './resolvers'
|
import resolvers from './resolvers'
|
||||||
|
import typeDefs from './types'
|
||||||
|
|
||||||
export default makeAugmentedSchema({
|
export default makeAugmentedSchema({
|
||||||
typeDefs,
|
typeDefs,
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '@src/server'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
import Resolver from './helpers/Resolver'
|
import Resolver from './helpers/Resolver'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getDriver, getNeode } from '@db/neo4j'
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import generateNonce from './helpers/generateNonce'
|
|
||||||
import Resolver from './helpers/Resolver'
|
|
||||||
import existingEmailAddress from './helpers/existingEmailAddress'
|
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
// eslint-disable-next-line import/extensions
|
// eslint-disable-next-line import/extensions
|
||||||
import Validator from 'neode/build/Services/Validator.js'
|
import Validator from 'neode/build/Services/Validator.js'
|
||||||
|
|
||||||
|
import existingEmailAddress from './helpers/existingEmailAddress'
|
||||||
|
import generateNonce from './helpers/generateNonce'
|
||||||
import normalizeEmail from './helpers/normalizeEmail'
|
import normalizeEmail from './helpers/normalizeEmail'
|
||||||
|
import Resolver from './helpers/Resolver'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Query: {
|
Query: {
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
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 '@src/server'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
import fetch from 'node-fetch'
|
||||||
|
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
jest.mock('node-fetch')
|
jest.mock('node-fetch')
|
||||||
const mockedFetch = jest.mocked(fetch)
|
const mockedFetch = jest.mocked(fetch)
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import fs from 'node:fs'
|
import fs from 'node:fs'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
|
|
||||||
import { minimatch } from 'minimatch'
|
import { minimatch } from 'minimatch'
|
||||||
|
|
||||||
let oEmbedProvidersFile = fs.readFileSync(
|
let oEmbedProvidersFile = fs.readFileSync(
|
||||||
|
|||||||
@ -2,13 +2,14 @@
|
|||||||
/* eslint-disable n/global-require */
|
/* eslint-disable n/global-require */
|
||||||
/* eslint-disable import/no-commonjs */
|
/* eslint-disable import/no-commonjs */
|
||||||
/* eslint-disable import/no-named-as-default */
|
/* eslint-disable import/no-named-as-default */
|
||||||
|
|
||||||
|
import { ApolloError } from 'apollo-server'
|
||||||
|
import isArray from 'lodash/isArray'
|
||||||
|
import isEmpty from 'lodash/isEmpty'
|
||||||
|
import mergeWith from 'lodash/mergeWith'
|
||||||
import Metascraper from 'metascraper'
|
import Metascraper from 'metascraper'
|
||||||
import fetch from 'node-fetch'
|
import fetch from 'node-fetch'
|
||||||
|
|
||||||
import { ApolloError } from 'apollo-server'
|
|
||||||
import isEmpty from 'lodash/isEmpty'
|
|
||||||
import isArray from 'lodash/isArray'
|
|
||||||
import mergeWith from 'lodash/mergeWith'
|
|
||||||
import findProvider from './findProvider'
|
import findProvider from './findProvider'
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
|
import CONFIG from '@config/index'
|
||||||
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 '@src/server'
|
|
||||||
import CONFIG from '@config/index'
|
|
||||||
import { filterPosts, createPostMutation } from '@graphql/posts'
|
import { filterPosts, createPostMutation } from '@graphql/posts'
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
CONFIG.CATEGORIES_ACTIVE = false
|
CONFIG.CATEGORIES_ACTIVE = false
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
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 '@src/server'
|
import createServer from '@src/server'
|
||||||
import gql from 'graphql-tag'
|
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
|
import CONFIG from '@config/index'
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import {
|
import {
|
||||||
createGroupMutation,
|
createGroupMutation,
|
||||||
updateGroupMutation,
|
updateGroupMutation,
|
||||||
@ -10,9 +13,7 @@ import {
|
|||||||
groupMembersQuery,
|
groupMembersQuery,
|
||||||
groupQuery,
|
groupQuery,
|
||||||
} from '@graphql/groups'
|
} from '@graphql/groups'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import CONFIG from '@config/index'
|
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import { v4 as uuid } from 'uuid'
|
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
import CONFIG from '@config/index'
|
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,6 +1,7 @@
|
|||||||
import { getMutedUsers } from '@schema/resolvers/users'
|
|
||||||
import { mergeWith, isArray } from 'lodash'
|
import { mergeWith, isArray } from 'lodash'
|
||||||
|
|
||||||
|
import { getMutedUsers } from '@schema/resolvers/users'
|
||||||
|
|
||||||
export const filterForMutedUsers = async (params, context) => {
|
export const filterForMutedUsers = async (params, context) => {
|
||||||
if (!context.user) return params
|
if (!context.user) return params
|
||||||
const [mutedUsers] = await Promise.all([getMutedUsers(context)])
|
const [mutedUsers] = await Promise.all([getMutedUsers(context)])
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
/* eslint-disable promise/prefer-await-to-callbacks */
|
/* eslint-disable promise/prefer-await-to-callbacks */
|
||||||
import { deleteImage, mergeImage } from './images'
|
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
|
import { deleteImage, mergeImage } from './images'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
const uuid = '[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}'
|
const uuid = '[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}'
|
||||||
|
|||||||
@ -1,13 +1,15 @@
|
|||||||
/* eslint-disable promise/avoid-new */
|
/* eslint-disable promise/avoid-new */
|
||||||
/* eslint-disable security/detect-non-literal-fs-filename */
|
/* eslint-disable security/detect-non-literal-fs-filename */
|
||||||
|
import { existsSync, unlinkSync, createWriteStream } from 'node:fs'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import { v4 as uuid } from 'uuid'
|
|
||||||
|
import { UserInputError } from 'apollo-server'
|
||||||
import { S3 } from 'aws-sdk'
|
import { S3 } from 'aws-sdk'
|
||||||
import slug from 'slug'
|
import slug from 'slug'
|
||||||
import { existsSync, unlinkSync, createWriteStream } from 'node:fs'
|
import { v4 as uuid } from 'uuid'
|
||||||
import { UserInputError } from 'apollo-server'
|
|
||||||
import { getDriver } from '@db/neo4j'
|
|
||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
import { getDriver } from '@db/neo4j'
|
||||||
|
|
||||||
// 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,4 +1,5 @@
|
|||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
|
|
||||||
import { fileLoader, mergeResolvers } from 'merge-graphql-schemas'
|
import { fileLoader, mergeResolvers } from 'merge-graphql-schemas'
|
||||||
|
|
||||||
// the files must be correctly evaluated in built and dev state - therefore accept both js & ts files
|
// the files must be correctly evaluated in built and dev state - therefore accept both js & ts files
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
/* eslint-disable security/detect-non-literal-regexp */
|
/* eslint-disable security/detect-non-literal-regexp */
|
||||||
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import CONSTANTS_REGISTRATION from '@constants/registration'
|
||||||
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 createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
import CONSTANTS_REGISTRATION from '@constants/registration'
|
|
||||||
|
|
||||||
let user
|
let user
|
||||||
let query
|
let query
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
|
|
||||||
let mutate, authenticatedUser
|
let mutate, authenticatedUser
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
|
|
||||||
import Resolver from './helpers/Resolver'
|
import Resolver from './helpers/Resolver'
|
||||||
import { queryLocations } from './users/location'
|
import { queryLocations } from './users/location'
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +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 { createMessageMutation, messageQuery, markMessagesAsSeen } from '@graphql/messages'
|
import { createMessageMutation, messageQuery, markMessagesAsSeen } from '@graphql/messages'
|
||||||
|
import { createRoomMutation, roomQuery } from '@graphql/rooms'
|
||||||
import createServer, { pubsub } from '@src/server'
|
import createServer, { pubsub } from '@src/server'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import { neo4jgraphql } from 'neo4j-graphql-js'
|
|
||||||
import Resolver from './helpers/Resolver'
|
|
||||||
|
|
||||||
import { getUnreadRoomsCount } from './rooms'
|
|
||||||
import { pubsub, ROOM_COUNT_UPDATED, CHAT_MESSAGE_ADDED } from '@src/server'
|
|
||||||
import { withFilter } from 'graphql-subscriptions'
|
import { withFilter } from 'graphql-subscriptions'
|
||||||
|
import { neo4jgraphql } from 'neo4j-graphql-js'
|
||||||
|
|
||||||
|
import { pubsub, ROOM_COUNT_UPDATED, CHAT_MESSAGE_ADDED } from '@src/server'
|
||||||
|
|
||||||
|
import Resolver from './helpers/Resolver'
|
||||||
|
import { getUnreadRoomsCount } from './rooms'
|
||||||
|
|
||||||
const setMessagesAsDistributed = async (undistributedMessagesIds, session) => {
|
const setMessagesAsDistributed = async (undistributedMessagesIds, session) => {
|
||||||
return session.writeTransaction(async (transaction) => {
|
return session.writeTransaction(async (transaction) => {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,14 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
|
||||||
import { getDriver } from '@db/neo4j'
|
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '@src/server'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
|
import { getDriver } from '@db/neo4j'
|
||||||
import {
|
import {
|
||||||
markAsReadMutation,
|
markAsReadMutation,
|
||||||
markAllAsReadMutation,
|
markAllAsReadMutation,
|
||||||
notificationQuery,
|
notificationQuery,
|
||||||
} from '@graphql/notifications'
|
} from '@graphql/notifications'
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
let authenticatedUser
|
let authenticatedUser
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import log from './helpers/databaseLogger'
|
|
||||||
import { withFilter } from 'graphql-subscriptions'
|
import { withFilter } from 'graphql-subscriptions'
|
||||||
|
|
||||||
import { pubsub, NOTIFICATION_ADDED } from '@src/server'
|
import { pubsub, NOTIFICATION_ADDED } from '@src/server'
|
||||||
|
|
||||||
|
import log from './helpers/databaseLogger'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Subscription: {
|
Subscription: {
|
||||||
notificationAdded: {
|
notificationAdded: {
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
|
||||||
import createServer from '@src/server'
|
|
||||||
|
|
||||||
import { createPostMutation } from '@graphql/posts'
|
|
||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
|
import { createPostMutation } from '@graphql/posts'
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
CONFIG.CATEGORIES_ACTIVE = false
|
CONFIG.CATEGORIES_ACTIVE = false
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
|
||||||
import CONSTANTS_REGISTRATION from '@constants/registration'
|
|
||||||
import createPasswordReset from './helpers/createPasswordReset'
|
|
||||||
import createServer from '@src/server'
|
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import CONSTANTS_REGISTRATION from '@constants/registration'
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
|
import createPasswordReset from './helpers/createPasswordReset'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
import { v4 as uuid } from 'uuid'
|
|
||||||
import bcrypt from 'bcryptjs'
|
import bcrypt from 'bcryptjs'
|
||||||
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
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,11 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
|
||||||
import createServer from '@src/server'
|
|
||||||
import { createPostMutation } from '@graphql/posts'
|
|
||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
|
import { createPostMutation } from '@graphql/posts'
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
CONFIG.CATEGORIES_ACTIVE = true
|
CONFIG.CATEGORIES_ACTIVE = true
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,17 @@
|
|||||||
import { v4 as uuid } from 'uuid'
|
|
||||||
import { neo4jgraphql } from 'neo4j-graphql-js'
|
|
||||||
import { isEmpty } from 'lodash'
|
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
import { mergeImage, deleteImage } from './images/images'
|
import { isEmpty } from 'lodash'
|
||||||
import Resolver from './helpers/Resolver'
|
import { neo4jgraphql } from 'neo4j-graphql-js'
|
||||||
|
import { v4 as uuid } from 'uuid'
|
||||||
|
|
||||||
|
import CONFIG from '@config/index'
|
||||||
|
|
||||||
|
import { validateEventParams } from './helpers/events'
|
||||||
import { filterForMutedUsers } from './helpers/filterForMutedUsers'
|
import { filterForMutedUsers } from './helpers/filterForMutedUsers'
|
||||||
import { filterInvisiblePosts } from './helpers/filterInvisiblePosts'
|
import { filterInvisiblePosts } from './helpers/filterInvisiblePosts'
|
||||||
import { filterPostsOfMyGroups } from './helpers/filterPostsOfMyGroups'
|
import { filterPostsOfMyGroups } from './helpers/filterPostsOfMyGroups'
|
||||||
import { validateEventParams } from './helpers/events'
|
import Resolver from './helpers/Resolver'
|
||||||
|
import { mergeImage, deleteImage } from './images/images'
|
||||||
import { createOrUpdateLocations } from './users/location'
|
import { createOrUpdateLocations } from './users/location'
|
||||||
import CONFIG from '@config/index'
|
|
||||||
|
|
||||||
const maintainPinnedPosts = (params) => {
|
const maintainPinnedPosts = (params) => {
|
||||||
const pinnedPostFilter = { pinned: true }
|
const pinnedPostFilter = { pinned: true }
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
|
import CONFIG from '@config/index'
|
||||||
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 '@src/server'
|
import { signupVerificationMutation } from '@graphql/authentications'
|
||||||
|
import { createCommentMutation } from '@graphql/comments'
|
||||||
import {
|
import {
|
||||||
createGroupMutation,
|
createGroupMutation,
|
||||||
changeGroupMemberRoleMutation,
|
changeGroupMemberRoleMutation,
|
||||||
@ -14,11 +17,7 @@ import {
|
|||||||
profilePagePosts,
|
profilePagePosts,
|
||||||
searchPosts,
|
searchPosts,
|
||||||
} from '@graphql/posts'
|
} from '@graphql/posts'
|
||||||
import { createCommentMutation } from '@graphql/comments'
|
import createServer from '@src/server'
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
import { DESCRIPTION_WITHOUT_HTML_LENGTH_MIN } from '@constants/groups'
|
|
||||||
import CONFIG from '@config/index'
|
|
||||||
import { signupVerificationMutation } from '@graphql/authentications'
|
|
||||||
|
|
||||||
CONFIG.CATEGORIES_ACTIVE = false
|
CONFIG.CATEGORIES_ACTIVE = false
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import CONFIG from '@config/index'
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getDriver, getNeode } from '@db/neo4j'
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
import CONFIG from '@config/index'
|
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
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 existingEmailAddress from './helpers/existingEmailAddress'
|
import existingEmailAddress from './helpers/existingEmailAddress'
|
||||||
|
import generateNonce from './helpers/generateNonce'
|
||||||
import normalizeEmail from './helpers/normalizeEmail'
|
import normalizeEmail from './helpers/normalizeEmail'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '@src/server'
|
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getDriver, getNeode } from '@db/neo4j'
|
import { getDriver, getNeode } from '@db/neo4j'
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const instance = getNeode()
|
const instance = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { getNeode } from '@db/neo4j'
|
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
|
|
||||||
|
import { getNeode } from '@db/neo4j'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|
||||||
const getUserAndBadge = async ({ badgeKey, userId }) => {
|
const getUserAndBadge = async ({ badgeKey, userId }) => {
|
||||||
|
|||||||
@ -1,8 +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 { createMessageMutation } from '@graphql/messages'
|
import { createMessageMutation } from '@graphql/messages'
|
||||||
|
import { createRoomMutation, roomQuery, unreadRoomsQuery } from '@graphql/rooms'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import { neo4jgraphql } from 'neo4j-graphql-js'
|
|
||||||
import Resolver from './helpers/Resolver'
|
|
||||||
import { pubsub, ROOM_COUNT_UPDATED } from '@src/server'
|
|
||||||
import { withFilter } from 'graphql-subscriptions'
|
import { withFilter } from 'graphql-subscriptions'
|
||||||
|
import { neo4jgraphql } from 'neo4j-graphql-js'
|
||||||
|
|
||||||
|
import { pubsub, ROOM_COUNT_UPDATED } from '@src/server'
|
||||||
|
|
||||||
|
import Resolver from './helpers/Resolver'
|
||||||
|
|
||||||
export const getUnreadRoomsCount = async (userId, session) => {
|
export const getUnreadRoomsCount = async (userId, session) => {
|
||||||
return session.readTransaction(async (transaction) => {
|
return session.readTransaction(async (transaction) => {
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
|
|
||||||
let query, authenticatedUser, user
|
let query, authenticatedUser, user
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '@src/server'
|
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getDriver } from '@db/neo4j'
|
import { getDriver } from '@db/neo4j'
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
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,6 +1,7 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
|
|
||||||
let query, authenticatedUser
|
let query, authenticatedUser
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,15 @@
|
|||||||
/* eslint-disable promise/prefer-await-to-callbacks */
|
/* eslint-disable promise/prefer-await-to-callbacks */
|
||||||
import jwt from 'jsonwebtoken'
|
|
||||||
import CONFIG from '@config/index'
|
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
|
||||||
import { loginMutation } from '@graphql/userManagement'
|
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer, { context } from '@src/server'
|
import gql from 'graphql-tag'
|
||||||
import encode from '@jwt/encode'
|
import jwt from 'jsonwebtoken'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
|
||||||
|
import CONFIG from '@config/index'
|
||||||
import { categories } from '@constants/categories'
|
import { categories } from '@constants/categories'
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
|
import { loginMutation } from '@graphql/userManagement'
|
||||||
|
import encode from '@jwt/encode'
|
||||||
|
import createServer, { context } from '@src/server'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import encode from '@jwt/encode'
|
|
||||||
import bcrypt from 'bcryptjs'
|
|
||||||
import { AuthenticationError } from 'apollo-server'
|
import { AuthenticationError } from 'apollo-server'
|
||||||
|
import bcrypt from 'bcryptjs'
|
||||||
|
|
||||||
import { getNeode } from '@db/neo4j'
|
import { getNeode } from '@db/neo4j'
|
||||||
import normalizeEmail from './helpers/normalizeEmail'
|
import encode from '@jwt/encode'
|
||||||
|
|
||||||
import log from './helpers/databaseLogger'
|
import log from './helpers/databaseLogger'
|
||||||
|
import normalizeEmail from './helpers/normalizeEmail'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import Factory, { cleanDatabase } from '@db/factories'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import { categories } from '@constants/categories'
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
import { createTestClient } from 'apollo-server-testing'
|
|
||||||
import { categories } from '@constants/categories'
|
|
||||||
|
|
||||||
const categoryIds = ['cat9']
|
const categoryIds = ['cat9']
|
||||||
let user
|
let user
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import { neo4jgraphql } from 'neo4j-graphql-js'
|
|
||||||
import { getNeode } from '@db/neo4j'
|
|
||||||
import { UserInputError, ForbiddenError } from 'apollo-server'
|
import { UserInputError, ForbiddenError } from 'apollo-server'
|
||||||
import { mergeImage, deleteImage } from './images/images'
|
import { neo4jgraphql } from 'neo4j-graphql-js'
|
||||||
import Resolver from './helpers/Resolver'
|
|
||||||
|
import { getNeode } from '@db/neo4j'
|
||||||
|
|
||||||
import log from './helpers/databaseLogger'
|
import log from './helpers/databaseLogger'
|
||||||
|
import Resolver from './helpers/Resolver'
|
||||||
|
import { mergeImage, deleteImage } from './images/images'
|
||||||
import { createOrUpdateLocations } from './users/location'
|
import { createOrUpdateLocations } from './users/location'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
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 createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
/* eslint-disable promise/avoid-new */
|
/* eslint-disable promise/avoid-new */
|
||||||
/* eslint-disable promise/prefer-await-to-callbacks */
|
/* eslint-disable promise/prefer-await-to-callbacks */
|
||||||
/* eslint-disable import/no-named-as-default */
|
/* eslint-disable import/no-named-as-default */
|
||||||
import request from 'request'
|
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||||
import Debug from 'debug'
|
import Debug from 'debug'
|
||||||
import asyncForEach from '@helpers/asyncForEach'
|
import request from 'request'
|
||||||
|
|
||||||
import CONFIG from '@config/index'
|
import CONFIG from '@config/index'
|
||||||
|
import asyncForEach from '@helpers/asyncForEach'
|
||||||
|
|
||||||
const debug = Debug('human-connection:location')
|
const debug = Debug('human-connection:location')
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import createServer from '@src/server'
|
|
||||||
import { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
|
import createServer from '@src/server'
|
||||||
|
|
||||||
const driver = getDriver()
|
const driver = getDriver()
|
||||||
const neode = getNeode()
|
const neode = getNeode()
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
import Factory, { cleanDatabase } from '@db/factories'
|
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
import Factory, { cleanDatabase } from '@db/factories'
|
||||||
import { getNeode, getDriver } from '@db/neo4j'
|
import { getNeode, getDriver } from '@db/neo4j'
|
||||||
import createServer from '@src/server'
|
import createServer from '@src/server'
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
|
|
||||||
import { mergeTypes, fileLoader } from 'merge-graphql-schemas'
|
import { mergeTypes, fileLoader } from 'merge-graphql-schemas'
|
||||||
|
|
||||||
const typeDefs = fileLoader(path.join(__dirname, './**/*.gql'))
|
const typeDefs = fileLoader(path.join(__dirname, './**/*.gql'))
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { createTestClient } from 'apollo-server-testing'
|
import { createTestClient } from 'apollo-server-testing'
|
||||||
|
|
||||||
import createServer from './server'
|
import createServer from './server'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,19 +1,21 @@
|
|||||||
/* eslint-disable import/no-named-as-default-member */
|
/* eslint-disable import/no-named-as-default-member */
|
||||||
import express from 'express'
|
|
||||||
import http from 'node:http'
|
import http from 'node:http'
|
||||||
import helmet from 'helmet'
|
|
||||||
import { ApolloServer } from 'apollo-server-express'
|
import { ApolloServer } from 'apollo-server-express'
|
||||||
import CONFIG from './config'
|
import bodyParser from 'body-parser'
|
||||||
// eslint-disable-next-line import/no-cycle
|
import express from 'express'
|
||||||
import middleware from './middleware'
|
|
||||||
import { getNeode, getDriver } from './db/neo4j'
|
|
||||||
import decode from './jwt/decode'
|
|
||||||
import schema from './schema'
|
|
||||||
import { RedisPubSub } from 'graphql-redis-subscriptions'
|
import { RedisPubSub } from 'graphql-redis-subscriptions'
|
||||||
import { PubSub } from 'graphql-subscriptions'
|
import { PubSub } from 'graphql-subscriptions'
|
||||||
import Redis from 'ioredis'
|
|
||||||
import bodyParser from 'body-parser'
|
|
||||||
import { graphqlUploadExpress } from 'graphql-upload'
|
import { graphqlUploadExpress } from 'graphql-upload'
|
||||||
|
import helmet from 'helmet'
|
||||||
|
import Redis from 'ioredis'
|
||||||
|
|
||||||
|
import CONFIG from './config'
|
||||||
|
import { getNeode, getDriver } from './db/neo4j'
|
||||||
|
import decode from './jwt/decode'
|
||||||
|
// eslint-disable-next-line import/no-cycle
|
||||||
|
import middleware from './middleware'
|
||||||
|
import schema from './schema'
|
||||||
|
|
||||||
export const NOTIFICATION_ADDED = 'NOTIFICATION_ADDED'
|
export const NOTIFICATION_ADDED = 'NOTIFICATION_ADDED'
|
||||||
export const CHAT_MESSAGE_ADDED = 'CHAT_MESSAGE_ADDED'
|
export const CHAT_MESSAGE_ADDED = 'CHAT_MESSAGE_ADDED'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user