Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: API v2 poc #26484

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft

Chore: API v2 poc #26484

wants to merge 8 commits into from

Conversation

sampaiodiego
Copy link
Member

@sampaiodiego sampaiodiego commented Aug 5, 2022

Proposed changes (including videos or screenshots)

This is the POC for API v2 using tsoa.

You can see the routes on the packages/rest-api/src/v2/usersController.ts file.

To get started, you do the usual to run the project, just checkout the git branch and then:

# install dependencies
yarn

# run
yarn dsv

You can then try the new API:

curl http://localhost:3000/api/v2/users

Or you can import the OpenAPI file into your preferred tool. The spec file is at packages/rest-api/public/swagger.json

Issue(s)

Steps to test or reproduce

Further comments

Pending items for this PoC:

  • Dependency injection of services to endpoint's controllers
  • Use Service to execute endpoints actions
  • Endpoints authentication
  • POST request (probably for sending a message)
  • Simple performance test comparison with v1

How tsoa works in a nutshell

During build time, it will look for controller files on v2/ folder and will generate a src/routes.ts file. TypeScript will then export src/routes.ts file that will be imported on Rocket.Chat, used then to register the routes on an express router hooked into WebApp.connectHandlers.

@lgtm-com
Copy link

lgtm-com bot commented Aug 8, 2022

This pull request introduces 1 alert when merging f3c5e04 into f45b956 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@codecov
Copy link

codecov bot commented Aug 8, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.04%. Comparing base (f79e8ed) to head (3e192af).
Report is 3491 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #26484      +/-   ##
===========================================
- Coverage    38.05%   38.04%   -0.01%     
===========================================
  Files          745      745              
  Lines        18625    18625              
  Branches      1412     1412              
===========================================
- Hits          7087     7086       -1     
+ Misses       11318    11317       -1     
- Partials       220      222       +2     
Flag Coverage Δ
e2e 38.04% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

dionisio-bot bot commented Apr 12, 2024

Looks like this PR is not ready to merge, because of the following issues:

  • This PR has conflicts, please resolve them before merging
  • This PR is missing the 'stat: QA assured' label
  • This PR is not mergeable
  • This PR is missing the required milestone or project
  • This PR has an invalid title

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link
Contributor

dionisio-bot bot commented Apr 12, 2024

Looks like this PR is not ready to merge, because of the following issues:

  • This PR has conflicts, please resolve them before merging
  • This PR is missing the 'stat: QA assured' label
  • This PR is not mergeable
  • This PR is missing the required milestone or project
  • This PR has an invalid title

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants