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

Save Project to local database #93

Open
thehabes opened this issue Apr 4, 2024 · 1 comment · Fixed by #103
Open

Save Project to local database #93

thehabes opened this issue Apr 4, 2024 · 1 comment · Fixed by #103
Assignees
Labels
OSS An issue which is appropriate for OSS to work on.

Comments

@thehabes
Copy link
Member

thehabes commented Apr 4, 2024

Projects will be saved into the local mongo database Projects collection (identified in .env file). A minimal project will look something like this:

 {
    "_id": {
        "$oid": "65f48b254da4e4b8c656d0d1"
    },
    "slug": "exampleProject",
    "creator": "https://store.rerum.io/v1/id/exampleAgent",
    "created": 1,
    "group": {
        "$oid": "65f48c9a4da4e4b8c656d0d2"
    },
    "layers": [ "https://store.rerum.io/v1/id/exampleAnnotationCollection" ],
    "lastModified": "exampleAnnotationPageId",
    "viewer": "https://static.t-pen.org/#65f48b254da4e4b8c656d0d1",
    "license": "CC-BY",
    "manifest": "https://external.example.com/manifest.json",
    "tools": [],
    "options": {},
    "tags": ["gog"],
    "title": "First Project"
}

undefined values do not need to be set and should not be assumed to be present on any Project. This chart explains the expected values and how they are used:

key type description required notes
_id ObjectID(hex) MongoDB generated complex key This will be generated if not provided, but should be assigned before saving so the Interface can be notified of the location before it clears the queue in the DB driver.
slug String slugified from user input as alternate lookup value This must be unique, but is not required.
creator URI Rerum Agent Id of Project owner/creator Based on auth'ed User, does not change after creation
created Date Literal timestamp of the time this Project was created for sorting and filtering
group ObjectID(hex) MongoDB generated complex key If provided (maybe as a hexstring), can point to an existing Group but must be generated and saved into Groups collection if not
layers Array of URI Annotation Collection(s) in RERUM 🥝 Interfaces won't really work without it, but it doesn't need to be added until the first Annotations are added
lastModified RERUM URI The most recent Annotation or Canvas manipulated Not defined on creation
viewer URL Interface location for readonly HTML Static page location once Project is publicly visible
license String statement of license If not defined, default to "CC-BY" which might be added to a config
manifest URI IIIF Manifest of source must preexist or be embedded in the body of a post and created in RERUM
tools Array project tools no default, no rules set for inclusion yet, just Interfaces aid
options Object config object for overriding Interfaces defaults
tags Array of String open tags defined by Users or by Interfaces
title String unicode title of Project generate if not provided
@thehabes thehabes added the OSS An issue which is appropriate for OSS to work on. label Apr 4, 2024
@cubap cubap changed the title Connect /project with database(s) Save Project to local database Apr 11, 2024
@cubap
Copy link
Member

cubap commented Apr 12, 2024

Tests should confirm validation checks for new Projects, mock the driver actions, and respond correctly to expected errors or invalid inputs.

@leandrumartin leandrumartin self-assigned this Apr 12, 2024
@leandrumartin leandrumartin linked a pull request Apr 20, 2024 that will close this issue
cubap pushed a commit that referenced this issue Apr 29, 2024
* 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()
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]>
cubap added a commit that referenced this issue Oct 16, 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 auth-dependent tests

* 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

* add mailer component, tester route

* minor changes preparing for release, connected to slumailrelay

* cleanup

* 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

* Add TPEN user to a Project (#130)

* 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]>

* Add remove member endpoint

* Fix User class instantiation without userID

* refactor permissions structure and  access checks

* Update checkPermissions.mjs

- :

* semicolon excising

* Update checkPermissions.mjs

* viewer cleanup, no project on delete

* apply READ permisions to project/:id

* dev database

* draft pr (#136)

* draft pr

getting user profile coming back
( update clientID for AUDIENCE )

* Correct User behavior

* remove redundant catches

* Updating User Class

fixes #137
- load profile (less redundant) on login and returns new User for new visitors
- better profile handling
- aligned with fixtures (I think)

* force CI/CD

* force CI/CD

* 138 creating a new project is not making groups and contributors (#141)

* draft pr

getting user profile coming back
( update clientID for AUDIENCE )

* Correct User behavior

* remove redundant catches

* Updating User Class

fixes #137
- load profile (less redundant) on login and returns new User for new visitors
- better profile handling
- aligned with fixtures (I think)

* fixes #138

- Group class
- touched mongo controller
- added validation

* add group._id

* AI built tests

* Update Group.test.mjs

* sync reserveId()

fixes #142

* fixed imports and Group.members

* curly braces

* skeletal user

* you big dummy

* Tested up on Dev

* reinstates user/id

fixes #144

* align test cases

delete meaningless test

* Group tests all passing

* last failing test

weak, but done

* CD fixes for MONGODBDEV and MONGODBNAMEDEV references

---------

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

* new User, new tests

---------

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]>
Co-authored-by: Onoja Victor <[email protected]>
Co-authored-by: Onoja Victor <[email protected]>
Co-authored-by: Onoja Victor <[email protected]>
cubap added a commit that referenced this issue Nov 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 auth-dependent tests

* 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

* add mailer component, tester route

* minor changes preparing for release, connected to slumailrelay

* cleanup

* 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

* Add TPEN user to a Project (#130)

* 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]>

* Add remove member endpoint

* Fix User class instantiation without userID

* refactor permissions structure and  access checks

* Update checkPermissions.mjs

- :

* semicolon excising

* Update checkPermissions.mjs

* viewer cleanup, no project on delete

* apply READ permisions to project/:id

* dev database

* draft pr (#136)

* draft pr

getting user profile coming back
( update clientID for AUDIENCE )

* Correct User behavior

* remove redundant catches

* Updating User Class

fixes #137
- load profile (less redundant) on login and returns new User for new visitors
- better profile handling
- aligned with fixtures (I think)

* force CI/CD

* force CI/CD

* 138 creating a new project is not making groups and contributors (#141)

* draft pr

getting user profile coming back
( update clientID for AUDIENCE )

* Correct User behavior

* remove redundant catches

* Updating User Class

fixes #137
- load profile (less redundant) on login and returns new User for new visitors
- better profile handling
- aligned with fixtures (I think)

* fixes #138

- Group class
- touched mongo controller
- added validation

* add group._id

* AI built tests

* Update Group.test.mjs

* sync reserveId()

fixes #142

* fixed imports and Group.members

* curly braces

* skeletal user

* you big dummy

* Tested up on Dev

* reinstates user/id

fixes #144

* align test cases

delete meaningless test

* Group tests all passing

* last failing test

weak, but done

* CD fixes for MONGODBDEV and MONGODBNAMEDEV references

---------

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

* new User, new tests

* Add new project test cases - add member, remove member (#143)

* Add new project test cases - add member, remove member

* clear out console log

* skip token-dependent tests (#145)

* Project normalization (#146)

* class has data property

* User Group Project alignment.

* Copilot reorganized

* renaming and validation

* AI tests

* adjusting tests

better "Create" for User

* AI repaired tests

* AI trimmed some of these

* Update index.mjs

* Update index.mjs

* Update index.mjs

* Update Group.mjs

* Update Group.mjs

* Update Group.mjs

* Update controller.mjs

* no type

* Update controller.mjs

* get some type out of here

* where's thecollection?

* Update controller.mjs

* Update controller.mjs

* most of this is nothing

The magic is the User import for the factory

* Update User.mjs

* steady on

* Update index.mjs

* Update ProjectFactory.mjs

* some weird dead code removal

User has an update() that got absorbed in a merge... it's just gone now.

* This isn't JSON-LD, stooge

* whitespace

* hmmm

* Update index.mjs

* shoot from the hip

* assign data to user

* tests, being careful with scope creep

---------

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

* Manage roles (#151)

* fix loading error on /project/:id

* Add role management endpoints

* update default role CONTRIBUTOR

* update manage-role endpoints

* fix #153

add/remove customroles

* validating a Group

* validate before save/update

* conventional naming

* documentation

* add switch owner endpoint

* add check to prevent last role deletion

* transfer ownership

* Cleanup from comments

* add custom roles endpoints (#156)

* add custom roles endpoints

* cleanup

* rename to scrub

* used in route

* const let

* test

* moved

* add "custom" to custom roles

* Update isDefaultRole.test.mjs

* allow string input for removal

* Update isDefaultRole.test.mjs

* Update index.mjs

* always customRoles

* check incoming, not default

* Update isDefaultRole.mjs

* retry

* throughput error message

* throughput error

---------

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

* Update Group.mjs

* Only strings, allowOwner switch

* wash doesn't throw

* Update index.mjs

* rethrow

---------

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

* Quick interfaces support (#155)

* better projects getting

* non-double roles

* another pipeline to prevent lots of calls

* skip skip skipadelphia

---------

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: Leandru Martin <[email protected]>
Co-authored-by: Leandru Martin <[email protected]>
Co-authored-by: Sandeep Naidu <[email protected]>
Co-authored-by: Onoja Victor <[email protected]>
Co-authored-by: Onoja Victor <[email protected]>
Co-authored-by: Onoja Victor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OSS An issue which is appropriate for OSS to work on.
Projects
None yet
3 participants