Skip to content

Commit

Permalink
chore(release): version 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkasa committed Oct 31, 2024
2 parents 5ad0cf5 + 6808e99 commit 71d6245
Show file tree
Hide file tree
Showing 38 changed files with 1,060 additions and 73 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
env:
TOGGL_WORKSPACE_ID: ${{ secrets.TOGGL_WORKSPACE_ID }}
TOGGL_API_TOKEN: ${{ secrets.TOGGL_API_TOKEN }}
TOGGL_ORGANIZATION_ID: ${{ secrets.TOGGL_ORGANIZATION_ID }}
TOGGL_USER_ID: ${{ secrets.TOGGL_USER_ID }}
GH_ACTION: "ACTION"

steps:
Expand Down
22 changes: 22 additions & 0 deletions docs/api-guide/model.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
# Abstract Classes

::: toggl_api.models.TogglClass
options:
show_source: true

::: toggl_api.models.WorkspaceChild
options:
show_source: true

---

# Main Models

::: toggl_api.TogglOrganization
options:
show_source: true
members:
- validate_name

::: toggl_api.TogglWorkspace
options:
show_source: true
members:
- validate_name

::: toggl_api.TogglClient
options:
show_source: true

::: toggl_api.TogglProject
options:
show_source: true

::: toggl_api.TogglTracker
options:
show_source: true

::: toggl_api.TogglTag
options:
show_source: true
4 changes: 4 additions & 0 deletions docs/api-guide/organization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> [!NOTE]
> Organization endpoint doesn't require a workspace id.
::: toggl_api.OrganizationEndpoint
34 changes: 34 additions & 0 deletions docs/api-guide/project_structure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,37 @@ toggl_api
├── utility.py
├── version.py
└── workspace.py
toggl_api
├── client.py
├── config.py
├── __init__.py
├── meta
│   ├── base_endpoint.py
│   ├── body.py
│   ├── cache
│   │   ├── base_cache.py
│   │   ├── __init__.py
│   │   ├── json_cache.py
│   │   └── sqlite_cache.py
│   ├── cached_endpoint.py
│   ├── enums.py
│   └── __init__.py
├── models
│   ├── _decorators.py
│   ├── __init__.py
│   ├── models.py
│   └── schema.py
├── organization.py
├── project.py
├── py.typed
├── reports
│   ├── __init__.py
│   └── reports.py
├── tag.py
├── tracker.py
├── user.py
├── utility.py
├── version.py
└── workspace.py

5 directories, 27 files
21 changes: 21 additions & 0 deletions docs/api-guide/workspace.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@

::: toggl_api.WorkspaceBody
options:
show_source: true

::: toggl_api.WorkspaceEndpoint
options:
show_source: true
members:
- get
- add
- collect
- edit
- tracker_constraints
- statistics


# Types

::: toggl_api.workspace.User
options:
show_source: true

::: toggl_api.workspace.WorkspaceStatistics
options:
show_source: true
56 changes: 53 additions & 3 deletions docs/static/mermaid/classes.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ classDiagram
commit(path: Path) None
load(path: Path) None
process_data(data: list[TogglClass]) list[TogglClass]
refresh(path: Path) bool
}
class OrganizationEndpoint {
endpoint
model
add(name: str, workspace_name: str) TogglOrganization
collect() list[TogglOrganization]
delete(organization: TogglOrganization | int) None
edit(organization: TogglOrganization | int, name: str) TogglOrganization
get(organization: TogglOrganization | int) TogglOrganization | None
}
class PaginatedResult {
next_id : Optional[int]
Expand Down Expand Up @@ -191,9 +201,6 @@ classDiagram
class TogglEndpoint {
BASE_ENDPOINT : str
HEADERS : Final[dict]
NOT_FOUND : Final[int]
OK_RESPONSE : Final[int]
SERVER_ERROR : Final[int]
endpoint
model
workspace_id : int
Expand All @@ -202,6 +209,10 @@ classDiagram
process_models(data: list[dict[str, Any]]) list[TogglClass]
request(parameters: str, headers: Optional[dict], body: Optional[dict], method: RequestMethod) Any
}
class TogglOrganization {
from_kwargs() TogglOrganization
validate_name(name: str) None
}
class TogglProject {
active : bool
client : Optional[int]
Expand All @@ -227,7 +238,10 @@ classDiagram
running() bool
}
class TogglWorkspace {
name : str
organization : int
from_kwargs() TogglWorkspace
validate_name(name: str) None
}
class TrackerBody {
created_with : str
Expand Down Expand Up @@ -258,6 +272,10 @@ classDiagram
process_bind_param(value: datetime, _) datetime | None
process_result_value(value: Optional[datetime], _) datetime | None
}
class User {
name : str
user_id : int
}
class UserEndpoint {
TRACKER_NOT_RUNNING : Final[int]
endpoint
Expand All @@ -266,32 +284,63 @@ classDiagram
collect(since: Optional[int | datetime], before: Optional[date], start_date: Optional[date], end_date: Optional[date]) list[TogglTracker]
current() TogglTracker | None
get(tracker_id: int | TogglTracker) TogglTracker | None
get_details() dict[str, Any]
verify_authentication(auth: BasicAuth) bool
}
class WeeklyReportEndpoint {
endpoint
export_report(body: ReportBody, extension: REPORT_FORMATS) bytes
search_time_entries(body: ReportBody) list[dict[str, Any]]
}
class WorkspaceBody {
admins : list[int]
name : Optional[str]
only_admins_may_create_projects : bool
only_admins_may_create_tags : bool
only_admins_see_billable_rates : bool
only_admins_see_team_dashboard : bool
projects_billable_by_default : bool
projects_enforce_billable : bool
projects_private_by_default : bool
rate_change_mode : Optional[Literal['start-today', 'override-current', 'override-all']]
reports_collapse : bool
rounding : Optional[int]
rounding_minutes : Optional[int]
format(endpoint: str) dict[str, Any]
}
class WorkspaceChild {
workspace : int
from_kwargs() WorkspaceChild
}
class WorkspaceEndpoint {
endpoint
model
organization_id
add(organization_id: int, body: WorkspaceBody) TogglWorkspace
collect(since: Optional[datetime | int]) list[TogglWorkspace]
edit(workspace_id: TogglWorkspace | int, body: WorkspaceBody) TogglWorkspace
get(workspace: Optional[TogglWorkspace | int]) TogglWorkspace | None
statistics(workspace_id: TogglWorkspace | int) WorkspaceStatistics
tracker_constraints(workspace_id: TogglWorkspace | int) dict[str, bool]
}
class WorkspaceStatistics {
admins : list[User]
groups_count : int
members_count : int
}
ClientBody --|> BaseBody
ClientEndpoint --|> TogglCachedEndpoint
JSONCache --|> TogglCache
SqliteCache --|> TogglCache
TogglCachedEndpoint --|> TogglEndpoint
TogglClient --|> WorkspaceChild
TogglOrganization --|> TogglClass
TogglProject --|> WorkspaceChild
TogglTag --|> WorkspaceChild
TogglTracker --|> WorkspaceChild
TogglWorkspace --|> TogglClass
WorkspaceChild --|> TogglClass
OrganizationEndpoint --|> TogglCachedEndpoint
ProjectBody --|> BaseBody
ProjectEndpoint --|> TogglCachedEndpoint
DetailedReportEndpoint --|> ReportEndpoint
Expand All @@ -303,6 +352,7 @@ classDiagram
TrackerBody --|> BaseBody
TrackerEndpoint --|> TogglCachedEndpoint
UserEndpoint --|> TogglCachedEndpoint
WorkspaceBody --|> BaseBody
WorkspaceEndpoint --|> TogglCachedEndpoint
Comparison --* TogglQuery : comparison
JSONSession --* JSONCache : session
Expand Down
9 changes: 9 additions & 0 deletions docs/static/mermaid/packages.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ classDiagram
}
class schema {
}
class organization {
}
class project {
}
class reports {
Expand Down Expand Up @@ -87,6 +89,9 @@ classDiagram
schema --> _decorators
schema --> models
schema --> utility
organization --> meta
organization --> meta
organization --> models
project --> meta
project --> models
project --> utility
Expand All @@ -105,6 +110,9 @@ classDiagram
user --> models
user --> utility
workspace --> meta
workspace --> body
workspace --> base_cache
workspace --> enums
workspace --> models
base_cache ..> meta
base_cache ..> models
Expand All @@ -113,3 +121,4 @@ classDiagram
sqlite_cache ..> meta
cached_endpoint ..> cache
cached_endpoint ..> base_cache
organization ..> base_cache
6 changes: 5 additions & 1 deletion docs/user-guide/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ All Tracker, Client, Project & Tag endpoints will have most of these methods:

---

- With environment variables setup correctly.
> [!INFO]
> With environment variables setup correctly.
### Tracker Example

Expand All @@ -33,6 +34,9 @@ All Tracker, Client, Project & Tag endpoints will have most of these methods:

### Project Example

> [!INFO]
> Using an existing togglrc file.
```python
{% include "examples/project_example.py" %}
```
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ nav:
- Endpoint: api-guide/endpoint.md
- Cache: api-guide/cache.md
- Models: api-guide/model.md
- Organization: api-guide/organization.md
- Workspace: api-guide/workspace.md
- Trackers: api-guide/tracker.md
- Projects: api-guide/project.md
Expand Down
16 changes: 15 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "toggl-api-wrapper"
version = "1.2.0"
version = "1.3.0"
description = "Simple Toggl API wrapper for non-premium features."
authors = ["David Kasakaitis <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -53,6 +53,7 @@ pytest-reportlog = "^0.4.0"
pytest-cov = "^5.0.0"
pytest-replay = "^1.5.2"
pytest-rerunfailures = "^14.0"
pytest-dependency = "^0.6.0"

[tool.poetry.group.docs.dependencies]
mkdocs = "^1.6.0"
Expand Down
1 change: 1 addition & 0 deletions scripts/cache/cache_project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version": "1.2.0", "data": []}
1 change: 1 addition & 0 deletions scripts/cache/cache_tracker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version": "1.2.0", "data": []}
Loading

0 comments on commit 71d6245

Please sign in to comment.