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.
Files changed (85) hide show
  1. {operx_cli-0.11.0 → operx_cli-0.11.1}/PKG-INFO +1 -1
  2. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/__init__.py +1 -1
  3. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/chat.py +13 -2
  4. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/PKG-INFO +1 -1
  5. {operx_cli-0.11.0 → operx_cli-0.11.1}/pyproject.toml +1 -1
  6. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_chat.py +21 -0
  7. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_connect.py +2 -2
  8. {operx_cli-0.11.0 → operx_cli-0.11.1}/README.md +0 -0
  9. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/AGENTES.md +0 -0
  10. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/agent_guide.py +0 -0
  11. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/api_fields.py +0 -0
  12. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/app.py +0 -0
  13. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/browser_login.py +0 -0
  14. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/client.py +0 -0
  15. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/__init__.py +0 -0
  16. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/account.py +0 -0
  17. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/ambiental.py +0 -0
  18. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/articulos.py +0 -0
  19. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/avisos.py +0 -0
  20. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/campos.py +0 -0
  21. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/common.py +0 -0
  22. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/completar.py +0 -0
  23. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/connect.py +0 -0
  24. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/empresas.py +0 -0
  25. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/inventario.py +0 -0
  26. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/lecturas.py +0 -0
  27. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/muestreo.py +0 -0
  28. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/ordenes.py +0 -0
  29. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/personas.py +0 -0
  30. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/planta.py +0 -0
  31. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/preventivos.py +0 -0
  32. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/raw.py +0 -0
  33. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/registros.py +0 -0
  34. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/reportes.py +0 -0
  35. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/rutinas.py +0 -0
  36. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/search.py +0 -0
  37. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/sst.py +0 -0
  38. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/commands/update.py +0 -0
  39. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/lookup.py +0 -0
  40. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/output.py +0 -0
  41. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/record_completion.py +0 -0
  42. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/self_update.py +0 -0
  43. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/settings.py +0 -0
  44. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/shell.py +0 -0
  45. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/spreadsheet.py +0 -0
  46. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/updates.py +0 -0
  47. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/values.py +0 -0
  48. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli/welcome.py +0 -0
  49. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/SOURCES.txt +0 -0
  50. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/dependency_links.txt +0 -0
  51. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/entry_points.txt +0 -0
  52. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/requires.txt +0 -0
  53. {operx_cli-0.11.0 → operx_cli-0.11.1}/operx_cli.egg-info/top_level.txt +0 -0
  54. {operx_cli-0.11.0 → operx_cli-0.11.1}/setup.cfg +0 -0
  55. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_agentes.py +0 -0
  56. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_api_campos.py +0 -0
  57. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_app.py +0 -0
  58. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_articulos.py +0 -0
  59. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_campos.py +0 -0
  60. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_cards.py +0 -0
  61. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_client.py +0 -0
  62. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_completar.py +0 -0
  63. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_daily_flows.py +0 -0
  64. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_inventario_lecturas.py +0 -0
  65. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_json_writes.py +0 -0
  66. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_login.py +0 -0
  67. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_logout_and_routes.py +0 -0
  68. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_lookup.py +0 -0
  69. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_more_of_the_api.py +0 -0
  70. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_muestreo.py +0 -0
  71. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_ordenes.py +0 -0
  72. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_output.py +0 -0
  73. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_personas.py +0 -0
  74. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_preventivos.py +0 -0
  75. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_record_completion.py +0 -0
  76. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_registros.py +0 -0
  77. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_rutinas.py +0 -0
  78. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_self_update.py +0 -0
  79. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_settings.py +0 -0
  80. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_shell.py +0 -0
  81. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_spreadsheet.py +0 -0
  82. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_sst_ambiental.py +0 -0
  83. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_updates.py +0 -0
  84. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_values.py +0 -0
  85. {operx_cli-0.11.0 → operx_cli-0.11.1}/tests/test_welcome.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: operx-cli
3
- Version: 0.11.0
3
+ Version: 0.11.1
4
4
  Summary: La línea de comandos de OperX: tu empresa desde la terminal, con tu token de API.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -2,4 +2,4 @@
2
2
  API (backend/users/api_allowlist.py) from a terminal, with a personal API
3
3
  token."""
4
4
 
5
- __version__ = "0.11.0"
5
+ __version__ = "0.11.1"
@@ -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.get("body") or (message.get("link") or {}).get("title") or ""
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.get("body"), "id": message["id"],
83
+ "author_name": message.get("author_name"), "text": words_of(message), "id": message["id"],
73
84
  }
74
85
 
75
86
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: operx-cli
3
- Version: 0.11.0
3
+ Version: 0.11.1
4
4
  Summary: La línea de comandos de OperX: tu empresa desde la terminal, con tu token de API.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "operx-cli"
7
- version = "0.11.0"
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