Skip to content

Commit

Permalink
Talawa api typescript migration (#780)
Browse files Browse the repository at this point in the history
* Removed package easygraphql-tester (#747)

Removed the package named easygraphql-tester because it was not being used anywhere in the app and had a security vulnerability.

* Revert "Removed package easygraphql-tester (#747)" (#753)

This reverts commit 61818a1.

* Bump moment-timezone from 0.5.34 to 0.5.37 (#757)

Bumps [moment-timezone](https://github.com/moment/moment-timezone) from 0.5.34 to 0.5.37.
- [Release notes](https://github.com/moment/moment-timezone/releases)
- [Changelog](https://github.com/moment/moment-timezone/blob/develop/changelog.md)
- [Commits](moment/moment-timezone@0.5.34...0.5.37)

---
updated-dependencies:
- dependency-name: moment-timezone
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Doubled the number of retries

The tests have been failing due to timeouts.

* add mongodb credentials in github actions yml file

* update github actions mongodb parameters

* update variable names in github actions

* update github actions push file

* revert github actions push file

* add start period for health check in github actions

* add extra health check parameters for mongo

* adjust mongo image version

* explicitly add mongo version to image for github actions

* Removed package easygraphql-tester (#754)

* Code Coverage : Tests for groups.js Fix #585 (#769)

* Create groups.spec.js

* Update groups.spec.js

* Update getPlugins.spec.js

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Bump jose from 2.0.5 to 2.0.6 (#770)

Bumps [jose](https://github.com/panva/jose) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/panva/jose/releases)
- [Changelog](https://github.com/panva/jose/blob/v2.0.6/CHANGELOG.md)
- [Commits](panva/jose@v2.0.5...v2.0.6)

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

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump file-type and image-hash (#752)

Bumps [file-type](https://github.com/sindresorhus/file-type) and [image-hash](https://github.com/danm/image-hash). These dependencies needed to be updated together.

Updates `file-type` from 14.7.1 to 16.5.4
- [Release notes](https://github.com/sindresorhus/file-type/releases)
- [Commits](sindresorhus/file-type@v14.7.1...v16.5.4)

Updates `image-hash` from 4.0.1 to 5.3.1
- [Release notes](https://github.com/danm/image-hash/releases)
- [Commits](https://github.com/danm/image-hash/commits)

---
updated-dependencies:
- dependency-name: file-type
  dependency-type: indirect
- dependency-name: image-hash
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump got and nodemon (#771)

Bumps [got](https://github.com/sindresorhus/got) and [nodemon](https://github.com/remy/nodemon). These dependencies needed to be updated together.

Removes `got`

Updates `nodemon` from 2.0.15 to 2.0.20
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](remy/nodemon@v2.0.15...v2.0.20)

---
updated-dependencies:
- dependency-name: got
  dependency-type: indirect
- dependency-name: nodemon
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vm2 from 3.9.9 to 3.9.11 (#772)

Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.9 to 3.9.11.
- [Release notes](https://github.com/patriksimek/vm2/releases)
- [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md)
- [Commits](patriksimek/vm2@3.9.9...3.9.11)

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

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Feature Request :  Performing Donations ( Ability to store donation transaction in Talwa-api )  (#756)

* Test : lib/resolvers/group_chat_query/groupChatMessages.js

* Add Test  : Added Valid JSON Check

* Create README.md

* Create README.md

* Update is-auth.js

* AddedDocs

Docs from withfilter pending

* Update index.js

* completed

* sample

* update/index.js

* update/index.js

* update/is-auth.js

* Update/readme.md

* update/image-readme

* Add/query-schema

* Update/Plugin-graphQL-schema

* Add/Plugin-MongoDB-Model

* Add/createPlugin-and-refractoring

* Add/getPlugins

* Add/Mutation/UpdatePluginStatus

* Add/Mutation/updateTempPluginInstalledOrgs

* Add/Mutation/Schema

* Add/import/mutations

* Add/plugins

* Fix/path-err

* Fix/Erros

* update/lockfile

* Add/plugin-model

* Update is-auth.js

* Removed extra queries

* Documentation added for plugin queries and models

* Fix/`delelte cr in prettier/prettier`

* updated : mutation

* Add/test `getPlugins`

* Fix/`lint error`

* test `updatePluginInstalledOrgs`

* Test/ `updateInstallStatus`

* Fix/Erros-1

* Fix/Erros-2

* Fix/Erros-3

* Test/`Queries.js`

* Test/`Mutation.js`

* remove extra `console.log`

* Delete admin-plugin-query.js

* Delete super-admin-plugin-query.js

* Fix/Package-lock

* Create cancel_membership_request.spec.js

* Update cancel_membership_request.js

* Update cancel_membership_request.spec.js

* Update cancel_membership_request.js

* `Typo`

* Add : Donation Model

* Add : getDonations Query

* Add : Schema for Donation

* Add : Schema for getDonations query

* Add : getDonationById Query

* Add : Schema for getDonationById

* Fix : `Donation Model`

* Add : createDonation Mutation

* Add : createDonation Schema

* Updated Donation Model

* Add :  `createDonation` GraphQL Mutation

* Fix : `getDonationById` Query

* Add : `getDonationByOrgId` Query

* Update : Scehma Updated due to change in `Donation` Model

* Update : `Donation` Schema in .graphql

* Add : `getDonationById` and `getDonationByOrgId` in gql schema

* Add : gql Schema for `DeletePayload`

* Add : `deleteDonationById` Mutation

* Chores : Formatting files

* Fix : Lint errors

* Test for send_membership_request.js (#763)

* test for reject_membership_request.js

* send_membership_request.spec.js initialized

* test for send_membership_request.js

* fixes in test for send membership request

* minor fixes in send_membership_request.spec.js

* 100% test coverage

Co-authored-by: Nishant <[email protected]>

* Talawa api multitenancy (#776)

* Initial setup (#726)

* Initial setup

* simplified creation

* added readme.md file

* added connection manager and id helper functions

* Error handling & security updates (#744)

* [Feature Request] New Features for Talawa-admin added (#725)

* check authentication feature added for talawa admin

* tests for check authentication added

* minor fixes

* typo fixes

* minor fixes

* npm err fixes

* google recaptcha configured

* new dependency added

* mailer, forgotPassword endpoint and otp endpoint is configured

* graphql endpoints updated

* constants updated

* Documentation updated

* tests for changes added

* hard coded value error fixes

* lint fixes

* lint fixes

* failed test cases fixes

* Failed tests fixes

* minor fixes

* marked-teminal dependency updated

* Tests fixes

* tests updated

* tests fixes

* tests updated

* new resolvers added and schema updated

* graphql mutations updated

* tests updated for changes

* tests updated

* tests updated

* tests updated

* minor fixes

* [Feature Request] : Plugin Architecture for Server (#730)

* Test : lib/resolvers/group_chat_query/groupChatMessages.js

* Add Test  : Added Valid JSON Check

* Create README.md

* Create README.md

* Update is-auth.js

* AddedDocs

Docs from withfilter pending

* Update index.js

* completed

* sample

* update/index.js

* update/index.js

* update/is-auth.js

* Update/readme.md

* update/image-readme

* Add/query-schema

* Update/Plugin-graphQL-schema

* Add/Plugin-MongoDB-Model

* Add/createPlugin-and-refractoring

* Add/getPlugins

* Add/Mutation/UpdatePluginStatus

* Add/Mutation/updateTempPluginInstalledOrgs

* Add/Mutation/Schema

* Add/import/mutations

* Add/plugins

* Fix/path-err

* Fix/Erros

* update/lockfile

* Add/plugin-model

* Update is-auth.js

* Removed extra queries

* Documentation added for plugin queries and models

* Fix/`delelte cr in prettier/prettier`

* updated : mutation

* Add/test `getPlugins`

* Fix/`lint error`

* test `updatePluginInstalledOrgs`

* Test/ `updateInstallStatus`

* Fix/Erros-1

* Fix/Erros-2

* Fix/Erros-3

* Test/`Queries.js`

* Test/`Mutation.js`

* remove extra `console.log`

* Delete admin-plugin-query.js

* Delete super-admin-plugin-query.js

* Fix/Package-lock

* added delimiter to helper functions

* error handling for connection manager

* added readme.md for connection manager

* error handling for Database module

Co-authored-by: Asmit Kumar Sirohi <[email protected]>
Co-authored-by: Siddhesh Bhupendra Kuakde <[email protected]>

* Create new tenant on createOrganization

* Custom schema functionality

* Added the context function

* modify createPost resolver

* fix createPost, createOrganization resolvers

* Initial setup (#726)

* Initial setup

* simplified creation

* added readme.md file

* added connection manager and id helper functions

* Error handling & security updates (#744)

* [Feature Request] New Features for Talawa-admin added (#725)

* check authentication feature added for talawa admin

* tests for check authentication added

* minor fixes

* typo fixes

* minor fixes

* npm err fixes

* google recaptcha configured

* new dependency added

* mailer, forgotPassword endpoint and otp endpoint is configured

* graphql endpoints updated

* constants updated

* Documentation updated

* tests for changes added

* hard coded value error fixes

* lint fixes

* lint fixes

* failed test cases fixes

* Failed tests fixes

* minor fixes

* marked-teminal dependency updated

* Tests fixes

* tests updated

* tests fixes

* tests updated

* new resolvers added and schema updated

* graphql mutations updated

* tests updated for changes

* tests updated

* tests updated

* tests updated

* minor fixes

* [Feature Request] : Plugin Architecture for Server (#730)

* Test : lib/resolvers/group_chat_query/groupChatMessages.js

* Add Test  : Added Valid JSON Check

* Create README.md

* Create README.md

* Update is-auth.js

* AddedDocs

Docs from withfilter pending

* Update index.js

* completed

* sample

* update/index.js

* update/index.js

* update/is-auth.js

* Update/readme.md

* update/image-readme

* Add/query-schema

* Update/Plugin-graphQL-schema

* Add/Plugin-MongoDB-Model

* Add/createPlugin-and-refractoring

* Add/getPlugins

* Add/Mutation/UpdatePluginStatus

* Add/Mutation/updateTempPluginInstalledOrgs

* Add/Mutation/Schema

* Add/import/mutations

* Add/plugins

* Fix/path-err

* Fix/Erros

* update/lockfile

* Add/plugin-model

* Update is-auth.js

* Removed extra queries

* Documentation added for plugin queries and models

* Fix/`delelte cr in prettier/prettier`

* updated : mutation

* Add/test `getPlugins`

* Fix/`lint error`

* test `updatePluginInstalledOrgs`

* Test/ `updateInstallStatus`

* Fix/Erros-1

* Fix/Erros-2

* Fix/Erros-3

* Test/`Queries.js`

* Test/`Mutation.js`

* remove extra `console.log`

* Delete admin-plugin-query.js

* Delete super-admin-plugin-query.js

* Fix/Package-lock

* added delimiter to helper functions

* error handling for connection manager

* added readme.md for connection manager

* error handling for Database module

Co-authored-by: Asmit Kumar Sirohi <[email protected]>
Co-authored-by: Siddhesh Bhupendra Kuakde <[email protected]>

* dynamic functionality additions

* update tenant schema folder

* modify all posts-comments resolvers

* resolve failing tests for posts modifications

* modify events-tasks-projects related resolvers

* resolve failing tests

* modified user queries

* modify longin mutation to return events properly

* modify org mutations and resolve failing tests

* diconnect properly from the database

* if not connection for org search in the database for it

* group chats and direct chats mutations

* remove console logs

* remove unnecessary comments

* fix drop database

Co-authored-by: Mickey <[email protected]>
Co-authored-by: Asmit Kumar Sirohi <[email protected]>
Co-authored-by: Siddhesh Bhupendra Kuakde <[email protected]>
Co-authored-by: JamaicanFriedChicken <[email protected]>

* interchanged .env and .env.sample from the installation guide (#774)

* Migrated develop branch to typescript including the changes till october 19, 2022

* Added some comments and reinstalled some packages to match the main repository's package.json

* Github actions update

* getLanguage.spec.ts import fix

* forgotPassword.spec.ts fix

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Peter Harrison <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JamaicanFriedChicken <[email protected]>
Co-authored-by: Siddhesh Bhupendra Kuakde <[email protected]>
Co-authored-by: Nishant Singh <[email protected]>
Co-authored-by: Nishant <[email protected]>
Co-authored-by: Ebrahim <[email protected]>
Co-authored-by: Mickey <[email protected]>
Co-authored-by: Asmit Kumar Sirohi <[email protected]>
Co-authored-by: Kanishka Bansode <[email protected]>
  • Loading branch information
11 people authored Nov 9, 2022
1 parent d32154c commit 9dd36b3
Show file tree
Hide file tree
Showing 648 changed files with 51,063 additions and 35,747 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
21 changes: 14 additions & 7 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# 👋 Welcome, we're glad you're setting up an installation of Talawa-api. Copy this
# 👋 Welcome, we're glad you're setting up an installation of Talawa-api. Copy this
# file to .env or set the variables in your local environment manually.


# Generate a unique random key, you can use `openssl rand -hex 32` in terminal

ACCESS_TOKEN_SECRET=


# Generate a unique random key, you can use `openssl rand -hex 32` in terminal

REFRESH_TOKEN_SECRET=

# if you are using DOCKER use this mongodb url
# mongodb://mongo:27017/talawa-api
# if you are using hosted mongodb, mongodb connection string will look like this
# mongodb+srv://<username>:<password>@<server_url>/<db_name>?retryWrites=true&w=majority
# for local instance use this connection string
# mongodb://localhost:27017/<db_name>?retryWrites=true&w=majority

# Please read about mongodb connection string here :- https://www.mongodb.com/docs/v5.2/reference/connection-string/

# This is the default mongodb connection string for the mongodb docker container that's created along with talawa-api docker container.
# Use this as the value for `MONGO_DB_URL` environment variables when you're using the docker approach.

# mongodb://talawa_mongodb:27017/talawa-api?retryWrites=true&w=majority


# This environment variable is used to provide the mongodb connection string to talawa-api.
MONGO_DB_URL=


# Get the google recaptcha secret key from google recaptcha admin or https://www.google.com/recaptcha/admin/create
# from here for reCAPTCHA v2 and "I'm not a robot" Checkbox, and paste the key here.
# Note: In domains, fill localhost
Expand Down
7 changes: 4 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
.github
.vscode

old-api
build
coverage
node_modules
src/generated
32 changes: 0 additions & 32 deletions .eslintrc.js

This file was deleted.

64 changes: 64 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"env": {
"es2022": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:prettier/recommended"
],
"overrides": [
{
"files": [
"*.ts"
],
"processor": "@graphql-eslint/graphql"
},
{
"files": [
"*.graphql"
],
"parser": "@graphql-eslint/eslint-plugin",
"plugins": [
"@graphql-eslint"
]
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"root": true,
"rules": {
"eqeqeq": [
"error",
"always"
],
"linebreak-style": [
"error",
"unix"
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"quotes": [
"error",
"double",
{
"allowTemplateLiterals": true,
"avoidEscape": true
}
]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/codeql-codescan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript']
language: [ 'typescript']

steps:
- name: Checkout repository
Expand Down
94 changes: 44 additions & 50 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: yarn
run: npm ci
- name: Run ESLint and Prettier
run: yarn lint
run: npm run lint

Count-lines-of-code:
name: Total number of lines in every file should not be more than 400
Expand All @@ -33,37 +33,37 @@ jobs:
- uses: actions/checkout@v2
- run: chmod +x ./.github/workflows/countline.py
- run: |
./.github/workflows/countline.py --exclude_directories tests
./.github/workflows/countline.py --exclude_directories __tests__
Code-Formatter:
name: Formats the code
runs-on: ubuntu-latest
needs: Linter
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- name: Prettify code
uses: creyD/[email protected]
with:
same_commit: True
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
with:
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- name: Prettify code
uses: creyD/[email protected]
with:
same_commit: True
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

JSDocs:
name : "JSDocs comments and pipeline"
runs-on : ubuntu-latest
name: 'JSDocs comments and pipeline'
runs-on: ubuntu-latest
needs: Code-Formatter
steps:
- uses: actions/checkout@v2
- name : "Check whether comments exists for JSDocs"
- name: 'Check whether comments exists for JSDocs'
run: |
chmod +x ./.github/workflows/check-jsdocs-comment.py
./.github/workflows/check-jsdocs-comment.py
- name : "Run JSDocs"
- name: 'Run JSDocs'
if: env.RUN_JSDOCS == 'True'
run: echo "Run JSdocs :${{ env.RUN_JSDOCS }}"

Expand All @@ -74,15 +74,14 @@ jobs:
strategy:
matrix:
node-version: [14.x]
mongodb-version: ['4.4']
services:
mongo:
image: mongo
image: mongo:4.4
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 27017:27017
env:
Expand All @@ -91,35 +90,30 @@ jobs:
REFRESH_TOKEN_SECRET: 96d41e144e63475f7f753735b50305cd2857cc41c2f2570babdb948c10b77bc5

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: npm install
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2

- name: Start the Application
run: npm run start-test-server-in-action
- name: Install dependencies
run: npm ci

- name: Sleep for 10s
uses: juliangruber/sleep-action@v1
with:
time: 10s
- name: Sleep for 10s
uses: juliangruber/sleep-action@v1
with:
time: 10s

- name: Run the tests
run: npm run test
- name: Run the tests
run: npm run test

- name: Present current coverage in PR
uses: codecov/[email protected]
with:
verbose: true
- name: Stop the Application
run: npm run stop-test-server-in-action
- name: Present current coverage in PR
uses: codecov/[email protected]
with:
verbose: true

- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/[email protected]
with:
path: "./coverage/lcov.info"
min_coverage: 46.5
- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/[email protected]
with:
path: './coverage/lcov.info'
min_coverage: 46.5
Loading

0 comments on commit 9dd36b3

Please sign in to comment.