tlnt-cli 1.5.2__tar.gz → 1.7.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.
Files changed (67) hide show
  1. tlnt_cli-1.7.0/PKG-INFO +143 -0
  2. tlnt_cli-1.7.0/README.md +126 -0
  3. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/pyproject.toml +1 -2
  4. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/pyproject.toml.orig +1 -2
  5. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/browser/login.py +2 -1
  6. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/approvals.py +10 -1
  7. tlnt_cli-1.7.0/src/tlnt/cli/commands/api.py +44 -0
  8. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/attendance.py +22 -1
  9. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/calendar.py +3 -1
  10. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/login.py +2 -11
  11. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/logout.py +4 -2
  12. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/notifications.py +11 -2
  13. tlnt_cli-1.7.0/src/tlnt/cli/commands/overtime.py +110 -0
  14. tlnt_cli-1.7.0/src/tlnt/cli/commands/payslip.py +59 -0
  15. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/profile.py +2 -1
  16. tlnt_cli-1.7.0/src/tlnt/cli/commands/reimbursement.py +21 -0
  17. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/setup.py +2 -1
  18. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/timeoff.py +20 -2
  19. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/update.py +2 -0
  20. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/main.py +70 -34
  21. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/options.py +17 -14
  22. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/output.py +24 -1
  23. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/client.py +240 -9
  24. tlnt_cli-1.7.0/src/tlnt/core/curl.py +58 -0
  25. tlnt_cli-1.7.0/src/tlnt/core/device.py +66 -0
  26. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/http_client.py +12 -0
  27. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/mekari.py +69 -10
  28. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/models.py +12 -0
  29. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/services/__init__.py +2 -1
  30. tlnt_cli-1.7.0/src/tlnt/core/services/api.py +85 -0
  31. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/services/attendance.py +31 -17
  32. tlnt_cli-1.7.0/src/tlnt/core/services/device.py +67 -0
  33. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/services/login.py +17 -1
  34. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/services/logout.py +3 -0
  35. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/services/notifications.py +28 -0
  36. tlnt_cli-1.7.0/src/tlnt/core/services/overtime.py +19 -0
  37. tlnt_cli-1.7.0/src/tlnt/core/services/payslip.py +49 -0
  38. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/services/setup.py +2 -0
  39. tlnt_cli-1.7.0/src/tlnt/core/services/status.py +55 -0
  40. tlnt_cli-1.7.0/src/tlnt/core/user_agent.py +72 -0
  41. tlnt_cli-1.5.2/PKG-INFO +0 -314
  42. tlnt_cli-1.5.2/README.md +0 -296
  43. tlnt_cli-1.5.2/src/tlnt/cli/commands/mcp.py +0 -8
  44. tlnt_cli-1.5.2/src/tlnt/core/services/status.py +0 -35
  45. tlnt_cli-1.5.2/src/tlnt/core/user_agent.py +0 -71
  46. tlnt_cli-1.5.2/src/tlnt/mcp/__init__.py +0 -0
  47. tlnt_cli-1.5.2/src/tlnt/mcp/main.py +0 -176
  48. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/LICENSE +0 -0
  49. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/__init__.py +0 -0
  50. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/__main__.py +0 -0
  51. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/browser/__init__.py +0 -0
  52. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/browser/oauth.py +0 -0
  53. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/browser/scripted.py +0 -0
  54. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/__init__.py +0 -0
  55. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/avatars.py +0 -0
  56. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/__init__.py +0 -0
  57. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/status.py +0 -0
  58. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/commands/version.py +0 -0
  59. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/cli/prompts.py +0 -0
  60. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/__init__.py +0 -0
  61. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/config.py +0 -0
  62. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/logs.py +0 -0
  63. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/play_store.py +0 -0
  64. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/services/calendar.py +0 -0
  65. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/services/profile.py +0 -0
  66. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/services/timeoff.py +0 -0
  67. {tlnt_cli-1.5.2 → tlnt_cli-1.7.0}/src/tlnt/core/session.py +0 -0
@@ -0,0 +1,143 @@
1
+ Metadata-Version: 2.4
2
+ Name: tlnt-cli
3
+ Version: 1.7.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
+ ![tlnt CLI logo](assets/logo.png)
19
+
20
+ # tlnt
21
+
22
+ ![CI](https://github.com/fathirazarthuro/tlnt/actions/workflows/ci.yml/badge.svg)
23
+ ![License](https://img.shields.io/github/license/fathirazarthuro/tlnt)
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
+ - `--curl` sends nothing but prints the bearer token and request body; keep
109
+ that output out of chat, logs and tickets.
110
+ - `TALENTA_READONLY=1` refuses every command that would change Talenta or
111
+ local state.
112
+ - The version checks only read public listings (PyPI and Google Play), never
113
+ send your session or config, and never log out, log in, or update for you.
114
+ - Never print passwords, bearer tokens, cookies, authorization codes, request
115
+ bodies, selfie contents, or real employee data.
116
+ - If `status` returns `session_missing`, `session_invalid`,
117
+ `mobile_token_missing`, or `mobile_token_expired`, ask
118
+ the user to run login explicitly.
119
+
120
+ ## Documentation
121
+
122
+ - [Docs site](https://tlnt-docs.vercel.app)
123
+ - [Install](docs/install.md) and [Setup](docs/setup.md)
124
+ - [Overview](docs/overview.md): commands and the JSON contract
125
+ - [Workflows](docs/workflows.md)
126
+ - [AI agent integrations](docs/integrations.md)
127
+ - [Security](docs/security.md)
128
+ - [Contributing](docs/contributing.md)
129
+ - [Agent skill](skills/tlnt-cli/SKILL.md)
130
+
131
+ ## Development
132
+
133
+ ```bash
134
+ uv sync --group dev --group docs
135
+ uv run pytest
136
+ uv run --group docs mkdocs build --strict
137
+ ```
138
+
139
+ Read [Contributing](docs/contributing.md) before changing public behavior.
140
+
141
+ ## License
142
+
143
+ `tlnt` is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,126 @@
1
+ ![tlnt CLI logo](assets/logo.png)
2
+
3
+ # tlnt
4
+
5
+ ![CI](https://github.com/fathirazarthuro/tlnt/actions/workflows/ci.yml/badge.svg)
6
+ ![License](https://img.shields.io/github/license/fathirazarthuro/tlnt)
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
+ - `--curl` sends nothing but prints the bearer token and request body; keep
92
+ that output out of chat, logs and tickets.
93
+ - `TALENTA_READONLY=1` refuses every command that would change Talenta or
94
+ local state.
95
+ - The version checks only read public listings (PyPI and Google Play), never
96
+ send your session or config, and never log out, log in, or update for you.
97
+ - Never print passwords, bearer tokens, cookies, authorization codes, request
98
+ bodies, selfie contents, or real employee data.
99
+ - If `status` returns `session_missing`, `session_invalid`,
100
+ `mobile_token_missing`, or `mobile_token_expired`, ask
101
+ the user to run login explicitly.
102
+
103
+ ## Documentation
104
+
105
+ - [Docs site](https://tlnt-docs.vercel.app)
106
+ - [Install](docs/install.md) and [Setup](docs/setup.md)
107
+ - [Overview](docs/overview.md): commands and the JSON contract
108
+ - [Workflows](docs/workflows.md)
109
+ - [AI agent integrations](docs/integrations.md)
110
+ - [Security](docs/security.md)
111
+ - [Contributing](docs/contributing.md)
112
+ - [Agent skill](skills/tlnt-cli/SKILL.md)
113
+
114
+ ## Development
115
+
116
+ ```bash
117
+ uv sync --group dev --group docs
118
+ uv run pytest
119
+ uv run --group docs mkdocs build --strict
120
+ ```
121
+
122
+ Read [Contributing](docs/contributing.md) before changing public behavior.
123
+
124
+ ## License
125
+
126
+ `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.5.2"
7
+ version = "1.7.0"
8
8
  description = "CLI wrapper for HRIS attendance and employment workflows."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -13,7 +13,6 @@ requires-python = ">=3.11,<3.15"
13
13
  dependencies = [
14
14
  "httpx>=0.28,<0.29",
15
15
  "loguru>=0.7,<1",
16
- "mcp>=2.0,<3",
17
16
  "platformdirs>=4.3,<5",
18
17
  "playwright>=1.50,<2",
19
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.5.2"
7
+ version = "1.7.0"
8
8
  description = "CLI wrapper for HRIS attendance and employment workflows."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -14,7 +14,6 @@ requires-python = ">=3.11,<3.15"
14
14
  dependencies = [
15
15
  "httpx>=0.28,<0.29",
16
16
  "loguru>=0.7,<1",
17
- "mcp>=2.0,<3",
18
17
  "platformdirs>=4.3,<5",
19
18
  "playwright>=1.50,<2",
20
19
  "rich>=14,<16",
@@ -17,6 +17,7 @@ from playwright.sync_api import sync_playwright
17
17
 
18
18
  from tlnt.browser.oauth import authorize_url, code_from_url, pkce_pair
19
19
  from tlnt.core.client import MekariClient
20
+ from tlnt.core.device import device_identity
20
21
  from tlnt.core.mekari import (
21
22
  DASHBOARD_TALENTA_URL,
22
23
  MEKARI_DOMAIN,
@@ -285,7 +286,7 @@ class BrowserLogin:
285
286
  context_factory: Callable[[], AbstractContextManager[Any]] = chrome_context,
286
287
  credentials: Credentials | None = None,
287
288
  ) -> None:
288
- self.client = client or MekariClient()
289
+ self.client = client or MekariClient(device=device_identity())
289
290
  self._owns_client = client is None
290
291
  self.context_factory = context_factory
291
292
  self.credentials = credentials
@@ -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 action_banner, confirm, console, dig, emit, spinner
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:
@@ -0,0 +1,44 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Annotated
4
+
5
+ import typer
6
+
7
+ from tlnt.cli.options import CurlOption, JsonOption, VerboseOption
8
+ from tlnt.cli.output import run
9
+ from tlnt.core.services.api import api_get as api_get_action
10
+
11
+
12
+ def _params(values: list[str]) -> dict[str, str]:
13
+ params: dict[str, str] = {}
14
+ for value in values:
15
+ key, separator, text = value.partition("=")
16
+ if not key or not separator:
17
+ raise typer.BadParameter("--param takes key=value")
18
+ params[key] = text
19
+ return params
20
+
21
+
22
+ def api_get(
23
+ path: Annotated[
24
+ str,
25
+ typer.Argument(
26
+ help="Path as listed in docs/apk-parity.md, e.g. time-off/balance-detail."
27
+ ),
28
+ ],
29
+ param: Annotated[
30
+ list[str] | None,
31
+ typer.Option("--param", "-p", help="Query value as key=value; repeat for more."),
32
+ ] = None,
33
+ json_output: JsonOption = False,
34
+ verbose: VerboseOption = False,
35
+ curl: CurlOption = False,
36
+ ) -> None:
37
+ """Read any Talenta mobile API path (GET only)."""
38
+ params = _params(param or [])
39
+ run(
40
+ "Loading API response...",
41
+ lambda: api_get_action(path, params),
42
+ json_output,
43
+ verbose,
44
+ )
@@ -9,9 +9,10 @@ import typer
9
9
 
10
10
  from tlnt.cli import prompts
11
11
  from tlnt.cli.approvals import run_approval
12
- from tlnt.cli.output import action_banner, confirm, emit, spinner
12
+ from tlnt.cli.output import action_banner, confirm, emit, require_writable, spinner
13
13
  from tlnt.cli.options import (
14
14
  AvatarsOption,
15
+ CurlOption,
15
16
  InteractiveOption,
16
17
  JsonOption,
17
18
  VerboseOption,
@@ -47,7 +48,14 @@ def _run_attendance(
47
48
  interactive: bool = False,
48
49
  verbose: bool = False,
49
50
  avatars: bool = False,
51
+ validate_location: bool = False,
50
52
  ) -> None:
53
+ if validate_location and not dry_run:
54
+ raise typer.BadParameter(
55
+ "--validate-location requires --dry-run.",
56
+ )
57
+ if not dry_run:
58
+ require_writable(json_output)
51
59
  if interactive:
52
60
  unavailable = prompts.guard(json_output, title=action_label)
53
61
  if unavailable is not None:
@@ -86,6 +94,7 @@ def _run_attendance(
86
94
  latitude=latitude,
87
95
  longitude=longitude,
88
96
  location_id=location_id,
97
+ validate_location=validate_location,
89
98
  ),
90
99
  json_output,
91
100
  avatars=avatars,
@@ -148,6 +157,13 @@ def _clock_command(event_type: str, label: str, doc: str) -> Callable[..., None]
148
157
  bool,
149
158
  typer.Option("--dry-run", help="Preview without submitting attendance."),
150
159
  ] = False,
160
+ validate_location: Annotated[
161
+ bool,
162
+ typer.Option(
163
+ "--validate-location",
164
+ help="With --dry-run, also call validate_location before preview.",
165
+ ),
166
+ ] = False,
151
167
  notes: Annotated[
152
168
  str,
153
169
  typer.Option("--notes", help="Optional attendance note."),
@@ -166,6 +182,7 @@ def _clock_command(event_type: str, label: str, doc: str) -> Callable[..., None]
166
182
  json_output: JsonOption = False,
167
183
  avatars: AvatarsOption = False,
168
184
  verbose: VerboseOption = False,
185
+ curl: CurlOption = False,
169
186
  ) -> None:
170
187
  _run_attendance(
171
188
  event_type,
@@ -180,6 +197,7 @@ def _clock_command(event_type: str, label: str, doc: str) -> Callable[..., None]
180
197
  interactive=interactive,
181
198
  verbose=verbose,
182
199
  avatars=avatars,
200
+ validate_location=validate_location,
183
201
  )
184
202
 
185
203
  command.__doc__ = doc
@@ -210,6 +228,7 @@ def attendance_summary_list(
210
228
  ] = None,
211
229
  json_output: JsonOption = False,
212
230
  verbose: VerboseOption = False,
231
+ curl: CurlOption = False,
213
232
  ) -> None:
214
233
  """Read attendance summaries for a date."""
215
234
  emit(summary_list_action(_attendance_date(selected_date)), json_output)
@@ -222,6 +241,7 @@ def attendance_summary_metrics(
222
241
  ] = None,
223
242
  json_output: JsonOption = False,
224
243
  verbose: VerboseOption = False,
244
+ curl: CurlOption = False,
225
245
  ) -> None:
226
246
  """Read attendance summary metrics for a date."""
227
247
  emit(summary_metrics_action(_attendance_date(selected_date)), json_output)
@@ -256,6 +276,7 @@ def attendance_approve(
256
276
  interactive: InteractiveOption = False,
257
277
  json_output: JsonOption = False,
258
278
  verbose: VerboseOption = False,
279
+ curl: CurlOption = False,
259
280
  ) -> None:
260
281
  """Approve a live attendance request after confirmation."""
261
282
  run_approval(
@@ -5,7 +5,7 @@ from typing import Annotated, Any
5
5
 
6
6
  import typer
7
7
 
8
- from tlnt.cli.options import JsonOption, VerboseOption
8
+ from tlnt.cli.options import CurlOption, JsonOption, VerboseOption
9
9
  from tlnt.cli.output import run
10
10
  from tlnt.core.services import calendar as calendar_service
11
11
 
@@ -64,6 +64,7 @@ def _filtered_command(name: str, label: str, doc: str) -> Callable[..., None]:
64
64
  user_id: Annotated[str | None, typer.Option("--user-id")] = None,
65
65
  json_output: JsonOption = False,
66
66
  verbose: VerboseOption = False,
67
+ curl: CurlOption = False,
67
68
  ) -> None:
68
69
  params = _calendar_params(
69
70
  start_date, end_date, limit, month, year, page,
@@ -96,6 +97,7 @@ calendar_activity = _filtered_command(
96
97
  def calendar_my_birthday(
97
98
  json_output: JsonOption = False,
98
99
  verbose: VerboseOption = False,
100
+ curl: CurlOption = False,
99
101
  ) -> None:
100
102
  """Read your birthday date."""
101
103
  run(
@@ -16,7 +16,7 @@ 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
19
+ from tlnt.cli.output import banner, deadline_bar, emit, require_writable
20
20
  from tlnt.cli.options import JsonOption, VerboseOption
21
21
  from tlnt.core import config
22
22
  from tlnt.core import mekari as mekari_constants
@@ -100,10 +100,6 @@ def _credentials(email: str) -> Credentials | Result:
100
100
 
101
101
  def login(
102
102
  json_output: JsonOption = False,
103
- store_password: Annotated[
104
- bool,
105
- typer.Option("--store-password", hidden=True),
106
- ] = False,
107
103
  browser: Annotated[
108
104
  Browser | None,
109
105
  typer.Option(
@@ -144,6 +140,7 @@ def login(
144
140
  verbose: VerboseOption = False,
145
141
  ) -> None:
146
142
  """Reuse valid session or sign in through your browser."""
143
+ require_writable(json_output)
147
144
  backend, endpoint = _resolve_backend(browser, cdp)
148
145
  email = (email or "").strip() or None
149
146
  if email and backend in (Browser.ego, Browser.yab):
@@ -156,12 +153,6 @@ def login(
156
153
  )
157
154
  if headless and not email:
158
155
  raise typer.BadParameter("--headless needs --email", param_hint="--headless")
159
- if store_password:
160
- typer.echo(
161
- "--store-password is deprecated and does nothing; "
162
- "it will be removed in 2.0.",
163
- err=True,
164
- )
165
156
  current = status_action()
166
157
  if current.ok:
167
158
  expiry_known = isinstance(current.data, dict) and bool(
@@ -1,11 +1,13 @@
1
- from tlnt.cli.output import run
2
- from tlnt.cli.options import JsonOption, VerboseOption
1
+ from tlnt.cli.output import require_writable, run
2
+ from tlnt.cli.options import CurlOption, 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
8
  verbose: VerboseOption = False,
9
+ curl: CurlOption = False,
9
10
  ) -> None:
10
11
  """Log out of Talenta and remove the saved session."""
12
+ require_writable(json_output)
11
13
  run("Signing out...", logout_action, json_output, verbose)
@@ -4,13 +4,14 @@ 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, VerboseOption
7
+ from tlnt.cli.options import AvatarsOption, CurlOption, 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,
11
11
  notification_count as notification_count_action,
12
12
  notification_detail as notification_detail_action,
13
13
  notification_list as notification_list_action,
14
+ notification_overtime_list as notification_overtime_list_action,
14
15
  notification_timeoff_list as notification_timeoff_list_action,
15
16
  )
16
17
 
@@ -18,6 +19,7 @@ from tlnt.core.services.notifications import (
18
19
  def notification_count(
19
20
  json_output: JsonOption = False,
20
21
  verbose: VerboseOption = False,
22
+ curl: CurlOption = False,
21
23
  ) -> None:
22
24
  """Read Talenta notification counts."""
23
25
  run("Loading notification counts...", notification_count_action, json_output, verbose)
@@ -26,7 +28,7 @@ def notification_count(
26
28
  def _inbox_list_command(
27
29
  action: Callable[..., Result], label: str, doc: str
28
30
  ) -> Callable[..., None]:
29
- """One inbox list; the three commands differ only in the inbox they read."""
31
+ """One inbox list; the list commands differ only in the inbox they read."""
30
32
 
31
33
  def command(
32
34
  page: Annotated[
@@ -44,6 +46,7 @@ def _inbox_list_command(
44
46
  json_output: JsonOption = False,
45
47
  avatars: AvatarsOption = False,
46
48
  verbose: VerboseOption = False,
49
+ curl: CurlOption = False,
47
50
  ) -> None:
48
51
  if page < 1:
49
52
  raise typer.BadParameter("page must be at least 1")
@@ -76,6 +79,11 @@ notification_timeoff_list = _inbox_list_command(
76
79
  "Loading time-off notifications...",
77
80
  "Read Talenta time-off notifications.",
78
81
  )
82
+ notification_overtime_list = _inbox_list_command(
83
+ lambda *filters: notification_overtime_list_action(*filters),
84
+ "Loading overtime notifications...",
85
+ "Read Talenta overtime notifications.",
86
+ )
79
87
 
80
88
 
81
89
  def notification_detail(
@@ -86,6 +94,7 @@ def notification_detail(
86
94
  json_output: JsonOption = False,
87
95
  avatars: AvatarsOption = False,
88
96
  verbose: VerboseOption = False,
97
+ curl: CurlOption = False,
89
98
  ) -> None:
90
99
  """Read one Talenta inbox notification detail."""
91
100
  if inbox_id < 1: