28 Commits
demo ... main

Author SHA1 Message Date
29b4e4d448 Merge pull request #12 from RiccardoSenica/dependabot/npm_and_yarn/client/npm_and_yarn-59d0d51f9e
Bump the npm_and_yarn group across 2 directories with 4 updates
2025-11-16 20:49:07 +01:00
dependabot[bot]
528737e6c6 Bump the npm_and_yarn group across 2 directories with 4 updates
Bumps the npm_and_yarn group with 3 updates in the /client directory: [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse), [brace-expansion](https://github.com/juliangruber/brace-expansion) and [browserslist](https://github.com/browserslist/browserslist).
Bumps the npm_and_yarn group with 1 update in the /server directory: [sha.js](https://github.com/crypto-browserify/sha.js).


Updates `@babel/traverse` from 7.28.0 to 7.28.4
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.28.4/packages/babel-traverse)

Updates `brace-expansion` from 1.1.11 to 1.1.12
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12)

Updates `brace-expansion` from 2.0.1 to 2.0.2
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12)

Updates `browserslist` from 4.25.1 to 4.26.0
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.25.1...4.26.0)

Updates `sha.js` from 2.4.11 to 2.4.12
- [Changelog](https://github.com/browserify/sha.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/sha.js/compare/v2.4.11...v2.4.12)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-version: 7.28.4
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: brace-expansion
  dependency-version: 1.1.12
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: brace-expansion
  dependency-version: 2.0.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: browserslist
  dependency-version: 4.26.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: sha.js
  dependency-version: 2.4.12
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-14 12:51:59 +00:00
d409ba9dee Merge pull request #11 from RiccardoSenica/dependabot/npm_and_yarn/client/npm_and_yarn-7d065cd83c
Bump form-data from 3.0.1 to 3.0.4 in /client in the npm_and_yarn group across 1 directory
2025-09-14 20:46:10 +08:00
dependabot[bot]
682b83377c Bump form-data in /client in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the /client directory: [form-data](https://github.com/form-data/form-data).


Updates `form-data` from 3.0.1 to 3.0.4
- [Release notes](https://github.com/form-data/form-data/releases)
- [Changelog](https://github.com/form-data/form-data/blob/v3.0.4/CHANGELOG.md)
- [Commits](https://github.com/form-data/form-data/compare/v3.0.1...v3.0.4)

---
updated-dependencies:
- dependency-name: form-data
  dependency-version: 3.0.4
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 15:12:47 +00:00
435685cf5d Merge pull request #10 from RiccardoSenica/dependabot/npm_and_yarn/client/npm_and_yarn-c6963743e9
Bump the npm_and_yarn group across 2 directories with 6 updates
2025-08-04 20:22:51 +08:00
dependabot[bot]
6e275094cb Bump the npm_and_yarn group across 2 directories with 6 updates
---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-version: 7.28.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: browserslist
  dependency-version: 4.25.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: on-headers
  dependency-version: 1.1.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: compression
  dependency-version: 1.8.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: apollo-server
  dependency-version: 3.13.0
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: apollo-server-core
  dependency-version: 2.19.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-18 02:02:43 +00:00
c883dfafe6 Merge pull request #9 from RiccardoSenica/dependabot/npm_and_yarn/server/npm_and_yarn-6ea9762674
Bump brace-expansion from 1.1.11 to 1.1.12 in /server in the npm_and_yarn group across 1 directory
2025-06-18 22:49:27 +02:00
dependabot[bot]
183220fcf1 Bump brace-expansion
Bumps the npm_and_yarn group with 1 update in the /server directory: [brace-expansion](https://github.com/juliangruber/brace-expansion).


Updates `brace-expansion` from 1.1.11 to 1.1.12
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.12
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 21:24:27 +00:00
c9e4a389bd Merge pull request #8 from RiccardoSenica/dependabot/npm_and_yarn/client/npm_and_yarn-4d2f0b6829
Bump @babel/traverse from 7.27.3 to 7.27.4 in /client in the npm_and_yarn group across 1 directory
2025-06-07 13:49:07 +02:00
dependabot[bot]
f0e823abac Bump @babel/traverse
Bumps the npm_and_yarn group with 1 update in the /client directory: [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse).


Updates `@babel/traverse` from 7.27.3 to 7.27.4
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.4/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-version: 7.27.4
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-05 02:30:27 +00:00
2661a1c0a1 Merge pull request #7 from RiccardoSenica/dependabot/npm_and_yarn/client/npm_and_yarn-867ed2ae06
Bump the npm_and_yarn group across 2 directories with 3 updates
2025-05-29 23:05:51 +02:00
dependabot[bot]
19ae483328 Bump the npm_and_yarn group across 2 directories with 3 updates
Bumps the npm_and_yarn group with 2 updates in the /client directory: [browserslist](https://github.com/browserslist/browserslist) and [path-to-regexp](https://github.com/pillarjs/path-to-regexp).
Bumps the npm_and_yarn group with 1 update in the /server directory: [@graphql-tools/git-loader](https://github.com/ardatan/graphql-tools/tree/HEAD/packages/loaders/git).


Updates `browserslist` from 4.24.0 to 4.25.0
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.24.0...4.25.0)

Updates `path-to-regexp` from 1.8.0 to 1.9.0
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v1.8.0...v1.9.0)

Updates `@graphql-tools/git-loader` from 6.2.5 to 6.2.6
- [Release notes](https://github.com/ardatan/graphql-tools/releases)
- [Changelog](https://github.com/ardatan/graphql-tools/blob/master/packages/loaders/git/CHANGELOG.md)
- [Commits](https://github.com/ardatan/graphql-tools/commits/@graphql-tools/git-loader@6.2.6/packages/loaders/git)

---
updated-dependencies:
- dependency-name: browserslist
  dependency-version: 4.25.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: path-to-regexp
  dependency-version: 1.9.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: "@graphql-tools/git-loader"
  dependency-version: 6.2.6
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-29 21:05:13 +00:00
1c6e583608 Merge pull request #6 from RiccardoSenica/dependabot/npm_and_yarn/client/npm_and_yarn-8982d4f94d
Bump the npm_and_yarn group across 2 directories with 21 updates
2025-05-29 22:59:37 +02:00
dependabot[bot]
4058e90200 Bump the npm_and_yarn group across 2 directories with 21 updates
Bumps the npm_and_yarn group with 11 updates in the /client directory:

| Package | From | To |
| --- | --- | --- |
| [@babel/helpers](https://github.com/babel/babel/tree/HEAD/packages/babel-helpers) | `7.25.7` | `7.27.3` |
| [@babel/runtime-corejs3](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime-corejs3) | `7.12.5` | `7.27.3` |
| [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) | `7.12.5` | `7.27.3` |
| [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) | `7.25.7` | `7.27.3` |
| [ansi-regex](https://github.com/chalk/ansi-regex) | `5.0.0` | `5.0.1` |
| [cookie](https://github.com/jshttp/cookie) | `0.6.0` | `0.7.1` |
| [express](https://github.com/expressjs/express) | `4.21.0` | `4.21.2` |
| [cross-spawn](https://github.com/moxystudio/node-cross-spawn) | `7.0.3` | `7.0.6` |
| [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) | `0.2.0` | `0.2.2` |
| [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) | `2.0.7` | `2.0.9` |
| [nanoid](https://github.com/ai/nanoid) | `3.3.7` | `3.3.11` |

Bumps the npm_and_yarn group with 13 updates in the /server directory:

| Package | From | To |
| --- | --- | --- |
| [@babel/helpers](https://github.com/babel/babel/tree/HEAD/packages/babel-helpers) | `7.12.5` | `7.27.3` |
| [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) | `7.12.5` | `7.27.3` |
| [cross-spawn](https://github.com/moxystudio/node-cross-spawn) | `7.0.3` | `7.0.6` |
| [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) | `0.2.0` | `0.2.2` |
| [ini](https://github.com/npm/ini) | `1.3.5` | `1.3.8` |
| [loader-utils](https://github.com/webpack/loader-utils) | `1.4.0` | `1.4.2` |
| [minimist](https://github.com/minimistjs/minimist) | `1.2.5` | `1.2.8` |
| [url-parse](https://github.com/unshiftio/url-parse) | `1.4.7` | `1.5.10` |
| [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) | `8.5.1` | `9.0.0` |
| [mongoose](https://github.com/Automattic/mongoose) | `5.13.20` | `6.13.6` |
| [object-path](https://github.com/mariocasciaro/object-path) | `0.11.5` | `0.11.8` |
| [pathval](https://github.com/chaijs/pathval) | `1.1.0` | `1.1.1` |
| [ua-parser-js](https://github.com/faisalman/ua-parser-js) | `0.7.23` | `0.7.40` |



Updates `@babel/helpers` from 7.25.7 to 7.27.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.3/packages/babel-helpers)

Updates `@babel/runtime-corejs3` from 7.12.5 to 7.27.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.3/packages/babel-runtime-corejs3)

Updates `@babel/runtime` from 7.12.5 to 7.27.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.3/packages/babel-runtime)

Updates `@babel/traverse` from 7.25.7 to 7.27.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.3/packages/babel-traverse)

Updates `ansi-regex` from 5.0.0 to 5.0.1
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

Updates `cookie` from 0.6.0 to 0.7.1
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1)

Updates `express` from 4.21.0 to 4.21.2
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.21.0...4.21.2)

Updates `cross-spawn` from 7.0.3 to 7.0.6
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

Updates `decode-uri-component` from 0.2.0 to 0.2.2
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

Updates `http-proxy-middleware` from 2.0.7 to 2.0.9
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.9/CHANGELOG.md)
- [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.7...v2.0.9)

Updates `nanoid` from 3.3.7 to 3.3.11
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.11)

Updates `path-to-regexp` from 0.1.10 to 0.1.12
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.12)

Updates `@babel/helpers` from 7.12.5 to 7.27.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.3/packages/babel-helpers)

Updates `@babel/runtime` from 7.12.5 to 7.27.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.27.3/packages/babel-runtime)

Updates `cross-spawn` from 7.0.3 to 7.0.6
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

Updates `decode-uri-component` from 0.2.0 to 0.2.2
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

Updates `ini` from 1.3.5 to 1.3.8
- [Release notes](https://github.com/npm/ini/releases)
- [Changelog](https://github.com/npm/ini/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/ini/compare/v1.3.5...v1.3.8)

Updates `loader-utils` from 1.4.0 to 1.4.2
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.2)

Updates `minimist` from 1.2.5 to 1.2.8
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.8)

Updates `url-parse` from 1.4.7 to 1.5.10
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.10)

Updates `jsonwebtoken` from 8.5.1 to 9.0.0
- [Changelog](https://github.com/auth0/node-jsonwebtoken/blob/master/CHANGELOG.md)
- [Commits](https://github.com/auth0/node-jsonwebtoken/compare/v8.5.1...v9.0.0)

Updates `mongoose` from 5.13.20 to 6.13.6
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/5.13.20...6.13.6)

Updates `object-path` from 0.11.5 to 0.11.8
- [Commits](https://github.com/mariocasciaro/object-path/commits/v0.11.8)

Updates `pathval` from 1.1.0 to 1.1.1
- [Release notes](https://github.com/chaijs/pathval/releases)
- [Changelog](https://github.com/chaijs/pathval/blob/master/CHANGELOG.md)
- [Commits](https://github.com/chaijs/pathval/compare/v1.1.0...v1.1.1)

Updates `ua-parser-js` from 0.7.23 to 0.7.40
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.23...0.7.40)

---
updated-dependencies:
- dependency-name: "@babel/helpers"
  dependency-version: 7.27.3
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: "@babel/runtime-corejs3"
  dependency-version: 7.27.3
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: "@babel/runtime"
  dependency-version: 7.27.3
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: "@babel/traverse"
  dependency-version: 7.27.3
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: ansi-regex
  dependency-version: 5.0.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: cookie
  dependency-version: 0.7.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: express
  dependency-version: 4.21.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: cross-spawn
  dependency-version: 7.0.6
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: decode-uri-component
  dependency-version: 0.2.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: http-proxy-middleware
  dependency-version: 2.0.9
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: nanoid
  dependency-version: 3.3.11
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: path-to-regexp
  dependency-version: 0.1.12
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: "@babel/helpers"
  dependency-version: 7.27.3
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: "@babel/runtime"
  dependency-version: 7.27.3
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: cross-spawn
  dependency-version: 7.0.6
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: decode-uri-component
  dependency-version: 0.2.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: ini
  dependency-version: 1.3.8
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: loader-utils
  dependency-version: 1.4.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: minimist
  dependency-version: 1.2.8
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: url-parse
  dependency-version: 1.5.10
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: jsonwebtoken
  dependency-version: 9.0.0
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: mongoose
  dependency-version: 6.13.6
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: object-path
  dependency-version: 0.11.8
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: pathval
  dependency-version: 1.1.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: ua-parser-js
  dependency-version: 0.7.40
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-29 20:54:32 +00:00
bdc04a78cc Merge pull request #1 from RiccardoSenica/dependabot/npm_and_yarn/client/npm_and_yarn-f24226c2ec
Bump the npm_and_yarn group across 2 directories with 22 updates
2025-05-29 22:42:49 +02:00
31b1a1e647 Merge branch 'main' into dependabot/npm_and_yarn/client/npm_and_yarn-f24226c2ec 2025-05-29 22:42:27 +02:00
df127fde84 Merge pull request #2 from RiccardoSenica/dependabot/npm_and_yarn/client/browserify-sign-4.2.3
Bump browserify-sign from 4.2.1 to 4.2.3 in /client
2025-05-29 22:32:01 +02:00
1a0165b8f6 Merge branch 'main' into dependabot/npm_and_yarn/client/browserify-sign-4.2.3 2025-05-29 22:31:51 +02:00
1f1ff28a2d Merge pull request #3 from RiccardoSenica/dependabot/npm_and_yarn/client/elliptic-6.5.7
Bump elliptic from 6.5.3 to 6.5.7 in /client
2025-05-29 22:27:48 +02:00
e82e4702ca Merge pull request #4 from RiccardoSenica/dependabot/npm_and_yarn/client/es5-ext-0.10.64
Bump es5-ext from 0.10.53 to 0.10.64 in /client
2025-05-29 22:27:36 +02:00
79de551fc6 Merge pull request #5 from RiccardoSenica/dependabot/npm_and_yarn/client/tar-6.2.1
Bump tar from 6.0.5 to 6.2.1 in /client
2025-05-29 22:27:22 +02:00
dependabot[bot]
2349fe1bbf Bump tar from 6.0.5 to 6.2.1 in /client
Bumps [tar](https://github.com/isaacs/node-tar) from 6.0.5 to 6.2.1.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-tar/compare/v6.0.5...v6.2.1)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-08 18:12:09 +00:00
dependabot[bot]
4393aaca07 Bump es5-ext from 0.10.53 to 0.10.64 in /client
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.53 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.53...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-08 18:11:27 +00:00
dependabot[bot]
00040b26e6 Bump elliptic from 6.5.3 to 6.5.7 in /client
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.7.
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.7)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-08 18:10:49 +00:00
dependabot[bot]
8d23f84783 Bump browserify-sign from 4.2.1 to 4.2.3 in /client
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.3.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.3)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-08 18:10:10 +00:00
dependabot[bot]
619326e587 Bump the npm_and_yarn group across 2 directories with 22 updates
Bumps the npm_and_yarn group with 6 updates in the /client directory:

| Package | From | To |
| --- | --- | --- |
| [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) | `7.12.7` | `7.25.7` |
| [body-parser](https://github.com/expressjs/body-parser) | `1.19.0` | `1.20.3` |
| [express](https://github.com/expressjs/express) | `4.17.1` | `4.21.0` |
| [braces](https://github.com/micromatch/braces) | `2.3.2` | `3.0.3` |
| [react-scripts](https://github.com/facebook/create-react-app/tree/HEAD/packages/react-scripts) | `4.0.1` | `5.0.1` |
| [ws](https://github.com/websockets/ws) | `5.2.2` | `7.5.10` |

Bumps the npm_and_yarn group with 6 updates in the /server directory:

| Package | From | To |
| --- | --- | --- |
| [body-parser](https://github.com/expressjs/body-parser) | `1.19.0` | `1.20.3` |
| [express](https://github.com/expressjs/express) | `4.17.1` | `4.20.0` |
| [word-wrap](https://github.com/jonschlinkert/word-wrap) | `1.2.3` | `1.2.5` |
| [mongodb](https://github.com/mongodb/node-mongodb-native) | `3.6.3` | `3.6.10` |
| [mongoose](https://github.com/Automattic/mongoose) | `5.11.9` | `5.13.20` |
| [get-func-name](https://github.com/chaijs/get-func-name) | `2.0.0` | `2.0.2` |



Updates `@babel/traverse` from 7.12.7 to 7.25.7
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.25.7/packages/babel-traverse)

Updates `body-parser` from 1.19.0 to 1.20.3
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/body-parser/compare/1.19.0...1.20.3)

Updates `express` from 4.17.1 to 4.21.0
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.21.0)

Updates `braces` from 2.3.2 to 3.0.3
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/commits/3.0.3)

Updates `react-scripts` from 4.0.1 to 5.0.1
- [Release notes](https://github.com/facebook/create-react-app/releases)
- [Changelog](https://github.com/facebook/create-react-app/blob/main/CHANGELOG-4.x.md)
- [Commits](https://github.com/facebook/create-react-app/commits/react-scripts@5.0.1/packages/react-scripts)

Updates `cookie` from 0.4.0 to 0.6.0
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Changelog](https://github.com/jshttp/cookie/blob/v0.6.0/HISTORY.md)
- [Commits](https://github.com/jshttp/cookie/compare/v0.4.0...v0.6.0)

Updates `ejs` from 2.7.4 to 3.1.10
- [Release notes](https://github.com/mde/ejs/releases)
- [Commits](https://github.com/mde/ejs/compare/v2.7.4...v3.1.10)

Updates `express` from 4.17.1 to 4.21.0
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.21.0)

Updates `glob-parent` from 3.1.0 to 5.1.2
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v5.1.2)

Updates `immer` from 7.0.9 to 9.0.21
- [Release notes](https://github.com/immerjs/immer/releases)
- [Commits](https://github.com/immerjs/immer/compare/v7.0.9...v9.0.21)

Updates `micromatch` from 3.1.10 to 4.0.2
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/3.1.10...4.0.2)

Updates `path-to-regexp` from 0.1.7 to 0.1.10
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.7...v0.1.10)

Updates `postcss` from 7.0.21 to 7.0.39
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/7.0.39/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/7.0.21...7.0.39)

Updates `rollup` from 1.32.1 to 2.79.2
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v1.32.1...v2.79.2)

Updates `semver` from 5.7.1 to 6.3.1
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v6.3.1)

Updates `send` from 0.17.1 to 0.19.0
- [Release notes](https://github.com/pillarjs/send/releases)
- [Changelog](https://github.com/pillarjs/send/blob/master/HISTORY.md)
- [Commits](https://github.com/pillarjs/send/compare/0.17.1...0.19.0)

Updates `serve-static` from 1.14.1 to 1.16.2
- [Release notes](https://github.com/expressjs/serve-static/releases)
- [Changelog](https://github.com/expressjs/serve-static/blob/v1.16.2/HISTORY.md)
- [Commits](https://github.com/expressjs/serve-static/compare/v1.14.1...v1.16.2)

Updates `webpack-dev-middleware` from 3.7.2 to 5.3.4
- [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
- [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v3.7.2...v5.3.4)

Updates `word-wrap` from 1.2.3 to 1.2.5
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5)

Updates `ws` from 5.2.2 to 7.5.10
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/5.2.2...7.5.10)

Updates `body-parser` from 1.19.0 to 1.20.3
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/body-parser/compare/1.19.0...1.20.3)

Updates `braces` from 2.3.2 to 1.8.5
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/commits/3.0.3)

Updates `express` from 4.17.1 to 4.20.0
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.21.0)

Updates `glob-parent` from 3.1.0 to 2.0.0
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v5.1.2)

Updates `micromatch` from 3.1.10 to 2.3.11
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/3.1.10...4.0.2)

Updates `path-to-regexp` from 0.1.7 to 0.1.10
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.7...v0.1.10)

Updates `send` from 0.17.1 to 0.18.0
- [Release notes](https://github.com/pillarjs/send/releases)
- [Changelog](https://github.com/pillarjs/send/blob/master/HISTORY.md)
- [Commits](https://github.com/pillarjs/send/compare/0.17.1...0.19.0)

Updates `serve-static` from 1.14.1 to 1.16.0
- [Release notes](https://github.com/expressjs/serve-static/releases)
- [Changelog](https://github.com/expressjs/serve-static/blob/v1.16.2/HISTORY.md)
- [Commits](https://github.com/expressjs/serve-static/compare/v1.14.1...v1.16.2)

Updates `word-wrap` from 1.2.3 to 1.2.5
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5)

Updates `mongodb` from 3.6.3 to 3.6.10
- [Release notes](https://github.com/mongodb/node-mongodb-native/releases)
- [Changelog](https://github.com/mongodb/node-mongodb-native/blob/main/HISTORY.md)
- [Commits](https://github.com/mongodb/node-mongodb-native/compare/v3.6.3...v3.6.10)

Updates `mongoose` from 5.11.9 to 5.13.20
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/5.11.9...5.13.20)

Updates `get-func-name` from 2.0.0 to 2.0.2
- [Release notes](https://github.com/chaijs/get-func-name/releases)
- [Commits](https://github.com/chaijs/get-func-name/commits/v2.0.2)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: body-parser
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: express
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: braces
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: react-scripts
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: cookie
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: ejs
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: express
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: glob-parent
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: immer
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: micromatch
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: path-to-regexp
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: postcss
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: rollup
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: semver
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: send
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: serve-static
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: webpack-dev-middleware
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: word-wrap
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: ws
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: body-parser
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: braces
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: express
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: glob-parent
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: micromatch
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: path-to-regexp
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: send
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: serve-static
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: word-wrap
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: mongodb
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: mongoose
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: get-func-name
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-08 18:09:03 +00:00
Riccardo
0ee1ce6fb8 Removed unused authentication and product code 2022-07-15 23:12:37 +02:00
Riccardo
36a945e175 Removed commented code 2022-07-15 22:58:56 +02:00
26 changed files with 31639 additions and 27524 deletions

30042
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@
"react-dom": "^17.0.1", "react-dom": "^17.0.1",
"react-router": "^5.2.0", "react-router": "^5.2.0",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"react-scripts": "4.0.1", "react-scripts": "5.0.1",
"subscriptions-transport-ws": "^0.9.18", "subscriptions-transport-ws": "^0.9.18",
"web-vitals": "^0.2.4" "web-vitals": "^0.2.4"
}, },

View File

@@ -1,11 +1,9 @@
import React from 'react'; import React from 'react';
import Header from './layout/Header'; import Header from './layout/Header';
import Login from './Login';
import AppointmentList from './appointment/AppointmentList'; import AppointmentList from './appointment/AppointmentList';
import CreateAppointment from './appointment/CreateAppointment'; import CreateAppointment from './appointment/CreateAppointment';
import UpdateAppointemnt from './appointment/UpdateAppointment'; import UpdateAppointemnt from './appointment/UpdateAppointment';
import Calendar from './Calendar'; import Calendar from './Calendar';
import Search from './Search';
import { Switch, Route } from 'react-router-dom'; import { Switch, Route } from 'react-router-dom';
const App = () => { const App = () => {
@@ -17,9 +15,7 @@ const App = () => {
<Route exact path="/" component={AppointmentList} /> <Route exact path="/" component={AppointmentList} />
<Route exact path="/create" component={CreateAppointment} /> <Route exact path="/create" component={CreateAppointment} />
<Route exact path="/update/:_id" component={UpdateAppointemnt} /> <Route exact path="/update/:_id" component={UpdateAppointemnt} />
<Route exact path="/login" component={Login} />
<Route exact path="/calendar" component={Calendar} /> <Route exact path="/calendar" component={Calendar} />
<Route exact path="/search" component={Search} />
</Switch> </Switch>
</div> </div>
</div> </div>
@@ -27,42 +23,3 @@ const App = () => {
}; };
export default App; export default App;
// // import logo from './../logo.svg';
// // import './../styles/App.css';
// import React, { Component } from 'react';
// import AppointmentList from './AppointmentList';
// import CreateAppointment from './CreateAppointment'
// // import Header from './Header';
// import Login from './Login'
// import Search from './Search';
// import { Redirect, Route, Switch } from 'react-router-dom';
// const App = () => {
// return (
// <div className="center w85">
// <Header />
// <div className="ph3 pv1 background-gray">
// <Switch>
// <Route exact path="/" component={AppointmentList} />
// <Route
// exact
// path="/create"
// component={CreateAppointment}
// />
// <Route exact path="/login" component={Login} />
// <Route exact path="/search" component={Search} />
// <Route
// exact
// path="/new/:page"
// component={AppointmentList}
// />
// </Switch>
// </div>
// </div>
// );
// };
// export default App;

View File

@@ -1,133 +0,0 @@
import React, { useState } from 'react';
import { useHistory } from 'react-router';
import { useMutation, gql } from '@apollo/client';
import { AUTH_TOKEN } from '../constants';
const SIGNUP_MUTATION = gql`
mutation SignupMutation(
$email: String!
$password: String!
$name: String!
) {
signup(
email: $email
password: $password
username: $name
) {
token
}
}
`;
const LOGIN_MUTATION = gql`
mutation LoginMutation(
$email: String!
$password: String!
) {
login(email: $email, password: $password) {
token
}
}
`;
const Login = () => {
const history = useHistory();
const [formState, setFormState] = useState({
login: true,
email: '',
password: '',
name: ''
});
const [login] = useMutation(LOGIN_MUTATION, {
variables: {
email: formState.email,
password: formState.password
},
onCompleted: ({ login }) => {
localStorage.setItem(AUTH_TOKEN, login.token);
history.push('/');
}
});
const [signup] = useMutation(SIGNUP_MUTATION, {
variables: {
name: formState.name,
email: formState.email,
password: formState.password
},
onCompleted: ({ signup }) => {
localStorage.setItem(AUTH_TOKEN, signup.token);
history.push('/');
}
});
return (
<div>
<h4 className="mv3">
{formState.login ? 'Login' : 'Sign Up'}
</h4>
<div className="flex flex-column">
{!formState.login && (
<input
value={formState.name}
onChange={(e) =>
setFormState({
...formState,
name: e.target.value
})
}
type="text"
placeholder="Your name"
/>
)}
<input
value={formState.email}
onChange={(e) =>
setFormState({
...formState,
email: e.target.value
})
}
type="text"
placeholder="Your email address"
/>
<input
value={formState.password}
onChange={(e) =>
setFormState({
...formState,
password: e.target.value
})
}
type="password"
placeholder="Choose a safe password"
/>
</div>
<div className="flex mt3">
<button
className="pointer mr2 button"
onClick={formState.login ? login : signup}
>
{formState.login ? 'login' : 'create account'}
</button>
<button
className="pointer button"
onClick={(e) =>
setFormState({
...formState,
login: !formState.login
})
}
>
{formState.login
? 'need to create an account?'
: 'already have an account?'}
</button>
</div>
</div>
);
};
export default Login;

View File

@@ -1,39 +1,46 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useLazyQuery } from '@apollo/client'; import { useLazyQuery } from '@apollo/client';
import gql from 'graphql-tag'; import gql from 'graphql-tag';
import Appointment from './appointment/Appointment';
const FEED_SEARCH_QUERY = gql` const FEED_SEARCH_QUERY = gql`
query FeedSearchQuery($filter: String!) { query FeedSearchQuery($filter: String!) {
feed(filter: $filter) { feed(filter: $filter) {
id id
appointments { links {
_id id
title title
description description
type
} }
} }
} }
`; `;
const Search = () => { const Search = () => {
const [searchFilter, setSearchFilter] = useState(''); const [searchFilter, setSearchFilter] = useState('');
const [executeSearch, { data }] = useLazyQuery( const [executeSearch, { data }] = useLazyQuery(
FEED_SEARCH_QUERY FEED_SEARCH_QUERY
); );
return ( return (
<> <>
<div> <div>
Search Search
<input type="text" onChange={(e) => setSearchFilter(e.target.value)}/> <input
<button onClick={() => executeSearch({ variables: { filter: searchFilter } })}>OK</button> type="text"
</div> onChange={(e) => setSearchFilter(e.target.value)}
{data && />
data.feed.appointments.map((appointment, index) => ( <button
<Appointment key={appointment.id} appointment={appointment} index={index} /> onClick={() =>
))} executeSearch({
</> variables: { filter: searchFilter }
); })
}
>
OK
</button>
</div>
</>
);
}; };
export default Search; export default Search;

View File

@@ -21,116 +21,18 @@ const Appointment = (props) => {
onCompleted: () => history.push('/') onCompleted: () => history.push('/')
}) })
// const updateAppointment = () => { const updateAppointment = () => {
// let path = `/update/${appointment._id}`; let path = `/update/${appointment._id}`;
// history.push(path); history.push(path);
// } }
return ( return (
<div> <div>
<div> <div>
<b>{appointment.title}</b> starts at {appointment.start}, ends at {appointment.end}. It is described as "{appointment.description}"<button onClick={deleteAppointment}>DELETE</button> <b>{appointment.title}</b> starts at {appointment.start}, ends at {appointment.end}. It is described as "{appointment.description}"<button onClick={deleteAppointment}>DELETE</button><button onClick={updateAppointment}>EDIT</button>
{/* <button onClick={updateAppointment}>EDIT</button> */}
</div> </div>
</div> </div>
); );
}; };
export default Appointment; export default Appointment;
// import { AUTH_TOKEN, APPOINTMENTS_PER_PAGE } from '../constants';
// import { timeDifferenceForDate } from '../utils'
// import { FEED_QUERY } from './AppointmentList'
// const FOLLOW_MUTATION = gql`
// mutation FollowMutation($appointmentId: ID!) {
// follow(followId: $followId) {
// id
// appointment {
// id
// follows {
// id
// user {
// id
// }
// }
// }
// user {
// id
// }
// }
// }
// `;
// const take = APPOINTMENTS_PER_PAGE;
// const skip = 0;
// const orderBy = { createdAt: 'desc' };
// const Appointment = (props) => {
// const { appointment } = props;
// const authToken = localStorage.getItem(AUTH_TOKEN);
// const take = APPOINTMENTS_PER_PAGE;
// const skip = 0;
// const orderBy = { createdAt: 'desc' };
// const [follow] = useMutation(FOLLOW_MUTATION, {
// variables: {
// appointmentId: appointment.id
// },
// update(cache, { data: { follow } }) {
// const { feed } = cache.readQuery({
// query: FEED_QUERY
// });
// const updatedAppointments = feed.follows.map((feedFollow) => {
// if (feedFollow.id === appointment.id) {
// return {
// ...feedFollow,
// follows: [...feedFollow.follows, follow]
// };
// }
// return feedFollow;
// });
// cache.writeQuery({
// query: FEED_QUERY,
// data: {
// feed: {
// appointments: updatedAppointments
// }
// }
// });
// }
// });
// return (
// <div className="flex mt2 items-start">
// <div className="flex items-center">
// <span className="gray">{props.index + 1}.</span>
// {authToken && (
// <div
// className="ml1 gray f11"
// style={{ cursor: 'pointer' }}
// onClick={follow}
// >
// ▲
// </div>
// )}
// </div>
// <div className="ml1">
// <div>
// {appointment.title} ({appointment.description})
// </div>
// {authToken && (
// <div className="f6 lh-copy gray">
// {appointment.follows.length} follows | by{' '}
// {follow.createdBy ? follow.createdBy.name : 'Unknown'}{' '}
// {timeDifferenceForDate(appointment.createdAt)}
// </div>
// )}
// </div>
// </div>
// );
// };
// export default Appointment;

View File

@@ -16,7 +16,7 @@ export const APPOINTMENTS_QUERY = gql`
const AppointmentList = () => { const AppointmentList = () => {
const { data } = useQuery(APPOINTMENTS_QUERY); const { data, loading } = useQuery(APPOINTMENTS_QUERY);
if (data !== undefined) { if (data !== undefined) {
return ( return (
@@ -39,175 +39,3 @@ const AppointmentList = () => {
}; };
export default AppointmentList; export default AppointmentList;
// import { useHistory } from 'react-router';
// import { APPOINTMENTS_PER_PAGE } from '../constants';
// import { Link } from 'react-router-dom';
// export const FEED_QUERY = gql`
// query AppointmentManyQuery(
// $take: Int
// $skip: Int
// $orderBy: AppointmentOrderByInput
// ) {
// appointmentMany(take: $take, skip: $skip, orderBy: $orderBy) {
// id
// appointments {
// id
// createdAt
// title
// # start
// # end
// description
// # createdBy {
// # id
// # name
// # }
// # follows {
// # id
// # user {
// # id
// # }
// # }
// }
// count
// }
// }
// `;
// // const NEW_APPOINTMENTS_SUBSCRIPTION = gql`
// // subscription {
// // newAppointment {
// // id
// // url
// // description
// // createdAt
// // createdBy {
// // id
// // name
// // }
// // follows {
// // id
// // user {
// // id
// // }
// // }
// // }
// // }
// // `;
// const getQueryVariables = (isNewPage, page) => {
// const skip = isNewPage ? (page - 1) * APPOINTMENTS_PER_PAGE : 0;
// const take = isNewPage ? APPOINTMENTS_PER_PAGE : 100;
// const orderBy = { createdAt: 'desc' };
// return { take, skip, orderBy };
// };
// const AppointmentList = () => {
// const history = useHistory();
// const isNewPage = history.location.pathname.includes(
// 'new'
// );
// const pageIndexParams = history.location.pathname.split(
// '/'
// );
// const page = parseInt(
// pageIndexParams[pageIndexParams.length - 1]
// );
// const pageIndex = page ? (page - 1) * APPOINTMENTS_PER_PAGE : 0;
// const {
// data,
// loading,
// error,
// subscribeToMore
// } = useQuery(FEED_QUERY, {
// variables: getQueryVariables(isNewPage, page)
// });
// // const { data } = useQuery(FEED_QUERY);
// const getAppointmentsToRender = (isNewPage, data) => {
// if (isNewPage) {
// return data.feed.appointments;
// }
// const rankedAppointments = data.feed.appointments.slice();
// rankedAppointments.sort(
// (l1, l2) => l2.follows.length - l1.follows.length
// );
// return rankedAppointments;
// };
// // subscribeToMore({
// // document: NEW_APPOINTMENTS_SUBSCRIPTION,
// // updateQuery: (prev, { subscriptionData }) => {
// // if (!subscriptionData.data) return prev;
// // const newAppointment = subscriptionData.data.newAppointment;
// // const exists = prev.feed.appointments.find(
// // ({ id }) => id === newAppointment.id
// // );
// // if (exists) return prev;
// // return Object.assign({}, prev, {
// // feed: {
// // appointments: [newAppointment, ...prev.feed.appointments],
// // count: prev.feed.appointments.length + 1,
// // __typename: prev.feed.__typename
// // }
// // });
// // }
// // });
// return (
// <>
// {loading && <p>Loading...</p>}
// {error && <pre>{JSON.stringify(error, null, 2)}</pre>}
// {data && (
// <>
// {getAppointmentsToRender(isNewPage, data).map(
// (appointment, index) => (
// <Link
// key={appointment.id}
// link={appointment}
// index={index + pageIndex}
// />
// )
// )}
// {isNewPage && (
// <div className="flex ml4 mv3 gray">
// <div
// className="pointer mr2"
// onClick={() => {
// if (page > 1) {
// history.push(`/new/${page - 1}`);
// }
// }}
// >
// Previous
// </div>
// <div
// className="pointer"
// onClick={() => {
// if (
// page <=
// data.feed.count / APPOINTMENTS_PER_PAGE
// ) {
// const nextPage = page + 1;
// history.push(`/new/${nextPage}`);
// }
// }}
// >
// Next
// </div>
// </div>
// )}
// </>
// )}
// </>
// );
// };
// export default AppointmentList;

View File

@@ -1,8 +1,6 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useHistory } from 'react-router'; import { useHistory } from 'react-router';
import { useMutation, gql } from '@apollo/client'; import { useMutation, gql } from '@apollo/client';
import { APPOINTMENTS_PER_PAGE } from '../../constants';
import { APPOINTMENTS_QUERY } from './AppointmentList';
import Datetime from 'react-datetime'; import Datetime from 'react-datetime';
import "react-datetime/css/react-datetime.css"; import "react-datetime/css/react-datetime.css";
@@ -43,34 +41,6 @@ const CreateAppointment = () => {
start: formState.start, start: formState.start,
end: formState.end end: formState.end
}, },
update: (cache, { data: { createAppointment } }) => {
const take = APPOINTMENTS_PER_PAGE;
const skip = 0;
const orderBy = { createdAt: 'desc' };
const data = cache.readQuery({
query: APPOINTMENTS_QUERY,
variables: {
take,
skip,
orderBy
}
});
cache.writeQuery({
query: APPOINTMENTS_QUERY,
data: {
allAppointments: {
appointments: [createAppointment, ...data.allAppointments]
}
},
variables: {
take,
skip,
orderBy
}
});
},
onCompleted: () => history.push('/') onCompleted: () => history.push('/')
}); });

View File

@@ -1,8 +1,6 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useHistory } from 'react-router'; import { useHistory } from 'react-router';
import { useMutation, gql, useQuery } from '@apollo/client'; import { useMutation, gql, useQuery } from '@apollo/client';
// import { APPOINTMENTS_PER_PAGE } from '../../constants';
// import { APPOINTMENTS_QUERY } from './AppointmentList';
import Datetime from 'react-datetime'; import Datetime from 'react-datetime';
import "react-datetime/css/react-datetime.css"; import "react-datetime/css/react-datetime.css";
@@ -74,10 +72,6 @@ const UpdateAppointment = ({ match: { params: { _id } } }) => {
if (data === undefined) { if (data === undefined) {
return <div>Loading...</div> return <div>Loading...</div>
} else { } else {
// setFormState({
// formState.title= data.oneAppointment.title
// })
return ( return (
<div> <div>
<form <form
@@ -95,16 +89,10 @@ const UpdateAppointment = ({ match: { params: { _id } } }) => {
type="text" type="text"
/> />
<input <input
readOnly
className="mb2" className="mb2"
value={formState.title} value={data.oneAppointment.title}
onChange={(e) =>
setFormState({
...formState,
title: e.target.value
})
}
type="text" type="text"
placeholder="Input title"
/> />
<input <input
className="mb2" className="mb2"

View File

@@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import { useHistory } from 'react-router'; import { useHistory } from 'react-router';
import { Link } from 'react-router-dom'; import { Link, withRouter } from 'react-router-dom';
import { AUTH_TOKEN } from '../../constants'; import { AUTH_TOKEN } from '../../constants';
const Header = () => { const Header = () => {
@@ -17,21 +17,6 @@ const Header = () => {
<div className="flex flex-fixed"> <div className="flex flex-fixed">
<Link to="/create" className="ml1 no-underline black">New</Link> <Link to="/create" className="ml1 no-underline black">New</Link>
</div> </div>
{/* <div className="flex flex-fixed">
<Link to="/search" className="ml1 no-underline black">Search</Link>
</div> */}
<div className="flex flex-fixed">
{authToken ? (
<div className="ml1 pointer black"
onClick={() => {
localStorage.removeItem(AUTH_TOKEN);
history.push(`/`);
}}
>Logout</div>
) : (
<Link to="/login" className="ml1 no-underline black">Login</Link>
)}
</div>
</div> </div>
); );
}; };

View File

@@ -5,8 +5,6 @@ import { AUTH_TOKEN } from './constants';
import App from './components/App'; import App from './components/App';
import { BrowserRouter } from 'react-router-dom'; import { BrowserRouter } from 'react-router-dom';
import { setContext } from '@apollo/client/link/context'; import { setContext } from '@apollo/client/link/context';
// import * as serviceWorker from './serviceWorker';
import { import {
ApolloProvider, ApolloProvider,
ApolloClient, ApolloClient,
@@ -15,7 +13,7 @@ import {
} from '@apollo/client'; } from '@apollo/client';
const httpLink = createHttpLink({ const httpLink = createHttpLink({
uri: 'http://localhost:4000/graphql' uri: 'http://localhost:4000/djhb58fytkh476dk45yh49'
}); });
const authLink = setContext((_, { headers }) => { const authLink = setContext((_, { headers }) => {
@@ -41,37 +39,3 @@ ReactDOM.render(
</BrowserRouter>, </BrowserRouter>,
document.getElementById('root') document.getElementById('root')
); );
// serviceWorker.unregister();
// import { split } from '@apollo/client';
// import { WebSocketLink } from '@apollo/client/link/ws';
// import { getMainDefinition } from '@apollo/client/utilities';
// // import AppointmentList from './components/AppointmentList';
// // export default App;
// const wsLink = new WebSocketLink({
// uri: `ws://localhost:4000/graphql`,
// options: {
// reconnect: true,
// connectionParams: {
// authToken: localStorage.getItem(AUTH_TOKEN)
// }
// }
// });
// const link = split(
// ({ query }) => {
// const { kind, operation } = getMainDefinition(query);
// return (
// kind === 'OperationDefinition' &&
// operation === 'subscription'
// );
// },
// wsLink,
// authLink.concat(httpLink)
// );
// // reportWebVitals();

File diff suppressed because it is too large Load Diff

View File

@@ -13,29 +13,29 @@
"@babel/node": "^7.12.10", "@babel/node": "^7.12.10",
"@babel/preset-env": "^7.12.11", "@babel/preset-env": "^7.12.11",
"apollo-engine": "^1.1.2", "apollo-engine": "^1.1.2",
"apollo-server": "^2.19.0", "apollo-server": "^3.13.0",
"apollo-server-express": "^2.19.1", "apollo-server-express": "^2.19.1",
"bcrypt": "^5.0.0", "bcrypt": "^5.0.0",
"bcryptjs": "2.4.3", "bcryptjs": "2.4.3",
"body-parser": "^1.19.0", "body-parser": "^1.20.3",
"chai": "^4.2.0", "chai": "^4.2.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"dotenv": "^8.2.0", "dotenv": "^8.2.0",
"esm": "^3.2.25", "esm": "^3.2.25",
"express": "^4.17.1", "express": "^4.20.0",
"express-graphql": "*", "express-graphql": "^0.12.0",
"graphql": "*", "graphql": "^15.4.0",
"graphql-compose": "*", "graphql-compose": "^7.23.0",
"graphql-compose-connection": "*", "graphql-compose-connection": "^8.0.1",
"graphql-compose-mongoose": "*", "graphql-compose-mongoose": "^9.0.0",
"graphql-depth-limit": "*", "graphql-depth-limit": "^1.1.0",
"graphql-middleware": "*", "graphql-middleware": "^6.0.0",
"graphql-tools": "*", "graphql-tools": "^7.0.2",
"jsonwebtoken": "8.5.1", "jsonwebtoken": "9.0.0",
"migrate": "^1.7.0", "migrate": "^1.7.0",
"mocha": "^8.2.1", "mocha": "^8.2.1",
"mongodb": "^3.6.3", "mongodb": "^3.6.10",
"mongoose": "^5.11.9", "mongoose": "^6.13.6",
"mongoose-bcrypt": "^1.9.0", "mongoose-bcrypt": "^1.9.0",
"mongoose-timestamp": "^0.6.0", "mongoose-timestamp": "^0.6.0",
"node-migrate": "^0.1.0" "node-migrate": "^0.1.0"
@@ -55,4 +55,4 @@
"nodemon": "^2.0.6", "nodemon": "^2.0.6",
"prettier": "^2.2.1" "prettier": "^2.2.1"
} }
} }

View File

@@ -9,7 +9,6 @@ import './utils/db.js';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import cors from 'cors'; import cors from 'cors';
import jwt from 'jsonwebtoken';
const moduleURL = new URL(import.meta.url); const moduleURL = new URL(import.meta.url);
const __dirname = path.dirname(moduleURL.pathname); const __dirname = path.dirname(moduleURL.pathname);
@@ -18,33 +17,10 @@ const pubsub = new PubSub();
dotenv.config(); dotenv.config();
function getTokenPayload(token) {
return jwt.verify(token, process.env.APP_SECRET);
}
function getUserId(req, authToken) {
if (req) {
const authHeader = req.headers.authorization;
if (authHeader) {
const token = authHeader.replace('Bearer ', '');
if (!token) {
throw new Error('No token found');
}
const { userId } = getTokenPayload(token);
return userId;
}
} else if (authToken) {
const { userId } = getTokenPayload(authToken);
return userId;
}
throw new Error('Not authenticated');
}
app.use(cors()); app.use(cors());
app.use('/graphql', graphqlHTTP({ app.use('/djhb58fytkh476dk45yh49', graphqlHTTP({
schema, schema: schema,
validationRules: [depthLimit(3)], validationRules: [depthLimit(3)],
graphiql: true graphiql: true
})); }));
@@ -54,33 +30,13 @@ const server = new ApolloServer({
path.join(__dirname, 'schema.graphql'), path.join(__dirname, 'schema.graphql'),
'utf8' 'utf8'
), ),
// schema,
cors: true, cors: true,
playground: process.env.NODE_ENV === 'development' ? true : false, playground: process.env.NODE_ENV === 'development' ? true : false,
context: ({ req }) => ({ context: ({ req }) => {
return {
...req, ...req,
mongoose, mongoose,
pubsub, pubsub
userId:
req && req.headers.authorization
? getUserId(req)
: null
}),
subscriptions: {
onConnect: (connectionParams) => {
if (connectionParams.authToken) {
return {
mongoose,
userId: getUserId(
null,
connectionParams.authToken
)
};
} else {
return {
mongoose
};
}
} }
}, },
introspection: true, introspection: true,
@@ -93,7 +49,6 @@ server.applyMiddleware({
path: '/', path: '/',
cors: true, cors: true,
onHealthCheck: () => onHealthCheck: () =>
// eslint-disable-next-line no-undef
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
if (mongoose.connection.readyState > 0) { if (mongoose.connection.readyState > 0) {
resolve(); resolve();
@@ -104,5 +59,6 @@ server.applyMiddleware({
}); });
app.listen({ port: process.env.PORT }, () => { app.listen({ port: process.env.PORT }, () => {
console.log(`Server listening on port ${process.env.PORT}`); console.log(`🚀 Server listening on port ${process.env.PORT}`);
console.log(`😷 Health checks available at ${process.env.HEALTH_ENDPOINT}`);
}); });

View File

@@ -24,11 +24,6 @@ const AppointmentSchema = new Schema({
deleted: { deleted: {
type: Boolean, type: Boolean,
required: false required: false
},
user: {
type: mongoose.Schema.Types.ObjectId,
ref: "user",
required: false
} }
}); });
export default mongoose.model('appointment', AppointmentSchema); export default mongoose.model('appointment', AppointmentSchema);

View File

@@ -1,33 +0,0 @@
import mongoose from 'mongoose';
import bcrypt from 'bcrypt';
const Schema = mongoose.Schema;
const UserSchema = new Schema({
username: {
type: String,
required: true
},
email: {
type: String,
required: true
},
password: {
type: String,
required: true
},
deleted: {
type: Boolean,
required: false
}
});
// hash the password
UserSchema.methods.generateHash = function (password) {
return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
};
// checking if password is valid
UserSchema.methods.validPassword = function (password) {
return bcrypt.compareSync(password, this.password);
};
export default mongoose.model('user', UserSchema);

View File

@@ -1,65 +1,32 @@
import Appointment from './models/appointment.js'; import Appointment from './models/appointment.js';
import User from './models/user.js';
import jwt from 'jsonwebtoken';
import { createAppointment } from './resolvers/Mutation';
export const resolvers = { export const resolvers = {
Query: { Query: {
async allAppointments() { async allAppointments() {
return await Appointment.find({ deleted: false }); return await Appointment.find({ deleted: false })
}, },
async oneAppointment(root, args) { async oneAppointment(root, args, context, info) {
return await Appointment.findOne({ return await Appointment.findOne({
_id: args._id _id: args._id
}); });
}, },
async allUsers() {
return await User.find();
},
}, },
Mutation: { Mutation: {
async signup(root, args) { async createAppointment(parent, args, context, info) {
const user = await User.create(args); console.log(context);
user.password = user.generateHash(args.password); args.deleted = false;
user.save(); return await Appointment.create(args);
const token = jwt.sign({ userId: user.id }, process.env.APP_SECRET);
return {
token,
user
};
}, },
async updateAppointment(parent, args, context, info) {
async login(parent, args) { console.log(args);
const user = await User.findOne({
email: args.email
});
if (!user) {
throw new Error('No such user found');
}
if (!user.validPassword(args.password)) {
throw new Error('Invalid password');
}
const token = jwt.sign({ userId: user.id }, process.env.APP_SECRET);
return {
token,
user
};
},
async createAppointment(parent, args, context) {
return await createAppointment(parent, args, context);
},
async updateAppointment(parent, args) {
return await Appointment.findOneAndUpdate({ return await Appointment.findOneAndUpdate({
args args
}, args, { }, args, {
new: true new: true
}); })
} },
async deleteAppointment(parent, args, context, info) {
return await Appointment.findOneAndUpdate({ _id: args._id }, { deleted: true })
},
} }
}; };

View File

@@ -4,13 +4,6 @@ function createdBy(parent, args, context) {
.createdBy(); .createdBy();
} }
function follows(parent, args, context) {
return context.mongo.appointment
.findUnique({ where: { id: parent.id } })
.follows();
}
module.exports = { module.exports = {
createdBy, createdBy
follows
}; };

View File

@@ -1,16 +0,0 @@
function appointment(parent, args, context) {
return context.mongo.follow
.findUnique({ where: { id: parent.id } })
.appointment();
}
function user(parent, args, context) {
return context.mongo.follow
.findUnique({ where: { id: parent.id } })
.user();
}
module.exports = {
appointment,
user
};

View File

@@ -1,87 +1,14 @@
const bcrypt = require('bcryptjs'); function createAppointment(parent, args, context, info) {
const jwt = require('jsonwebtoken'); const newAppointment = context.mongo.appointment.create({
import dotenv from 'dotenv';
import appointment from '../models/appointment';
dotenv.config();
async function createAppointment(parent, args, context) {
const { userId } = context;
args.deleted = false;
args.createdBy = userId;
console.log(parent, args, context);
return await appointment.create(args);
}
async function signup(parent, args, context) {
const password = await bcrypt.hash(args.password, 10);
const user = await context.mongo.user.create({
data: { ...args, password }
});
const token = jwt.sign({ userId: user.id }, process.env.APP_SECRET);
return {
token,
user
};
}
async function login(parent, args, context) {
const user = await context.mongo.user.findUnique({
where: { email: args.email }
});
if (!user) {
throw new Error('No such user found');
}
const valid = await bcrypt.compare(
args.password,
user.password
);
if (!valid) {
throw new Error('Invalid password');
}
const token = jwt.sign({ userId: user.id }, process.env.APP_SECRET);
return {
token,
user
};
}
async function follow(parent, args, context) {
const { userId } = context;
const follow = await context.mongo.follow.findUnique({
where: {
linkId_userId: {
linkId: Number(args.linkId),
userId
}
}
});
if (follow) {
throw new Error(
`Already followed the appointment: ${args.linkId}`
);
}
const newFollow = context.mongo.follow.create({
data: { data: {
user: { connect: { id: userId } }, title: args.title,
link: { connect: { id: Number(args.linkId) } } description: args.description
} }
}); });
context.pubsub.publish('NEW_FOLLOW', newFollow);
return newFollow; return newAppointment;
} }
module.exports = { module.exports = {
createAppointment, createAppointment
signup,
login,
follow
}; };

View File

@@ -1,4 +1,4 @@
async function feed(parent, args, context) { async function feed(parent, args, context, info) {
const where = args.filter const where = args.filter
? { ? {

View File

@@ -1,22 +1,14 @@
function newAppointmentSubscribe(parent, args, context) { function newLinkSubscribe(parent, args, context, info) {
return context.pubsub.asyncIterator("NEW_APPOINTMENT"); return context.pubsub.asyncIterator("NEW_LINK")
} }
const newAppointment = { const newAppointment = {
subscribe: newAppointmentSubscribe, subscribe: newLinkSubscribe,
resolve: payload => payload, resolve: payload => {
}; return payload
},
function newFollowSubscribe(parent, args, context) {
return context.pubsub.asyncIterator("NEW_FOLLOW");
} }
const newFollow = {
subscribe: newFollowSubscribe,
resolve: payload => payload,
};
module.exports = { module.exports = {
newAppointment, newAppointment,
newFollow }
};

View File

@@ -8,8 +8,6 @@ type Query {
): Feed! ): Feed!
allAppointments: [Appointment] allAppointments: [Appointment]
oneAppointment(_id: ID!): Appointment oneAppointment(_id: ID!): Appointment
allUsers: [User]
users: [User!]!
} }
type Feed { type Feed {
@@ -37,33 +35,10 @@ type Mutation {
deleted: Boolean deleted: Boolean
): Appointment ): Appointment
deleteAppointment(_id: ID!): Appointment deleteAppointment(_id: ID!): Appointment
signup(email: String!, password: String!, username: String!): AuthPayload
login(email: String!, password: String!): AuthPayload
follow(appointmentId: ID!): Follow
} }
type Subscription { type Subscription {
newAppointment: Appointment newAppointment: Appointment
newFollow: Follow
}
#User Schemas
type User {
_id: ID!
username: String!
email: String!
password: String!
appointments: [Appointment!]!
}
input UserInput {
username: String!
email: String!
password: String!
appointments: [AppointmentInput!]!
}
type AuthPayload {
token: String
user: User
} }
# Appointment schemas # Appointment schemas
@@ -75,8 +50,6 @@ type Appointment {
start: DateTime! start: DateTime!
end: DateTime! end: DateTime!
deleted: Boolean deleted: Boolean
createdBy: User
# follows: [Follow!]!
} }
input AppointmentInput { input AppointmentInput {
title: String! title: String!
@@ -91,13 +64,6 @@ input AppointmentOrderByInput {
desc: Sort desc: Sort
} }
# Follow schemas
type Follow {
_id: ID!
appointment: Appointment!
user: User!
}
# General-purpose schemas # General-purpose schemas
enum Sort { enum Sort {
asc asc

View File

@@ -1,31 +1,5 @@
import jwt from 'jsonwebtoken'; const APP_SECRET = 'GraphQL-is-aw3some';
import dotenv from 'dotenv';
dotenv.config();
function getTokenPayload(token) {
return jwt.verify(token, process.env.APP_SECRET);
}
function getUserId(req, authToken) {
if (req) {
const authHeader = req.headers.authorization;
if (authHeader) {
const token = authHeader.replace('Bearer ', '');
if (!token) {
throw new Error('No token found');
}
const { userId } = getTokenPayload(token);
return userId;
}
} else if (authToken) {
const { userId } = getTokenPayload(authToken);
return userId;
}
throw new Error('Not authenticated');
}
module.exports = { module.exports = {
getUserId APP_SECRET
}; };

View File

@@ -1,7 +1,4 @@
// const mongoose = require("mongoose");
import mongoose from 'mongoose'; import mongoose from 'mongoose';
// const dotenv = require("../../.env");
import dotenv from 'dotenv'; import dotenv from 'dotenv';
dotenv.config(); dotenv.config();

File diff suppressed because it is too large Load Diff