operx-cli 0.11.0__tar.gz → 0.11.1__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.
- {operx_cli-0.11.0 → operx_cli-0.11.1}/PKG-INFO +1 -1
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/__init__.py +1 -1
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/chat.py +13 -2
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/PKG-INFO +1 -1
- {operx_cli-0.11.0 → operx_cli-0.11.1}/pyproject.toml +1 -1
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_chat.py +21 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_connect.py +2 -2
- {operx_cli-0.11.0 → operx_cli-0.11.1}/README.md +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/AGENTES.md +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/agent_guide.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/api_fields.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/app.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/browser_login.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/client.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/__init__.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/account.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/ambiental.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/articulos.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/avisos.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/campos.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/common.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/completar.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/connect.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/empresas.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/inventario.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/lecturas.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/muestreo.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/ordenes.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/personas.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/planta.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/preventivos.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/raw.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/registros.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/reportes.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/rutinas.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/search.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/sst.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/update.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/lookup.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/output.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/record_completion.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/self_update.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/settings.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/shell.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/spreadsheet.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/updates.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/values.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/welcome.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/SOURCES.txt +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/dependency_links.txt +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/entry_points.txt +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/requires.txt +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/top_level.txt +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/setup.cfg +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_agentes.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_api_campos.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_app.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_articulos.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_campos.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_cards.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_client.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_completar.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_daily_flows.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_inventario_lecturas.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_json_writes.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_login.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_logout_and_routes.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_lookup.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_more_of_the_api.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_muestreo.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_ordenes.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_output.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_personas.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_preventivos.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_record_completion.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_registros.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_rutinas.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_self_update.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_settings.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_shell.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_spreadsheet.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_sst_ambiental.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_updates.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_values.py +0 -0
- {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_welcome.py +0 -0
|
@@ -50,9 +50,20 @@ def mentioned(text, people):
|
|
|
50
50
|
]
|
|
51
51
|
|
|
52
52
|
|
|
53
|
+
# Where a message puts its record among its words; the record itself is its «link».
|
|
54
|
+
RECORD_MARKER = "[[•]]"
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def words_of(message):
|
|
58
|
+
"""The message's text, with the record's place named by the record's title."""
|
|
59
|
+
link = message.get("link")
|
|
60
|
+
name = (link.get("title") or "Registro no disponible") if link else ""
|
|
61
|
+
return (message.get("body") or "").replace(RECORD_MARKER, name).strip()
|
|
62
|
+
|
|
63
|
+
|
|
53
64
|
def message_line(message):
|
|
54
65
|
"""One message for a person: when, who, what, and what hangs from it."""
|
|
55
|
-
text = "(eliminado)" if message.get("deleted") else message
|
|
66
|
+
text = "(eliminado)" if message.get("deleted") else words_of(message) or (message.get("link") or {}).get("title") or ""
|
|
56
67
|
extras = []
|
|
57
68
|
if message.get("edited_at"):
|
|
58
69
|
extras.append("editado")
|
|
@@ -69,7 +80,7 @@ def _found_row(found):
|
|
|
69
80
|
message = found["message"]
|
|
70
81
|
return {
|
|
71
82
|
"channel": f"#{found['conversation']['title']}", "when": shown_moment(message.get("created_at")),
|
|
72
|
-
"author_name": message.get("author_name"), "text": message
|
|
83
|
+
"author_name": message.get("author_name"), "text": words_of(message), "id": message["id"],
|
|
73
84
|
}
|
|
74
85
|
|
|
75
86
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "operx-cli"
|
|
7
|
-
version = "0.11.
|
|
7
|
+
version = "0.11.1"
|
|
8
8
|
description = "La línea de comandos de OperX: tu empresa desde la terminal, con tu token de API."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -75,6 +75,27 @@ def test_leer_finds_the_channel_by_name_with_or_without_hash():
|
|
|
75
75
|
assert "Hay más antes: --antes 12" in result.output
|
|
76
76
|
|
|
77
77
|
|
|
78
|
+
WORK_ORDER = {"kind": "work_order", "id": 1042, "title": "OT-1042 · Cambio de rodamiento", "detail": "En Progreso"}
|
|
79
|
+
NOT_AVAILABLE = {"kind": None, "id": None, "title": None, "detail": ""}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def test_leer_names_the_record_where_the_message_puts_it():
|
|
83
|
+
fake = FakeApi({
|
|
84
|
+
("GET", "chat/conversations/"): [CHANNEL],
|
|
85
|
+
("GET", "chat/conversations/4/messages/"): {"messages": [
|
|
86
|
+
message(20, "Revisa [[•]] hoy", link=WORK_ORDER),
|
|
87
|
+
message(21, "[[•]]", link=WORK_ORDER),
|
|
88
|
+
message(22, "Mira [[•]]", link=NOT_AVAILABLE),
|
|
89
|
+
], "has_more": False},
|
|
90
|
+
})
|
|
91
|
+
result = run(fake, "chat", "leer", "4")
|
|
92
|
+
|
|
93
|
+
assert "Revisa OT-1042 · Cambio de rodamiento hoy" in result.output
|
|
94
|
+
assert "Laura Gómez: OT-1042 · Cambio de rodamiento" in result.output
|
|
95
|
+
assert "Mira Registro no disponible" in result.output
|
|
96
|
+
assert "[[" not in result.output
|
|
97
|
+
|
|
98
|
+
|
|
78
99
|
def test_leer_a_thread_asks_for_its_replies():
|
|
79
100
|
fake = FakeApi({
|
|
80
101
|
("GET", "chat/conversations/"): [CHANNEL],
|
|
@@ -18,7 +18,7 @@ POINT_TEMP = {
|
|
|
18
18
|
CARD = {
|
|
19
19
|
"id": 3, "uid": "d-fwd000001", "name": "Broker planta", "preset": "broker", "model_label": "Broker de la planta", "place_name": "Planta Yumbo",
|
|
20
20
|
"status": "active", "state": "receiving", "last_seen_at": "2026-11-05T10:39:35.188451-05:00", "silent_since": None, "last_error": "",
|
|
21
|
-
"every_minutes": 5, "channels_total": 2, "channels_mapped": 0, "main": None, "strip": ["gap", "ok"], "strip_from": "2026-11-04T11:15:36.712052-05:00",
|
|
21
|
+
"every_minutes": 5, "channels_total": 2, "channels_mapped": 0, "connector": None, "main": None, "strip": ["gap", "ok"], "strip_from": "2026-11-04T11:15:36.712052-05:00",
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
@@ -39,7 +39,7 @@ DEVICE = {
|
|
|
39
39
|
"place_id": 1, "place_name": "Planta Yumbo", "time_zone": "America/Bogota", "use_arrival_time": False, "every_minutes": 5, "status": "active",
|
|
40
40
|
"state": "receiving", "last_seen_at": "2026-11-05T10:39:35.188451-05:00", "last_error": "", "silent_since": None,
|
|
41
41
|
"ingest_address": "https://api.operx.pro/api/v1/connect/ingest",
|
|
42
|
-
"channels": [channel(31, "planta/comp2/temp", "80.5000"), channel(32, "planta/comp2/horas", "1200.0000")],
|
|
42
|
+
"channels": [channel(31, "planta/comp2/temp", "80.5000"), channel(32, "planta/comp2/horas", "1200.0000")], "connector": None,
|
|
43
43
|
}
|
|
44
44
|
MESSAGE = {
|
|
45
45
|
"id": 46, "received_at": "2026-11-05T10:39:35.188451-05:00", "way": "mqtt", "result": "read", "values_in": 1, "values_written": 0,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|