Commit Graph

296 Commits

Author SHA1 Message Date
Mateusz Filipowicz
ae23f73810 fix: passing setting response body as pointer to Post method (#34) 2025-02-21 15:59:06 +01:00
Mateusz Filipowicz
d665aceba2 docs: add migration guide from paultyng/go-unifi 2025-02-21 06:56:53 +01:00
Mateusz Filipowicz
637809c663 feat: support Zone-Based Firewalls (#33)
* feat: support Zone-Based Firewalls

* chore: add usage example of zone-based firewall

* chore: add note to readme to support unifi controller v2

* fix: invalid path for reordering firewall zone policies
2025-02-20 18:48:04 +01:00
Mateusz Filipowicz
16f71e7fe9 feat: add Version method to client to provide system version information (#32) 2025-02-19 09:19:20 +01:00
Mateusz Filipowicz
d3a3d5a342 feat: allow creating own http.RoundTripper for http.Client with HttpRoundTripperProvider when customizing pre-configured http.Transport with HttpTransportCustomizer is not sufficient (#31)
feat: allow creating own http.RoundTripper for http.Client with `HttpRoundTripperProvider` when customizing pre-configured http.Transport with `HttpTransportCustomizer` is not sufficient
2025-02-19 01:28:11 +01:00
Mateusz Filipowicz
7c7ef98c03 feat: rename HttpCustomizer to HttpTransportCustomizer and make it return http.Transport that is later used (#30)
* feat: rename HttpCustomizer to HttpTransportCustomizer and make it return http.Transport that is later used

* linting
2025-02-19 01:03:21 +01:00
Mateusz Filipowicz
e25b426a84 docs: update docs with valid reference to detailed documentation 2025-02-18 22:38:47 +01:00
Mateusz Filipowicz
35e7b2c3cc docs: add detailed usage documentation together with examples (#29)
* feat: rename Pass to Password in ClientConfig

* docs: add more detailed usage documentation together with examples

* chore: update issue templates

* docs: add codeowners, code of conduct and contributing docs

* chore: add editorconfig

* chore: apply linter
2025-02-18 22:36:08 +01:00
Mateusz Filipowicz
5b32a4763e chore: rollback bug issue template 2025-02-18 15:51:17 +01:00
Mateusz Filipowicz
ebc01e985b test 2025-02-18 15:49:55 +01:00
Mateusz Filipowicz
51d523f334 chore: use input-based bug report template 2025-02-18 15:48:43 +01:00
Mateusz Filipowicz
0667fc722a chore: disable blank issues 2025-02-18 15:44:02 +01:00
Mateusz Filipowicz
b54dbc5e6d chore: add issue templates 2025-02-18 15:36:57 +01:00
Mateusz Filipowicz
7432260d3e feat: expose all available actions on all resources through Client (#27) 2025-02-18 10:23:18 +01:00
Mateusz Filipowicz
87d0c6e28d feat(experimental): add support for reading and updating all settings (#26) 2025-02-18 09:32:02 +01:00
Mateusz Filipowicz
7b35725921 feat(experimental): add support for reading and updating all settings (#25) 2025-02-18 07:43:04 +01:00
Mateusz Filipowicz
0e2736fa54 feat: remove deprecated SettingProviderCapabilities (#24) 2025-02-17 17:06:14 +01:00
Mateusz Filipowicz
ede158ad33 chore(deps): update golang to 1.23.5 2025-02-17 15:47:19 +01:00
dependabot[bot]
a3f50c64a9 chore(deps): bump github.com/golangci/golangci-lint from 1.64.2 to 1.64.5 (#19)
chore(deps): bump github.com/golangci/golangci-lint

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.64.2 to 1.64.5.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.64.2...v1.64.5)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 15:46:29 +01:00
dependabot[bot]
75092b8220 chore(deps): bump github.com/go-playground/validator/v10 from 10.24.0 to 10.25.0 (#22)
chore(deps): bump github.com/go-playground/validator/v10

Bumps [github.com/go-playground/validator/v10](https://github.com/go-playground/validator) from 10.24.0 to 10.25.0.
- [Release notes](https://github.com/go-playground/validator/releases)
- [Commits](https://github.com/go-playground/validator/compare/v10.24.0...v10.25.0)

---
updated-dependencies:
- dependency-name: github.com/go-playground/validator/v10
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 15:40:10 +01:00
Mateusz Filipowicz
aa188a6faa feat: add API v2 support by adding APGroup and DNSRecord resource handling with generated code (#23)
* feat: add API v2 support by adding APGroup and DNSRecord resource handling with generated code

* fix tests
2025-02-17 15:39:54 +01:00
Mateusz Filipowicz
dca894e8e7 feat: use Client interface instead of client struct when interacting with UniFi SDK (#21)
* feat: use Client interface instead of client struct when interacting with UniFi SDK

Breaking change!

* chore: linting

* chore: linting
2025-02-17 09:38:41 +01:00
Mateusz Filipowicz
fadc5ada8b feat: add client customization option (#20)
* feat: add client customization

* chore: fix linting

* feat: allow excluding client function by resource name
2025-02-16 23:00:05 +01:00
Mateusz Filipowicz
5a403dbb39 feat: simplified generated resources code customizations with yaml file config (#17)
* feat: simplified generated code customizations with yaml file config

* chore: apply linting
2025-02-12 09:18:44 +01:00
dependabot[bot]
8c99b428d9 chore(deps): bump github.com/golangci/golangci-lint from 1.63.4 to 1.64.2 (#16)
chore(deps): bump github.com/golangci/golangci-lint

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.63.4 to 1.64.2.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.63.4...v1.64.2)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-12 08:52:27 +01:00
dependabot[bot]
b964de6fcc chore(deps): bump golang.org/x/tools from 0.29.0 to 0.30.0 (#12)
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.29.0 to 0.30.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.29.0...v0.30.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-12 00:33:23 +01:00
dependabot[bot]
f72f5799c4 chore(deps): bump golang.org/x/net from 0.34.0 to 0.35.0 (#13)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.34.0 to 0.35.0.
- [Commits](https://github.com/golang/net/compare/v0.34.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-12 00:13:13 +01:00
Mateusz Filipowicz
bb21419c0e test: add comprehensive testing of codegen (#14) 2025-02-12 00:10:46 +01:00
Mateusz Filipowicz
6016a3d34a feat: add code generation for Unifi client interface (#11)
* feat: add code generation for Unifi client interface

* chore: apply linter hints

* chore: add tests

* fix: nondeterministic client function signature due to iteration of map params

* chore: add move version tests

* chore: add more generator tests

* chore: lint
2025-02-11 16:28:29 +01:00
Mateusz Filipowicz
c6e20b675c refactor: major refactor of unifi.go to split it into multiple files for cohesiveness and readability.
Even more documentation
2025-02-10 22:59:39 +01:00
Mateusz Filipowicz
473a5d0d5c chore: increase test coverage of unifi 2025-02-10 19:02:30 +01:00
Mateusz Filipowicz
35b786277c feat: use sysinfo API for getting system information with fallback to old API (#10)
* feat: use sysinfo API for getting system information with fallback to old API

* chore: apply linting
2025-02-10 18:43:20 +01:00
dependabot[bot]
103da3baaa chore(deps): bump fgrosse/go-coverage-report from 1.1.1 to 1.2.0
Bumps [fgrosse/go-coverage-report](https://github.com/fgrosse/go-coverage-report) from 1.1.1 to 1.2.0.
- [Release notes](https://github.com/fgrosse/go-coverage-report/releases)
- [Changelog](https://github.com/fgrosse/go-coverage-report/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fgrosse/go-coverage-report/compare/v1.1.1...v1.2.0)

---
updated-dependencies:
- dependency-name: fgrosse/go-coverage-report
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 18:01:36 +01:00
Mateusz Filipowicz
7f5968314d feat: make error handling more verbose and collect more error information from API errors, support API V2 error format (#8)
feat: make error handling more verbose and collect more error information from Unifi Controller, support API V2 error format
2025-02-10 03:03:56 +01:00
Mateusz Filipowicz
53bb1a13b9 feat: generate fields validation and use it when sending requests to API (#7)
* feat: generate fields validation and use it when issuing requests to API with soft (default) or hard modes

* chore: apply linter fixes

* feat: enable field validation on int fields

* feat: add validation for ^[\w]+$ fields

* feat: add validation for MAC address fields

* fix: trim wrappers for all comments

* feat: add validation for IPv4, IPv6 and IP(IPv4/IPv6) fields

* feat: add validation for numeric, non-zero based fields

* fix: one of validation can contain dot (.) sign in values

* feat: add second notation of MAC address validation

* fix: one of validation can start with ^( and end with )$

* feat: add option to disable validation and use soft validation by default

* chore: fix test

* docs: add readme about client-side validation
2025-02-09 21:08:21 +01:00
Mateusz Filipowicz
9f4fe33d07 ci: code coverage reporting in PR 2025-02-09 14:24:03 +01:00
Mateusz Filipowicz
6d239a890b ci: enable coverage generation 2025-02-09 14:19:00 +01:00
Mateusz Filipowicz
32f8cbf789 chore: use GPG for signing release 2025-02-09 10:34:14 +01:00
Mateusz Filipowicz
1b3d2a51d8 chore: use Github changelog autogeneration with goreleaser 2025-02-09 05:07:06 +01:00
Mateusz Filipowicz
7675214e5b chore: fix release yml name for changelog generation configuration 2025-02-09 05:00:04 +01:00
Mateusz Filipowicz
7b61fb7857 ci: fetch full depth when releasing 2025-02-09 04:55:45 +01:00
Mateusz Filipowicz
c7e81e2b18 feat: add validation of ClientConfig fields for improved data integrity (#5)
* feat: add validation of ClientConfig fields for improved data integrity

* chore: add tests for client config validation
2025-02-09 04:21:15 +01:00
Mateusz Filipowicz
e99645cf93 fix: renamed generator template to use ErrNotFound instead of NotFoundError 2025-02-09 02:07:44 +01:00
Mateusz Filipowicz
d79f581c1f chore: apply linter fixes 2025-02-09 01:51:47 +01:00
Mateusz Filipowicz
685572d5ce test: add tests for Unifi client 2025-02-09 01:51:47 +01:00
Mateusz Filipowicz
f79f21c4ad feat: new, more customizable client supporting API Key and user/password authentication 2025-02-09 01:51:47 +01:00
Mateusz Filipowicz
8a0cf33e75 chore: update go-git 2025-02-07 18:51:46 +01:00
Mateusz Filipowicz
cac05add7a docs: update README 2025-02-07 18:35:45 +01:00
Mateusz Filipowicz
e629288cba feat(codegen): rename "fields" to "codegen" for more meaningful naming 2025-02-07 17:42:05 +01:00
Mateusz Filipowicz
f396b2f712 chore: improve logging and add trace logging with --trace flag 2025-02-07 17:42:05 +01:00