Commit Graph

346 Commits

Author SHA1 Message Date
Andrew Bastin
aab76f1358 chore: bump version to 2023.12.3 2024-01-30 20:27:25 +05:30
Balu Babu
1df9de44b7
chore: upgraded prisma version to v5.8.0 (#3787) 2024-01-30 18:16:28 +05:30
Andrew Bastin
cd371fc9d4 chore: bump versions to 2023.12.2 2024-01-03 16:58:51 +05:30
Andrew Bastin
8f503479b6 chore: bump package version to 2023.12.1 2023-12-22 20:49:21 +05:30
Mir Arif Hasan
54d8378ccf fix: improve smtp email validation and fix enableAndDisableSSO mutation (#3689)
Co-authored-by: Balu Babu <balub997@gmail.com>
2023-12-22 20:37:15 +05:30
Mir Arif Hasan
4f138beb8a
chore: db migration missing message (#3672) 2023-12-19 18:42:00 +06:00
Mir Arif Hasan
a694d3f7eb
hotfix: added validation on infra config update (#3667)
* feat: added validation on infra config update

* chore: removed async keyword

* fix: feedback
2023-12-19 17:15:46 +06:00
Andrew Bastin
fad31a47ee chore: bump versions of all relevant packages 2023-12-16 22:27:41 +05:30
Liyas Thomas
06f0f1c91b fix: broken docs link 2023-12-16 10:36:54 +05:30
Mir Arif Hasan
6abc0e6071
HBE-326 feature: server configuration through GraphQL API (#3591)
* feat: restart cmd added in aio service

* feat: nestjs config package added

* test: fix all broken test case

* feat: infra config module add with get-update-reset functionality

* test: fix test case failure

* feat: update infra configs mutation added

* feat: utilise ConfigService in util functions

* chore: remove saml stuff

* feat: removed saml stuffs

* fix: config service precedence

* fix: mailer module init with right env value

* feat: added mutations and query

* feat: add query infra-configs

* fix: mailer module init issue

* chore: smtp url validation added

* fix: all sso disabling is handled

* fix: pnpm i without db connection

* fix: allowedAuthProviders and enableAndDisableSSO

* fix: validateSMTPUrl check

* feat: get api added for fetch provider list

* feat: feedback resolve

* chore: update code comments

* fix: uppercase issue of VITE_ALLOWED_AUTH_PROVIDERS

* chore: update lockfile

* fix: add validation checks for MAILER_ADDRESS_FROM

* test: fix test case

* chore: feedback resolve

* chore: renamed an enum

* chore: app shutdown way changed

---------

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2023-12-12 16:42:58 +06:00
Balu Babu
18864bfecf
feat: addition of data field into User and Team Collections (#3614)
* feat: added new columns into the TeamCollections and UserCollections models

* feat: completed addition of new data field in TeamCollection

* feat: completed addition of new data field in UserCollections

* chore: updated all tests in team-collection module

* chore: added tests for updateTeamCollection method in team-collection module

* chore: refactored all existing testcases in user-collection to reflect new changes

* chore: added new testcases for updateUserCollection method in user-collection module

* chore: made data field optional in team and user collections

* chore: fixed edgecases for data being null

* chore: resolved issue with team-request testcases

* chore: completed changes requested in PR review

* chore: changed target to prod in hoppscotch-old-backend service
2023-12-05 20:12:37 +05:30
James George
1829c088cc
feat: support for subpath based access in SH apps (#3449)
Co-authored-by: Balu Babu <balub997@gmail.com>
2023-11-22 19:35:35 +05:30
Andrew Bastin
7b18526f24 chore: merge hoppscotch/main into hoppscotch/release/2023.12.0 2023-11-16 13:51:12 +05:30
Andrew Bastin
23afc201a1 chore: bump version to release/2023.8.4 2023-11-14 21:26:16 +05:30
Balu Babu
f5d2e4f11f
feat: introducing shortcode into admin module (#3504)
* feat: added query in infra to fetch all shortcodes

* feat: added mutation in admin to delete shortcode

* chore: added new tests for methods in shortcode module

* chore: removed .vscode file

* chore: added a new ShortcodeCreator type to output of fetchAllShortcodes query

* chore: shortcodeCreator type is now nullable

* chore: added type defs to fetchAllShortcodes method in admin module

* docs: update code comments

* chore: changed target to prod in hoppscotch-old-backend

---------

Co-authored-by: Mir Arif Hasan <arif.ishan05@gmail.com>
2023-11-10 14:28:02 +05:30
Balu Babu
4caf0053cd
feat: introduction of shared-requests (#3476)
* feat: added new property to existing shortcode model in prisma schema

* chore: created shared-requests module

* chore: created shared-request model

* chore: complete sharedRequest query

* chore: completed mutation to create a SharedRequest

* chore: completed subscription to create a SharedRequest

* chore: completed query to fetch all user created shared-requests

* chore: completed mutation to delete a SharedRequest

* chore: completed subscription to delete a SharedRequest

* chore: removed unused dependncues in share-requests module

* chore: added shared-requests into user deletion spec

* test: added all testcases for shared-request module

* test: modified all relevant tests in shortcode module

* chore: added deprecated label to all queries,mutations and subscriptions in the shortcode module

* chore: resolved all comments raised in review

* feat: added ability to update and listen to updates of shared-requests

* chore: added updatedOn field to shortcode model

* chore: fixed issue with updateSharedRequest method

* chore: fixed incorrect value getting updated

* chore: added all test-cases for updateSharedRequest method

* chore: created migration for shared-requests

* chore: moved shared-requests into shortcode module

* chore: added missing import in shortcode tests

* chore: changed properties to embedProperties in shortcode model

* feat: generated migrations file for new schema changes to Shortcodes table

* chore: changed target of old-backend service in docker-compose file

* chore: fixed issue with updatedOn field in shortcodes model

* chore: removed unused dependencies

* fix: handle invalid input for shortcode properties

* Revert "fix: handle invalid input for shortcode properties"

This reverts commit 4dcb0afb18.

* chore: changed updateShortcode method name to updateEmbedProperties

* chore: changed target of hoppscotch-old-backend service to prod

---------

Co-authored-by: Mir Arif Hasan <arif.ishan05@gmail.com>
2023-11-07 17:57:51 +05:30
Andrew Bastin
97bd808431 chore: set versions with a bump version 2023-11-07 16:04:02 +05:30
Andrew Bastin
93ce86f32d chore: merge hoppscotch/release/2023.8.3 into hoppscotch/release/2023.12.0 2023-11-06 18:56:01 +05:30
Andrew Bastin
4ebf850cb6 chore: bump version to 2023.8.3 2023-11-06 17:39:31 +05:30
Balu Babu
76af7d5e10
fix: mailer template issue (#3475) 2023-11-06 17:25:36 +05:30
Mir Arif Hasan
59b5a50a97
HBE-296 feat: introducing 'infra' type and splitting model properties between 'admin' and 'infra' (#3445)
* feat: infra type added in admin module

* feat: infra-resolver added in admin module

* feat: feedback resolved

* feat: deprecated tag added in some admin ResolveFields

* build: update pnpm-lock file

* feat: add field in infra type

* feat: admin extends user partially

* feat: admin extends user with omitting some fields

* chore: remove unused imports

* build: conflict resolve in pnpm lock file
2023-10-30 17:03:43 +06:00
Balu Babu
46caf9b198
refactor: removed all instances of rejectOnNotFound in prisma queries (#3377)
* chore: removed rejectOnNotFound property from prisma query in team-enviroment method

* chore: fixed issues with test cases in team-environment module

* chore: changed target of hoppscotch-old-backend service back to prod
2023-10-16 14:04:03 +05:30
Mir Arif Hasan
f5db54484c
HBE-266 Update NestJS packages (#3389)
* build: update npm nest packages

* build: removed depricated apollo-server-plugin package

* build: pnpm-lock file added

* build: swc integrated

* Revert "build: swc integrated"

This reverts commit 803a01f38f210dfbcd603665893d29af565c8908.

* feat: upgrade graphql* packages version

* feat: upgrade point release

* feat: update pnpm-lock file
2023-10-16 12:23:55 +05:30
Mir Arif Hasan
8deb6471b9
HBE-270 Test-Case timestamp issue fix in backend (#3415)
test: timestamp issue fix in user-history
2023-10-16 12:11:15 +05:30
Andrew Bastin
0188a8d7db chore: bump version 2023-10-06 22:04:57 +05:30
James George
2694731c36
chore: remove stale type definitions (#3368) 2023-10-05 14:49:04 +05:30
Andrew Bastin
bb380f3751 chore: bump version to 2023.8.1 2023-09-18 20:18:23 +05:30
Andrew Bastin
57365eeae0 chore: bump version to 2023.8.0 2023-08-31 13:55:36 +05:30
Mir Arif Hasan
d4d7a20fbd
HBE-258 hotfix: skip parameter in findMany in shortcode module (#3294)
fix: skip parameter in findMany
2023-08-26 01:35:51 +05:30
Andrew Bastin
efa40cf6ea
feat: container registry friendly docker images and all-in-one container (#3193)
Co-authored-by: Balu Babu <balub997@gmail.com>
2023-08-24 00:01:28 +05:30
Mir Arif Hasan
2c1fd5d711
feat: prefix VITE_ added in conditional auth provider env variable (#3246) (HBE-248) 2023-08-08 14:16:13 +05:30
Andrew Bastin
05f2d8817b chore: merge hoppscotch/main into release/2023.8.0 2023-08-08 12:18:01 +05:30
Andrew Bastin
0e70c28324 feat: dynamically select which auth providers for your instance of hoppscotch (be implementation) 2023-08-03 20:12:54 +05:30
Ankit Sridhar
88f6a4ae26
[feat] : Allow admins to revoke a team invite (HBE-230) (#3162)
feat: added functionality for admin to revoke team invite
2023-08-03 14:08:32 +05:30
Andrew Bastin
6496bea846 chore: bump version to 2023.4.8 2023-07-18 21:46:36 +05:30
Balu Babu
82b6e08d68
fix: fixed issue in team-environment test cases (#3189) 2023-07-17 12:33:11 +05:30
Andrew Bastin
8300f9a0a2 chore: merge release/2023.4.8 into release/2023.8.0 2023-07-13 12:10:14 +05:30
Mir Arif Hasan
525ba77739
refactor: team invitation module in pseudo fp-ts (#3175) 2023-07-13 11:58:03 +05:30
Balu Babu
6bc748a267
refactor: introduce team-environments into self-host refactored to pseudo-fp format (#3177) 2023-07-13 11:52:19 +05:30
Andrew Bastin
b29c04c28d
fix: email not being checked case insensitive on team invitation acceptance (#3174) 2023-07-11 20:03:08 +05:30
Andrew Bastin
9dbce74f5e chore: bump version to 2023.4.7 2023-06-27 15:43:03 +05:30
James Butler
5650de1183 fix: self-host unable to use Azure oauth (#3138) 2023-06-27 15:37:25 +05:30
Ankit Sridhar
5632334c9a fix: remove existing team invitation for an invitee when adding invitee to team by admin (HBE-229) (#3157) 2023-06-27 15:37:25 +05:30
Omer Baflah
c765270dfe fix: correct typos (#3153) 2023-06-27 15:37:25 +05:30
Balu Babu
6304fd50c3 fix: fixed issue with team-invitations and new user accounts (#3137) 2023-06-27 15:37:25 +05:30
Andrew Bastin
399a238bf4 chore: bump version to 2023.4.7 2023-06-27 14:15:12 +05:30
James Butler
64c5077506
fix: self-host unable to use Azure oauth (#3138) 2023-06-22 23:43:05 +05:30
Ankit Sridhar
878ec833ce
fix: remove existing team invitation for an invitee when adding invitee to team by admin (HBE-229) (#3157) 2023-06-22 23:38:02 +05:30
Omer Baflah
77e8a36ab0
fix: correct typos (#3153) 2023-06-22 00:35:57 +05:30
Balu Babu
84b0c30d64
fix: fixed issue with team-invitations and new user accounts (#3137) 2023-06-15 17:15:06 +05:30
Andrew Bastin
e3dd9e99a1 chore: bump version to 2023.4.6 2023-06-12 10:43:44 +05:30
Andrew Bastin
a213c0c26c chore: bump version to 2023.4.5 2023-06-04 23:41:01 -04:00
Andrew Bastin
15424903ed fix: stop logging DATABASE_URL in logs 2023-06-04 23:33:32 -04:00
Andrew Bastin
1cce117b0a chore: bump version to 2023.4.4 2023-06-02 11:06:51 -04:00
Ankit Sridhar
05e32ef9e4
fix: update team invitation link to domain specified in .env [HBE-202] (#3096) 2023-05-31 10:36:34 -04:00
Mir Arif Hasan
1b413e2f47
fix: timing dependency on test case (#3070) 2023-05-23 16:32:39 -04:00
Andrew Bastin
d6c8400116 chore: bump version to 2023.4.3 2023-05-11 17:05:28 +05:30
Andrew Bastin
c2520006ac chore: bump version to 2023.4.2 2023-05-11 14:09:38 +05:30
Mir Arif Hasan
08f61e7408 fix: magic link URL (#3028) 2023-05-11 14:09:38 +05:30
Mir Arif Hasan
9beda15f00 fix: returning response from authCookieHandler (#3025) 2023-05-11 14:09:38 +05:30
Andrew Bastin
8450fb6596 chore: release 2023.4.1 2023-04-23 16:44:51 +05:30
Andrew Bastin
b68115d3b2 refactor: change user collections min title length to 1 2023-04-11 15:40:26 +05:30
Balu Babu
4ce9e67460
chore: added global lint and test commands to backend package (#81)
* chore: added global lint and test commands to backend package

* chore: removed lint command from root scope execution
2023-04-10 12:25:45 +05:30
Balu Babu
7668be50ae chore: added orderBy field to query to fetch childCollectionList 2023-04-08 05:56:08 +05:30
Ankit Sridhar
100664f77e
fix: refactor related to checklist observation (#73)
* refactor: removed unused files, dependencies and added valid callback URL

* chore: update env example

* test: fixed issue with subscription on deleteUserCollection in UserCollection module

* test: fixed time related issue with auth service methods

* chore: removed unused dependencies in auth.service file

---------

Co-authored-by: Mir Arif Hasan <arif.ishan05@gmail.com>
Co-authored-by: Balu Babu <balub997@gmail.com>
2023-04-07 22:22:41 +05:30
Mir Arif Hasan
696cf8490b
refactor: removing unused import, commented codes, improved cursor query (#69)
* chore: refactor code in some modules

* refactor: getTeamsOfUser functino

* chore: remove unused import

* chore: revert some changes
2023-04-06 19:54:10 +05:30
Mir Arif Hasan
ffc08227dd
fix: all unit test cases for backend modules (HBE-171) (#51)
* fix: if-condition for getCollectionOfRequest func

* fix: all test cases for team request module

* fix: user collection test case

* fix: team module test case

* refactor: updated test description for last implemented changes in admin and removed commented code

---------

Co-authored-by: ankitsridhar16 <ankit.sridhar16@gmail.com>
2023-04-06 19:53:04 +05:30
Balu Babu
2435436580
chore: changes origins to view whitelisted origins in backend (#70) 2023-04-06 14:04:04 +05:30
Balu Babu
22aa8ee334
hotfix: magiclink dynamic email redirection url (#67)
* chore: modified magiclink /signin function to work with origin

* chore: modified testcases for signInMagicLink to reflect new changes

* chore: removed prisma migration file

* chore: removed admin module dulicate from guards folder

* chore: implemented ENUMs for origins in signin method

* chore: added VITE_ADMIN_URL to .env.example file
2023-04-06 12:11:01 +06:00
Ankit Sridhar
6d688ed2bc
refactor: removing unused env variables from env example (#66) 2023-04-05 21:53:27 +05:30
Ankit Sridhar
8bdb9a657f
feat: self host packaging (HBE-166) (#41)
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2023-04-04 03:17:18 +05:30
Akash K
c49573db65
fix: serialize user sessions properly (#62)
* fix: cast prisma user object to user object

* chore: improved consistency

* chore: cast function renamed

---------

Co-authored-by: Mir Arif Hasan <arif.ishan05@gmail.com>
2023-04-03 09:47:40 +05:30
Akash K
7286d3b94f
feat: add reqType to userHistoryDeletedMany subscription (#61) 2023-03-30 12:17:00 +05:30
Balu Babu
ea93162056
refactor: modifed return types of mutation/subscriptions in UserCollections (#57)
* refactor: modifed userCollectionRemoved subscription to return custom return type

* chore: created new return type for export to JSON mutation in UserCollection

* refactor: added reqType to exportUserCollectionsToJSON query

* chore: remove duplicate enum in user-collection.model.ts file
2023-03-29 15:50:48 +05:30
Mir Arif Hasan
ccdce37f88
fix: enum type fixes in SDL (HBE-183) (#55)
* fix: added reqType typed in sdl

* fix: updateUserSession type
2023-03-28 17:46:41 +06:00
Ankit Sridhar
9d6a7f709c
feat: introducing get team info by id in admin module as a query (HBE-182) (#54)
* feat: introducing get team info by id in admin module as a query

* chore: adding resolve field for admin

* chore: remove nullable false

* refactor: rename getTeamInfo to teamInfo

* refactor: make myRole nullable
2023-03-28 15:35:38 +05:30
Mir Arif Hasan
96a4125f15
feat: rate-limit annotation added in admin resolver (#53) 2023-03-24 15:21:46 +05:30
Ankit Sridhar
b16e90c10d
fix: check for admin users when removing user as admin (HBE-180) (#52)
* fix: check if admin users are there in infra when removing user as an admin

* fix: corrected the logic for length check

* chore: update error message

* chore: add new error message
2023-03-24 15:21:23 +05:30
Balu Babu
3df0492275
refactor: removing Redis from pubsub in sh-backend (HBE-178) (#49)
* chore: removed production env check and redis as pubsub provider in pubsub module

* chore: removed pnpm-lock.yaml file from backend

* chore: removed migrations folder from prisma

* chore: removed RedisPubSub from pubsub service file and changed signature of asyncIterator method
2023-03-21 16:46:54 +05:30
Mir Arif Hasan
fa8ca0569d
feat: introducing rate-limiting on queries, mutations and most of the REST endpoints (HBE-111) (#46)
* feat: rate-limiting guard added and configured in app module

* feat: rate-limit annotation added in controllers and resolvers (query, mutation, not subscription)

* docs: added comments
2023-03-21 16:45:50 +05:30
Ankit Sridhar
f78354a377
feat: Introducing Admin Module to Backend (HBE-83) (#21)
* feat: introducing admin module, resolvers and service files as a module

* feat: adding admin module in the app module

* feat: introducing admin guard and decorator for allowing admin operations

* feat: invited user model

* chore: added user invitation mail description to mailer service

* chore: added admin and user related error

* feat: added invited users as a new model in prisma

* chore: added admin related topics to pubsub

* chore: added service method to fetch all users from user table

* chore: added user deletion base implementation

* Revert "chore: added user deletion base implementation"

This reverts commit d1615ad83db2bae946e2d366a903d2f95051dabb.

* feat: adding team related operations to admin

* chore: adding admin related service methods to teams module service

* chore: adding admin related service methods to team coll invitations requests envs

* chore: added more module error messages

* chore: added admin check service method

* chore: added find individual user by UID in admin

* HBE-106 feat: introduced code to handle first time admin login setup (#23)

* test: wrote test cases for verifyAdmin route service method

* chore: added comments to verifyAdmin service method

* chore: deleted the prisma migration file

* chore: added find admin users

* feat: added user deletion into admin module

* chore: admin user related errors

* chore: fixed registry pattern in the shortcodes and teams to handle user deletion

* chore: add subscription topic for user deletion

* chore: updated user type in data handler

* feat: implement and fix user deletion

* feat: added make user admin mutation

* chore: added unit tests for admin specific service methods in admin module

* chore: added invitation not found error

* chore: added admin specific operation test cases in specific modules

* chore: added tests related to user deletion and admin related operation in user module

* chore: updated to error constant when invitations not found

* chore: fix rebase overwritten methods

* feat: implement remove user as admin

* chore: add new line

* feat: introducing basic metrics into the self-hosted admin module (HBE-104) (#43)

* feat: introducing admin module, resolvers and service files as a module

* feat: adding admin module in the app module

* feat: introducing admin guard and decorator for allowing admin operations

* feat: invited user model

* chore: added user invitation mail description to mailer service

* chore: added admin and user related error

* feat: added invited users as a new model in prisma

* chore: added admin related topics to pubsub

* chore: added service method to fetch all users from user table

* chore: added user deletion base implementation

* Revert "chore: added user deletion base implementation"

This reverts commit d1615ad83db2bae946e2d366a903d2f95051dabb.

* feat: adding team related operations to admin

* chore: adding admin related service methods to teams module service

* chore: adding admin related service methods to team coll invitations requests envs

* chore: added more module error messages

* chore: added admin check service method

* chore: added find individual user by UID in admin

* HBE-106 feat: introduced code to handle first time admin login setup (#23)

* test: wrote test cases for verifyAdmin route service method

* chore: added comments to verifyAdmin service method

* chore: deleted the prisma migration file

* chore: added find admin users

* feat: added user deletion into admin module

* chore: admin user related errors

* chore: fixed registry pattern in the shortcodes and teams to handle user deletion

* chore: add subscription topic for user deletion

* chore: updated user type in data handler

* feat: implement and fix user deletion

* feat: added make user admin mutation

* chore: added unit tests for admin specific service methods in admin module

* chore: added invitation not found error

* chore: added admin specific operation test cases in specific modules

* chore: added tests related to user deletion and admin related operation in user module

* chore: updated to error constant when invitations not found

* chore: fix rebase overwritten methods

* feat: implement remove user as admin

* chore: add new line

* chore: created new GQL return type for admin module

* chore: created resolver and service method for method to fetch org metrics

* chore: removed all entities relevant to seperate query for fetching admin metrics

* chore: created all resolvers for metrics

* feat: completed adding field resolves to query org metrics

* test: wrote tests for all metrics related methods in admin module

* test: added test cases for get count functions in multiple modules

* chore: removed prisma migration folder

* Delete backend-schema.gql

* chore: resolved merge conflicts in team test file

---------

Co-authored-by: ankitsridhar16 <ankit.sridhar16@gmail.com>

* refactor: update mailer service to stop using postmark (#38)

* refactor: update mailer service to stop using postmark

* chore: remove postmark as a dep and move out postmark code

* chore: remove postmark variables from .env.example

* chore: add formal errors for mailer initialization errors

* chore: add and update jsdoc comments in mailer service methods

* chore: added user invitation mail description to mailer service

* chore: updated with review changes requested for admin module

* feat: adding admin resolver to gql schema

* feat: adding input args for admin resolvers

* chore: invited user renamed

* chore: updated mailer service to be compatible with new mailer

* chore: updated team service with review changes

* chore: updated team collection service with review changes

* chore: updated team environments service with review changes

* chore: updated team requests service with review changes

* chore: updated user service with review changes

* refactor: invited user model

* chore: review changes implemented

* chore: implemented the review changes for admin, user and teams module

* chore: removed error handling and implemented review changes

* refactor: naming change for IsAdmin

---------

Co-authored-by: Balu Babu <balub997@gmail.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2023-03-21 16:42:30 +05:30
Andrew Bastin
2244fb0523 chore: add numberScalarMode for schema gen as well 2023-03-20 22:01:06 +05:30
Andrew Bastin
e978541bf1
refactor: update mailer service to stop using postmark (#38)
* refactor: update mailer service to stop using postmark

* chore: remove postmark as a dep and move out postmark code

* chore: remove postmark variables from .env.example

* chore: add formal errors for mailer initialization errors

* chore: add and update jsdoc comments in mailer service methods
2023-03-15 14:02:55 +05:30
Balu Babu
b0d9a934d9
hotfix: fixing type errors in backend graphql layer (HBE-174) (#45)
* chore: added the nest graphql fix for making it use Int over Float

* chore: changed the type of cursor to Int in PaginationArgs

* chore: fixed description mismatch in rootUserCreation functions in UserCollection module

* chore: removed unused title type in UserRequest input-args

* fix: added ID scaler in user-request input type

* fix: added ID scaler in team-invitation and user-history

---------

Co-authored-by: Mir Arif Hasan <arif.ishan05@gmail.com>
2023-03-15 11:20:45 +05:30
Balu Babu
a779ba5c0e
hotfix: adding dynamic redirection in self-host auth system (HBE-173) (#40)
* chore: completed base auth implementation with redirectUrl

* chore: completed base auth fix with redirect_uri

* chore: added whitelist based redirection

* chore: added a env variable for session secret in main.ts

* chore: removed migrations folder from prisma directory
2023-03-14 19:19:22 +05:30
Balu Babu
be46ed2686
refactor: adding JSON import/export functions to UserCollections module (HBE-169) (#37)
* feat: created exportUserCollectionsToJSON mutation for UserCollection module

* chore: added comments to export functions

* chore: added type and user ownership checking to creation methods

* chore: replaced request property with spread request object instead

* chore: completed all changes requested in inital review of PR

* chore: explicitly exporting request title in export function

* chore: explicitly exporting request title in export function

* chore: added codegen folder to gitignore

* chore: removed gql-code gen file from repo
2023-03-14 18:31:47 +05:30
Balu Babu
28dbaf317e
chore: added the correct GQL return type to userRequestMoved subscription (#44) 2023-03-14 11:49:27 +05:30
Andrew Bastin
65719b560b
feat: introduce gql schema sdl generation to the backend (#35)
* feat: introduce gql schema sdl generation to the backend

* chore: update gql-codegen consumers to get schema from generated sdl

* chore: hoppscotch-backend generates gql sdl on postinstall

* fix: add back missed part of generate-gql-sdl script

* chore: updated generate sdl script to hardcode whitelisted domains

* chore: add prisma generate on postinstall script

---------

Co-authored-by: ankitsridhar16 <ankit.sridhar16@gmail.com>
2023-03-13 18:52:50 +05:30
Mir Arif Hasan
8550c92e37
feat: subscription return response updated for moveUserRequest (#39)
* feat: subscription return response updated for moveUserRequest

* feat: update test cases
2023-03-13 16:15:51 +05:30
Mir Arif Hasan
7d3b2c064a
refactor: Refactoring of Team Request with Reordering (HBE-151) (#20)
* feat: createdOn, updatedOn added in team-request schema and updateTeamReq resolver refactored

* feat: resolver name changed for updateTeamRequest

* refactor: searchForTeamRequest resolver

* refactor: some functions refactored

* refactor: team-request service and subscriptions

* refactor: update GqlRequestTeamMemberGuard

* feat: team request reordering add

* feat: handle exception on update Team Request

* chore: change some return statement

* fix: change field name of MoveTeamRequestArgs

* feat: publish message update for reorder team req

* test: fix all the exists cases

* fix: add return statement

* test: add few functions test cases

* feat: made backward compatible

* fix: team-member guard for retrive user

* fix: few bugs

* chore: destructured parameters in service methods

* test: fix test cases

* feat: updateLookUpRequestOrder resolver added

* test: fix test cases

* chore: improved code consistency

* fix: feedback changes

* fix: main changes
2023-03-09 20:59:39 +06:00
Balu Babu
2a715d5348
refactor: refactoring Team-Collections with reordering in self-host (HBE-150) (#34)
* chore: removed firebase module as a dependency from team-collection module

* chore: modified team-collection resolver file to use input-args types

* chore: modified getTeamOfCollection service method and resolver

* chore: modified getParentOfCollection service method in team-collection module

* chore: modified getChildrenOfCollection service method in team-collection module

* chore: added new fields to TeamCollection model in prisma schema file

* chore: modified getCollection service method and resolver in team-collection module

* chore: modified createCollection service method and resolver in team-collection module

* chore: created cast helper function to resolve issue with creation mutation in team-collection

* chore: modified teamCollectionRemoved subscription return types

* chore: removed return types from subscriptions in team-collection module

* chore: removed all instances of getTeamCollections service method in team-collection module

* feat: added mutation to handle moving collections and supporting subscriptions

* feat: added mutation to re-ordering team-collection order

* chore: added teacher comments to both collection modules

* test: added test cases for getTeamOfCollection service method

* test: added test cases for getParentOfCollection service method

* test: added test cases for getChildrenOfCollection service method

* test: added test cases for getTeamRootCollections service method

* test: added test cases for getCollection service method

* test: added test cases for createCollection service method

* chore: renamed renameCollection to renameUserCollection in UserCollection module

* test: added test cases for renameCollection service method

* test: added test cases for deleteCollection service method

* test: added test cases for moveCollection service method

* test: added test cases for updateCollectionOrder service method

* chore: added import and export to JSON mutations to team-collection module

* chore: created replaceCollectionsWithJSON mutation in team-collection module

* chore: moved the mutation and service method of importCollectionFromFirestore to the end of file

* chore: added helper comments to all import,export functions

* chore: exportCollectionsToJSON service method orders collections and requests in ascending order

* chore: added test cases for importCollectionsFromJSON service method

* chore: added ToDo to write test cases for exportCollectionsToJSON

* chore: removed prisma migration folder

* chore: completed all changes requested in inital PR review

* chore: completed all changes requested in second  PR review

* chore: completed all changes requested in third PR review
2023-03-09 19:37:40 +05:30
Mir Arif Hasan
223150550f
feat: user request module with re-ordering (HBE-78) (#11)
* feat: added user-request schema in prisma

* feat: basic mutation and queries implementation

* fix: enum registration in graphql

* feat: user resolver added for user requests

* chore: refactor codes

* feat: transaction added in request reordering operation

* feat: pubsub added in user request

* refactor: user request service

* chore: feedback added

* chore: code improvement

* fix: bug fix

* feat: request type update in schema and JSDoc added

* test: fetchUserRequests and fetchUserRequest unit test added

* chore: refactor two functions

* test: unit test added for more functions

* chore: code readability improved

* test: added unit test for reorderRequests function

* feat: subscriptions added

* fix: User reference to AuthUser

* fix: User to AuthUser in test file

* chore: update dto file extensions

* feat: relation added in schema level

* chore: add function for db to model type casting

* feat: filter with title and collectionID add in userRequest resolver

* feat: resolvers added for userCollection in request module, and move inputTypes in a single file

* test: test file updated

* docs: description updated

* feat: createdOn, updatedOn added in user request schema

* chore: (delete in future) user collection module add for testing purpose

* feat: separate resolvers for create, update, delete user request based on req type

* feat: used paginationArgs from common types

* fix: shift InputTypes to ArgsTypes

* docs: update docs

* feat: avoid destructuring

* test: fix test cases for create and update

* docs: update JS doc

* feat: separate object variables for moveRequest function

* test: fix test case for moveRequest function

* feat: saperate parameters for fetchUserRequest

* test: fix test cases for fetchUserRequests

* feat: update some query names and made review changes

* test: fix test cases

* feat: remove filtering with title

* test: fix text cases for fetchUserRequests func

* feat: update subscription key

* feat: edge case handled for user request creation

* test: fix test case

* fix: user field resolver

* fix: fetch user req issue

* fix: update with type check

* test: fix test cases

* feat: type checked on move request

* test: add test case for typeValidity check func

* fix: edge condition added in if statement

* fix: error message

* chore: removed user collection from this branch

* fix: typos
2023-03-03 16:51:49 +06:00
Balu Babu
80c6f600db
hotfix: refresh token cookie migration (HBE-167) (#31)
* chore: removed signed cookies from refresh token strategy

* chore: removed signed cookies from refresh RTCookie decorator
2023-03-03 15:52:26 +05:30
Balu Babu
a938be3712
feat: Introducing user-collections into self-host (HBE-98) (#18)
* feat: team module added

* feat: teamEnvironment module added

* feat: teamCollection module added

* feat: team request module added

* feat: team invitation module added

* feat: selfhost auth frontend (#15)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>

* feat: bringing shortcodes from central to selfhost

* chore: added review changes in resolver

* chore: commented out subscriptions

* chore: bump backend prettier version

* feat: created new user-collections module with base files

* feat: added new models for user-collection and user-request tables in schema.prisma file

* feat: mutations to create user-collections complete

* feat: added user field resolver for userCollections

* feat: added parent field resolver for userCollections

* feat: added child field resolver with pagination for userCollections

* feat: added query to fetch root user-collections with pagination for userCollections

* feat: added query to fetch user-collections for userCollections

* feat: added mutation to rename user-collections

* feat: added mutation to delete user-collections

* feat: added mutation to delete user-collections

* refactor: changed the way we fetch root and child user-collection counts for other operations

* feat: added mutation to move user-collections between root and other child collections

* refactor: abstracted orderIndex update logic into helpert function

* chore: mutation to update order root user-collections complete

* feat: user-collections order can be updated when moving it to the end of list

* feat: user-collections order update feature complete

* feat: subscriptions for user-collection module complete

* chore: removed all console.logs from user-collection.service file

* test: added tests for all field resolvers for user-collection module

* test: test cases for getUserCollection is complete

* test: test cases for getUserRootCollections is complete

* test: test cases for createUserCollection is complete

* test: test cases for renameCollection is complete

* test: test cases for moveUserCollection is complete

* test: test cases for updateUserCollectionOrder is complete

* chore: added createdOn and updatedOn fields to userCollections and userRequests schema

* chore: created function to check if title are of valid size

* refactor: simplified user-collection creation code

* chore: made changed requested in initial PR review

* chore: added requestType enum to user-collections

* refactor: created two seperate queries to fetch root REST or GQL queries

* chore: created seperate mutations and queries for REST and GQL root/child collections

* chore: migrated all input args classess into a single file

* chore: modified createUserCollection service method to work with different creation inputs args type

* chore: rewrote all test cases for user-collections service methods with new CollType

* fix: added updated and deleted subscription changes

* fix: made all the changes requested in the initial PR review

* fix: made all the changes requested in the second PR review

* chore: removed migrations from prisma directory

* fix: made all the changes requested in the third PR review

* chore: added collection type checking to updateUserCollectionOrder service method

* chore: refactored all test cases to reflect new additions to service methods

* chore: fixed issues with pnpm-lock

* chore: removed migrations from prisma directory

* chore: hopefully fixed pnpm-lock issues

* chore: removed console logs in auth controller

---------

Co-authored-by: Mir Arif Hasan <arif.ishan05@gmail.com>
Co-authored-by: Akash K <57758277+amk-dev@users.noreply.github.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
Co-authored-by: ankitsridhar16 <ankit.sridhar16@gmail.com>
2023-03-03 15:03:05 +05:30
Ankit Sridhar
1780f3858d
fix : User history fix for returning most recently executed 50 user history REST/GraphQL items (HBE-165) (#27)
* chore: updated fetchUserHistory operation to return recently executed 50 entries

* chore: updated history to use PaginationArgs for operation

* chore: updated GraphQL resolver name
2023-03-02 14:56:50 +05:30
Mir Arif Hasan
5eb85fd99c
fix: cleaning deprecated resolvers on Team Module (HBE-157) (#25)
* fix: retrive user object from gql-team-member-guard

* feat: removed addTeamMemberByEmail resolver
2023-02-28 14:22:00 +06:00
Balu Babu
2ba05a46ee
HBE-164 refactor: subscriptions auth cookie fix (#26)
* chore: added error handling to cookie extraction logic for subscriptions

* chore: removed migration file from prisma directory
2023-02-27 19:32:33 +05:30
Ankit Sridhar
292ed87201
fix: added updated and deleted subscription changes (#24) 2023-02-27 19:03:48 +05:30
Balu Babu
1860057a25
HBE-147 refactor: Introduce shortcodes into self-host refactored to pseudo-fp format (#22)
* refactor: refactor all queries,mutations and subscriptions for shortcode module

* test: rewrote test cases for shortcodes

* chore: modified shortcode error code

* chore: created helper function to do shortcode type conversion in service file

* chore: simplifed logic to fetch user shortcodes with cursor pagination

* chore: removed migrations file

* chore: removed unused imports in shortcodes module

* chore: modified generateUniqueShortCodeID function

* chore: modified generateUniqueShortCodeID function

* chore: changed jwtService to use verify instead of decode

* docs: added teacher comments to all shortcodes service methods

* chore: removed stale test cases from shortcode modules
2023-02-22 17:40:53 +05:30
Mir Arif Hasan
24dd535d9e
HBE-155 Common input-args for Pagination (#19)
* feat: common input-args added

* chore: move common input-types.args.ts into types folder

* fix: add gql InputType annotation

* docs: update field description
2023-02-16 11:58:07 +06:00