Skip to content

Commit

Permalink
chore(release): 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
benemohamed committed Jul 26, 2023
1 parent c6bd93b commit d49ae1d
Show file tree
Hide file tree
Showing 21 changed files with 939 additions and 141 deletions.
81 changes: 80 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,85 @@ tomba login

![tomba email](svg/login.svg)

### Domain search

Instantly locate email addresses from any company name or website.

```bash
tomba search --target "tomba.io"
```

![tomba domain search](svg/search.svg)

### Enrichment

Locate and include data in your emails.

```bash
tomba enrich --target "[email protected]"
```

![tomba enrich](svg/enrich.svg)

### Author Finder

Instantly discover the email addresses of article authors.

```bash
tomba author --target "https://clearbit.com/blog/company-name-to-domain-api"
```

![tomba author](svg/author.svg)

### Linkedin Finder

Instantly discover the email addresses of Linkedin URLs.

```bash
tomba linkedin --target "https://www.linkedin.com/in/mohamed-ben-rebia"
```

![tomba linkedin](svg/linkedin.svg)

### Email Verifier

Verify the deliverability of an email address.

```bash
tomba verify --target "[email protected]"
```

![tomba verify](svg/verify.svg)

### Available Commands

| Command name | Description |
| ------------ | ------------------------------------------------------------------ |
| author | Instantly discover the email addresses of article authors. |
| completion | Generate the autocompletion script for the specified shell |
| count | Returns total email addresses we have for one domain. |
| enrich | Locate and include data in your emails. |
| help | Help about any command |
| linkedin | Instantly discover the email addresses of Linkedin URLs. |
| login | Sign in to Tomba account |
| logout | delete your current KEY & SECRET API session. |
| search | Instantly locate email addresses from any company name or website. |
| status | Returns domain status if is webmail or disposable. |
| verify | Verify the deliverability of an email address. |
| version | Print version number and build information. |

### Command Flags

| shortopts | longopts | Description |
| --------- | ---------- | --------------------------------------------------------------- |
| `-h` | `--help` | help for tomba |
| `-j` | `--json` | output JSON format. (default true) |
| `-k` | `--key` | Tomba API KEY. |
| `-o` | `--output` | Save the results to file. |
| `-s` | `--secret` | Tomba API SECRET. |
| `-t` | `--target` | TARGET SPECIFICATION Can pass email, Domain, URL, Linkedin URL. |
| `-y` | `--yaml` | output YAML format. |

## Auto-Completion

Auto-completion is supported for at least the following shells:
Expand All @@ -63,7 +142,7 @@ zsh
NOTE: it may work for other shells as well because the implementation is in
Golang and is not necessarily shell-specific.

### Installation
### Completion

Installing auto-completions is as simple as running one command (works for
`bash`, `fish`, `powershell` and `zsh` shells):
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2
10 changes: 1 addition & 9 deletions cmd/author.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/tomba-io/tomba/pkg/output"
"github.com/tomba-io/tomba/pkg/start"
"github.com/tomba-io/tomba/pkg/util"
_key "github.com/tomba-io/tomba/pkg/validation/key"
_url "github.com/tomba-io/tomba/pkg/validation/url"
)

Expand All @@ -26,15 +25,8 @@ var authorCmd = &cobra.Command{
func authorRun(cmd *cobra.Command, args []string) {
fmt.Println(Long)
init := start.New(conn)
if init.Key == "" || init.Secret == "" {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidNoLogin.Error()))
return
}
if !_key.IsValidAPI(init.Key) && !_key.IsValidAPI(init.Secret) {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidLogin.Error()))
return
}
url := init.Target

if !_url.IsValidURL(url) {
fmt.Println(util.ErrorIcon(), util.Red(start.ErrArgumentsURL.Error()))
return
Expand Down
2 changes: 1 addition & 1 deletion cmd/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const (
authorExample = ` tomba author --target "https://clearbit.com/blog/company-name-to-domain-api"`
countExample = ` tomba count --target "clearbit.com"`
enrichExample = ` tomba enrich --target "[email protected]"`
linkedinExample = ` tomba linkedin --target "https://www.linkedin.com/in/alex-maccaw-ab592978"`
linkedinExample = ` tomba linkedin --target "https://www.linkedin.com/in/mohamed-ben-rebia"`
searchExample = ` tomba search --target "tomba.io"`
statusExample = ` tomba status --target "tomba.io"`
verifyExample = ` tomba verify --target "[email protected]"`
Expand Down
9 changes: 0 additions & 9 deletions cmd/count.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/tomba-io/tomba/pkg/start"
"github.com/tomba-io/tomba/pkg/util"
_domain "github.com/tomba-io/tomba/pkg/validation/domain"
_key "github.com/tomba-io/tomba/pkg/validation/key"
)

// countCmd represents the count command
Expand All @@ -26,14 +25,6 @@ var countCmd = &cobra.Command{
func countRun(cmd *cobra.Command, args []string) {
fmt.Println(Long)
init := start.New(conn)
if init.Key == "" || init.Secret == "" {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidNoLogin.Error()))
return
}
if !_key.IsValidAPI(init.Key) && !_key.IsValidAPI(init.Secret) {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidLogin.Error()))
return
}
url := init.Target

if !_domain.IsValidDomain(url) {
Expand Down
11 changes: 1 addition & 10 deletions cmd/enrich.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/tomba-io/tomba/pkg/start"
"github.com/tomba-io/tomba/pkg/util"
_email "github.com/tomba-io/tomba/pkg/validation/email"
_key "github.com/tomba-io/tomba/pkg/validation/key"
)

// enrichCmd represents the enrich command
Expand All @@ -26,16 +25,8 @@ var enrichCmd = &cobra.Command{
func enrichRun(cmd *cobra.Command, args []string) {
fmt.Println(Long)
init := start.New(conn)
if init.Key == "" || init.Secret == "" {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidNoLogin.Error()))
return
}
if !_key.IsValidAPI(init.Key) && !_key.IsValidAPI(init.Secret) {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidLogin.Error()))
return
}

email := init.Target

if !_email.IsValidEmail(email) {
fmt.Println(util.ErrorIcon(), util.Red(start.ErrArgumentEmail.Error()))
return
Expand Down
10 changes: 1 addition & 9 deletions cmd/linkedin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/tomba-io/tomba/pkg/output"
"github.com/tomba-io/tomba/pkg/start"
"github.com/tomba-io/tomba/pkg/util"
_key "github.com/tomba-io/tomba/pkg/validation/key"
_url "github.com/tomba-io/tomba/pkg/validation/url"
)

Expand All @@ -26,15 +25,8 @@ var linkedinCmd = &cobra.Command{
func linkedinRun(cmd *cobra.Command, args []string) {
fmt.Println(Long)
init := start.New(conn)
if init.Key == "" || init.Secret == "" {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidNoLogin.Error()))
return
}
if !_key.IsValidAPI(init.Key) && !_key.IsValidAPI(init.Secret) {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidLogin.Error()))
return
}
url := init.Target

if !_url.IsValidURL(url) {
fmt.Println(util.ErrorIcon(), util.Red(start.ErrArgumentsURL.Error()))
return
Expand Down
10 changes: 1 addition & 9 deletions cmd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/tomba-io/tomba/pkg/start"
"github.com/tomba-io/tomba/pkg/util"
_domain "github.com/tomba-io/tomba/pkg/validation/domain"
_key "github.com/tomba-io/tomba/pkg/validation/key"
)

// searchCmd represents the search command
Expand All @@ -26,15 +25,8 @@ var searchCmd = &cobra.Command{
func searchRun(cmd *cobra.Command, args []string) {
fmt.Println(Long)
init := start.New(conn)
if init.Key == "" || init.Secret == "" {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidNoLogin.Error()))
return
}
if !_key.IsValidAPI(init.Key) && !_key.IsValidAPI(init.Secret) {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidLogin.Error()))
return
}
domain := init.Target

if !_domain.IsValidDomain(domain) {
fmt.Println(util.ErrorIcon(), util.Red(start.ErrArgumentsDomain.Error()))
return
Expand Down
10 changes: 1 addition & 9 deletions cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/tomba-io/tomba/pkg/start"
"github.com/tomba-io/tomba/pkg/util"
_domain "github.com/tomba-io/tomba/pkg/validation/domain"
_key "github.com/tomba-io/tomba/pkg/validation/key"
)

// statusCmd represents the status command
Expand All @@ -26,15 +25,8 @@ var statusCmd = &cobra.Command{
func statusRun(cmd *cobra.Command, args []string) {
fmt.Println(Long)
init := start.New(conn)
if init.Key == "" || init.Secret == "" {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidNoLogin.Error()))
return
}
if !_key.IsValidAPI(init.Key) && !_key.IsValidAPI(init.Secret) {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidLogin.Error()))
return
}
domain := init.Target

if !_domain.IsValidDomain(domain) {
fmt.Println(util.ErrorIcon(), util.Red(start.ErrArgumentsDomain.Error()))
return
Expand Down
5 changes: 1 addition & 4 deletions cmd/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ var verifyCmd = &cobra.Command{
func verifyRun(cmd *cobra.Command, args []string) {
fmt.Println(Long)
init := start.New(conn)
if init.Key == "" || init.Secret == "" {
fmt.Println(util.WarningIcon(), util.Yellow(start.ErrErrInvalidNoLogin.Error()))
return
}
email := init.Target

if !_email.IsValidEmail(email) {
fmt.Println(util.ErrorIcon(), util.Red(start.ErrArgumentEmail.Error()))
return
Expand Down
14 changes: 12 additions & 2 deletions pkg/start/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package start

import (
"fmt"
"os"

"github.com/tomba-io/tomba/pkg/config"
"github.com/tomba-io/go/tomba"
"github.com/tomba-io/tomba/pkg/config"
"github.com/tomba-io/tomba/pkg/util"
_key "github.com/tomba-io/tomba/pkg/validation/key"
)

// Conn
Expand Down Expand Up @@ -45,7 +48,14 @@ func New(conn Conn) *Conn {
Tomba: tomba,
}
}

if conn.Key == "" || conn.Secret == "" {
fmt.Println(util.WarningIcon(), util.Yellow(ErrErrInvalidNoLogin.Error()))
os.Exit(0)
}
if !_key.IsValidAPI(conn.Key) && !_key.IsValidAPI(conn.Secret) {
fmt.Println(util.WarningIcon(), util.Yellow(ErrErrInvalidLogin.Error()))
os.Exit(0)
}
tomba := tomba.New(conn.Key, conn.Secret)
return &Conn{
Parameters: conn.Parameters,
Expand Down
2 changes: 1 addition & 1 deletion pkg/validation/key/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package key

// IsValidAPI Check if Tomba.io kEY or SECRET is valid
func IsValidAPI(credential string) bool {
return len(credential) > 39
return len(credential) >= 39
}
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "fmt"

var (
app = "tomba"
version = "v1.0.1"
version = "v1.0.2"
)

// String returns a string.
Expand Down
2 changes: 1 addition & 1 deletion snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ issues: https://github.com/tomba-io/tomba/issues
license: "Apache-2.0"
source-code: https://github.com/tomba-io/tomba.git
website: https://tomba.io/
version: 1.0.1
version: 1.0.2
grade: stable
base: core20

Expand Down
Loading

0 comments on commit d49ae1d

Please sign in to comment.