Skip to content

Commit

Permalink
chore(release): 6.0.0 [skip ci]
Browse files Browse the repository at this point in the history
## [6.0.0](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](a5bf13d))
* add delete API ([0e077c3](0e077c3))
* add os Mismatch ([30b0215](30b0215))
* add revision string field to confidence object ([8a2f270](8a2f270))
* drop support for go 1.20 ([46953bc](46953bc))
* drop usage of `github.com/pkg/errors` ([186d30a](186d30a))
* introduce `TooManyRequestsError` ([85f3307](85f3307))
* provide `HttpResponse()` in `ApiError` ([acd1274](acd1274))
* re-write request handling logic ([14b7e7f](14b7e7f))
* remove usage of github.com/antihax/optional package ([62db97f](62db97f))
* rename `GenericSwaggerError` to `ApiError` ([259b7b4](259b7b4))
* rename `ManyRequestsResponse` to `TooManyRequestsResponse` ([3f66641](3f66641))

### Bug Fixes

* allow passing `nil` configuration to `NewAPIClient` ([8234fbe](8234fbe))
* move test related dependencies to test module ([298275d](298275d))
* use correct error type for `incognito`, `rawDeviceAttributes` and `tampering` in the `GetEvent` method ([c29aea9](c29aea9))

### Reverts

* Revert "chore(release): 6.0.0-test.1 [skip ci]" ([9916b45](9916b45))
* "chore(release): 6.0.0-test.1 [skip ci]" ([84ec138](84ec138))
  • Loading branch information
semantic-release-bot committed Jun 27, 2024
1 parent f26a52e commit dfd4eac
Show file tree
Hide file tree
Showing 21 changed files with 92 additions and 37 deletions.
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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"
)

Expand Down Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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"
)

Expand Down Expand Up @@ -163,15 +163,15 @@ 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:
```go
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() {
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packageVersion": "5.0.2",
"packageVersion": "6.0.0",
"gitRepoId": "fingerprint-pro-server-api-go-sdk",
"gitUserId": "fingerprintjs",
"packageName": "sdk",
Expand Down
2 changes: 1 addition & 1 deletion example/deleteVisit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion example/getEvent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion example/getVisits.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion example/sealedResults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion example/webhookSignature.go
Original file line number Diff line number Diff line change
@@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion sdk/api_fingerprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/*
Expand Down
2 changes: 1 addition & 1 deletion sdk/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion sdk/sealed/unseal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
14 changes: 7 additions & 7 deletions template/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
)

Expand Down Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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"
)

Expand Down Expand Up @@ -171,15 +171,15 @@ 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:
```go
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() {
Expand Down
4 changes: 2 additions & 2 deletions test/DeleteVisitorData_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions test/GetEvent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions test/GetVisits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/Region_test.go
Original file line number Diff line number Diff line change
@@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions test/Unseal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/api_fingerprint_test.go
Original file line number Diff line number Diff line change
@@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion test/webhook_test.go
Original file line number Diff line number Diff line change
@@ -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"
)
Expand Down

0 comments on commit dfd4eac

Please sign in to comment.