diff --git a/CHANGELOG.md b/CHANGELOG.md index 725ea4e..66e2435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,58 @@ +## [6.0.0](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/compare/v5.0.2...v6.0.0) (2024-06-27) + + +### ⚠ BREAKING CHANGES + +* it is now easier to check for too many requests error (429): + +```go + response, httpRes, err := client.FingerprintApi.GetVisits(auth, visitorId, &opts) + fmt.Printf("%+v\n", httpRes) + + if err != nil { + var tooManyRequestsError *sdk.TooManyRequestsError + + if errors.As(err, &tooManyRequestsError) { + log.Printf("Too many requests, retry after %d seconds", tooManyRequestsError.RetryAfter()) + } else { + log.Print(err) + } + } +``` +* rename `GenericSwaggerError` to `ApiError` +* rename `ManyRequestsResponse` to `TooManyRequestsResponse` +* go 1.20 has reached EOL. Minimal supported version of go is now 1.21 +* right now we use native `errors` package for joining errors, meaning that multiple error messages are now joined by new line rather than colon (:) +* optional pkg is no longer used in this SDK. Please pass native GO types instead. + +### Features + +* add `IsValidWebhookSignature` function for validating webhook signature ([a5bf13d](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/a5bf13d62171ce06ec031e26a33d27d3f0b851bb)) +* add delete API ([0e077c3](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/0e077c3546c4a29d4ca8ae42da2eff6c587fee6f)) +* add os Mismatch ([30b0215](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/30b0215128f488db116ce29e8c531cbb8718eafb)) +* add revision string field to confidence object ([8a2f270](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/8a2f270a3cc057dec78bf7b4aaa36522ca960d9c)) +* drop support for go 1.20 ([46953bc](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/46953bc345e5d6c8acdb215c2b665b54c91fe5a8)) +* drop usage of `github.com/pkg/errors` ([186d30a](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/186d30a6ae0135a02f6abd20e0746ee59bee024a)) +* introduce `TooManyRequestsError` ([85f3307](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/85f3307c19991a0cb716a6c8f313ed7fa83bccf9)) +* provide `HttpResponse()` in `ApiError` ([acd1274](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/acd1274a1e7b157f0b3dad1ff1d9b53a2730b4e6)) +* re-write request handling logic ([14b7e7f](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/14b7e7f2f26280e5ffe59269273995b17ab19126)) +* remove usage of github.com/antihax/optional package ([62db97f](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/62db97f9373b7bf929cee3f8b5fccb50d8b82bd8)) +* rename `GenericSwaggerError` to `ApiError` ([259b7b4](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/259b7b417c7dcab31021e67aaa34e8daa3e41d82)) +* rename `ManyRequestsResponse` to `TooManyRequestsResponse` ([3f66641](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/3f66641c610d34db4cd0657833ff2696948f2f3b)) + + +### Bug Fixes + +* allow passing `nil` configuration to `NewAPIClient` ([8234fbe](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/8234fbef2bd91cbc4b62ac7061b5c907759e9527)) +* move test related dependencies to test module ([298275d](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/298275d75d13298745304916425539f905b0225f)) +* use correct error type for `incognito`, `rawDeviceAttributes` and `tampering` in the `GetEvent` method ([c29aea9](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/c29aea98fb7f814f19b46225a5656318fc4f81fd)) + + +### Reverts + +* Revert "chore(release): 6.0.0-test.1 [skip ci]" ([9916b45](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/9916b459c455951a6247636a9bbccc7cecc3b285)) +* "chore(release): 6.0.0-test.1 [skip ci]" ([84ec138](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/commit/84ec138b42fe10a7ffe649c031692da68e2cfaff)) + ## [5.0.2](https://github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/compare/v5.0.1...v5.0.2) (2024-03-28) diff --git a/README.md b/README.md index e21bdd5..de7969b 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Fingerprint Pro Server API allows you to get information about visitors and abou This Go package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 3 -- Package version: 5.0.2 +- Package version: 6.0.0 - Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen ## Requirements @@ -35,7 +35,7 @@ We keep the [Go support policy](https://go.dev/doc/devel/release) and support th 1. Get the package from GitHub: ```shell -go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk +go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk ``` 2. Import and use the library: @@ -46,7 +46,7 @@ package main import ( "context" "fmt" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "log" ) @@ -97,7 +97,7 @@ If your subscription is in region other than US, you need to change the region i ```go import ( - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" ) func main() { @@ -112,7 +112,7 @@ func main() { This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). Install the sealed results dependency as below: ```shell -go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/sealed +go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/sealed ``` Then you can use below code to unseal results: ```go @@ -121,7 +121,7 @@ package main import ( "encoding/base64" "fmt" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/sealed" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/sealed" "os" ) @@ -163,7 +163,7 @@ func main() { This SDK provides utility method for verifing the HMAC signature of the incoming webhook request. Install the webhook dependency as below: ```shell -go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/webhook +go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/webhook ``` Then you can use below code to verify signature: @@ -171,7 +171,7 @@ Then you can use below code to verify signature: package main import ( - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/webhook" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/webhook" ) func main() { diff --git a/config.json b/config.json index a24d16e..4ed5a72 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "packageVersion": "5.0.2", + "packageVersion": "6.0.0", "gitRepoId": "fingerprint-pro-server-api-go-sdk", "gitUserId": "fingerprintjs", "packageName": "sdk", diff --git a/example/deleteVisit.go b/example/deleteVisit.go index db83eb4..ce3c7db 100644 --- a/example/deleteVisit.go +++ b/example/deleteVisit.go @@ -3,7 +3,7 @@ package main import ( "context" "fmt" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "log" "os" diff --git a/example/getEvent.go b/example/getEvent.go index 9d390bd..6ae0b37 100644 --- a/example/getEvent.go +++ b/example/getEvent.go @@ -7,7 +7,7 @@ import ( "log" "os" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "github.com/joho/godotenv" ) diff --git a/example/getVisits.go b/example/getVisits.go index d94727b..d800d37 100644 --- a/example/getVisits.go +++ b/example/getVisits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "errors" "fmt" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "log" "os" diff --git a/example/sealedResults.go b/example/sealedResults.go index 7936925..7c35a2e 100644 --- a/example/sealedResults.go +++ b/example/sealedResults.go @@ -4,7 +4,7 @@ import ( "encoding/base64" "encoding/json" "fmt" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/sealed" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/sealed" "github.com/joho/godotenv" "log" "os" diff --git a/example/webhookSignature.go b/example/webhookSignature.go index b0ab6e7..90e1551 100644 --- a/example/webhookSignature.go +++ b/example/webhookSignature.go @@ -1,7 +1,7 @@ package main import ( - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/webhook" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/webhook" "log" ) diff --git a/generate.go b/generate.go index cce8a80..79440f3 100644 --- a/generate.go +++ b/generate.go @@ -10,7 +10,7 @@ import ( "path/filepath" "strings" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/config" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/config" ) var files = []string{"README.md", "docs", ".swagger-codegen"} diff --git a/go.mod b/go.mod index 703b96f..f595afa 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5 +module github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6 go 1.21 diff --git a/sdk/api_fingerprint.go b/sdk/api_fingerprint.go index 57b3da6..e9511af 100644 --- a/sdk/api_fingerprint.go +++ b/sdk/api_fingerprint.go @@ -15,7 +15,7 @@ import ( "strings" ) -const IntegrationInfo = "fingerprint-pro-server-go-sdk/5.0.2" +const IntegrationInfo = "fingerprint-pro-server-go-sdk/6.0.0" type FingerprintApiServiceInterface interface { /* diff --git a/sdk/configuration.go b/sdk/configuration.go index f717dfd..cd93960 100644 --- a/sdk/configuration.go +++ b/sdk/configuration.go @@ -93,7 +93,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "Swagger-Codegen/5.0.2/go", + UserAgent: "Swagger-Codegen/6.0.0/go", region: RegionUS, } cfg.basePath = resolveBasePath(cfg.region) diff --git a/sdk/sealed/unseal.go b/sdk/sealed/unseal.go index 7382985..0cb5185 100644 --- a/sdk/sealed/unseal.go +++ b/sdk/sealed/unseal.go @@ -7,7 +7,7 @@ import ( "crypto/cipher" "encoding/json" "errors" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "io" ) diff --git a/template/README.mustache b/template/README.mustache index a1a6bda..dd4190a 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -43,7 +43,7 @@ We keep the [Go support policy](https://go.dev/doc/devel/release) and support th 1. Get the package from GitHub: ```shell -go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk +go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk ``` 2. Import and use the library: @@ -54,7 +54,7 @@ package main import ( "context" "fmt" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "log" ) @@ -105,7 +105,7 @@ If your subscription is in region other than US, you need to change the region i ```go import ( - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" ) func main() { @@ -120,7 +120,7 @@ func main() { This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). Install the sealed results dependency as below: ```shell -go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/sealed +go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/sealed ``` Then you can use below code to unseal results: ```go @@ -129,7 +129,7 @@ package main import ( "encoding/base64" "fmt" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/sealed" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/sealed" "os" ) @@ -171,7 +171,7 @@ func main() { This SDK provides utility method for verifing the HMAC signature of the incoming webhook request. Install the webhook dependency as below: ```shell -go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/webhook +go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/webhook ``` Then you can use below code to verify signature: @@ -179,7 +179,7 @@ Then you can use below code to verify signature: package main import ( - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/webhook" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/webhook" ) func main() { diff --git a/test/DeleteVisitorData_test.go b/test/DeleteVisitorData_test.go index 7f25890..4d9e5ba 100644 --- a/test/DeleteVisitorData_test.go +++ b/test/DeleteVisitorData_test.go @@ -5,8 +5,8 @@ import ( "encoding/json" "errors" "fmt" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/config" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/config" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "github.com/stretchr/testify/assert" "net/http" "net/http/httptest" diff --git a/test/GetEvent_test.go b/test/GetEvent_test.go index 92800ee..4877e9f 100644 --- a/test/GetEvent_test.go +++ b/test/GetEvent_test.go @@ -5,8 +5,8 @@ import ( "encoding/json" "errors" "fmt" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/config" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/config" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "github.com/stretchr/testify/assert" "log" "net/http" diff --git a/test/GetVisits_test.go b/test/GetVisits_test.go index 5e4ea7f..67ac2cd 100644 --- a/test/GetVisits_test.go +++ b/test/GetVisits_test.go @@ -5,8 +5,8 @@ import ( "encoding/json" "errors" "fmt" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/config" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/config" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "github.com/stretchr/testify/assert" "log" "net/http" diff --git a/test/Region_test.go b/test/Region_test.go index 9c91d4d..b2ba004 100644 --- a/test/Region_test.go +++ b/test/Region_test.go @@ -1,7 +1,7 @@ package test import ( - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "github.com/stretchr/testify/assert" "testing" ) diff --git a/test/Unseal_test.go b/test/Unseal_test.go index 52f0444..c91b3ba 100644 --- a/test/Unseal_test.go +++ b/test/Unseal_test.go @@ -4,8 +4,8 @@ import ( "encoding/base64" "encoding/json" "errors" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/sealed" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/sealed" "github.com/stretchr/testify/assert" "reflect" "testing" diff --git a/test/api_fingerprint_test.go b/test/api_fingerprint_test.go index c26ab19..94a145b 100644 --- a/test/api_fingerprint_test.go +++ b/test/api_fingerprint_test.go @@ -1,7 +1,7 @@ package test import ( - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk" "github.com/stretchr/testify/assert" "testing" ) diff --git a/test/webhook_test.go b/test/webhook_test.go index 91bac8b..f66ac71 100644 --- a/test/webhook_test.go +++ b/test/webhook_test.go @@ -1,7 +1,7 @@ package test import ( - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v5/sdk/webhook" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v6/sdk/webhook" "github.com/stretchr/testify/assert" "testing" )