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

getUserProjects(options) #69

Open
cubap opened this issue Mar 18, 2024 · 0 comments · Fixed by #75
Open

getUserProjects(options) #69

cubap opened this issue Mar 18, 2024 · 0 comments · Fixed by #75
Assignees

Comments

@cubap
Copy link
Member

cubap commented Mar 18, 2024

Implement an authenticated endpoint (GET /projects) for a logged in user to get their own list of projects. The endpoint will get the agent from the bearer token and use that id as the lookup, returning an unexpanded list of projects, offering only (at this time) project ID and Title.

This is a GET, but for more sophisticated uses, a query string can manipulate the default options:

parameter default description
isPublic undefined true to include only public projects; false to exclude public projects. (TODO: open GET /publicProjects)
hasRoles[] ALL limit based on the group membership for projects. If used multiple times, matching ANY includes it in the return
exceptRoles[] NONE remove projects from the returned list based on group membership. Can be used multiple times. Overrules inclusion from hasRoles[]
createdBefore NOW only include projects with a creation date not before the UNIX seconds value. Combine with createdAfter for a single range.
modifiedBefore NOW only include projects modified (by anyone) before the UNIX seconds value. Combine with modifiedAfter for a single range. Overruled by created-x filters.
createdAfter 0 inverts createdBefore
modifiedAfter 0 inverts modifiedBefore
hasCollaborators undefined true for group sizes >1; false for group sizes >1
tags[] undefined may be multiple to match any exact tag (case insensitive) on the project.
fields[] [id, title] The returned array will include these listed fields on each entry, adding a value of undefined if the property is not present.
count false Only return an integer of the length of the list that would have been returned with all other filters applied. Invalidates fields[]

Interfaces

Many Interfaces will use a version of this and it can get expensive to call, so leave room for the caching of this list in TPEN Static. In this way, starting a new project would push up to that list and may avoid making the call into MongoDB. However, any custom filter requests would need to be applied. If we create the need for many vanilla options, we can include more cached options.

Notes

  • These are authenticated so the long and messy GETs are not a big deal and make logging more helpful.
  • The "[]" on some parameters is not a standard, but a widely used convention that will likely work well with the NodeJS/Express used now and whatever may be implemented in the future for unambiguous unordered parameter arrays.
  • This method and the shape of a Project may not coevolve smoothly, so missing parameters and close spellings may need to be handled on a case-by-case basis. In general, we shouldn't get Errors from this except for malformed URLs, Unauthenticated.
  • No matches returns an empty array. One match returns one Project object in an array.
  • We may consider paging in the future, possibly compulsory if things go nuts.
@cubap cubap added core-functionality OSS An issue which is appropriate for OSS to work on. labels Mar 18, 2024
@leandrumartin leandrumartin linked a pull request Mar 25, 2024 that will close this issue
@cubap cubap removed the OSS An issue which is appropriate for OSS to work on. label Apr 2, 2024
cubap added a commit that referenced this issue Apr 10, 2024
and combining with #69
cubap added a commit that referenced this issue Apr 10, 2024
* Slightly improved commenting clarity on respondWithProject()

* Very basic skeleton of /projects endpoint

* Added query param parsing for /projects, begun work on /projects tests

* Partial implementation of query params for /projects, mock data for /projects. Commented out /projects unit tests (not yet working)

* Resolved issue with authentication middleware implementation in /projects route

* /projects files now read environment variables

* commented out failing tests, added support for /projects hasRoles and exceptRoles queries

* Addressed some comments

* Query validation for /projects endpoint

* Addressed comments, fixed failing tests, and added lots more tests.

* weak getProjects() cleanup

The code works and is cleaner, but the sample projects are not ideal and it is tough to prove the filtering (which is incomplete anyway) works.

---------

Co-authored-by: Patrick Cuba <[email protected]>
cubap added a commit that referenced this issue Apr 10, 2024
* Initialize Endpoints (#51)

* /manifest route prototype (#6) (#10)

* More set up for testing

* Now this is something worth bringing to the table to talk about.

* Now this is something worth bringing to the table to talk about.

* Hands up, no further until after stand up.  Make sure this is on a better looking track.

* Better organization.  Better notes and textual queues to what is going on.

* oo get that low hanging coverage

* test wording hint

* If I typed out this comment your would TLDR and move on so...here's some stuff.

* Fancy.  Tests are segregated and can be called individually or all together.

* Cleaning up

* cleanup getting ready for PR

* Documentation for sanity

Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on issue 19 (#32)

* added initial code for issue19 page/id

* removed the test cases package in page/tests-not required now

* updated on the previous comments on issue

* WIP on Issue 21 (#33)

* Added the initial codebase to implement the GET/line/{lineid} and REST responses

* Added the Code Changes Documentation

* Delete Code Changes Documnetation.md

* Updated the code with the requested comments and added the end to end,exists and functionality test cases

* Added the Read me file , updated the code for the requested changes

---------

Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on Issue 2 (#34)

* Initial commit on Issue #2, largely duplicating /manifest code to new /project directory

* /project sends local dummy JSON data

* Added tests to project directory

* Addressed comment on mockPause() in project.mjs

---------

Co-authored-by: Bryan Haberberger <[email protected]>

* Manifest endpoint cleanup (#47)

* clean it up!

* documentation

* documentation and cleanup

* documentation and cleanup

* big merge cleanup

---------

Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* validating name

package name was invalid. Space and CAPS removed

* license hotfix

* WIP on issue 56-extend-page-web-api (#63)

* updated the code and written test cases initially failing

* updated the changes for the issue 56 Added all the changes that will mock the Database functionality for now If the db connection provided just need to connect

* added put route

* added few more test cases to check differnt query params conditions

* updated on the review comments

* removed ";"

* updated unit tests

* Slightly improved commenting clarity on respondWithProject()

* Integrated getUserProjects function into the project endpoint along with authenticateUser middleware for token validation. Updated response formatting and error handling, included dbController import, introduced getUserProjects function to fetch projects based on user ID, and modified findLineById to include a simulated database delay while returning line objects by ID

* Very basic skeleton of /projects endpoint

* Added query param parsing for /projects, begun work on /projects tests

* resolving merge

* resolving

* Partial implementation of query params for /projects, mock data for /projects. Commented out /projects unit tests (not yet working)

* Resolved issue with authentication middleware implementation in /projects route

* /projects files now read environment variables

* commented out failing tests, added support for /projects hasRoles and exceptRoles queries

* Updated the code cloned from development and added the services at get /project ,added the parameter handling,appllied filters ,returned as json ,surfaces the errors.

* Addressed some comments

* Query validation for /projects endpoint

* updated the code with requested changes , added the old code , updated the issue requirements

* Updated the code based on the requested changes ,added the documentation

* Addressed comments, fixed failing tests, and added lots more tests.

* weak getProjects() cleanup

The code works and is cleaner, but the sample projects are not ideal and it is tough to prove the filtering (which is incomplete anyway) works.

* moving tests to /projects

and combining with #69

* remove from /project

* skipping auth until auth is universal

---------

Co-authored-by: Bryan Haberberger <[email protected]>
Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Sandeep Naidu <[email protected]>
cubap added a commit that referenced this issue Aug 8, 2024
* hot fix for dbTests

* Fixed the end to end and functionality tests (#98)

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

* WIP on issue  71-simple-getuserprofile-workflow (#74)

* Initialize Endpoints (#51)

* /manifest route prototype (#6) (#10)

* More set up for testing

* Now this is something worth bringing to the table to talk about.

* Now this is something worth bringing to the table to talk about.

* Hands up, no further until after stand up.  Make sure this is on a better looking track.

* Better organization.  Better notes and textual queues to what is going on.

* oo get that low hanging coverage

* test wording hint

* If I typed out this comment your would TLDR and move on so...here's some stuff.

* Fancy.  Tests are segregated and can be called individually or all together.

* Cleaning up

* cleanup getting ready for PR

* Documentation for sanity

Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on issue 19 (#32)

* added initial code for issue19 page/id

* removed the test cases package in page/tests-not required now

* updated on the previous comments on issue

* WIP on Issue 21 (#33)

* Added the initial codebase to implement the GET/line/{lineid} and REST responses

* Added the Code Changes Documentation

* Delete Code Changes Documnetation.md

* Updated the code with the requested comments and added the end to end,exists and functionality test cases

* Added the Read me file , updated the code for the requested changes

---------

Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on Issue 2 (#34)

* Initial commit on Issue #2, largely duplicating /manifest code to new /project directory

* /project sends local dummy JSON data

* Added tests to project directory

* Addressed comment on mockPause() in project.mjs

---------

Co-authored-by: Bryan Haberberger <[email protected]>

* Manifest endpoint cleanup (#47)

* clean it up!

* documentation

* documentation and cleanup

* documentation and cleanup

* big merge cleanup

---------

Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* validating name

package name was invalid. Space and CAPS removed

* license hotfix

* WIP on issue 56-extend-page-web-api (#63)

* updated the code and written test cases initially failing

* updated the changes for the issue 56 Added all the changes that will mock the Database functionality for now If the db connection provided just need to connect

* added put route

* added few more test cases to check differnt query params conditions

* updated on the review comments

* removed ";"

* updated unit tests

* updated just for draft

* updating merge

* updating the userProfiles functionality defining its seperate package and tests with in

* updating on top of review comments

* updating the page code back to dev

* updating on the top of review comments

* updated and corrected

* updated the test cases

* removed semicollans

* roll back page to orginal

* Update index.mjs

* Update index.mjs

* Update page.mjs

* Update functionality_unit.test.mjs

* Update functionality_unit.test.mjs

* added based the filtration comments

---------

Co-authored-by: Bryan Haberberger <[email protected]>
Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* WIP on Issue #69 (#75)

* Slightly improved commenting clarity on respondWithProject()

* Very basic skeleton of /projects endpoint

* Added query param parsing for /projects, begun work on /projects tests

* Partial implementation of query params for /projects, mock data for /projects. Commented out /projects unit tests (not yet working)

* Resolved issue with authentication middleware implementation in /projects route

* /projects files now read environment variables

* commented out failing tests, added support for /projects hasRoles and exceptRoles queries

* Addressed some comments

* Query validation for /projects endpoint

* Addressed comments, fixed failing tests, and added lots more tests.

* weak getProjects() cleanup

The code works and is cleaner, but the sample projects are not ideal and it is tough to prove the filtering (which is incomplete anyway) works.

---------

Co-authored-by: Patrick Cuba <[email protected]>

* WIP on Issue 70 simple getuserprojects workflow (#73)

* Initialize Endpoints (#51)

* /manifest route prototype (#6) (#10)

* More set up for testing

* Now this is something worth bringing to the table to talk about.

* Now this is something worth bringing to the table to talk about.

* Hands up, no further until after stand up.  Make sure this is on a better looking track.

* Better organization.  Better notes and textual queues to what is going on.

* oo get that low hanging coverage

* test wording hint

* If I typed out this comment your would TLDR and move on so...here's some stuff.

* Fancy.  Tests are segregated and can be called individually or all together.

* Cleaning up

* cleanup getting ready for PR

* Documentation for sanity

Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on issue 19 (#32)

* added initial code for issue19 page/id

* removed the test cases package in page/tests-not required now

* updated on the previous comments on issue

* WIP on Issue 21 (#33)

* Added the initial codebase to implement the GET/line/{lineid} and REST responses

* Added the Code Changes Documentation

* Delete Code Changes Documnetation.md

* Updated the code with the requested comments and added the end to end,exists and functionality test cases

* Added the Read me file , updated the code for the requested changes

---------

Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on Issue 2 (#34)

* Initial commit on Issue #2, largely duplicating /manifest code to new /project directory

* /project sends local dummy JSON data

* Added tests to project directory

* Addressed comment on mockPause() in project.mjs

---------

Co-authored-by: Bryan Haberberger <[email protected]>

* Manifest endpoint cleanup (#47)

* clean it up!

* documentation

* documentation and cleanup

* documentation and cleanup

* big merge cleanup

---------

Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* validating name

package name was invalid. Space and CAPS removed

* license hotfix

* WIP on issue 56-extend-page-web-api (#63)

* updated the code and written test cases initially failing

* updated the changes for the issue 56 Added all the changes that will mock the Database functionality for now If the db connection provided just need to connect

* added put route

* added few more test cases to check differnt query params conditions

* updated on the review comments

* removed ";"

* updated unit tests

* Slightly improved commenting clarity on respondWithProject()

* Integrated getUserProjects function into the project endpoint along with authenticateUser middleware for token validation. Updated response formatting and error handling, included dbController import, introduced getUserProjects function to fetch projects based on user ID, and modified findLineById to include a simulated database delay while returning line objects by ID

* Very basic skeleton of /projects endpoint

* Added query param parsing for /projects, begun work on /projects tests

* resolving merge

* resolving

* Partial implementation of query params for /projects, mock data for /projects. Commented out /projects unit tests (not yet working)

* Resolved issue with authentication middleware implementation in /projects route

* /projects files now read environment variables

* commented out failing tests, added support for /projects hasRoles and exceptRoles queries

* Updated the code cloned from development and added the services at get /project ,added the parameter handling,appllied filters ,returned as json ,surfaces the errors.

* Addressed some comments

* Query validation for /projects endpoint

* updated the code with requested changes , added the old code , updated the issue requirements

* Updated the code based on the requested changes ,added the documentation

* Addressed comments, fixed failing tests, and added lots more tests.

* weak getProjects() cleanup

The code works and is cleaner, but the sample projects are not ideal and it is tough to prove the filtering (which is incomplete anyway) works.

* moving tests to /projects

and combining with #69

* remove from /project

* skipping auth until auth is universal

---------

Co-authored-by: Bryan Haberberger <[email protected]>
Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Sandeep Naidu <[email protected]>

* reserveId

tests passing

* upsidedown letter

* set variable timeout for tests (#100)

* set variable timeout for tests

* hot fix

* undiff to avoid conflicts

* undiff to avoid conflicts

---------

Co-authored-by: Bryan Haberberger <[email protected]>

* 101 isvalidid for db controller (#109)

* Initialize Endpoints (#51)

* /manifest route prototype (#6) (#10)

* More set up for testing

* Now this is something worth bringing to the table to talk about.

* Now this is something worth bringing to the table to talk about.

* Hands up, no further until after stand up.  Make sure this is on a better looking track.

* Better organization.  Better notes and textual queues to what is going on.

* oo get that low hanging coverage

* test wording hint

* If I typed out this comment your would TLDR and move on so...here's some stuff.

* Fancy.  Tests are segregated and can be called individually or all together.

* Cleaning up

* cleanup getting ready for PR

* Documentation for sanity

Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on issue 19 (#32)

* added initial code for issue19 page/id

* removed the test cases package in page/tests-not required now

* updated on the previous comments on issue

* WIP on Issue 21 (#33)

* Added the initial codebase to implement the GET/line/{lineid} and REST responses

* Added the Code Changes Documentation

* Delete Code Changes Documnetation.md

* Updated the code with the requested comments and added the end to end,exists and functionality test cases

* Added the Read me file , updated the code for the requested changes

---------

Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on Issue 2 (#34)

* Initial commit on Issue #2, largely duplicating /manifest code to new /project directory

* /project sends local dummy JSON data

* Added tests to project directory

* Addressed comment on mockPause() in project.mjs

---------

Co-authored-by: Bryan Haberberger <[email protected]>

* Manifest endpoint cleanup (#47)

* clean it up!

* documentation

* documentation and cleanup

* documentation and cleanup

* big merge cleanup

---------

Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* validating name

package name was invalid. Space and CAPS removed

* license hotfix

* WIP on issue 56-extend-page-web-api (#63)

* updated the code and written test cases initially failing

* updated the changes for the issue 56 Added all the changes that will mock the Database functionality for now If the db connection provided just need to connect

* added put route

* added few more test cases to check differnt query params conditions

* updated on the review comments

* removed ";"

* updated unit tests

* Code fixes for passing tests (#99)

* hot fix for dbTests

* Fixed the end to end and functionality tests (#98)

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

---------

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

* hotfix to get this working.

Continue work on this branch

* tests in

these are useless but should break later correctly

* real validation

` expect(database.isValidId(123)).toBeTruthy()` is still false somehow

* import for validation

* https://youtu.be/tgGAHzvDyGU?si=4Gnih3pU6KipSMdZ

---------

Co-authored-by: Bryan Haberberger <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* add changes from user class, skip mongo unit tests

* line:169 was saving a Promise

* only used once

* make sure its new for reasons

* unskip tests

* exact test

* Get me Wayne Brady

* from comments

* WIP on Issue #93 (#103)

* Added /project/create route and logic to add project to database

* Fixed bug that took way too long to diagnose. I hate programming

* Validations for some project keys

* More object validation in /project/create and some unit tests for the endpoint

* Useful comments

* Restructuring project/index.mjs

* Project endpoints now expect hexadecimal string id instead of numeric id

* Check for @type in new Project, new unit tests

* Fixed weird issue with tests and made slight fixes to other tests

* URL validation for "manifest" key of new Project

* helpful comment

* Implement database.isValidId()

* add private router for authenticated requests

* add agent to new user object

* unnested logic

* Private user routes (#116)

* add private router for authenticated requests

* add agent to new user object

* unnested logic

---------

Co-authored-by: Patrick Cuba <[email protected]>

* READONLY typo and node version

* adjust error

* move agent to where it is expected

* punt this test

* Update auth_unit_test.mjs

* Update auth_unit_test.mjs

* move auth application to specific route

* auth test

* match project creator with user agent

* add error handling to privateProfile

* Add error handling

* pass non-auth error onward as is

* 9 simplify cors (#117)

* Added common_cors.json file to put all reused CORS headers in one file

* Fixed missing import statement

* Updated common_cors.json import to include type assertion

* Added common_cors to more files that use the same CORS headers

* Undid mysterious package-lock change from previous commit

* clean up

* import project class

* create project from manifest

* add project class

* modify importProject to use Page and Project

* import project

* CATCH ERRORS

* reduce dependencies

* modify import pipeline

* noDiff

* private user routes (#118)

* move auth application to specific route

* auth test

* match project creator with user agent

* add error handling to privateProfile

* Add error handling

* pass non-auth error onward as is

* clean up

* Using the `getByID()` method

* combined methods

* getById

* collection default

* fix auto format

* test user class

* updated tests with mock data/methods

* test API existence

* add test cases

---------

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

* clean up

* refactor check block

* restructure project; layers-pages-lines

* clean up

* cleanup

* skip tests that use TEST_TOKEN for now.

* Import projects route and tests (#121)

* add importProject route

* add member elements

* add class and api tests

* move import project from /projects to /project

* delete /projects directory and route

* create manifest from URL

* Update tests to suite new import project structure

* Hot fix

* add URL validation function

* User cleanup (#122)

* remove redundant file

* refactor error responder

* cleanup, rewrite /:id

* replace stubs with actual tests

* Project cleanup (#123)

* remove redundant file

* refactor error responder

* cleanup, rewrite /:id

* replace stubs with actual tests

* project cleanup -- Use Project class to create and get

* Authenticated /projects

* Authenticated /projects

* cleanup

* notify improper request methods

* add ProjectFactory

* add saveProject

* rewrite tests

* add findOne(), cleanup resp[0] occurrences]

* Skip Tests (#125)

* remove redundant file

* refactor error responder

* cleanup, rewrite /:id

* replace stubs with actual tests

* project cleanup -- Use Project class to create and get

* Authenticated /projects

* Authenticated /projects

* cleanup

* notify improper request methods

* add ProjectFactory

* add saveProject

* rewrite tests

* add findOne(), cleanup resp[0] occurrences]

* skip auth-dependent tests

* nodiff

* Update package-lock.json

* 126 error fixes (#127)

* skip auth-dependent tests

* error fix from issue 126

* add/fix test cases

* cleanup

* cleanup

* skip auth-dependent tests

* modify /project/:id test

* cleanup

---------

Co-authored-by: Bryan Haberberger <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Sandeep Naidu <[email protected]>
cubap added a commit that referenced this issue Aug 28, 2024
* Development (#124)

* hot fix for dbTests

* Fixed the end to end and functionality tests (#98)

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

* WIP on issue  71-simple-getuserprofile-workflow (#74)

* Initialize Endpoints (#51)

* /manifest route prototype (#6) (#10)

* More set up for testing

* Now this is something worth bringing to the table to talk about.

* Now this is something worth bringing to the table to talk about.

* Hands up, no further until after stand up.  Make sure this is on a better looking track.

* Better organization.  Better notes and textual queues to what is going on.

* oo get that low hanging coverage

* test wording hint

* If I typed out this comment your would TLDR and move on so...here's some stuff.

* Fancy.  Tests are segregated and can be called individually or all together.

* Cleaning up

* cleanup getting ready for PR

* Documentation for sanity

Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on issue 19 (#32)

* added initial code for issue19 page/id

* removed the test cases package in page/tests-not required now

* updated on the previous comments on issue

* WIP on Issue 21 (#33)

* Added the initial codebase to implement the GET/line/{lineid} and REST responses

* Added the Code Changes Documentation

* Delete Code Changes Documnetation.md

* Updated the code with the requested comments and added the end to end,exists and functionality test cases

* Added the Read me file , updated the code for the requested changes

---------

Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on Issue 2 (#34)

* Initial commit on Issue #2, largely duplicating /manifest code to new /project directory

* /project sends local dummy JSON data

* Added tests to project directory

* Addressed comment on mockPause() in project.mjs

---------

Co-authored-by: Bryan Haberberger <[email protected]>

* Manifest endpoint cleanup (#47)

* clean it up!

* documentation

* documentation and cleanup

* documentation and cleanup

* big merge cleanup

---------

Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* validating name

package name was invalid. Space and CAPS removed

* license hotfix

* WIP on issue 56-extend-page-web-api (#63)

* updated the code and written test cases initially failing

* updated the changes for the issue 56 Added all the changes that will mock the Database functionality for now If the db connection provided just need to connect

* added put route

* added few more test cases to check differnt query params conditions

* updated on the review comments

* removed ";"

* updated unit tests

* updated just for draft

* updating merge

* updating the userProfiles functionality defining its seperate package and tests with in

* updating on top of review comments

* updating the page code back to dev

* updating on the top of review comments

* updated and corrected

* updated the test cases

* removed semicollans

* roll back page to orginal

* Update index.mjs

* Update index.mjs

* Update page.mjs

* Update functionality_unit.test.mjs

* Update functionality_unit.test.mjs

* added based the filtration comments

---------

Co-authored-by: Bryan Haberberger <[email protected]>
Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* WIP on Issue #69 (#75)

* Slightly improved commenting clarity on respondWithProject()

* Very basic skeleton of /projects endpoint

* Added query param parsing for /projects, begun work on /projects tests

* Partial implementation of query params for /projects, mock data for /projects. Commented out /projects unit tests (not yet working)

* Resolved issue with authentication middleware implementation in /projects route

* /projects files now read environment variables

* commented out failing tests, added support for /projects hasRoles and exceptRoles queries

* Addressed some comments

* Query validation for /projects endpoint

* Addressed comments, fixed failing tests, and added lots more tests.

* weak getProjects() cleanup

The code works and is cleaner, but the sample projects are not ideal and it is tough to prove the filtering (which is incomplete anyway) works.

---------

Co-authored-by: Patrick Cuba <[email protected]>

* WIP on Issue 70 simple getuserprojects workflow (#73)

* Initialize Endpoints (#51)

* /manifest route prototype (#6) (#10)

* More set up for testing

* Now this is something worth bringing to the table to talk about.

* Now this is something worth bringing to the table to talk about.

* Hands up, no further until after stand up.  Make sure this is on a better looking track.

* Better organization.  Better notes and textual queues to what is going on.

* oo get that low hanging coverage

* test wording hint

* If I typed out this comment your would TLDR and move on so...here's some stuff.

* Fancy.  Tests are segregated and can be called individually or all together.

* Cleaning up

* cleanup getting ready for PR

* Documentation for sanity

Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on issue 19 (#32)

* added initial code for issue19 page/id

* removed the test cases package in page/tests-not required now

* updated on the previous comments on issue

* WIP on Issue 21 (#33)

* Added the initial codebase to implement the GET/line/{lineid} and REST responses

* Added the Code Changes Documentation

* Delete Code Changes Documnetation.md

* Updated the code with the requested comments and added the end to end,exists and functionality test cases

* Added the Read me file , updated the code for the requested changes

---------

Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on Issue 2 (#34)

* Initial commit on Issue #2, largely duplicating /manifest code to new /project directory

* /project sends local dummy JSON data

* Added tests to project directory

* Addressed comment on mockPause() in project.mjs

---------

Co-authored-by: Bryan Haberberger <[email protected]>

* Manifest endpoint cleanup (#47)

* clean it up!

* documentation

* documentation and cleanup

* documentation and cleanup

* big merge cleanup

---------

Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* validating name

package name was invalid. Space and CAPS removed

* license hotfix

* WIP on issue 56-extend-page-web-api (#63)

* updated the code and written test cases initially failing

* updated the changes for the issue 56 Added all the changes that will mock the Database functionality for now If the db connection provided just need to connect

* added put route

* added few more test cases to check differnt query params conditions

* updated on the review comments

* removed ";"

* updated unit tests

* Slightly improved commenting clarity on respondWithProject()

* Integrated getUserProjects function into the project endpoint along with authenticateUser middleware for token validation. Updated response formatting and error handling, included dbController import, introduced getUserProjects function to fetch projects based on user ID, and modified findLineById to include a simulated database delay while returning line objects by ID

* Very basic skeleton of /projects endpoint

* Added query param parsing for /projects, begun work on /projects tests

* resolving merge

* resolving

* Partial implementation of query params for /projects, mock data for /projects. Commented out /projects unit tests (not yet working)

* Resolved issue with authentication middleware implementation in /projects route

* /projects files now read environment variables

* commented out failing tests, added support for /projects hasRoles and exceptRoles queries

* Updated the code cloned from development and added the services at get /project ,added the parameter handling,appllied filters ,returned as json ,surfaces the errors.

* Addressed some comments

* Query validation for /projects endpoint

* updated the code with requested changes , added the old code , updated the issue requirements

* Updated the code based on the requested changes ,added the documentation

* Addressed comments, fixed failing tests, and added lots more tests.

* weak getProjects() cleanup

The code works and is cleaner, but the sample projects are not ideal and it is tough to prove the filtering (which is incomplete anyway) works.

* moving tests to /projects

and combining with #69

* remove from /project

* skipping auth until auth is universal

---------

Co-authored-by: Bryan Haberberger <[email protected]>
Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Sandeep Naidu <[email protected]>

* reserveId

tests passing

* upsidedown letter

* set variable timeout for tests (#100)

* set variable timeout for tests

* hot fix

* undiff to avoid conflicts

* undiff to avoid conflicts

---------

Co-authored-by: Bryan Haberberger <[email protected]>

* 101 isvalidid for db controller (#109)

* Initialize Endpoints (#51)

* /manifest route prototype (#6) (#10)

* More set up for testing

* Now this is something worth bringing to the table to talk about.

* Now this is something worth bringing to the table to talk about.

* Hands up, no further until after stand up.  Make sure this is on a better looking track.

* Better organization.  Better notes and textual queues to what is going on.

* oo get that low hanging coverage

* test wording hint

* If I typed out this comment your would TLDR and move on so...here's some stuff.

* Fancy.  Tests are segregated and can be called individually or all together.

* Cleaning up

* cleanup getting ready for PR

* Documentation for sanity

Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on issue 19 (#32)

* added initial code for issue19 page/id

* removed the test cases package in page/tests-not required now

* updated on the previous comments on issue

* WIP on Issue 21 (#33)

* Added the initial codebase to implement the GET/line/{lineid} and REST responses

* Added the Code Changes Documentation

* Delete Code Changes Documnetation.md

* Updated the code with the requested comments and added the end to end,exists and functionality test cases

* Added the Read me file , updated the code for the requested changes

---------

Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Bryan Haberberger <[email protected]>

* WIP on Issue 2 (#34)

* Initial commit on Issue #2, largely duplicating /manifest code to new /project directory

* /project sends local dummy JSON data

* Added tests to project directory

* Addressed comment on mockPause() in project.mjs

---------

Co-authored-by: Bryan Haberberger <[email protected]>

* Manifest endpoint cleanup (#47)

* clean it up!

* documentation

* documentation and cleanup

* documentation and cleanup

* big merge cleanup

---------

Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* validating name

package name was invalid. Space and CAPS removed

* license hotfix

* WIP on issue 56-extend-page-web-api (#63)

* updated the code and written test cases initially failing

* updated the changes for the issue 56 Added all the changes that will mock the Database functionality for now If the db connection provided just need to connect

* added put route

* added few more test cases to check differnt query params conditions

* updated on the review comments

* removed ";"

* updated unit tests

* Code fixes for passing tests (#99)

* hot fix for dbTests

* Fixed the end to end and functionality tests (#98)

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

---------

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

* hotfix to get this working.

Continue work on this branch

* tests in

these are useless but should break later correctly

* real validation

` expect(database.isValidId(123)).toBeTruthy()` is still false somehow

* import for validation

* https://youtu.be/tgGAHzvDyGU?si=4Gnih3pU6KipSMdZ

---------

Co-authored-by: Bryan Haberberger <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>

* add changes from user class, skip mongo unit tests

* line:169 was saving a Promise

* only used once

* make sure its new for reasons

* unskip tests

* exact test

* Get me Wayne Brady

* from comments

* WIP on Issue #93 (#103)

* Added /project/create route and logic to add project to database

* Fixed bug that took way too long to diagnose. I hate programming

* Validations for some project keys

* More object validation in /project/create and some unit tests for the endpoint

* Useful comments

* Restructuring project/index.mjs

* Project endpoints now expect hexadecimal string id instead of numeric id

* Check for @type in new Project, new unit tests

* Fixed weird issue with tests and made slight fixes to other tests

* URL validation for "manifest" key of new Project

* helpful comment

* Implement database.isValidId()

* add private router for authenticated requests

* add agent to new user object

* unnested logic

* Private user routes (#116)

* add private router for authenticated requests

* add agent to new user object

* unnested logic

---------

Co-authored-by: Patrick Cuba <[email protected]>

* READONLY typo and node version

* adjust error

* move agent to where it is expected

* punt this test

* Update auth_unit_test.mjs

* Update auth_unit_test.mjs

* move auth application to specific route

* auth test

* match project creator with user agent

* add error handling to privateProfile

* Add error handling

* pass non-auth error onward as is

* 9 simplify cors (#117)

* Added common_cors.json file to put all reused CORS headers in one file

* Fixed missing import statement

* Updated common_cors.json import to include type assertion

* Added common_cors to more files that use the same CORS headers

* Undid mysterious package-lock change from previous commit

* clean up

* import project class

* create project from manifest

* add project class

* modify importProject to use Page and Project

* import project

* CATCH ERRORS

* reduce dependencies

* modify import pipeline

* noDiff

* private user routes (#118)

* move auth application to specific route

* auth test

* match project creator with user agent

* add error handling to privateProfile

* Add error handling

* pass non-auth error onward as is

* clean up

* Using the `getByID()` method

* combined methods

* getById

* collection default

* fix auto format

* test user class

* updated tests with mock data/methods

* test API existence

* add test cases

---------

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

* clean up

* refactor check block

* restructure project; layers-pages-lines

* clean up

* cleanup

* skip tests that use TEST_TOKEN for now.

* Import projects route and tests (#121)

* add importProject route

* add member elements

* add class and api tests

* move import project from /projects to /project

* delete /projects directory and route

* create manifest from URL

* Update tests to suite new import project structure

* Hot fix

* add URL validation function

* User cleanup (#122)

* remove redundant file

* refactor error responder

* cleanup, rewrite /:id

* replace stubs with actual tests

* Project cleanup (#123)

* remove redundant file

* refactor error responder

* cleanup, rewrite /:id

* replace stubs with actual tests

* project cleanup -- Use Project class to create and get

* Authenticated /projects

* Authenticated /projects

* cleanup

* notify improper request methods

* add ProjectFactory

* add saveProject

* rewrite tests

* add findOne(), cleanup resp[0] occurrences]

* Skip Tests (#125)

* remove redundant file

* refactor error responder

* cleanup, rewrite /:id

* replace stubs with actual tests

* project cleanup -- Use Project class to create and get

* Authenticated /projects

* Authenticated /projects

* cleanup

* notify improper request methods

* add ProjectFactory

* add saveProject

* rewrite tests

* add findOne(), cleanup resp[0] occurrences]

* skip auth-dependent tests

* nodiff

* Update package-lock.json

* 126 error fixes (#127)

* skip auth-dependent tests

* error fix from issue 126

* add/fix test cases

* cleanup

* cleanup

* skip auth-dependent tests

* modify /project/:id test

* cleanup

---------

Co-authored-by: Bryan Haberberger <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Sandeep Naidu <[email protected]>

* Add roles and permissions

* add existing TPEN user to TPEN project

* check user access for permissions to modify project members

* update access check

* add payload validation

* add non-existing TPEN user to project

* add non-TPEN user to project

* clean up

---------

Co-authored-by: Bryan Haberberger <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: BhanuKandula5030 <[email protected]>
Co-authored-by: Sandeep Kumar Sutharapu <[email protected]>
Co-authored-by: Patrick Cuba <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Sandeep Naidu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants