tlnt-cli 1.5.1__tar.gz → 1.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tlnt_cli-1.6.0/PKG-INFO +141 -0
- tlnt_cli-1.6.0/README.md +124 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/pyproject.toml +1 -3
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/pyproject.toml.orig +1 -3
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/browser/login.py +2 -3
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/browser/oauth.py +2 -2
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/browser/scripted.py +2 -2
- {tlnt_cli-1.5.1/src/tlnt/cli/commands → tlnt_cli-1.6.0/src/tlnt/cli}/approvals.py +10 -1
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/attendance.py +7 -13
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/calendar.py +1 -3
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/login.py +5 -15
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/logout.py +3 -3
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/notifications.py +1 -4
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/profile.py +1 -2
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/setup.py +3 -3
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/status.py +1 -2
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/timeoff.py +109 -84
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/update.py +2 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/main.py +2 -4
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/options.py +0 -9
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/output.py +18 -0
- {tlnt_cli-1.5.1/src/tlnt/core/clients/mekari → tlnt_cli-1.6.0/src/tlnt/core}/client.py +57 -88
- tlnt_cli-1.5.1/src/tlnt/core/clients/mekari/constants.py → tlnt_cli-1.6.0/src/tlnt/core/mekari.py +1 -1
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/models.py +16 -4
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/services/__init__.py +1 -1
- tlnt_cli-1.6.0/src/tlnt/core/services/attendance.py +213 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/services/calendar.py +1 -1
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/services/login.py +5 -33
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/services/logout.py +1 -12
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/services/notifications.py +1 -1
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/services/profile.py +1 -1
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/services/setup.py +1 -1
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/services/status.py +5 -4
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/services/timeoff.py +1 -1
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/session.py +2 -24
- tlnt_cli-1.5.1/PKG-INFO +0 -315
- tlnt_cli-1.5.1/README.md +0 -296
- tlnt_cli-1.5.1/src/tlnt/cli/commands/mcp.py +0 -8
- tlnt_cli-1.5.1/src/tlnt/core/clients/__init__.py +0 -0
- tlnt_cli-1.5.1/src/tlnt/core/clients/mekari/__init__.py +0 -0
- tlnt_cli-1.5.1/src/tlnt/core/services/attendance.py +0 -213
- tlnt_cli-1.5.1/src/tlnt/mcp/__init__.py +0 -0
- tlnt_cli-1.5.1/src/tlnt/mcp/main.py +0 -176
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/LICENSE +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/__init__.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/__main__.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/browser/__init__.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/__init__.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/avatars.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/__init__.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/commands/version.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/cli/prompts.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/__init__.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/config.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/http_client.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/logs.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/play_store.py +0 -0
- {tlnt_cli-1.5.1 → tlnt_cli-1.6.0}/src/tlnt/core/user_agent.py +0 -0
tlnt_cli-1.6.0/PKG-INFO
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tlnt-cli
|
|
3
|
+
Version: 1.6.0
|
|
4
|
+
Summary: CLI wrapper for HRIS attendance and employment workflows.
|
|
5
|
+
Author: Fathiraz Arthuro
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: httpx>=0.28,<0.29
|
|
9
|
+
Requires-Dist: loguru>=0.7,<1
|
|
10
|
+
Requires-Dist: platformdirs>=4.3,<5
|
|
11
|
+
Requires-Dist: playwright>=1.50,<2
|
|
12
|
+
Requires-Dist: rich>=14,<16
|
|
13
|
+
Requires-Dist: rich-pixels>=3,<4
|
|
14
|
+
Requires-Dist: typer>=0.20,<1
|
|
15
|
+
Requires-Python: >=3.11, <3.15
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
# tlnt
|
|
21
|
+
|
|
22
|
+

|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
`tlnt` is a Python CLI wrapper for Mekari Talenta employment data,
|
|
26
|
+
notifications, attendance summaries and previews, and human-confirmed attendance actions.
|
|
27
|
+
|
|
28
|
+
> [!WARNING]
|
|
29
|
+
> `tlnt` is an unofficial, independent research and educational project. It
|
|
30
|
+
> is not affiliated with Mekari or Talenta. Use it only when your account and
|
|
31
|
+
> the actions you perform are authorized. Read the [full bilingual
|
|
32
|
+
> disclaimer](docs/index.md#disclaimer) before using it.
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
uv tool install tlnt-cli
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Or use `pipx install tlnt-cli` or `pip install tlnt-cli`. PyPI refuses the name
|
|
41
|
+
`tlnt` as too similar to an existing project, so the package is `tlnt-cli`; the
|
|
42
|
+
command is still `tlnt`. It requires Python 3.11–3.14, with uv as the recommended
|
|
43
|
+
package manager. Browser login requires Google Chrome or Microsoft Edge, or a
|
|
44
|
+
compatible running browser over CDP.
|
|
45
|
+
|
|
46
|
+
Run `tlnt update` to install the latest release. See [Install](docs/install.md)
|
|
47
|
+
for other install methods, the version notices, and upgrading from tlnt 1.5.0
|
|
48
|
+
or earlier.
|
|
49
|
+
|
|
50
|
+
## Quick start
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
tlnt setup # create config.json, then set client_id in it
|
|
54
|
+
tlnt login # sign in through Chrome or Edge
|
|
55
|
+
tlnt status --json
|
|
56
|
+
tlnt profile
|
|
57
|
+
tlnt attendance clock-in --dry-run --latitude LATITUDE --longitude LONGITUDE
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Ask the project maintainers for `client_id`. [Setup](docs/setup.md) covers the
|
|
61
|
+
config keys and every way to sign in: through a browser you already run
|
|
62
|
+
(`--cdp`), from the terminal (`--email`), and on a host with no display
|
|
63
|
+
(`--headless`).
|
|
64
|
+
|
|
65
|
+
## Use tlnt from scripts and agents
|
|
66
|
+
|
|
67
|
+
Human-readable tables are the default. Add `--json` to write one result object
|
|
68
|
+
to stdout; version notices and diagnostics go to stderr. Exit code `0` means
|
|
69
|
+
success, `1` an operational failure, and `2` invalid arguments. Check `code`
|
|
70
|
+
before reading `data`; the codes are listed in
|
|
71
|
+
[Overview](docs/overview.md#stable-result-codes).
|
|
72
|
+
|
|
73
|
+
Set `TALENTA_READONLY=1` when a script or an agent must never change anything:
|
|
74
|
+
every write then stops with `read_only_mode` before any prompt or request.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
TALENTA_READONLY=1 tlnt notification attendance-list --json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Agents should install the [agent skill](skills/tlnt-cli/SKILL.md) and read
|
|
81
|
+
[Integrations](docs/integrations.md), which also shows how to call tlnt from
|
|
82
|
+
an MCP client.
|
|
83
|
+
|
|
84
|
+
## Commands
|
|
85
|
+
|
|
86
|
+
| Area | What it covers |
|
|
87
|
+
| --- | --- |
|
|
88
|
+
| [Session](docs/session.md) | `setup`, `login`, `logout`, `status`, `profile`. |
|
|
89
|
+
| [Attendance](docs/attendance.md) | Clock-in and clock-out previews and actions, summaries, approval. |
|
|
90
|
+
| [Notification](docs/notification.md) | Inbox counts, lists and details. |
|
|
91
|
+
| [Time off](docs/timeoff.md) | Balances, requests, cancellations and approval. |
|
|
92
|
+
| [Calendar](docs/calendar.md) | Holidays, time off, birthdays and activity. |
|
|
93
|
+
| [Install](docs/install.md) | `update` and the version notices. |
|
|
94
|
+
|
|
95
|
+
The full command map, global options and output modes are in
|
|
96
|
+
[Overview](docs/overview.md), or run `tlnt --help`.
|
|
97
|
+
|
|
98
|
+
## Safety contract
|
|
99
|
+
|
|
100
|
+
- Do not open the login flow automatically.
|
|
101
|
+
- Never ask the user for their Mekari password. Only they start
|
|
102
|
+
`tlnt login --email`, and the password comes from a hidden prompt or from
|
|
103
|
+
`TALENTA_PASSWORD` in the host's own environment.
|
|
104
|
+
- Live clock-in, clock-out, approval, time-off requests, and cancellations
|
|
105
|
+
always ask for confirmation. The prompt reads standard input, so it guards
|
|
106
|
+
against mistakes, not scripts; use `TALENTA_READONLY=1` for that.
|
|
107
|
+
- `--dry-run` never submits attendance.
|
|
108
|
+
- `TALENTA_READONLY=1` refuses every command that would change Talenta or
|
|
109
|
+
local state.
|
|
110
|
+
- The version checks only read public listings (PyPI and Google Play), never
|
|
111
|
+
send your session or config, and never log out, log in, or update for you.
|
|
112
|
+
- Never print passwords, bearer tokens, cookies, authorization codes, request
|
|
113
|
+
bodies, selfie contents, or real employee data.
|
|
114
|
+
- If `status` returns `session_missing`, `session_invalid`,
|
|
115
|
+
`mobile_token_missing`, or `mobile_token_expired`, ask
|
|
116
|
+
the user to run login explicitly.
|
|
117
|
+
|
|
118
|
+
## Documentation
|
|
119
|
+
|
|
120
|
+
- [Docs site](https://tlnt-docs.vercel.app)
|
|
121
|
+
- [Install](docs/install.md) and [Setup](docs/setup.md)
|
|
122
|
+
- [Overview](docs/overview.md): commands and the JSON contract
|
|
123
|
+
- [Workflows](docs/workflows.md)
|
|
124
|
+
- [AI agent integrations](docs/integrations.md)
|
|
125
|
+
- [Security](docs/security.md)
|
|
126
|
+
- [Contributing](docs/contributing.md)
|
|
127
|
+
- [Agent skill](skills/tlnt-cli/SKILL.md)
|
|
128
|
+
|
|
129
|
+
## Development
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
uv sync --group dev --group docs
|
|
133
|
+
uv run pytest
|
|
134
|
+
uv run --group docs mkdocs build --strict
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Read [Contributing](docs/contributing.md) before changing public behavior.
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
`tlnt` is licensed under the [MIT License](LICENSE).
|
tlnt_cli-1.6.0/README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# tlnt
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
`tlnt` is a Python CLI wrapper for Mekari Talenta employment data,
|
|
9
|
+
notifications, attendance summaries and previews, and human-confirmed attendance actions.
|
|
10
|
+
|
|
11
|
+
> [!WARNING]
|
|
12
|
+
> `tlnt` is an unofficial, independent research and educational project. It
|
|
13
|
+
> is not affiliated with Mekari or Talenta. Use it only when your account and
|
|
14
|
+
> the actions you perform are authorized. Read the [full bilingual
|
|
15
|
+
> disclaimer](docs/index.md#disclaimer) before using it.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
uv tool install tlnt-cli
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or use `pipx install tlnt-cli` or `pip install tlnt-cli`. PyPI refuses the name
|
|
24
|
+
`tlnt` as too similar to an existing project, so the package is `tlnt-cli`; the
|
|
25
|
+
command is still `tlnt`. It requires Python 3.11–3.14, with uv as the recommended
|
|
26
|
+
package manager. Browser login requires Google Chrome or Microsoft Edge, or a
|
|
27
|
+
compatible running browser over CDP.
|
|
28
|
+
|
|
29
|
+
Run `tlnt update` to install the latest release. See [Install](docs/install.md)
|
|
30
|
+
for other install methods, the version notices, and upgrading from tlnt 1.5.0
|
|
31
|
+
or earlier.
|
|
32
|
+
|
|
33
|
+
## Quick start
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
tlnt setup # create config.json, then set client_id in it
|
|
37
|
+
tlnt login # sign in through Chrome or Edge
|
|
38
|
+
tlnt status --json
|
|
39
|
+
tlnt profile
|
|
40
|
+
tlnt attendance clock-in --dry-run --latitude LATITUDE --longitude LONGITUDE
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Ask the project maintainers for `client_id`. [Setup](docs/setup.md) covers the
|
|
44
|
+
config keys and every way to sign in: through a browser you already run
|
|
45
|
+
(`--cdp`), from the terminal (`--email`), and on a host with no display
|
|
46
|
+
(`--headless`).
|
|
47
|
+
|
|
48
|
+
## Use tlnt from scripts and agents
|
|
49
|
+
|
|
50
|
+
Human-readable tables are the default. Add `--json` to write one result object
|
|
51
|
+
to stdout; version notices and diagnostics go to stderr. Exit code `0` means
|
|
52
|
+
success, `1` an operational failure, and `2` invalid arguments. Check `code`
|
|
53
|
+
before reading `data`; the codes are listed in
|
|
54
|
+
[Overview](docs/overview.md#stable-result-codes).
|
|
55
|
+
|
|
56
|
+
Set `TALENTA_READONLY=1` when a script or an agent must never change anything:
|
|
57
|
+
every write then stops with `read_only_mode` before any prompt or request.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
TALENTA_READONLY=1 tlnt notification attendance-list --json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Agents should install the [agent skill](skills/tlnt-cli/SKILL.md) and read
|
|
64
|
+
[Integrations](docs/integrations.md), which also shows how to call tlnt from
|
|
65
|
+
an MCP client.
|
|
66
|
+
|
|
67
|
+
## Commands
|
|
68
|
+
|
|
69
|
+
| Area | What it covers |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| [Session](docs/session.md) | `setup`, `login`, `logout`, `status`, `profile`. |
|
|
72
|
+
| [Attendance](docs/attendance.md) | Clock-in and clock-out previews and actions, summaries, approval. |
|
|
73
|
+
| [Notification](docs/notification.md) | Inbox counts, lists and details. |
|
|
74
|
+
| [Time off](docs/timeoff.md) | Balances, requests, cancellations and approval. |
|
|
75
|
+
| [Calendar](docs/calendar.md) | Holidays, time off, birthdays and activity. |
|
|
76
|
+
| [Install](docs/install.md) | `update` and the version notices. |
|
|
77
|
+
|
|
78
|
+
The full command map, global options and output modes are in
|
|
79
|
+
[Overview](docs/overview.md), or run `tlnt --help`.
|
|
80
|
+
|
|
81
|
+
## Safety contract
|
|
82
|
+
|
|
83
|
+
- Do not open the login flow automatically.
|
|
84
|
+
- Never ask the user for their Mekari password. Only they start
|
|
85
|
+
`tlnt login --email`, and the password comes from a hidden prompt or from
|
|
86
|
+
`TALENTA_PASSWORD` in the host's own environment.
|
|
87
|
+
- Live clock-in, clock-out, approval, time-off requests, and cancellations
|
|
88
|
+
always ask for confirmation. The prompt reads standard input, so it guards
|
|
89
|
+
against mistakes, not scripts; use `TALENTA_READONLY=1` for that.
|
|
90
|
+
- `--dry-run` never submits attendance.
|
|
91
|
+
- `TALENTA_READONLY=1` refuses every command that would change Talenta or
|
|
92
|
+
local state.
|
|
93
|
+
- The version checks only read public listings (PyPI and Google Play), never
|
|
94
|
+
send your session or config, and never log out, log in, or update for you.
|
|
95
|
+
- Never print passwords, bearer tokens, cookies, authorization codes, request
|
|
96
|
+
bodies, selfie contents, or real employee data.
|
|
97
|
+
- If `status` returns `session_missing`, `session_invalid`,
|
|
98
|
+
`mobile_token_missing`, or `mobile_token_expired`, ask
|
|
99
|
+
the user to run login explicitly.
|
|
100
|
+
|
|
101
|
+
## Documentation
|
|
102
|
+
|
|
103
|
+
- [Docs site](https://tlnt-docs.vercel.app)
|
|
104
|
+
- [Install](docs/install.md) and [Setup](docs/setup.md)
|
|
105
|
+
- [Overview](docs/overview.md): commands and the JSON contract
|
|
106
|
+
- [Workflows](docs/workflows.md)
|
|
107
|
+
- [AI agent integrations](docs/integrations.md)
|
|
108
|
+
- [Security](docs/security.md)
|
|
109
|
+
- [Contributing](docs/contributing.md)
|
|
110
|
+
- [Agent skill](skills/tlnt-cli/SKILL.md)
|
|
111
|
+
|
|
112
|
+
## Development
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
uv sync --group dev --group docs
|
|
116
|
+
uv run pytest
|
|
117
|
+
uv run --group docs mkdocs build --strict
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Read [Contributing](docs/contributing.md) before changing public behavior.
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
`tlnt` is licensed under the [MIT License](LICENSE).
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tlnt-cli"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.6.0"
|
|
8
8
|
description = "CLI wrapper for HRIS attendance and employment workflows."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -12,9 +12,7 @@ license-files = ["LICENSE"]
|
|
|
12
12
|
requires-python = ">=3.11,<3.15"
|
|
13
13
|
dependencies = [
|
|
14
14
|
"httpx>=0.28,<0.29",
|
|
15
|
-
"keyring>=25,<26",
|
|
16
15
|
"loguru>=0.7,<1",
|
|
17
|
-
"mcp>=2.0,<3",
|
|
18
16
|
"platformdirs>=4.3,<5",
|
|
19
17
|
"playwright>=1.50,<2",
|
|
20
18
|
"rich>=14,<16",
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tlnt-cli"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.6.0"
|
|
8
8
|
description = "CLI wrapper for HRIS attendance and employment workflows."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -13,9 +13,7 @@ authors = [{ name = "Fathiraz Arthuro" }]
|
|
|
13
13
|
requires-python = ">=3.11,<3.15"
|
|
14
14
|
dependencies = [
|
|
15
15
|
"httpx>=0.28,<0.29",
|
|
16
|
-
"keyring>=25,<26",
|
|
17
16
|
"loguru>=0.7,<1",
|
|
18
|
-
"mcp>=2.0,<3",
|
|
19
17
|
"platformdirs>=4.3,<5",
|
|
20
18
|
"playwright>=1.50,<2",
|
|
21
19
|
"rich>=14,<16",
|
|
@@ -16,8 +16,8 @@ from playwright.sync_api import TimeoutError as PlaywrightTimeoutError
|
|
|
16
16
|
from playwright.sync_api import sync_playwright
|
|
17
17
|
|
|
18
18
|
from tlnt.browser.oauth import authorize_url, code_from_url, pkce_pair
|
|
19
|
-
from tlnt.core.
|
|
20
|
-
from tlnt.core.
|
|
19
|
+
from tlnt.core.client import MekariClient
|
|
20
|
+
from tlnt.core.mekari import (
|
|
21
21
|
DASHBOARD_TALENTA_URL,
|
|
22
22
|
MEKARI_DOMAIN,
|
|
23
23
|
STATIC_ASSET_SUFFIXES,
|
|
@@ -404,7 +404,6 @@ class BrowserLogin:
|
|
|
404
404
|
session = SessionState(
|
|
405
405
|
version=1,
|
|
406
406
|
saved_at=datetime.now().astimezone().isoformat(),
|
|
407
|
-
web_storage={},
|
|
408
407
|
profile=profile,
|
|
409
408
|
mobile=mobile,
|
|
410
409
|
)
|
|
@@ -7,8 +7,8 @@ import hashlib
|
|
|
7
7
|
import secrets
|
|
8
8
|
from urllib.parse import parse_qsl, urlencode, urlsplit
|
|
9
9
|
|
|
10
|
-
from tlnt.core
|
|
11
|
-
from tlnt.core.
|
|
10
|
+
from tlnt.core import mekari as constants
|
|
11
|
+
from tlnt.core.mekari import (
|
|
12
12
|
OAUTH_AUTHORIZE_URL,
|
|
13
13
|
OAUTH_SCOPE,
|
|
14
14
|
TOKEN_REDIRECT_URL,
|
|
@@ -20,8 +20,8 @@ from tlnt.browser.login import (
|
|
|
20
20
|
_OAuthSink,
|
|
21
21
|
)
|
|
22
22
|
from tlnt.browser.oauth import authorize_url, pkce_pair
|
|
23
|
-
from tlnt.core.
|
|
24
|
-
from tlnt.core.
|
|
23
|
+
from tlnt.core.client import MekariClient
|
|
24
|
+
from tlnt.core.mekari import DASHBOARD_TALENTA_URL
|
|
25
25
|
from tlnt.core.logs import logger
|
|
26
26
|
from tlnt.core.models import MobileToken, Profile
|
|
27
27
|
|
|
@@ -7,7 +7,15 @@ from collections.abc import Callable
|
|
|
7
7
|
import typer
|
|
8
8
|
|
|
9
9
|
from tlnt.cli import prompts
|
|
10
|
-
from tlnt.cli.output import
|
|
10
|
+
from tlnt.cli.output import (
|
|
11
|
+
action_banner,
|
|
12
|
+
confirm,
|
|
13
|
+
console,
|
|
14
|
+
dig,
|
|
15
|
+
emit,
|
|
16
|
+
require_writable,
|
|
17
|
+
spinner,
|
|
18
|
+
)
|
|
11
19
|
from tlnt.core.models import Result
|
|
12
20
|
|
|
13
21
|
|
|
@@ -33,6 +41,7 @@ def run_approval(
|
|
|
33
41
|
submit: Callable[[int, int, str, str], Result],
|
|
34
42
|
) -> None:
|
|
35
43
|
"""Show one inbox request and approve it only after terminal confirmation."""
|
|
44
|
+
require_writable(json_output)
|
|
36
45
|
if interactive:
|
|
37
46
|
unavailable = prompts.guard(json_output, title=f"Approve {noun}")
|
|
38
47
|
if unavailable is not None:
|
|
@@ -8,17 +8,16 @@ from typing import Annotated
|
|
|
8
8
|
import typer
|
|
9
9
|
|
|
10
10
|
from tlnt.cli import prompts
|
|
11
|
-
from tlnt.cli.
|
|
12
|
-
from tlnt.cli.output import action_banner, confirm, emit, spinner
|
|
11
|
+
from tlnt.cli.approvals import run_approval
|
|
12
|
+
from tlnt.cli.output import action_banner, confirm, emit, require_writable, spinner
|
|
13
13
|
from tlnt.cli.options import (
|
|
14
14
|
AvatarsOption,
|
|
15
15
|
InteractiveOption,
|
|
16
16
|
JsonOption,
|
|
17
|
-
TableOption,
|
|
18
17
|
VerboseOption,
|
|
19
18
|
)
|
|
20
19
|
from tlnt.core.config import get_setting
|
|
21
|
-
from tlnt.core.models import Result
|
|
20
|
+
from tlnt.core.models import Result, iso_date
|
|
22
21
|
from tlnt.core.services import positive_id
|
|
23
22
|
from tlnt.core.services.attendance import (
|
|
24
23
|
clock as clock_action,
|
|
@@ -49,6 +48,8 @@ def _run_attendance(
|
|
|
49
48
|
verbose: bool = False,
|
|
50
49
|
avatars: bool = False,
|
|
51
50
|
) -> None:
|
|
51
|
+
if not dry_run:
|
|
52
|
+
require_writable(json_output)
|
|
52
53
|
if interactive:
|
|
53
54
|
unavailable = prompts.guard(json_output, title=action_label)
|
|
54
55
|
if unavailable is not None:
|
|
@@ -165,7 +166,6 @@ def _clock_command(event_type: str, label: str, doc: str) -> Callable[..., None]
|
|
|
165
166
|
] = None,
|
|
166
167
|
interactive: InteractiveOption = False,
|
|
167
168
|
json_output: JsonOption = False,
|
|
168
|
-
table: TableOption = False,
|
|
169
169
|
avatars: AvatarsOption = False,
|
|
170
170
|
verbose: VerboseOption = False,
|
|
171
171
|
) -> None:
|
|
@@ -199,11 +199,8 @@ attendance_clockout = _clock_command(
|
|
|
199
199
|
def _attendance_date(value: str | None) -> date:
|
|
200
200
|
if value is None:
|
|
201
201
|
return date.today()
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
except ValueError as error:
|
|
205
|
-
raise typer.BadParameter("date must be YYYY-MM-DD") from error
|
|
206
|
-
if selected_date.isoformat() != value:
|
|
202
|
+
selected_date = iso_date(value)
|
|
203
|
+
if selected_date is None:
|
|
207
204
|
raise typer.BadParameter("date must be YYYY-MM-DD")
|
|
208
205
|
return selected_date
|
|
209
206
|
|
|
@@ -214,7 +211,6 @@ def attendance_summary_list(
|
|
|
214
211
|
typer.Option("--date", help="Attendance date (YYYY-MM-DD)."),
|
|
215
212
|
] = None,
|
|
216
213
|
json_output: JsonOption = False,
|
|
217
|
-
table: TableOption = False,
|
|
218
214
|
verbose: VerboseOption = False,
|
|
219
215
|
) -> None:
|
|
220
216
|
"""Read attendance summaries for a date."""
|
|
@@ -227,7 +223,6 @@ def attendance_summary_metrics(
|
|
|
227
223
|
typer.Option("--date", help="Attendance date (YYYY-MM-DD)."),
|
|
228
224
|
] = None,
|
|
229
225
|
json_output: JsonOption = False,
|
|
230
|
-
table: TableOption = False,
|
|
231
226
|
verbose: VerboseOption = False,
|
|
232
227
|
) -> None:
|
|
233
228
|
"""Read attendance summary metrics for a date."""
|
|
@@ -262,7 +257,6 @@ def attendance_approve(
|
|
|
262
257
|
] = "",
|
|
263
258
|
interactive: InteractiveOption = False,
|
|
264
259
|
json_output: JsonOption = False,
|
|
265
|
-
table: TableOption = False,
|
|
266
260
|
verbose: VerboseOption = False,
|
|
267
261
|
) -> None:
|
|
268
262
|
"""Approve a live attendance request after confirmation."""
|
|
@@ -5,7 +5,7 @@ from typing import Annotated, Any
|
|
|
5
5
|
|
|
6
6
|
import typer
|
|
7
7
|
|
|
8
|
-
from tlnt.cli.options import JsonOption,
|
|
8
|
+
from tlnt.cli.options import JsonOption, VerboseOption
|
|
9
9
|
from tlnt.cli.output import run
|
|
10
10
|
from tlnt.core.services import calendar as calendar_service
|
|
11
11
|
|
|
@@ -63,7 +63,6 @@ def _filtered_command(name: str, label: str, doc: str) -> Callable[..., None]:
|
|
|
63
63
|
date: Annotated[str | None, typer.Option("--date")] = None,
|
|
64
64
|
user_id: Annotated[str | None, typer.Option("--user-id")] = None,
|
|
65
65
|
json_output: JsonOption = False,
|
|
66
|
-
table: TableOption = False,
|
|
67
66
|
verbose: VerboseOption = False,
|
|
68
67
|
) -> None:
|
|
69
68
|
params = _calendar_params(
|
|
@@ -96,7 +95,6 @@ calendar_activity = _filtered_command(
|
|
|
96
95
|
|
|
97
96
|
def calendar_my_birthday(
|
|
98
97
|
json_output: JsonOption = False,
|
|
99
|
-
table: TableOption = False,
|
|
100
98
|
verbose: VerboseOption = False,
|
|
101
99
|
) -> None:
|
|
102
100
|
"""Read your birthday date."""
|
|
@@ -16,11 +16,11 @@ from tlnt.browser.login import (
|
|
|
16
16
|
)
|
|
17
17
|
from tlnt.browser.scripted import LABELS
|
|
18
18
|
from tlnt.cli import prompts
|
|
19
|
-
from tlnt.cli.output import banner, deadline_bar, emit
|
|
20
|
-
from tlnt.cli.options import JsonOption,
|
|
19
|
+
from tlnt.cli.output import banner, deadline_bar, emit, require_writable
|
|
20
|
+
from tlnt.cli.options import JsonOption, VerboseOption
|
|
21
21
|
from tlnt.core import config
|
|
22
|
-
from tlnt.core
|
|
23
|
-
from tlnt.core.
|
|
22
|
+
from tlnt.core import mekari as mekari_constants
|
|
23
|
+
from tlnt.core.mekari import DASHBOARD_TALENTA_URL
|
|
24
24
|
from tlnt.core.models import Result
|
|
25
25
|
from tlnt.core.services.login import login as login_action
|
|
26
26
|
from tlnt.core.services.status import status as status_action
|
|
@@ -100,11 +100,6 @@ def _credentials(email: str) -> Credentials | Result:
|
|
|
100
100
|
|
|
101
101
|
def login(
|
|
102
102
|
json_output: JsonOption = False,
|
|
103
|
-
table: TableOption = False,
|
|
104
|
-
store_password: Annotated[
|
|
105
|
-
bool,
|
|
106
|
-
typer.Option("--store-password", hidden=True),
|
|
107
|
-
] = False,
|
|
108
103
|
browser: Annotated[
|
|
109
104
|
Browser | None,
|
|
110
105
|
typer.Option(
|
|
@@ -145,6 +140,7 @@ def login(
|
|
|
145
140
|
verbose: VerboseOption = False,
|
|
146
141
|
) -> None:
|
|
147
142
|
"""Reuse valid session or sign in through your browser."""
|
|
143
|
+
require_writable(json_output)
|
|
148
144
|
backend, endpoint = _resolve_backend(browser, cdp)
|
|
149
145
|
email = (email or "").strip() or None
|
|
150
146
|
if email and backend in (Browser.ego, Browser.yab):
|
|
@@ -157,12 +153,6 @@ def login(
|
|
|
157
153
|
)
|
|
158
154
|
if headless and not email:
|
|
159
155
|
raise typer.BadParameter("--headless needs --email", param_hint="--headless")
|
|
160
|
-
if store_password:
|
|
161
|
-
typer.echo(
|
|
162
|
-
"--store-password is deprecated and does nothing; "
|
|
163
|
-
"it will be removed in 2.0.",
|
|
164
|
-
err=True,
|
|
165
|
-
)
|
|
166
156
|
current = status_action()
|
|
167
157
|
if current.ok:
|
|
168
158
|
expiry_known = isinstance(current.data, dict) and bool(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
from tlnt.cli.output import run
|
|
2
|
-
from tlnt.cli.options import JsonOption,
|
|
1
|
+
from tlnt.cli.output import require_writable, run
|
|
2
|
+
from tlnt.cli.options import JsonOption, VerboseOption
|
|
3
3
|
from tlnt.core.services.logout import logout as logout_action
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def logout(
|
|
7
7
|
json_output: JsonOption = False,
|
|
8
|
-
table: TableOption = False,
|
|
9
8
|
verbose: VerboseOption = False,
|
|
10
9
|
) -> None:
|
|
11
10
|
"""Log out of Talenta and remove the saved session."""
|
|
11
|
+
require_writable(json_output)
|
|
12
12
|
run("Signing out...", logout_action, json_output, verbose)
|
|
@@ -4,7 +4,7 @@ from typing import Annotated
|
|
|
4
4
|
import typer
|
|
5
5
|
|
|
6
6
|
from tlnt.cli.output import run
|
|
7
|
-
from tlnt.cli.options import AvatarsOption, JsonOption,
|
|
7
|
+
from tlnt.cli.options import AvatarsOption, JsonOption, VerboseOption
|
|
8
8
|
from tlnt.core.models import Result
|
|
9
9
|
from tlnt.core.services.notifications import (
|
|
10
10
|
notification_attendance_list as notification_attendance_list_action,
|
|
@@ -17,7 +17,6 @@ from tlnt.core.services.notifications import (
|
|
|
17
17
|
|
|
18
18
|
def notification_count(
|
|
19
19
|
json_output: JsonOption = False,
|
|
20
|
-
table: TableOption = False,
|
|
21
20
|
verbose: VerboseOption = False,
|
|
22
21
|
) -> None:
|
|
23
22
|
"""Read Talenta notification counts."""
|
|
@@ -43,7 +42,6 @@ def _inbox_list_command(
|
|
|
43
42
|
typer.Option("--status", help="Talenta notification status filter."),
|
|
44
43
|
] = 3,
|
|
45
44
|
json_output: JsonOption = False,
|
|
46
|
-
table: TableOption = False,
|
|
47
45
|
avatars: AvatarsOption = False,
|
|
48
46
|
verbose: VerboseOption = False,
|
|
49
47
|
) -> None:
|
|
@@ -86,7 +84,6 @@ def notification_detail(
|
|
|
86
84
|
typer.Argument(help="Talenta inbox ID."),
|
|
87
85
|
],
|
|
88
86
|
json_output: JsonOption = False,
|
|
89
|
-
table: TableOption = False,
|
|
90
87
|
avatars: AvatarsOption = False,
|
|
91
88
|
verbose: VerboseOption = False,
|
|
92
89
|
) -> None:
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
from tlnt.cli.output import run
|
|
2
|
-
from tlnt.cli.options import AvatarsOption, JsonOption,
|
|
2
|
+
from tlnt.cli.options import AvatarsOption, JsonOption, VerboseOption
|
|
3
3
|
from tlnt.core.services.profile import profile as profile_action
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def profile(
|
|
7
7
|
json_output: JsonOption = False,
|
|
8
|
-
table: TableOption = False,
|
|
9
8
|
avatars: AvatarsOption = False,
|
|
10
9
|
verbose: VerboseOption = False,
|
|
11
10
|
) -> None:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
from tlnt.cli.output import run
|
|
2
|
-
from tlnt.cli.options import JsonOption,
|
|
1
|
+
from tlnt.cli.output import require_writable, run
|
|
2
|
+
from tlnt.cli.options import JsonOption, VerboseOption
|
|
3
3
|
from tlnt.core.services.setup import setup as setup_action
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def setup(
|
|
7
7
|
json_output: JsonOption = False,
|
|
8
|
-
table: TableOption = False,
|
|
9
8
|
verbose: VerboseOption = False,
|
|
10
9
|
) -> None:
|
|
11
10
|
"""Create config.json, or add new keys to it and drop old ones."""
|
|
11
|
+
require_writable(json_output)
|
|
12
12
|
run("Writing config...", setup_action, json_output, verbose)
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
from tlnt.cli.output import run
|
|
2
|
-
from tlnt.cli.options import JsonOption,
|
|
2
|
+
from tlnt.cli.options import JsonOption, VerboseOption
|
|
3
3
|
from tlnt.core.services.status import status as status_action
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def status(
|
|
7
7
|
json_output: JsonOption = False,
|
|
8
|
-
table: TableOption = False,
|
|
9
8
|
verbose: VerboseOption = False,
|
|
10
9
|
) -> None:
|
|
11
10
|
"""Check the saved Talenta session and mobile token."""
|