worker-automate-hub 0.4.440__tar.gz → 0.4.442__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/PKG-INFO +1 -1
  2. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/pyproject.toml +1 -1
  3. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/api/client.py +0 -48
  4. worker_automate_hub-0.4.442/worker_automate_hub/api/rpa_fila_service.py +58 -0
  5. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/task_executor.py +1 -1
  6. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/worker.py +4 -3
  7. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/README.md +0 -0
  8. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/__init__.py +0 -0
  9. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/api/__init__.py +0 -0
  10. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/api/ahead_service.py +0 -0
  11. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/api/helpers/__init__.py +0 -0
  12. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
  13. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/api/rpa_historico_service.py +0 -0
  14. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/cli.py +0 -0
  15. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/config/__init__.py +0 -0
  16. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/config/settings.py +0 -0
  17. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/config.py +0 -0
  18. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/core/so_manipulation.py +0 -0
  19. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/decorators/__init__.py +0 -0
  20. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/decorators/deprecation.py +0 -0
  21. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/decorators/rate_limit.py +0 -0
  22. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/decorators/repeat.py +0 -0
  23. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/decorators/retry.py +0 -0
  24. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/decorators/singleton.py +0 -0
  25. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/decorators/timeit.py +0 -0
  26. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/models/__init__.py +0 -0
  27. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/models/dao/__init__.py +0 -0
  28. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
  29. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
  30. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
  31. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/models/dto/__init__.py +0 -0
  32. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
  33. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +0 -0
  34. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/models/dto/rpa_processo_rdp_dto.py +0 -0
  35. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
  36. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/__init__.py +0 -0
  37. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
  38. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
  39. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/conexao_rdp.py +0 -0
  40. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
  41. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
  42. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
  43. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
  44. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
  45. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
  46. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
  47. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +0 -0
  48. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +0 -0
  49. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
  50. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
  51. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +0 -0
  52. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
  53. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
  54. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
  55. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
  56. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
  57. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +0 -0
  58. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +0 -0
  59. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
  60. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
  61. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
  62. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
  63. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/playground.py +0 -0
  64. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/sped_fiscal.py +0 -0
  65. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
  66. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/tasks/task_definitions.py +0 -0
  67. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/utils/__init__.py +0 -0
  68. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/utils/env.py +0 -0
  69. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
  70. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/utils/logger.py +0 -0
  71. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/utils/toast.py +0 -0
  72. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/utils/updater.py +0 -0
  73. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/utils/util.py +0 -0
  74. {worker_automate_hub-0.4.440 → worker_automate_hub-0.4.442}/worker_automate_hub/utils/utils_nfe_entrada.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: worker-automate-hub
3
- Version: 0.4.440
3
+ Version: 0.4.442
4
4
  Summary: Worker Automate HUB é uma aplicação para automatizar rotinas de RPA nos ambientes Argenta.
5
5
  Author: Joel Paim
6
6
  Requires-Python: >=3.12,<4.0
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "worker-automate-hub"
3
- version = "0.4.440"
3
+ version = "0.4.442"
4
4
  description = "Worker Automate HUB é uma aplicação para automatizar rotinas de RPA nos ambientes Argenta."
5
5
  authors = ["Joel Paim"]
6
6
  readme = "README.md"
@@ -45,33 +45,6 @@ async def get_new_task(stop_event: threading.Event) -> RpaProcessoEntradaDTO:
45
45
  )
46
46
  return None
47
47
 
48
- async def burnQueue(id_fila: str):
49
- env_config, _ = load_env_config()
50
- try:
51
-
52
- headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
53
-
54
-
55
- async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
56
- async with session.delete(
57
- f"{env_config["API_BASE_URL"]}/fila/burn-queue/{id_fila}",
58
- headers=headers_basic,
59
- ) as response:
60
- if response.status == 200:
61
- logger.info("Fila excluida com sucesso.")
62
- console.print("\nFila excluida com sucesso.\n", style="bold green")
63
- else:
64
- logger.error(f"Erro ao excluir a fila: {response.content}")
65
- console.print(f"Erro ao excluir a fila: {response.content}", style="bold red")
66
-
67
- except Exception as e:
68
- err_msg = f"Erro remover registro da fila: {e}"
69
- logger.error(err_msg)
70
- console.print(
71
- f"{err_msg}\n",
72
- style="bold red",
73
- )
74
- return None
75
48
 
76
49
  async def notify_is_alive(stop_event: threading.Event):
77
50
  env_config, _ = load_env_config()
@@ -348,28 +321,7 @@ async def send_gchat_message(message: str) -> None:
348
321
  style="bold red",
349
322
  )
350
323
  return None
351
-
352
- async def unlock_queue(id: str):
353
- env_config, _ = load_env_config()
354
- try:
355
- headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
356
-
357
324
 
358
- async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
359
- async with session.get(
360
- f"{env_config["API_BASE_URL"]}/fila/unlock-queue/{id}",
361
- headers=headers_basic,
362
- ) as response:
363
- return await response.text()
364
-
365
- except Exception as e:
366
- err_msg = f"Erro ao desbloquear a fila: {e}"
367
- logger.error(err_msg)
368
- console.print(
369
- f"{err_msg}\n",
370
- style="bold red",
371
- )
372
- return None
373
325
 
374
326
 
375
327
  def read_secret(path: str, vault_token: str):
@@ -0,0 +1,58 @@
1
+ from worker_automate_hub.config.settings import load_env_config
2
+ from worker_automate_hub.utils.logger import logger
3
+ from rich.console import Console
4
+
5
+ import aiohttp
6
+
7
+ console = Console()
8
+
9
+
10
+ async def burn_queue(id_fila: str):
11
+ env_config, _ = load_env_config()
12
+ try:
13
+
14
+ headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
15
+
16
+
17
+ async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
18
+ async with session.delete(
19
+ f"{env_config["API_BASE_URL"]}/fila/burn-queue/{id_fila}",
20
+ headers=headers_basic,
21
+ ) as response:
22
+ if response.status == 200:
23
+ logger.info("Fila excluida com sucesso.")
24
+ console.print("\nFila excluida com sucesso.\n", style="bold green")
25
+ else:
26
+ logger.error(f"Erro ao excluir a fila: {response.content}")
27
+ console.print(f"Erro ao excluir a fila: {response.content}", style="bold red")
28
+
29
+ except Exception as e:
30
+ err_msg = f"Erro remover registro da fila: {e}"
31
+ logger.error(err_msg)
32
+ console.print(
33
+ f"{err_msg}\n",
34
+ style="bold red",
35
+ )
36
+ return None
37
+
38
+ async def unlock_queue(id: str):
39
+ env_config, _ = load_env_config()
40
+ try:
41
+ headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
42
+
43
+
44
+ async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
45
+ async with session.get(
46
+ f"{env_config["API_BASE_URL"]}/fila/unlock-queue/{id}",
47
+ headers=headers_basic,
48
+ ) as response:
49
+ return await response.text()
50
+
51
+ except Exception as e:
52
+ err_msg = f"Erro ao desbloquear a fila: {e}"
53
+ logger.error(err_msg)
54
+ console.print(
55
+ f"{err_msg}\n",
56
+ style="bold red",
57
+ )
58
+ return None
@@ -6,8 +6,8 @@ from rich.console import Console
6
6
  from worker_automate_hub.api.client import (
7
7
  get_processo,
8
8
  send_gchat_message,
9
- unlock_queue,
10
9
  )
10
+ from worker_automate_hub.api.rpa_fila_service import unlock_queue
11
11
  from worker_automate_hub.api.rpa_historico_service import store, update
12
12
  from worker_automate_hub.models.dao.rpa_historico import RpaHistorico
13
13
  from worker_automate_hub.models.dao.rpa_processo import RpaProcesso
@@ -3,11 +3,11 @@ import os
3
3
  import threading
4
4
  from pathlib import Path
5
5
 
6
+ from worker_automate_hub.api.rpa_fila_service import burn_queue, unlock_queue
6
7
  import pyfiglet
7
8
  from rich.console import Console
8
9
 
9
10
  from worker_automate_hub.api.client import (
10
- burnQueue,
11
11
  get_new_task,
12
12
  notify_is_alive,
13
13
  send_gchat_message,
@@ -41,11 +41,12 @@ async def check_and_execute_tasks(stop_event: threading.Event):
41
41
  if task is not None:
42
42
  processo_existe = await is_uuid_in_tasks(task.uuidProcesso)
43
43
  if processo_existe:
44
- await burnQueue(task.uuidFila)
44
+ await burn_queue(task.uuidFila)
45
45
  logger.info(f"Executando a task: {task.nomProcesso}")
46
46
  await perform_task(task)
47
47
  else:
48
- log_message = f"O processo [{task.nomProcesso}] não existe no Worker [{worker_config['NOME_ROBO']}] e não foi removido da fila."
48
+ await unlock_queue(task.uuidFila)
49
+ log_message = f"O processo [{task.nomProcesso}] não existe no Worker [{worker_config['NOME_ROBO']}] e foi devolvido para a fila."
49
50
  console.print(f"\n{log_message}\n", style="yellow")
50
51
  logger.error(log_message)
51
52
  await send_gchat_message(log_message)