Compare commits

...

39 Commits

Author SHA1 Message Date
d543c192a8
fix(webapp): fix lang query location (#9337) 2026-03-01 10:00:37 +00:00
4b0470310e
feat(webapp): metadata for link preview (#9335) 2026-03-01 07:06:50 +00:00
dependabot[bot]
3a56878899
build(deps-dev): bump the cypress group with 2 updates (#9309)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 06:42:48 +00:00
dependabot[bot]
762037c7b8
build(deps-dev): bump webpack from 5.105.2 to 5.105.3 (#9311)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 06:09:53 +00:00
dependabot[bot]
c10b2e1af7
build(deps): bump minimatch from 10.2.2 to 10.2.4 in /backend (#9313)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 05:45:18 +00:00
dependabot[bot]
6e53c53f38
build(deps-dev): bump @types/lodash from 4.17.23 to 4.17.24 in /backend (#9314)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 05:18:55 +00:00
dependabot[bot]
8690adf895
build(deps-dev): bump the vue group in /packages/ui with 2 updates (#9315)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 05:21:10 +01:00
dependabot[bot]
8216db5925
build(deps): bump @aws-sdk/lib-storage from 3.990.0 to 3.995.0 in /backend (#9316)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 03:27:24 +00:00
dependabot[bot]
9f71ac2ece
build(deps-dev): bump @storybook/vue3-vite from 10.2.10 to 10.2.13 in /packages/ui (#9318)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 03:59:15 +01:00
dependabot[bot]
f4bea134a2
build(deps-dev): bump eslint-plugin-jsdoc from 62.7.0 to 62.7.1 in /packages/ui (#9320)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 03:18:04 +01:00
dependabot[bot]
fb4830c0b0
build(deps-dev): bump @types/node from 25.3.0 to 25.3.2 in /backend (#9323)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 17:41:41 +01:00
dependabot[bot]
07ff56ccb3
build(deps-dev): bump @tailwindcss/vite from 4.2.0 to 4.2.1 in /packages/ui (#9325)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 13:50:31 +00:00
dependabot[bot]
73dfda12da
build(deps): bump graphql from 16.12.0 to 16.13.0 in /backend (#9324)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 14:25:56 +01:00
dependabot[bot]
907d9abcb6
build(deps-dev): bump @types/node from 25.3.0 to 25.3.2 in /packages/ui (#9328)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 12:14:26 +00:00
dependabot[bot]
272a6a4b0a
build(deps-dev): bump eslint-plugin-playwright from 2.7.0 to 2.8.0 in /packages/ui (#9329)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 10:19:25 +00:00
dependabot[bot]
c910931fc1
build(deps-dev): bump eslint-plugin-storybook from 10.2.10 to 10.2.13 in /packages/ui (#9330)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 09:38:32 +00:00
dependabot[bot]
9f742ffbde
build(deps): bump @aws-sdk/client-s3 from 3.995.0 to 3.1000.0 in /backend (#9331)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 08:57:51 +00:00
dependabot[bot]
85efb3b161
build(deps-dev): bump @tailwindcss/cli from 4.2.0 to 4.2.1 in /packages/ui (#9332)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 09:34:16 +01:00
dependabot[bot]
76362570de
build(deps-dev): bump tailwindcss from 4.2.0 to 4.2.1 in /packages/ui (#9333)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 07:49:13 +00:00
0f1504fb8a
fix(workflow): ensure cucumber-json-formatter (#9300) 2026-02-27 01:17:48 +00:00
795881e5b4
feat(e2e): e2e - chat notification (#9303) 2026-02-27 01:39:26 +01:00
d0348545ad
feat(webapp): complete translations + Albanian (#9301) 2026-02-26 23:47:15 +00:00
732ac9a2ad
fix(webapp): downgrade graphql - socket not working (#9302) 2026-02-26 23:01:19 +00:00
8feb34a41a
fix(webapp): fix landscape image distances (#9299) 2026-02-25 15:43:34 +00:00
dependabot[bot]
f40398ec66
build(deps): bump graphql from 14.7.0 to 16.12.0 in /webapp (#9045)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-25 14:59:51 +00:00
114a25025f
feat(webapp): first draft of landscape mode (#9298) 2026-02-25 14:34:20 +00:00
1174cf9a03
fix(webapp): fix time display in user teaser (#9297) 2026-02-25 14:06:39 +00:00
6b77839fb4
fix(webapp): fix embed in non-editor-mode (#9296) 2026-02-25 13:16:08 +00:00
dependabot[bot]
587559a97a
build(deps): bump body-parser from 1.20.3 to 2.2.2 in /backend (#9101)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 12:15:22 +01:00
fc5d3aca8e
refactor(workflow): use docker cache (#9294) 2026-02-23 09:46:14 +00:00
dependabot[bot]
b72a7c29dd
build(deps-dev): bump @badeball/cypress-cucumber-preprocessor from 24.0.0 to 24.0.1 in the cypress group (#9256)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 08:43:04 +00:00
b4db6dc8d8
refactor(backend): graphql lint + query gql files (#9293) 2026-02-23 08:09:50 +00:00
dependabot[bot]
cef1cceea4
build(deps-dev): bump @tailwindcss/vite from 4.1.18 to 4.2.0 in /packages/ui (#9257)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 08:41:59 +01:00
dependabot[bot]
e31e9f6259
build(deps): bump tailwind-merge from 3.4.0 to 3.5.0 in /packages/ui (#9258)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 05:48:12 +00:00
dependabot[bot]
5005f53e00
build(deps-dev): bump @storybook/vue3-vite from 10.2.8 to 10.2.10 in /packages/ui (#9259)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 05:16:03 +00:00
dependabot[bot]
a0cb0f437b
build(deps-dev): bump @types/node from 25.2.3 to 25.3.0 in /packages/ui (#9261)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 04:35:37 +00:00
dependabot[bot]
15d3c27fb6
build(deps): bump the metascraper group in /backend with 12 updates (#9262)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 05:06:12 +01:00
dependabot[bot]
470889c252
build(deps-dev): bump nodemon from 3.1.11 to 3.1.14 in /backend (#9265)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 03:24:00 +00:00
9decd998cc
refactor(backend): update apollo (#9292) 2026-02-23 03:45:32 +01:00
316 changed files with 10096 additions and 9526 deletions

View File

@ -11,7 +11,7 @@ jobs:
documentation: ${{ steps.changes.outputs.documentation }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check for markdown file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
@ -28,7 +28,7 @@ jobs:
if: needs.files-changed.outputs.markdown == 'true'
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Remove uncheckable documentation files
run: rm -rf ./CHANGELOG.md # workaround until https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/183 has been done
@ -51,10 +51,10 @@ jobs:
if: needs.files-changed.outputs.documentation == 'true'
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node 20
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '20'

View File

@ -13,7 +13,7 @@ jobs:
documentation: ${{ steps.changes.outputs.documentation }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check for file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
@ -27,10 +27,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node 20
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: 20

View File

@ -59,7 +59,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Log in to the Container registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9
with:
@ -81,7 +83,7 @@ jobs:
type=sha
- name: Build and push Docker images
id: push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: ${{ matrix.app.context }}
target: ${{ matrix.app.target }}
@ -89,3 +91,5 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.app.name }}
cache-to: type=gha,mode=max,scope=${{ matrix.app.name }}

View File

@ -14,11 +14,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # Fetch full History for changelog
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: '.nvmrc'
- name: Setup env
@ -58,11 +58,11 @@ jobs:
needs: [github_tag]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # Fetch full History for changelog
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: '.nvmrc'
- name: Setup env

View File

@ -11,7 +11,7 @@ jobs:
backend: ${{ steps.changes.outputs.backend }}
docker: ${{ steps.changes.outputs.docker }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check for backend file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
@ -28,13 +28,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Neo4J | Build 'community' image
run: |
docker compose -f docker-compose.yml -f docker-compose.test.yml build neo4j
docker save "ghcr.io/ocelot-social-community/ocelot-social/neo4j:community" > /tmp/neo4j.tar
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: neo4j
file: neo4j/Dockerfile
target: community
load: true
tags: ghcr.io/ocelot-social-community/ocelot-social/neo4j:community
cache-from: type=gha,scope=neo4j
cache-to: type=gha,mode=max,scope=neo4j
- name: Save image for test job
run: docker save "ghcr.io/ocelot-social-community/ocelot-social/neo4j:community" > /tmp/neo4j.tar
- name: Cache docker images
id: cache-neo4j
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v4.0.2
@ -49,13 +61,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: backend | Build 'test' image
run: |
docker compose -f docker-compose.yml -f docker-compose.test.yml build backend
docker save "ghcr.io/ocelot-social-community/ocelot-social/backend:test" > /tmp/backend.tar
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: backend
file: backend/Dockerfile
target: test
load: true
tags: ghcr.io/ocelot-social-community/ocelot-social/backend:test
cache-from: type=gha,scope=backend-test
cache-to: type=gha,mode=max,scope=backend-test
- name: Save image for test job
run: docker save "ghcr.io/ocelot-social-community/ocelot-social/backend:test" > /tmp/backend.tar
- name: Cache docker images
id: cache-backend
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v4.0.2
@ -70,15 +94,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: 'backend/.nvmrc'
cache: 'yarn'
cache-dependency-path: 'backend/yarn.lock'
- name: backend | Lint
run: cd backend && yarn && yarn run lint
run: cd backend && yarn --frozen-lockfile && yarn run lint
unit_test_backend:
name: Unit tests - Backend
@ -89,7 +115,7 @@ jobs:
checks: write
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Restore Neo4J cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v4.0.2

View File

@ -8,28 +8,52 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Copy backend env file
run: |
cp backend/.env.test_e2e backend/.env
cp webapp/.env.template webapp/.env
- name: Build backend and dependencies
- name: Neo4J | Build image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: neo4j
file: neo4j/Dockerfile
target: community
load: true
tags: ghcr.io/ocelot-social-community/ocelot-social/neo4j:community
cache-from: type=gha,scope=neo4j
cache-to: type=gha,mode=max,scope=neo4j
- name: Backend | Build image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: backend
file: backend/Dockerfile
target: test
load: true
tags: ghcr.io/ocelot-social-community/ocelot-social/backend:test
cache-from: type=gha,scope=backend-test
cache-to: type=gha,mode=max,scope=backend-test
- name: Pull third-party images
run: |
# Build and start all required images for backend
docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach neo4j backend --build
# Save the build images
docker save "ghcr.io/ocelot-social-community/ocelot-social/backend:test" > /tmp/backend.tar
docker pull quay.io/minio/minio:latest
docker pull quay.io/minio/mc:latest
docker pull maildev/maildev:latest
- name: Save all images
run: |
docker save "ghcr.io/ocelot-social-community/ocelot-social/backend:test" > /tmp/backend.tar
docker save "ghcr.io/ocelot-social-community/ocelot-social/neo4j:community" > /tmp/neo4j.tar
docker save "quay.io/minio/minio:latest" > /tmp/minio.tar
docker save "quay.io/minio/mc:latest" > /tmp/minio-mc.tar
docker save "maildev/maildev:latest" > /tmp/mailserver.tar
# Stop the containers
docker compose -f docker-compose.yml -f docker-compose.test.yml down
- name: Cache docker images
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v4.0.2
with:
@ -46,19 +70,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Copy backend env file
run: |
cp backend/.env.test_e2e backend/.env
cp webapp/.env.template webapp/.env
- name: Build docker image
run: |
docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach webapp --build --no-deps
docker save "ghcr.io/ocelot-social-community/ocelot-social/webapp:test" > /tmp/webapp.tar
- name: Cache docker image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Webapp | Build 'test' image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
file: webapp/Dockerfile
target: test
load: true
tags: ghcr.io/ocelot-social-community/ocelot-social/webapp:test
cache-from: type=gha,scope=webapp-test
cache-to: type=gha,mode=max,scope=webapp-test
- name: Save image for test jobs
run: docker save "ghcr.io/ocelot-social-community/ocelot-social/webapp:test" > /tmp/webapp.tar
- name: Cache docker image
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v4.0.2
with:
path: /tmp/webapp.tar
@ -72,10 +103,10 @@ jobs:
run: rm -rf /opt/hostedtoolcache
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.4.0
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: 'backend/.nvmrc'
cache: 'yarn'
@ -87,7 +118,8 @@ jobs:
- name: Install cypress requirements
run: |
sudo wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-386"
sudo wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-amd64"
echo "66a2ef158866c3ecb3d8e49a7189814a485bddca43e133e4ca5735b8d3951bf7 /opt/cucumber-json-formatter" | sha256sum -c -
sudo chmod +x /opt/cucumber-json-formatter
cd backend
yarn install
@ -112,7 +144,7 @@ jobs:
features: ${{ steps.list.outputs.features }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: List feature files
id: list
@ -134,10 +166,10 @@ jobs:
run: rm -rf /opt/hostedtoolcache
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.4.0
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: 'backend/.nvmrc'
cache: 'yarn'
@ -169,10 +201,22 @@ jobs:
path: /tmp/webapp.tar
key: ${{ github.run_id }}-e2e-webapp-cache
- name: Copy env files
run: |
cp webapp/.env.template webapp/.env
cp backend/.env.test_e2e backend/.env
- name: Ensure cucumber-json-formatter exists
run: |
if [ ! -f /opt/cucumber-json-formatter ]; then
sudo wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-amd64"
echo "66a2ef158866c3ecb3d8e49a7189814a485bddca43e133e4ca5735b8d3951bf7 /opt/cucumber-json-formatter" | sha256sum -c -
fi
sudo chmod +x /opt/cucumber-json-formatter
sudo ln -fs /opt/cucumber-json-formatter /usr/bin/cucumber-json-formatter
- name: Boot up test system | docker compose
run: |
chmod +x /opt/cucumber-json-formatter
sudo ln -fs /opt/cucumber-json-formatter /usr/bin/cucumber-json-formatter
docker load < /tmp/neo4j.tar
docker load < /tmp/backend.tar
docker load < /tmp/minio.tar
@ -180,7 +224,14 @@ jobs:
docker load < /tmp/mailserver.tar
docker load < /tmp/webapp.tar
docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach backend mailserver webapp
sleep 90s
echo "Waiting for backend (max 120s)..."
timeout 120 bash -c 'until curl -sf -X POST -H "Content-Type: application/json" -d "{\"query\":\"{__typename}\"}" http://localhost:4000 > /dev/null 2>&1; do sleep 5; done'
echo "Backend is ready."
echo "Waiting for webapp (max 120s)..."
timeout 120 bash -c 'until curl -sf http://localhost:3000 > /dev/null 2>&1; do sleep 5; done'
echo "Webapp is ready."
- name: Full stack tests | run tests
id: e2e-tests

View File

@ -11,7 +11,7 @@ jobs:
docker: ${{ steps.changes.outputs.docker }}
webapp: ${{ steps.changes.outputs.webapp }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check for frontend file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
@ -28,10 +28,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: 'webapp/.nvmrc'
@ -43,16 +43,28 @@ jobs:
build_test_webapp:
name: Docker Build Test - Webapp
if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.webapp == 'true'
needs: [files-changed, prepare]
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Webapp | Build 'test' image
run: |
docker build --target test -f webapp/Dockerfile -t "ghcr.io/ocelot-social-community/ocelot-social/webapp:test" .
docker save "ghcr.io/ocelot-social-community/ocelot-social/webapp:test" > /tmp/webapp.tar
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
file: webapp/Dockerfile
target: test
load: true
tags: ghcr.io/ocelot-social-community/ocelot-social/webapp:test
cache-from: type=gha,scope=webapp-test
cache-to: type=gha,mode=max,scope=webapp-test
- name: Save image for test job
run: docker save "ghcr.io/ocelot-social-community/ocelot-social/webapp:test" > /tmp/webapp.tar
- name: Cache docker image
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v4.0.2
@ -67,15 +79,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4.0.3
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: 'webapp/.nvmrc'
cache: 'yarn'
cache-dependency-path: 'webapp/yarn.lock'
- name: webapp | Lint
run: cd webapp && yarn && yarn run lint
run: cd webapp && yarn --frozen-lockfile && yarn run lint
unit_test_webapp:
name: Unit Tests - Webapp
@ -86,7 +100,7 @@ jobs:
checks: write
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Restore webapp cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v4.0.2

View File

@ -34,26 +34,26 @@ jobs:
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Build development image
uses: docker/build-push-action@v6
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: ./packages/ui
file: ./packages/ui/Dockerfile
target: development
push: false
tags: ocelot-social/ui:development
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha,scope=ui-development
cache-to: type=gha,mode=max,scope=ui-development
- name: Build production image
uses: docker/build-push-action@v6
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: ./packages/ui
file: ./packages/ui/Dockerfile
target: production
push: false
tags: ocelot-social/ui:latest
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha,scope=ui-production
cache-to: type=gha,mode=max,scope=ui-production

View File

@ -1,73 +1,62 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import comments from 'eslint-config-it4c/modules/comments'
import eslint from 'eslint-config-it4c/modules/eslint'
import importX from 'eslint-config-it4c/modules/import-x'
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-return */
import config from 'eslint-config-it4c'
import graphql from 'eslint-config-it4c/modules/graphql'
import jest from 'eslint-config-it4c/modules/jest'
import json from 'eslint-config-it4c/modules/json'
import node from 'eslint-config-it4c/modules/node'
import prettier from 'eslint-config-it4c/modules/prettier'
import promise from 'eslint-config-it4c/modules/promise'
import security from 'eslint-config-it4c/modules/security'
import typescript from 'eslint-config-it4c/modules/typescript'
import yaml from 'eslint-config-it4c/modules/yaml'
// TODO: GraphQL linting is disabled because @graphql-eslint/eslint-plugin v4
// (bundled with eslint-config-it4c) requires graphql@^16, but the backend
// uses graphql@^14 (required by apollo-server v2). Re-enable when upgrading graphql.
// import graphql from 'eslint-config-it4c/modules/graphql'
//
// ...graphql.map((c) => ({
// ...c,
// files: ['**/*.graphql', '**/*.gql'],
// })),
// {
// files: ['**/*.graphql', '**/*.gql'],
// languageOptions: {
// parserOptions: {
// schema: './src/graphql/types/**/*.gql',
// assumeValid: true,
// },
// },
// rules: {
// '@graphql-eslint/require-description': 'off',
// '@graphql-eslint/naming-convention': 'off',
// '@graphql-eslint/strict-id-in-types': 'off',
// '@graphql-eslint/no-typename-prefix': 'off',
// '@graphql-eslint/known-directives': 'off',
// '@graphql-eslint/known-argument-names': 'off',
// '@graphql-eslint/known-type-names': 'off',
// '@graphql-eslint/lone-schema-definition': 'off',
// '@graphql-eslint/provided-required-arguments': 'off',
// '@graphql-eslint/unique-directive-names': 'off',
// '@graphql-eslint/unique-directive-names-per-location': 'off',
// '@graphql-eslint/unique-field-definition-names': 'off',
// '@graphql-eslint/unique-operation-types': 'off',
// '@graphql-eslint/unique-type-names': 'off',
// },
// },
export default [
{
ignores: ['node_modules/', 'build/', 'coverage/'],
},
...eslint,
...typescript,
...importX,
...node,
...promise,
...security,
...comments,
...json,
...yaml,
...prettier,
...config,
...jest,
// GraphQL schema linting (extend file pattern to include .gql)
...graphql.map((c) => ({
...c,
files: ['**/*.graphql', '**/*.gql'],
})),
{
files: ['**/*.graphql', '**/*.gql'],
// TODO: Parser must be set explicitly because the it4c module only provides
// plugins and rules, not languageOptions. Without this, ESLint uses the JS
// parser for .gql files. Remove when fixed in eslint-config-it4c.
languageOptions: {
parser: graphql[0].plugins['@graphql-eslint'].parser,
parserOptions: {
graphQLConfig: {
schema: './src/graphql/types/**/*.gql',
documents: './src/graphql/queries/**/*.gql',
},
},
},
rules: {
// Would require descriptions on every type/field/input — too noisy for now
'@graphql-eslint/require-description': 'off',
// camelCase operation names and _id/_ne underscores conflict with existing schema
'@graphql-eslint/naming-convention': 'off',
// Many types (Image, File, InviteCode, etc.) intentionally lack id: ID!
'@graphql-eslint/strict-id-in-types': 'off',
// Fields like groupType, queryLocations match parent type name by coincidence
'@graphql-eslint/no-typename-prefix': 'off',
// neo4j-graphql-js adds arguments (first, offset) at runtime not present in static schema
'@graphql-eslint/known-argument-names': 'off',
// TODO: operations-recommended rules must be disabled because the it4c
// graphql module bundles both schema and operations configs together.
// Remove when eslint-config-it4c exports them separately (e.g. graphql/schema).
'@graphql-eslint/executable-definitions': 'off',
// neo4j-graphql-js adds fields at runtime (_id, relations) not present in static schema
'@graphql-eslint/fields-on-correct-type': 'off',
},
},
{
// Backend-specific TypeScript overrides
files: ['**/*.ts'],
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['eslint.config.ts'],
allowDefaultProject: ['eslint.config.ts', 'jest.config.ts', 'prettier.config.ts'],
},
tsconfigRootDir: import.meta.dirname,
},

View File

@ -1,27 +0,0 @@
/* eslint-disable import-x/no-commonjs */
const requireJSON5 = require('require-json5')
const { pathsToModuleNameMapper } = require('ts-jest')
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: 93,
},
},
testMatch: ['**/src/**/?(*.)+(spec|test).ts?(x)'],
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
}

40
backend/jest.config.ts Normal file
View File

@ -0,0 +1,40 @@
import { readFileSync } from 'node:fs'
import { pathsToModuleNameMapper } from 'ts-jest'
import { parseConfigFileTextToJson } from 'typescript'
// eslint-disable-next-line n/no-sync -- config files are synchronous by nature
const tsconfigText = readFileSync('./tsconfig.json', 'utf-8')
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- parseConfigFileTextToJson returns untyped config
const { config } = parseConfigFileTextToJson('tsconfig.json', tsconfigText)
const paths = (config as { compilerOptions: { paths: Record<string, string[]> } }).compilerOptions
.paths
export default {
verbose: true,
preset: 'ts-jest',
collectCoverage: true,
collectCoverageFrom: [
'**/*.ts',
'!**/node_modules/**',
'!**/test/**',
'!**/build/**',
'!**/src/**/?(*.)+(spec|test).ts?(x)',
'!**/src/db/**',
'!*.config.ts',
'!**/*.d.ts',
'!**/gql-register.ts',
],
coverageThreshold: {
global: {
lines: 93,
},
},
testMatch: ['**/src/**/?(*.)+(spec|test).ts?(x)'],
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
transform: {
'\\.gql$': '<rootDir>/test/graphqlTransform.ts',
'\\.tsx?$': 'ts-jest',
},
moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: '<rootDir>/' }),
}

View File

@ -10,20 +10,20 @@
"scripts": {
"start": "node build/src/",
"build": "tsc && tsc-alias && ./scripts/build.copy.files.sh",
"dev": "nodemon --exec ts-node --require tsconfig-paths/register src/index.ts -e js,ts,gql",
"dev": "nodemon --exec tsx src/index.ts -e js,ts,gql",
"dev:debug": "nodemon --exec node --inspect=0.0.0.0:9229 build/src/index.js -e js,ts,gql",
"lint": "eslint --max-warnings 0 .",
"test": "cross-env NODE_ENV=test NODE_OPTIONS=--max-old-space-size=8192 jest --runInBand --coverage --forceExit --detectOpenHandles",
"db:reset": "ts-node --require tsconfig-paths/register src/db/reset.ts",
"db:reset:withmigrations": "ts-node --require tsconfig-paths/register src/db/reset-with-migrations.ts",
"db:seed": "ts-node --require tsconfig-paths/register src/db/seed.ts",
"db:data:admin": "ts-node --require tsconfig-paths/register src/db/admin.ts",
"db:data:badges": "ts-node --require tsconfig-paths/register src/db/badges.ts",
"db:data:branding": "ts-node --require tsconfig-paths/register src/db/data-branding.ts",
"db:data:categories": "ts-node --require tsconfig-paths/register src/db/categories.ts",
"db:reset": "tsx src/db/reset.ts",
"db:reset:withmigrations": "tsx src/db/reset-with-migrations.ts",
"db:seed": "tsx --require ./src/graphql/gql-register.ts src/db/seed.ts",
"db:data:admin": "tsx src/db/admin.ts",
"db:data:badges": "tsx src/db/badges.ts",
"db:data:branding": "tsx src/db/data-branding.ts",
"db:data:categories": "tsx src/db/categories.ts",
"db:migrate": "migrate --compiler 'ts:./src/db/compiler.ts' --migrations-dir ./src/db/migrations --store ./src/db/migrate/store.ts",
"db:migrate:create": "migrate --compiler 'ts:./src/db/compiler.ts' --migrations-dir ./src/db/migrations --template-file ./src/db/migrate/template.ts --date-format 'yyyymmddHHmmss' create",
"db:func:disable:notifications": "ts-node --require tsconfig-paths/register src/db/disable-notifications.ts",
"db:func:disable:notifications": "tsx src/db/disable-notifications.ts",
"prod:migrate": "migrate --migrations-dir ./build/src/db/migrations --store ./build/src/db/migrate/store.js",
"prod:db:data:branding": "node build/src/db/data-branding.js",
"prod:db:data:categories": "node build/src/db/categories.js",
@ -31,27 +31,27 @@
"prod:db:func:disable:notifications": "node build/src/db/disable-notifications.js"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.995.0",
"@aws-sdk/lib-storage": "^3.990.0",
"@apollo/server": "^4.11.3",
"@aws-sdk/client-s3": "^3.1000.0",
"@aws-sdk/lib-storage": "^3.1000.0",
"@graphql-tools/load-files": "^7.0.0",
"@graphql-tools/merge": "^9.0.0",
"@sentry/node": "^5.30.0",
"@types/mime-types": "^3.0.1",
"apollo-server": "~2.14.2",
"apollo-server-express": "^2.14.2",
"bcryptjs": "~3.0.3",
"body-parser": "^1.20.3",
"body-parser": "^2.2.2",
"cheerio": "~1.2.0",
"cross-env": "~10.1.0",
"dotenv": "~17.0.1",
"email-templates": "^13.0.1",
"express": "^4.22.1",
"graphql": "^14.6.0",
"graphql": "^16.13.0",
"graphql-middleware": "~6.1.35",
"graphql-middleware-sentry": "^3.2.1",
"graphql-redis-subscriptions": "^2.7.0",
"graphql-shield": "~7.2.2",
"graphql-subscriptions": "^1.1.0",
"graphql-tag": "~2.10.3",
"graphql-shield": "^7.6.5",
"graphql-subscriptions": "^2.0.0",
"graphql-upload": "^13.0.0",
"graphql-ws": "^5.16.2",
"helmet": "~8.1.0",
"ioredis": "^5.9.3",
"jsonwebtoken": "~8.5.1",
@ -59,24 +59,23 @@
"linkify-html": "^4.3.2",
"linkifyjs": "^4.3.2",
"lodash": "~4.17.23",
"merge-graphql-schemas": "^1.7.8",
"metascraper": "^5.49.19",
"metascraper-author": "^5.49.19",
"metascraper-date": "^5.49.19",
"metascraper-description": "^5.49.19",
"metascraper-image": "^5.49.19",
"metascraper-lang": "^5.49.19",
"metascraper": "^5.49.24",
"metascraper-author": "^5.49.24",
"metascraper-date": "^5.49.24",
"metascraper-description": "^5.49.24",
"metascraper-image": "^5.49.24",
"metascraper-lang": "^5.49.24",
"metascraper-lang-detector": "^4.10.2",
"metascraper-logo": "^5.49.19",
"metascraper-publisher": "^5.49.19",
"metascraper-logo": "^5.49.24",
"metascraper-publisher": "^5.49.24",
"metascraper-soundcloud": "^5.34.4",
"metascraper-title": "^5.49.19",
"metascraper-url": "^5.49.19",
"metascraper-video": "^5.49.19",
"metascraper-youtube": "^5.49.20",
"metascraper-title": "^5.49.24",
"metascraper-url": "^5.49.24",
"metascraper-video": "^5.49.24",
"metascraper-youtube": "^5.49.24",
"migrate": "^2.1.0",
"mime-types": "^3.0.2",
"minimatch": "^10.2.2",
"minimatch": "^10.2.4",
"mustache": "^4.2.0",
"neo4j-driver": "^4.4.11",
"neo4j-graphql-js": "2.11.5",
@ -88,10 +87,12 @@
"pug": "^3.0.3",
"sanitize-html": "~2.17.1",
"slugify": "^1.6.6",
"subscriptions-transport-ws": "^0.11.0",
"trunc-html": "~1.1.2",
"tslog": "^4.10.2",
"uuid": "~9.0.1",
"validator": "^13.15.26",
"ws": "^8.18.2",
"xregexp": "^5.1.2"
},
"devDependencies": {
@ -99,23 +100,21 @@
"@types/email-templates": "^10.0.4",
"@types/jest": "^30.0.0",
"@types/jsonwebtoken": "~8.5.1",
"@types/lodash": "^4.17.23",
"@types/node": "^25.3.0",
"@types/lodash": "^4.17.24",
"@types/node": "^25.3.2",
"@types/request": "^2.48.13",
"@types/slug": "^5.0.9",
"@types/uuid": "~9.0.1",
"apollo-server-testing": "~2.11.0",
"@types/ws": "^8.18.1",
"eslint": "^9.27.0",
"eslint-config-it4c": "^0.12.0",
"jest": "^30.2.0",
"nodemon": "~3.1.11",
"nodemon": "~3.1.14",
"prettier": "^3.8.1",
"require-json5": "^1.3.0",
"rosie": "^2.1.1",
"ts-jest": "^29.4.6",
"ts-node": "^10.9.2",
"tsc-alias": "^1.8.16",
"tsconfig-paths": "^4.2.0",
"tsx": "^4.21.0",
"typescript": "^5.8.3"
},
"resolutions": {
@ -125,7 +124,9 @@
"**/string-width": "4.2.0",
"**/wrap-ansi": "7.0.0",
"**/jwa": "^2.0.1",
"**/@types/express": "4.17.25"
"**/@types/express": "4.17.25",
"neo4j-graphql-js/graphql": "^16.11.0",
"graphql-upload/graphql": "^16.11.0"
},
"engines": {
"node": ">=20.12.1"

View File

@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
import databaseContext from '@context/database'
import pubsubContext from '@context/pubsub'
import CONFIG from '@src/config'
@ -7,8 +5,6 @@ import { decode } from '@src/jwt/decode'
import ocelotLogger from '@src/logger'
import type { DecodedUser } from '@src/jwt/decode'
import type OcelotLogger from '@src/logger'
import type { ApolloServerExpressConfig } from 'apollo-server-express'
const serverDatabase = databaseContext()
const serverPubsub = pubsubContext()
@ -18,7 +14,7 @@ export const getContext =
database?: ReturnType<typeof databaseContext>
pubsub?: ReturnType<typeof pubsubContext>
authenticatedUser: DecodedUser | null | undefined
logger?: typeof OcelotLogger
logger?: typeof ocelotLogger
config: typeof CONFIG
}) =>
async (req: { headers: { authorization?: string } }) => {
@ -44,18 +40,11 @@ export const getContext =
req,
cypherParams: {
currentUserId: user ? user.id : null,
languageDefault: config.LANGUAGE_DEFAULT.toUpperCase(),
},
config,
}
return result
}
export const context: ApolloServerExpressConfig['context'] = async (options) => {
const { connection, req } = options
if (connection) {
return connection.context
} else {
return getContext()(req)
}
}
export type Context = Awaited<ReturnType<ReturnType<typeof getContext>>>

View File

@ -1,10 +1,8 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-require-imports */
/* eslint-disable import-x/no-commonjs */
// eslint-disable-next-line n/no-unpublished-require
const tsNode = require('ts-node')
// eslint-disable-next-line import-x/no-unassigned-import, n/no-unpublished-require
require('tsconfig-paths/register')
const tsx = require('tsx/cjs/api')
module.exports = tsNode.register
module.exports = tsx.register

View File

@ -13,6 +13,7 @@ export default {
nameNL: { type: 'string' },
namePL: { type: 'string' },
nameRU: { type: 'string' },
nameSQ: { type: 'string' },
isIn: {
type: 'relationship',
relationship: 'IS_IN',

View File

@ -11,13 +11,13 @@ import sample from 'lodash/sample'
import CONFIG from '@config/index'
import { categories } from '@constants/categories'
import { ChangeGroupMemberRole } from '@graphql/queries/ChangeGroupMemberRole'
import { CreateComment } from '@graphql/queries/CreateComment'
import { CreateGroup } from '@graphql/queries/CreateGroup'
import { CreateMessage } from '@graphql/queries/CreateMessage'
import { CreatePost } from '@graphql/queries/CreatePost'
import { CreateRoom } from '@graphql/queries/CreateRoom'
import { JoinGroup } from '@graphql/queries/JoinGroup'
import CreateComment from '@graphql/queries/comments/CreateComment.gql'
import ChangeGroupMemberRole from '@graphql/queries/groups/ChangeGroupMemberRole.gql'
import CreateGroup from '@graphql/queries/groups/CreateGroup.gql'
import JoinGroup from '@graphql/queries/groups/JoinGroup.gql'
import CreateMessage from '@graphql/queries/messaging/CreateMessage.gql'
import CreateRoom from '@graphql/queries/messaging/CreateRoom.gql'
import CreatePost from '@graphql/queries/posts/CreatePost.gql'
import { createApolloTestSetup } from '@root/test/helpers'
import Factory from './factories'
@ -42,7 +42,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
authenticatedUser,
config: CONFIG,
})
const apolloSetup = createApolloTestSetup({ context })
const apolloSetup = await createApolloTestSetup({ context })
const { mutate, server, database } = apolloSetup
const { neode } = database

View File

@ -14,6 +14,7 @@ export interface LocationDbProperties {
namePL: string
namePT: string
nameRU: string
nameSQ: string
type: string
}

6
backend/src/graphql.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
declare module '*.gql' {
import type { DocumentNode } from 'graphql'
const value: DocumentNode
export default value
}

View File

@ -0,0 +1,19 @@
import { GraphQLError } from 'graphql'
export class UserInputError extends GraphQLError {
constructor(message: string) {
super(message, { extensions: { code: 'BAD_USER_INPUT' } })
}
}
export class AuthenticationError extends GraphQLError {
constructor(message: string) {
super(message, { extensions: { code: 'UNAUTHENTICATED' } })
}
}
export class ForbiddenError extends GraphQLError {
constructor(message: string) {
super(message, { extensions: { code: 'FORBIDDEN' } })
}
}

View File

@ -0,0 +1,21 @@
/* eslint-disable n/no-sync, security/detect-non-literal-fs-filename */
// Register a require hook for .gql files so they can be imported at runtime.
// Jest uses its own graphqlTransform.ts for this; this hook covers tsx/node usage
// (e.g. db:seed).
import { readFileSync } from 'node:fs'
import Module from 'node:module'
import { parse } from 'graphql'
// @ts-expect-error -- require.extensions is deprecated but still functional for CJS hooks
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
Module._extensions['.gql'] = function (_module: typeof module, filename: string) {
const content = readFileSync(filename, 'utf-8')
try {
_module.exports = parse(content)
} catch (error: unknown) {
throw new Error(
`Failed to parse ${filename}: ${error instanceof Error ? error.message : String(error)}`,
)
}
}

View File

@ -1,11 +0,0 @@
import gql from 'graphql-tag'
export const AddEmailAddress = gql`
mutation ($email: String!) {
AddEmailAddress(email: $email) {
email
verifiedAt
createdAt
}
}
`

View File

@ -1,15 +0,0 @@
import gql from 'graphql-tag'
export const AddPostEmotions = gql`
mutation ($to: _PostInput!, $data: _EMOTEDInput!) {
AddPostEmotions(to: $to, data: $data) {
from {
id
}
to {
id
}
emotion
}
}
`

View File

@ -0,0 +1,8 @@
query Category {
Category {
id
slug
name
icon
}
}

View File

@ -1,12 +0,0 @@
import gql from 'graphql-tag'
export const Category = gql`
query {
Category {
id
slug
name
icon
}
}
`

View File

@ -1,16 +0,0 @@
import gql from 'graphql-tag'
export const ChangeGroupMemberRole = gql`
mutation ($groupId: ID!, $userId: ID!, $roleInGroup: GroupMemberRole!) {
ChangeGroupMemberRole(groupId: $groupId, userId: $userId, roleInGroup: $roleInGroup) {
user {
id
name
slug
}
membership {
role
}
}
}
`

View File

@ -1,15 +0,0 @@
import gql from 'graphql-tag'
export const CreateComment = gql`
mutation ($id: ID, $postId: ID!, $content: String!) {
CreateComment(id: $id, postId: $postId, content: $content) {
id
content
author {
name
}
isPostObservedByMe
postObservingUsersCount
}
}
`

View File

@ -1,53 +0,0 @@
import gql from 'graphql-tag'
export const CreateGroup = gql`
mutation (
$id: ID
$name: String!
$slug: String
$about: String
$description: String!
$groupType: GroupType!
$actionRadius: GroupActionRadius!
$categoryIds: [ID]
$locationName: String # empty string '' sets it to null
) {
CreateGroup(
id: $id
name: $name
slug: $slug
about: $about
description: $description
groupType: $groupType
actionRadius: $actionRadius
categoryIds: $categoryIds
locationName: $locationName
) {
id
name
slug
createdAt
updatedAt
disabled
deleted
about
description
descriptionExcerpt
groupType
actionRadius
categories {
id
slug
name
icon
}
locationName
location {
name
nameDE
nameEN
}
myRole
}
}
`

View File

@ -1,22 +0,0 @@
import gql from 'graphql-tag'
export const CreateMessage = gql`
mutation ($roomId: ID!, $content: String!, $files: [FileInput]) {
CreateMessage(roomId: $roomId, content: $content, files: $files) {
id
content
senderId
username
avatar
date
saved
distributed
seen
files {
url
name
type
}
}
}
`

View File

@ -1,51 +0,0 @@
import gql from 'graphql-tag'
export const CreatePost = gql`
mutation (
$id: ID
$title: String!
$slug: String
$content: String!
$categoryIds: [ID]
$groupId: ID
$postType: PostType
$eventInput: _EventInput
) {
CreatePost(
id: $id
title: $title
slug: $slug
content: $content
categoryIds: $categoryIds
groupId: $groupId
postType: $postType
eventInput: $eventInput
) {
id
slug
title
content
disabled
deleted
postType
author {
name
}
categories {
id
}
eventStart
eventEnd
eventLocationName
eventVenue
eventIsOnline
eventLocation {
lng
lat
}
isObservedByMe
observingUsersCount
language
}
}
`

View File

@ -1,22 +0,0 @@
import gql from 'graphql-tag'
export const CreateRoom = gql`
mutation ($userId: ID!) {
CreateRoom(userId: $userId) {
id
roomId
roomName
lastMessageAt
unreadCount
#avatar
users {
_id
id
name
avatar {
url
}
}
}
}
`

View File

@ -1,14 +0,0 @@
import gql from 'graphql-tag'
export const CreateSocialMedia = gql`
mutation ($url: String!) {
CreateSocialMedia(url: $url) {
id
url
url
ownedBy {
name
}
}
}
`

View File

@ -1,12 +0,0 @@
import gql from 'graphql-tag'
export const DeleteComment = gql`
mutation ($id: ID!) {
DeleteComment(id: $id) {
id
content
contentExcerpt
deleted
}
}
`

View File

@ -1,20 +0,0 @@
import gql from 'graphql-tag'
export const DeletePost = gql`
mutation ($id: ID!) {
DeletePost(id: $id) {
id
deleted
content
contentExcerpt
image {
url
}
comments {
deleted
content
contentExcerpt
}
}
}
`

View File

@ -1,10 +0,0 @@
import gql from 'graphql-tag'
export const DeleteSocialMedia = gql`
mutation ($id: ID!) {
DeleteSocialMedia(id: $id) {
id
url
}
}
`

View File

@ -1,30 +0,0 @@
import gql from 'graphql-tag'
export const DeleteUser = gql`
mutation ($id: ID!, $resource: [Deletable]) {
DeleteUser(id: $id, resource: $resource) {
id
name
about
deleted
contributions {
id
content
contentExcerpt
deleted
comments {
id
content
contentExcerpt
deleted
}
}
comments {
id
content
contentExcerpt
deleted
}
}
}
`

View File

@ -1,12 +0,0 @@
import gql from 'graphql-tag'
export const Donations = gql`
query {
Donations {
id
showDonations
goal
progress
}
}
`

View File

@ -1,40 +0,0 @@
import gql from 'graphql-tag'
export const Group = gql`
query Group($isMember: Boolean, $id: ID, $slug: String) {
Group(isMember: $isMember, id: $id, slug: $slug) {
id
name
slug
createdAt
updatedAt
disabled
deleted
about
description
descriptionExcerpt
groupType
actionRadius
categories {
id
slug
name
icon
}
avatar {
url
}
locationName
location {
name
nameDE
nameEN
}
myRole
inviteCodes {
code
redeemedByCount
}
}
}
`

View File

@ -1,16 +0,0 @@
import gql from 'graphql-tag'
export const GroupMembers = gql`
query GroupMembers($id: ID!) {
GroupMembers(id: $id) {
user {
id
name
slug
}
membership {
role
}
}
}
`

View File

@ -1,16 +0,0 @@
import gql from 'graphql-tag'
export const JoinGroup = gql`
mutation ($groupId: ID!, $userId: ID!) {
JoinGroup(groupId: $groupId, userId: $userId) {
user {
id
name
slug
}
membership {
role
}
}
}
`

View File

@ -1,16 +0,0 @@
import gql from 'graphql-tag'
export const LeaveGroup = gql`
mutation ($groupId: ID!, $userId: ID!) {
LeaveGroup(groupId: $groupId, userId: $userId) {
user {
id
name
slug
}
membership {
role
}
}
}
`

View File

@ -1,7 +0,0 @@
import gql from 'graphql-tag'
export const MarkMessagesAsSeen = gql`
mutation ($messageIds: [String!]) {
MarkMessagesAsSeen(messageIds: $messageIds)
}
`

View File

@ -1,27 +0,0 @@
import gql from 'graphql-tag'
export const Message = gql`
query ($roomId: ID!, $first: Int, $offset: Int) {
Message(roomId: $roomId, first: $first, offset: $offset, orderBy: indexId_desc) {
_id
id
indexId
content
senderId
author {
id
}
username
avatar
date
saved
distributed
seen
files {
url
name
type
}
}
}
`

View File

@ -1,39 +0,0 @@
import gql from 'graphql-tag'
export const Post = gql`
query ($id: ID, $filter: _PostFilter, $first: Int, $offset: Int, $orderBy: [_PostOrdering]) {
Post(id: $id, filter: $filter, first: $first, offset: $offset, orderBy: $orderBy) {
id
title
content
contentExcerpt
eventStart
pinned
createdAt
pinnedAt
isObservedByMe
observingUsersCount
clickedCount
emotionsCount
emotions {
emotion
User {
id
}
}
author {
id
name
}
shoutedBy {
id
}
tags {
id
}
comments {
content
}
}
}
`

View File

@ -1,7 +0,0 @@
import gql from 'graphql-tag'
export const PostsEmotionsByCurrentUser = gql`
query ($postId: ID!) {
PostsEmotionsByCurrentUser(postId: $postId)
}
`

View File

@ -1,7 +0,0 @@
import gql from 'graphql-tag'
export const PostsEmotionsCountByEmotion = gql`
query ($postId: ID!, $data: _EMOTEDInput!) {
PostsEmotionsCountByEmotion(postId: $postId, data: $data)
}
`

View File

@ -1,15 +0,0 @@
import gql from 'graphql-tag'
export const RemovePostEmotions = gql`
mutation ($to: _PostInput!, $data: _EMOTEDInput!) {
RemovePostEmotions(to: $to, data: $data) {
from {
id
}
to {
id
}
emotion
}
}
`

View File

@ -1,16 +0,0 @@
import gql from 'graphql-tag'
export const RemoveUserFromGroup = gql`
mutation ($groupId: ID!, $userId: ID!) {
RemoveUserFromGroup(groupId: $groupId, userId: $userId) {
user {
id
name
slug
}
membership {
role
}
}
}
`

View File

@ -1,34 +0,0 @@
import gql from 'graphql-tag'
export const Room = gql`
query Room($first: Int, $offset: Int, $id: ID) {
Room(first: $first, offset: $offset, id: $id, orderBy: lastMessageAt_desc) {
id
roomId
roomName
avatar
lastMessageAt
unreadCount
lastMessage {
_id
id
content
senderId
username
avatar
date
saved
distributed
seen
}
users {
_id
id
name
avatar {
url
}
}
}
}
`

View File

@ -1,9 +0,0 @@
import gql from 'graphql-tag'
export const Signup = gql`
mutation ($email: String!, $locale: String!, $inviteCode: String) {
Signup(email: $email, locale: $locale, inviteCode: $inviteCode) {
email
}
}
`

View File

@ -1,30 +0,0 @@
import gql from 'graphql-tag'
export const SignupVerification = gql`
mutation (
$password: String!
$email: String!
$name: String!
$slug: String
$nonce: String!
$termsAndConditionsAgreedVersion: String!
$about: String
$locale: String
) {
SignupVerification(
email: $email
password: $password
name: $name
slug: $slug
nonce: $nonce
termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion
about: $about
locale: $locale
) {
id
slug
termsAndConditionsAgreedVersion
termsAndConditionsAgreedAt
}
}
`

View File

@ -1,7 +0,0 @@
import gql from 'graphql-tag'
export const UnreadRooms = gql`
query {
UnreadRooms
}
`

View File

@ -1,12 +0,0 @@
import gql from 'graphql-tag'
export const UpdateComment = gql`
mutation ($content: String!, $id: ID!) {
UpdateComment(content: $content, id: $id) {
id
content
createdAt
updatedAt
}
}
`

View File

@ -1,14 +0,0 @@
import gql from 'graphql-tag'
export const UpdateDonations = gql`
mutation ($showDonations: Boolean, $goal: Int, $progress: Int) {
UpdateDonations(showDonations: $showDonations, goal: $goal, progress: $progress) {
id
showDonations
goal
progress
createdAt
updatedAt
}
}
`

View File

@ -1,54 +0,0 @@
import gql from 'graphql-tag'
export const UpdateGroup = gql`
mutation (
$id: ID!
$name: String
$slug: String
$about: String
$description: String
$actionRadius: GroupActionRadius
$categoryIds: [ID]
$avatar: ImageInput
$locationName: String # empty string '' sets it to null
) {
UpdateGroup(
id: $id
name: $name
slug: $slug
about: $about
description: $description
actionRadius: $actionRadius
categoryIds: $categoryIds
avatar: $avatar
locationName: $locationName
) {
id
name
slug
createdAt
updatedAt
disabled
deleted
about
description
descriptionExcerpt
groupType
actionRadius
categories {
id
slug
name
icon
}
# avatar # test this as result
locationName
location {
name
nameDE
nameEN
}
myRole
}
}
`

View File

@ -1,44 +0,0 @@
import gql from 'graphql-tag'
export const UpdatePost = gql`
mutation (
$id: ID!
$title: String!
$content: String!
$image: ImageInput
$categoryIds: [ID]
$postType: PostType
$eventInput: _EventInput
) {
UpdatePost(
id: $id
title: $title
content: $content
image: $image
categoryIds: $categoryIds
postType: $postType
eventInput: $eventInput
) {
id
title
content
author {
name
slug
}
createdAt
updatedAt
categories {
id
}
postType
eventStart
eventLocationName
eventVenue
eventLocation {
lng
lat
}
}
}
`

View File

@ -1,10 +0,0 @@
import gql from 'graphql-tag'
export const UpdateSocialMedia = gql`
mutation ($id: ID!, $url: String!) {
UpdateSocialMedia(id: $id, url: $url) {
id
url
}
}
`

View File

@ -1,67 +0,0 @@
import gql from 'graphql-tag'
export const UpdateUser = gql`
mutation (
$id: ID!
$slug: String
$name: String
$about: String
$allowEmbedIframes: Boolean
$showShoutsPublicly: Boolean
$emailNotificationSettings: [EmailNotificationSettingsInput]
$termsAndConditionsAgreedVersion: String
$avatar: ImageInput
$locationName: String # empty string '' sets it to null
$locale: String
) {
UpdateUser(
id: $id
slug: $slug
name: $name
about: $about
allowEmbedIframes: $allowEmbedIframes
showShoutsPublicly: $showShoutsPublicly
emailNotificationSettings: $emailNotificationSettings
termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion
avatar: $avatar
locationName: $locationName
locale: $locale
) {
id
slug
name
about
allowEmbedIframes
showShoutsPublicly
termsAndConditionsAgreedVersion
termsAndConditionsAgreedAt
locationName
locale
location {
name
nameDE
nameEN
nameRU
}
emailNotificationSettings {
type
settings {
name
value
}
}
avatar {
url
alt
sensitive
aspectRatio
type
}
badgeVerification {
id
description
icon
}
}
}
`

View File

@ -1,165 +0,0 @@
import gql from 'graphql-tag'
export const User = gql`
query ($id: ID, $name: String, $email: String) {
User(id: $id, name: $name, email: $email) {
id
name
badgeTrophiesCount
badgeTrophies {
id
}
badgeVerification {
id
isDefault
}
badgeTrophiesSelected {
id
isDefault
}
followedBy {
id
}
followedByCurrentUser
following {
name
slug
about
avatar {
url
}
comments {
content
contentExcerpt
}
contributions {
title
slug
image {
url
}
content
contentExcerpt
}
}
isMuted
isBlocked
location {
distanceToMe
}
activeCategories
}
}
`
export const UserEmailNotificationSettings = gql`
query ($id: ID, $name: String, $email: String) {
User(id: $id, name: $name, email: $email) {
id
name
badgeTrophiesCount
badgeTrophies {
id
}
badgeVerification {
id
isDefault
}
badgeTrophiesSelected {
id
isDefault
}
followedBy {
id
}
followedByCurrentUser
following {
name
slug
about
avatar {
url
}
comments {
content
contentExcerpt
}
contributions {
title
slug
image {
url
}
content
contentExcerpt
}
}
isMuted
isBlocked
location {
distanceToMe
}
emailNotificationSettings {
type
settings {
name
value
}
}
activeCategories
}
}
`
export const UserEmail = gql`
query ($id: ID, $name: String, $email: String) {
User(id: $id, name: $name, email: $email) {
id
name
email
badgeTrophiesCount
badgeTrophies {
id
}
badgeVerification {
id
isDefault
}
badgeTrophiesSelected {
id
isDefault
}
followedBy {
id
}
followedByCurrentUser
following {
name
slug
about
avatar {
url
}
comments {
content
contentExcerpt
}
contributions {
title
slug
image {
url
}
content
contentExcerpt
}
}
isMuted
isBlocked
location {
distanceToMe
}
activeCategories
}
}
`

View File

@ -1,11 +0,0 @@
import gql from 'graphql-tag'
export const VerifyEmailAddress = gql`
mutation ($email: String!, $nonce: String!) {
VerifyEmailAddress(email: $email, nonce: $nonce) {
email
createdAt
verifiedAt
}
}
`

View File

@ -1,7 +0,0 @@
import gql from 'graphql-tag'
export const VerifyNonce = gql`
query ($email: String!, $nonce: String!) {
VerifyNonce(email: $email, nonce: $nonce)
}
`

View File

@ -0,0 +1,5 @@
mutation Signup($email: String!, $locale: String!, $inviteCode: String) {
Signup(email: $email, locale: $locale, inviteCode: $inviteCode) {
email
}
}

View File

@ -0,0 +1,26 @@
mutation SignupVerification(
$password: String!
$email: String!
$name: String!
$slug: String
$nonce: String!
$termsAndConditionsAgreedVersion: String!
$about: String
$locale: String
) {
SignupVerification(
email: $email
password: $password
name: $name
slug: $slug
nonce: $nonce
termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion
about: $about
locale: $locale
) {
id
slug
termsAndConditionsAgreedVersion
termsAndConditionsAgreedAt
}
}

View File

@ -0,0 +1,3 @@
query VerifyNonce($email: String!, $nonce: String!) {
VerifyNonce(email: $email, nonce: $nonce)
}

View File

@ -0,0 +1,3 @@
mutation changePassword($oldPassword: String!, $newPassword: String!) {
changePassword(oldPassword: $oldPassword, newPassword: $newPassword)
}

View File

@ -0,0 +1,21 @@
query currentUser {
currentUser {
id
slug
name
avatar {
url
}
email
role
activeCategories
following {
id
name
}
inviteCodes {
code
redeemedByCount
}
}
}

View File

@ -0,0 +1,3 @@
mutation login($email: String!, $password: String!) {
login(email: $email, password: $password)
}

View File

@ -0,0 +1,3 @@
mutation requestPasswordReset($email: String!, $locale: String!) {
requestPasswordReset(email: $email, locale: $locale)
}

View File

@ -0,0 +1,3 @@
mutation resetPassword($nonce: String!, $email: String!, $newPassword: String!) {
resetPassword(nonce: $nonce, email: $email, newPassword: $newPassword)
}

View File

@ -1,7 +0,0 @@
import gql from 'graphql-tag'
export const availableRoles = gql`
query {
availableRoles
}
`

View File

@ -0,0 +1,14 @@
mutation resetTrophyBadgesSelected {
resetTrophyBadgesSelected {
id
badgeTrophiesCount
badgeTrophiesSelected {
id
isDefault
}
badgeTrophiesUnused {
id
}
badgeTrophiesUnusedCount
}
}

View File

@ -0,0 +1,16 @@
mutation revokeBadge($badgeId: ID!, $userId: ID!) {
revokeBadge(badgeId: $badgeId, userId: $userId) {
id
badgeTrophies {
id
}
badgeVerification {
id
isDefault
}
badgeTrophiesSelected {
id
isDefault
}
}
}

View File

@ -0,0 +1,16 @@
mutation rewardTrophyBadge($badgeId: ID!, $userId: ID!) {
rewardTrophyBadge(badgeId: $badgeId, userId: $userId) {
id
badgeVerification {
id
isDefault
}
badgeTrophiesCount
badgeTrophies {
id
}
badgeTrophiesSelected {
id
}
}
}

View File

@ -0,0 +1,14 @@
mutation setTrophyBadgeSelected($slot: Int!, $badgeId: ID) {
setTrophyBadgeSelected(slot: $slot, badgeId: $badgeId) {
id
badgeTrophiesCount
badgeTrophiesSelected {
id
isDefault
}
badgeTrophiesUnused {
id
}
badgeTrophiesUnusedCount
}
}

View File

@ -0,0 +1,12 @@
mutation setVerificationBadge($badgeId: ID!, $userId: ID!) {
setVerificationBadge(badgeId: $badgeId, userId: $userId) {
id
badgeVerification {
id
isDefault
}
badgeTrophies {
id
}
}
}

View File

@ -1,11 +0,0 @@
import gql from 'graphql-tag'
export const blockUser = gql`
mutation ($id: ID!) {
blockUser(id: $id) {
id
name
isBlocked
}
}
`

View File

@ -1,11 +0,0 @@
import gql from 'graphql-tag'
export const blockedUsers = gql`
query {
blockedUsers {
id
name
isBlocked
}
}
`

View File

@ -1,7 +0,0 @@
import gql from 'graphql-tag'
export const changePassword = gql`
mutation ($oldPassword: String!, $newPassword: String!) {
changePassword(oldPassword: $oldPassword, newPassword: $newPassword)
}
`

View File

@ -0,0 +1,12 @@
mutation CreateComment($id: ID, $postId: ID!, $content: String!) {
CreateComment(id: $id, postId: $postId, content: $content) {
id
content
author {
id
name
}
isPostObservedByMe
postObservingUsersCount
}
}

View File

@ -0,0 +1,8 @@
mutation DeleteComment($id: ID!) {
DeleteComment(id: $id) {
id
content
contentExcerpt
deleted
}
}

View File

@ -0,0 +1,8 @@
mutation UpdateComment($content: String!, $id: ID!) {
UpdateComment(content: $content, id: $id) {
id
content
createdAt
updatedAt
}
}

View File

@ -1,24 +0,0 @@
import gql from 'graphql-tag'
export const currentUser = gql`
query currentUser {
currentUser {
id
slug
name
avatar {
url
}
email
role
activeCategories
following {
name
}
inviteCodes {
code
redeemedByCount
}
}
}
`

View File

@ -0,0 +1,8 @@
query Donations {
Donations {
id
showDonations
goal
progress
}
}

View File

@ -0,0 +1,10 @@
mutation UpdateDonations($showDonations: Boolean, $goal: Int, $progress: Int) {
UpdateDonations(showDonations: $showDonations, goal: $goal, progress: $progress) {
id
showDonations
goal
progress
createdAt
updatedAt
}
}

View File

@ -0,0 +1,17 @@
query embed($url: String!) {
embed(url: $url) {
type
title
author
publisher
date
description
url
image
audio
video
lang
sources
html
}
}

View File

@ -1,21 +0,0 @@
import gql from 'graphql-tag'
export const embed = gql`
query ($url: String!) {
embed(url: $url) {
type
title
author
publisher
date
description
url
image
audio
video
lang
sources
html
}
}
`

View File

@ -0,0 +1,11 @@
mutation AddPostEmotions($to: _PostInput!, $data: _EMOTEDInput!) {
AddPostEmotions(to: $to, data: $data) {
from {
id
}
to {
id
}
emotion
}
}

View File

@ -0,0 +1,3 @@
query PostsEmotionsByCurrentUser($postId: ID!) {
PostsEmotionsByCurrentUser(postId: $postId)
}

View File

@ -0,0 +1,3 @@
query PostsEmotionsCountByEmotion($postId: ID!, $data: _EMOTEDInput!) {
PostsEmotionsCountByEmotion(postId: $postId, data: $data)
}

View File

@ -0,0 +1,11 @@
mutation RemovePostEmotions($to: _PostInput!, $data: _EMOTEDInput!) {
RemovePostEmotions(to: $to, data: $data) {
from {
id
}
to {
id
}
emotion
}
}

View File

@ -0,0 +1,3 @@
mutation shout($id: ID!) {
shout(id: $id, type: Post)
}

View File

@ -0,0 +1,3 @@
mutation unshout($id: ID!) {
unshout(id: $id, type: Post)
}

View File

@ -1,28 +0,0 @@
import gql from 'graphql-tag'
export const fileReport = gql`
mutation ($resourceId: ID!, $reasonCategory: ReasonCategory!, $reasonDescription: String!) {
fileReport(
resourceId: $resourceId
reasonCategory: $reasonCategory
reasonDescription: $reasonDescription
) {
createdAt
reasonCategory
reasonDescription
reportId
resource {
__typename
... on User {
name
}
... on Post {
title
}
... on Comment {
content
}
}
}
}
`

View File

@ -1,15 +0,0 @@
import gql from 'graphql-tag'
export const followUser = gql`
mutation ($id: ID!) {
followUser(id: $id) {
id
name
followedBy {
id
name
}
followedByCurrentUser
}
}
`

View File

@ -1,36 +0,0 @@
import gql from 'graphql-tag'
export const generateGroupInviteCode = gql`
mutation generateGroupInviteCode($groupId: ID!, $expiresAt: String, $comment: String) {
generateGroupInviteCode(groupId: $groupId, expiresAt: $expiresAt, comment: $comment) {
code
createdAt
generatedBy {
id
name
avatar {
url
}
}
redeemedBy {
id
name
avatar {
url
}
}
expiresAt
comment
invitedTo {
id
groupType
name
about
avatar {
url
}
}
isValid
}
}
`

View File

@ -1,36 +0,0 @@
import gql from 'graphql-tag'
export const generatePersonalInviteCode = gql`
mutation generatePersonalInviteCode($expiresAt: String, $comment: String) {
generatePersonalInviteCode(expiresAt: $expiresAt, comment: $comment) {
code
createdAt
generatedBy {
id
name
avatar {
url
}
}
redeemedBy {
id
name
avatar {
url
}
}
expiresAt
comment
invitedTo {
id
groupType
name
about
avatar {
url
}
}
isValid
}
}
`

View File

@ -0,0 +1,12 @@
mutation ChangeGroupMemberRole($groupId: ID!, $userId: ID!, $roleInGroup: GroupMemberRole!) {
ChangeGroupMemberRole(groupId: $groupId, userId: $userId, roleInGroup: $roleInGroup) {
user {
id
name
slug
}
membership {
role
}
}
}

View File

@ -0,0 +1,48 @@
mutation CreateGroup(
$id: ID
$name: String!
$slug: String
$about: String
$description: String!
$groupType: GroupType!
$actionRadius: GroupActionRadius!
$categoryIds: [ID]
$locationName: String # empty string '' sets it to null
) {
CreateGroup(
id: $id
name: $name
slug: $slug
about: $about
description: $description
groupType: $groupType
actionRadius: $actionRadius
categoryIds: $categoryIds
locationName: $locationName
) {
id
name
slug
createdAt
updatedAt
disabled
deleted
about
description
descriptionExcerpt
groupType
actionRadius
categories {
id
slug
name
icon
}
locationName
location {
id
name
}
myRole
}
}

View File

@ -0,0 +1,35 @@
query Group($isMember: Boolean, $id: ID, $slug: String) {
Group(isMember: $isMember, id: $id, slug: $slug) {
id
name
slug
createdAt
updatedAt
disabled
deleted
about
description
descriptionExcerpt
groupType
actionRadius
categories {
id
slug
name
icon
}
avatar {
url
}
locationName
location {
id
name
}
myRole
inviteCodes {
code
redeemedByCount
}
}
}

View File

@ -0,0 +1,12 @@
query GroupMembers($id: ID!) {
GroupMembers(id: $id) {
user {
id
name
slug
}
membership {
role
}
}
}

Some files were not shown because too many files have changed in this diff Show More