worker-automate-hub 0.4.367__tar.gz → 0.4.372__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/PKG-INFO +1 -1
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/pyproject.toml +1 -1
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/api/client.py +1 -1
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +2 -1
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/sped_fiscal.py +26 -29
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/task_executor.py +3 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/README.md +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/api/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/api/ahead_service.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/api/helpers/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/api/rpa_historico_service.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/cli.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/config/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/config/settings.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/config.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/core/so_manipulation.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/decorators/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/decorators/deprecation.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/decorators/rate_limit.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/decorators/repeat.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/decorators/retry.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/decorators/singleton.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/decorators/timeit.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/models/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/models/dao/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/models/dto/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/conexao_rdp.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/playground.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/task_definitions.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/__init__.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/env.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/logger.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/toast.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/updater.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/util.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/utils_nfe_entrada.py +0 -0
- {worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/worker.py +0 -0
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/api/client.py
RENAMED
@@ -492,7 +492,7 @@ async def get_status_nf_emsys(chave: int):
|
|
492
492
|
# Função para enviar arquivo de imagem a api
|
493
493
|
async def send_file(uuidRelacao: str, desArquivo: str, tipo: str, file: bytes, file_extension: str = "jpg") -> None:
|
494
494
|
"""
|
495
|
-
Função assíncrona para enviar um arquivo de imagem para uma API.
|
495
|
+
Função assíncrona para enviar um arquivo de imagem/text para uma API.
|
496
496
|
|
497
497
|
Args:
|
498
498
|
uuidRelacao (str): UUID da relação associada ao arquivo.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from datetime import datetime
|
2
|
-
from typing import List
|
2
|
+
from typing import List, Optional
|
3
3
|
|
4
4
|
from worker_automate_hub.models.dto.rpa_sistema_dto import RpaSistemaDTO
|
5
5
|
from pydantic import BaseModel, Field
|
@@ -12,6 +12,7 @@ class RpaProcessoEntradaDTO(BaseModel):
|
|
12
12
|
nomProcesso: str = Field(..., alias="nomProcesso")
|
13
13
|
uuidFila: str = Field(..., alias="uuidFila")
|
14
14
|
sistemas: List[RpaSistemaDTO] = Field(..., alias="sistemas")
|
15
|
+
historico_id: Optional[str] = None
|
15
16
|
|
16
17
|
class Config:
|
17
18
|
populate_by_name = True
|
@@ -54,6 +54,17 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
54
54
|
multiplicador_timeout = int(float(task.sistemas[0].timeout))
|
55
55
|
set_variable("timeout_multiplicador", multiplicador_timeout)
|
56
56
|
|
57
|
+
historico_id = task.historico_id
|
58
|
+
if historico_id:
|
59
|
+
console.print("Historico ID recuperado com sucesso...\n")
|
60
|
+
else:
|
61
|
+
console.print("Não foi possivel recuperar o histórico do ID, não sendo possivel enviar o arquivo SPED como retorno...\n")
|
62
|
+
return RpaRetornoProcessoDTO(
|
63
|
+
sucesso=False,
|
64
|
+
retorno="Não foi possivel recuperar o histórico do ID, não sendo possivel enviar o arquivo SPED como retorno",
|
65
|
+
status=RpaHistoricoStatusEnum.Falha,
|
66
|
+
)
|
67
|
+
|
57
68
|
# Fecha a instancia do emsys - caso esteja aberta
|
58
69
|
await kill_all_emsys()
|
59
70
|
|
@@ -399,36 +410,22 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
399
410
|
file_bytes = ""
|
400
411
|
with open(temp_path_to_txt, 'rb') as file:
|
401
412
|
file_bytes = file.read()
|
402
|
-
await worker_sleep(6)
|
403
413
|
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
result
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
status=RpaHistoricoStatusEnum.Sucesso,
|
420
|
-
)
|
421
|
-
except Exception as e:
|
422
|
-
result = f"Arquivo do SPED gerado com sucesso, porém gerou erro ao realizar o envio para o backoffice {e} - Arquivo ainda salvo na dispositivo utilizado no diretório {temp_path_to_txt} !"
|
423
|
-
console.print(result, style="bold red")
|
424
|
-
|
425
|
-
return RpaRetornoProcessoDTO(
|
426
|
-
sucesso=False,
|
427
|
-
retorno=result,
|
428
|
-
status=RpaHistoricoStatusEnum.Falha,
|
429
|
-
)
|
430
|
-
else:
|
431
|
-
result = f"Arquivo do SPED gerado com sucesso, porém não foi possivel obter o id do historico para envio do arquivo, retorno {get_historico["retorno"]} - Arquivo ainda salvo na dispositivo utilizado no diretório {temp_path_to_txt}"
|
414
|
+
|
415
|
+
await worker_sleep(6)
|
416
|
+
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
417
|
+
desArquivo = f"ArquivoSped_{filial_cod}_{timestamp}.txt"
|
418
|
+
try:
|
419
|
+
await send_file(historico_id, desArquivo, "text", file_bytes, file_extension="txt")
|
420
|
+
result = "Arquivo do SPED gerado com sucesso e arquivo salvo no Backoffice !"
|
421
|
+
os.remove(temp_path_to_txt)
|
422
|
+
return RpaRetornoProcessoDTO(
|
423
|
+
sucesso=True,
|
424
|
+
retorno=result,
|
425
|
+
status=RpaHistoricoStatusEnum.Sucesso,
|
426
|
+
)
|
427
|
+
except Exception as e:
|
428
|
+
result = f"Arquivo do SPED gerado com sucesso, porém gerou erro ao realizar o envio para o backoffice {e} - Arquivo ainda salvo na dispositivo utilizado no diretório {temp_path_to_txt} !"
|
432
429
|
console.print(result, style="bold red")
|
433
430
|
return RpaRetornoProcessoDTO(
|
434
431
|
sucesso=False,
|
@@ -54,6 +54,9 @@ async def perform_task(task: RpaProcessoEntradaDTO):
|
|
54
54
|
try:
|
55
55
|
if task_uuid in task_definitions:
|
56
56
|
# Executar a task
|
57
|
+
if task_uuid == "276d0c41-0b7c-4446-ae0b-dd5d782917cc":
|
58
|
+
task.historico_id = historico.uuidHistorico
|
59
|
+
|
57
60
|
result: RpaRetornoProcessoDTO = await task_definitions[task_uuid](task)
|
58
61
|
if registrar_historico:
|
59
62
|
await _update_historico(
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/api/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/api/ahead_service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/config/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/config/settings.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/decorators/repeat.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/decorators/retry.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/decorators/timeit.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/models/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/tasks/__init__.py
RENAMED
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
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/env.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/logger.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/toast.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/updater.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.367 → worker_automate_hub-0.4.372}/worker_automate_hub/utils/util.py
RENAMED
File without changes
|
File without changes
|
File without changes
|