Skip to content

Commit

Permalink
(release): v0.6.0 (#32)
Browse files Browse the repository at this point in the history
* (chore): update go mod deps
* (fix): unblock snapcraft build
* (fix): fix workspace env var name
* (chore): add badges
* (chore): fix golint warnings
* (release): v0.6.0
  • Loading branch information
lucassabreu authored Jun 17, 2020
1 parent c38bb80 commit b8f872f
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 62 deletions.
26 changes: 9 additions & 17 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,14 @@ changelog:
exclude:
- '^docs:'
- '^test:'
# snapcrafts:
# - name: clockify-cli
# summary: Helps to interact with Clockfy's API
# description: Helps to interact with Clockfy's API
snapcrafts:
- name: clockify-cli
summary: Helps to interact with Clockfy's API
description: Helps to interact with Clockfy's API

# grade: stable
# confinement: classic
# publish: true
grade: stable
publish: true

# apps:
# clockify-cli:
# plugs: ["personal-files", "network"]

# plugs:
# personal-files:
# read:
# - $HOME/clockify-cli.yaml
# write:
# - $HOME/clockify-cli.yaml
apps:
clockify-cli:
plugs: ["network"]
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.6.0] - 2020-06-16

## Added

- some badges, who does not like they?

## Fixed

- help was showing `CLOCKIFY_WROKSPACE` as env var for workspace, the right name is
`CLOCKIFY_WORKSPACE`
- fixed some `golint` warnings

## Changed

- go mod dependencies updated
- `snapcraft` package only requires network

## Removed

- Removed `GetCurrentUser` in favor of `GetMe` to be closer to the APIs format

## [v0.5.0] - 2020-06-15

## Changed
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ clockify-cli

A simple cli to manage your time entries on Clockify from terminal

[![clockify-cli](https://snapcraft.io//clockify-cli/badge.svg)](https://snapcraft.io/clockify-cli)
[![Build Status](https://travis-ci.org/lucassabreu/clockify-cli.svg?branch=master)](https://travis-ci.org/lucassabreu/clockify-cli)
[![Go Report Card](https://goreportcard.com/badge/github.com/lucassabreu/clockify-cli)](https://goreportcard.com/report/github.com/lucassabreu/clockify-cli)

Features
--------

Expand Down Expand Up @@ -63,7 +67,7 @@ Flags:
Can be generated here: https://clockify.me/user/settings#generateApiKeyBtn
--trello-token string Trello's token (defaults to env $CLOCKIFY_TRELLO_TOKEN)
-u, --user-id string user id from the token (defaults to env $CLOCKIFY_USER_ID)
-w, --workspace string workspace to be used (defaults to env $CLOCKIFY_WROKSPACE)
-w, --workspace string workspace to be used (defaults to env $CLOCKIFY_WORKSPACE)
Use "clockify-cli [command] --help" for more information about a command.
```
18 changes: 5 additions & 13 deletions api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,6 @@ type WorkspaceUsersParam struct {
Email string
}

func (c *Client) CurrentUser() (dto.User, error) {
var u dto.User
r, err := c.NewRequest("GET", "v1/user", nil)
if err != nil {
return u, err
}

_, err = c.Do(r, &u)
return u, err
}

// WorkspaceUsers all users in a Workspace
func (c *Client) WorkspaceUsers(p WorkspaceUsersParam) ([]dto.User, error) {
var users []dto.User
Expand Down Expand Up @@ -133,6 +122,7 @@ func (c *Client) WorkspaceUsers(p WorkspaceUsersParam) ([]dto.User, error) {
return uCopy, nil
}

// PaginationParam parameters about pagination
type PaginationParam struct {
AllPages bool
Page int
Expand Down Expand Up @@ -257,9 +247,10 @@ func (c *Client) LogInProgress(p LogInProgressParam) (*dto.TimeEntryImpl, error)
return timeEntryImpl, err
}

// GetTimeEntryParam params to get a Time Entry
type GetTimeEntryParam struct {
Workspace string
TimeEntryId string
TimeEntryID string
}

// GetTimeEntry will retrieve a Time Entry using its Workspace and ID
Expand All @@ -269,7 +260,7 @@ func (c *Client) GetTimeEntry(p GetTimeEntryParam) (timeEntry *dto.TimeEntryImpl
fmt.Sprintf(
"v1/workspaces/%s/time-entries/%s",
p.Workspace,
p.TimeEntryId,
p.TimeEntryID,
),
nil,
)
Expand Down Expand Up @@ -353,6 +344,7 @@ func (c *Client) GetUser(id string) (*dto.User, error) {
return user, err
}

// GetMe get details about the user who created the token
func (c *Client) GetMe() (dto.User, error) {
r, err := c.NewRequest("GET", "v1/user", nil)

Expand Down
1 change: 1 addition & 0 deletions api/httpClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/lucassabreu/clockify-cli/api/dto"
)

// QueryAppender an interface to identify if the parameters should be sent through the query or body
type QueryAppender interface {
AppendToQuery(url.URL) url.URL
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/inClone.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func getTimeEntry(id, workspace, userID string, c *api.Client) (dto.TimeEntryImp
if id != "last" {
tei, err := c.GetTimeEntry(api.GetTimeEntryParam{
Workspace: workspace,
TimeEntryId: id,
TimeEntryID: id,
})

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func init() {
Can be generated here: https://clockify.me/user/settings#generateApiKeyBtn`)
_ = viper.BindPFlag("token", rootCmd.PersistentFlags().Lookup("token"))

rootCmd.PersistentFlags().StringP("workspace", "w", "", "workspace to be used (defaults to env $CLOCKIFY_WROKSPACE)")
rootCmd.PersistentFlags().StringP("workspace", "w", "", "workspace to be used (defaults to env $CLOCKIFY_WORKSPACE)")
_ = viper.BindPFlag("workspace", rootCmd.PersistentFlags().Lookup("workspace"))

rootCmd.PersistentFlags().StringP("user-id", "u", "", "user id from the token (defaults to env $CLOCKIFY_USER_ID)")
Expand Down
24 changes: 13 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
module github.com/lucassabreu/clockify-cli

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.11 // indirect
github.com/mattn/go-runewidth v0.0.4 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/olekukonko/tablewriter v0.0.1
github.com/spf13/cobra v0.0.3
github.com/spf13/viper v1.3.1
github.com/stretchr/testify v1.3.0 // indirect
golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect
github.com/smartystreets/assertions v1.0.0 // indirect
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.6.1
github.com/stretchr/testify v1.6.1 // indirect
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 // indirect
golang.org/x/text v0.3.2 // indirect
gopkg.in/AlecAivazis/survey.v1 v1.8.2
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v2 v2.2.2
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v2 v2.3.0
)

go 1.13
Loading

0 comments on commit b8f872f

Please sign in to comment.