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

Migrate npm #642

Merged
merged 2 commits into from
Aug 3, 2023
Merged

Migrate npm #642

merged 2 commits into from
Aug 3, 2023

Conversation

thib3113
Copy link
Owner

@thib3113 thib3113 commented Aug 3, 2023

migrate to npm, an try to repair scenario tests (failed => disabled)

@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #642 (bf5e366) into main (80b26ab) will decrease coverage by 3.42%.
Report is 1 commits behind head on main.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #642      +/-   ##
==========================================
- Coverage   99.81%   96.39%   -3.42%     
==========================================
  Files          54       54              
  Lines        2159     2165       +6     
  Branches      697      703       +6     
==========================================
- Hits         2155     2087      -68     
- Misses          4       78      +74     
Files Changed Coverage Δ
src/Sites/Sites.ts 92.30% <87.50%> (-7.70%) ⬇️
src/Controller.ts 100.00% <100.00%> (ø)
src/UnifiAuth.ts 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80b26ab...bf5e366. Read the comment docs.

@sonarcloud
Copy link

sonarcloud bot commented Aug 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

90.0% 90.0% Coverage
0.0% 0.0% Duplication

@thib3113 thib3113 merged commit c5e74a5 into main Aug 3, 2023
30 of 32 checks passed
@thib3113 thib3113 deleted the migrate-npm branch August 3, 2023 00:39
KyleBrandon pushed a commit to KyleBrandon/unifi-client that referenced this pull request Aug 4, 2023
* save

* disable scenarios tests for the moment
thib3113 added a commit that referenced this pull request Aug 5, 2023
* Support querying and updating UniFi Networks

Added INetwork.ts to provide a contract for the Network entity
Added Network.ts to represent a network in UniFi
Added Networks.ts to allow for querying all existing networks
Updated Controller.ts to provide API to getNetworks
Added unit tests for Network.ts
Added unit tests for Networks.ts

* update gitignore

* 2FA don't work on non unifiOS (#639)

* upgrade deps

* fix(CI): repair snyk CI

* fix(deps): fix dependencies

* fix(deps): include lock file

* unifi-client-638 2FA don't work on non unifiOS

* follow sonar recommendation

* Migrate npm (#642)

* save

* disable scenarios tests for the moment

* move security snyk check on weekly actions

* Support querying and updating UniFi Networks

Added INetwork.ts to provide a contract for the Network entity
Added Network.ts to represent a network in UniFi
Added Networks.ts to allow for querying all existing networks
Updated Controller.ts to provide API to getNetworks
Added unit tests for Network.ts
Added unit tests for Networks.ts

* update gitignore

* Address code review feedback for PR #641

Update Controller and IController to remove exposure of Networks
- Networks are based on a Site and should not be exposed at that level

Update Network
- Renamed `save()` to `setEnabed()` to better describe the intent
- Renamed `_updateDevice()` to `_update()` as this does not update a device and should be generic.  Note that this is a protected method only called by `setEnabled()` currently.

* Address code review feedback for PR #641

- Remove unused reference from IController (lint is your friend)
- Update Network to require _id as opposed to name.  The reason being that the _id is required to update or save a network with UniFi, not the name.
- Update Network to support update() by taking a Partial<INetwork> requiring an _id.
- Update Network to clean up the save() method.
- Update Network.test
        - add support method expectNetworkEqual()
        - update construct::network tests to expect _id vs name
        - update functions::save tests to expect _id
        - update functions::update to test updating a network with only an id (no reason to query before)

* Address code review feedback for PR #641

- Update Network to set _id as a readonly property in the constructor
- Moved debug initialization out of import()
- Modified update()
	- Omit the _id from the passed properties
	- Ensure that this._id is valid
	- Merge passed properties into this
- Modifed save()
	- Ensure that this._id is valid
	- Remove merge of response as it's empty
- Modified update unit tests
	- Removed check for a valid _id as it's now ignored
	- Added test that passes _id as properties to ensure it's correctly omitted

* try CI permissions

---------

Co-authored-by: Thibaut SEVERAC <thib3113@gmail.com>
KyleBrandon pushed a commit to KyleBrandon/unifi-client that referenced this pull request Aug 12, 2023
* save

* disable scenarios tests for the moment
KyleBrandon added a commit to KyleBrandon/unifi-client that referenced this pull request Aug 12, 2023
* Support querying and updating UniFi Networks

Added INetwork.ts to provide a contract for the Network entity
Added Network.ts to represent a network in UniFi
Added Networks.ts to allow for querying all existing networks
Updated Controller.ts to provide API to getNetworks
Added unit tests for Network.ts
Added unit tests for Networks.ts

* update gitignore

* 2FA don't work on non unifiOS (thib3113#639)

* upgrade deps

* fix(CI): repair snyk CI

* fix(deps): fix dependencies

* fix(deps): include lock file

* unifi-client-638 2FA don't work on non unifiOS

* follow sonar recommendation

* Migrate npm (thib3113#642)

* save

* disable scenarios tests for the moment

* move security snyk check on weekly actions

* Support querying and updating UniFi Networks

Added INetwork.ts to provide a contract for the Network entity
Added Network.ts to represent a network in UniFi
Added Networks.ts to allow for querying all existing networks
Updated Controller.ts to provide API to getNetworks
Added unit tests for Network.ts
Added unit tests for Networks.ts

* update gitignore

* Address code review feedback for PR thib3113#641

Update Controller and IController to remove exposure of Networks
- Networks are based on a Site and should not be exposed at that level

Update Network
- Renamed `save()` to `setEnabed()` to better describe the intent
- Renamed `_updateDevice()` to `_update()` as this does not update a device and should be generic.  Note that this is a protected method only called by `setEnabled()` currently.

* Address code review feedback for PR thib3113#641

- Remove unused reference from IController (lint is your friend)
- Update Network to require _id as opposed to name.  The reason being that the _id is required to update or save a network with UniFi, not the name.
- Update Network to support update() by taking a Partial<INetwork> requiring an _id.
- Update Network to clean up the save() method.
- Update Network.test
        - add support method expectNetworkEqual()
        - update construct::network tests to expect _id vs name
        - update functions::save tests to expect _id
        - update functions::update to test updating a network with only an id (no reason to query before)

* Address code review feedback for PR thib3113#641

- Update Network to set _id as a readonly property in the constructor
- Moved debug initialization out of import()
- Modified update()
	- Omit the _id from the passed properties
	- Ensure that this._id is valid
	- Merge passed properties into this
- Modifed save()
	- Ensure that this._id is valid
	- Remove merge of response as it's empty
- Modified update unit tests
	- Removed check for a valid _id as it's now ignored
	- Added test that passes _id as properties to ensure it's correctly omitted

* try CI permissions

---------

Co-authored-by: Thibaut SEVERAC <thib3113@gmail.com>
KyleBrandon pushed a commit to KyleBrandon/unifi-client that referenced this pull request Aug 12, 2023
* save

* disable scenarios tests for the moment
KyleBrandon added a commit to KyleBrandon/unifi-client that referenced this pull request Aug 12, 2023
* Support querying and updating UniFi Networks

Added INetwork.ts to provide a contract for the Network entity
Added Network.ts to represent a network in UniFi
Added Networks.ts to allow for querying all existing networks
Updated Controller.ts to provide API to getNetworks
Added unit tests for Network.ts
Added unit tests for Networks.ts

* update gitignore

* 2FA don't work on non unifiOS (thib3113#639)

* upgrade deps

* fix(CI): repair snyk CI

* fix(deps): fix dependencies

* fix(deps): include lock file

* unifi-client-638 2FA don't work on non unifiOS

* follow sonar recommendation

* Migrate npm (thib3113#642)

* save

* disable scenarios tests for the moment

* move security snyk check on weekly actions

* Support querying and updating UniFi Networks

Added INetwork.ts to provide a contract for the Network entity
Added Network.ts to represent a network in UniFi
Added Networks.ts to allow for querying all existing networks
Updated Controller.ts to provide API to getNetworks
Added unit tests for Network.ts
Added unit tests for Networks.ts

* update gitignore

* Address code review feedback for PR thib3113#641

Update Controller and IController to remove exposure of Networks
- Networks are based on a Site and should not be exposed at that level

Update Network
- Renamed `save()` to `setEnabed()` to better describe the intent
- Renamed `_updateDevice()` to `_update()` as this does not update a device and should be generic.  Note that this is a protected method only called by `setEnabled()` currently.

* Address code review feedback for PR thib3113#641

- Remove unused reference from IController (lint is your friend)
- Update Network to require _id as opposed to name.  The reason being that the _id is required to update or save a network with UniFi, not the name.
- Update Network to support update() by taking a Partial<INetwork> requiring an _id.
- Update Network to clean up the save() method.
- Update Network.test
        - add support method expectNetworkEqual()
        - update construct::network tests to expect _id vs name
        - update functions::save tests to expect _id
        - update functions::update to test updating a network with only an id (no reason to query before)

* Address code review feedback for PR thib3113#641

- Update Network to set _id as a readonly property in the constructor
- Moved debug initialization out of import()
- Modified update()
	- Omit the _id from the passed properties
	- Ensure that this._id is valid
	- Merge passed properties into this
- Modifed save()
	- Ensure that this._id is valid
	- Remove merge of response as it's empty
- Modified update unit tests
	- Removed check for a valid _id as it's now ignored
	- Added test that passes _id as properties to ensure it's correctly omitted

* try CI permissions

---------

Co-authored-by: Thibaut SEVERAC <thib3113@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant