From e21c2570380ff7ec750d2dd2d1f9ca68e696f2e1 Mon Sep 17 00:00:00 2001 From: Alexandre Batistella Bellas Date: Sun, 21 Jan 2024 14:53:40 -0300 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20padronizar=20um=20reposit=C3=B3rio?= =?UTF-8?q?=20por=20linguagem=20de=20programa=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/.eslintrc.json => .eslintrc.json | 0 .gitignore | 3 - .../.prettierrc.json => .prettierrc.json | 0 README.md | 127 +++- {typescript/demo => demo}/README.md | 0 {typescript/demo => demo}/index.html | 0 {typescript/demo => demo}/package-lock.json | 0 {typescript/demo => demo}/package.json | 0 {typescript/demo => demo}/server.ts | 0 {typescript/demo => demo}/tsconfig.json | 0 typescript/jest.config.ts => jest.config.ts | 0 .../package-lock.json => package-lock.json | 0 typescript/package.json => package.json | 8 +- php/.gitattributes | 2 - php/.gitignore | 3 - php/README.md | 95 --- php/demo/composer.json | 19 - php/demo/composer.lock | 687 ------------------ php/demo/src/Main.php | 10 - php/phpunit.xml | 25 - php/src/Bling.php | 61 -- php/src/BlingTest.spec.php | 51 -- php/src/Contracts/IResponseObject.php | 25 - php/src/Contracts/IResponseRootObject.php | 16 - php/src/Entities/@shared/BaseEntity.php | 40 - php/src/Entities/@shared/DTO/Error/Error.php | 59 -- .../Entities/@shared/DTO/Error/ErrorField.php | 63 -- .../DTO/Error/ErrorFieldCollection.php | 57 -- .../@shared/DTO/Error/ErrorResponse.php | 49 -- .../__tests__/ErrorResponseTest.spec.php | 136 ---- php/src/Entities/@shared/DTO/Request/Body.php | 20 - .../Entities/@shared/DTO/Request/Headers.php | 18 - .../@shared/DTO/Request/QueryParams.php | 18 - .../@shared/DTO/Request/RequestOptions.php | 25 - .../@shared/DTO/Request/ResponseOptions.php | 42 -- .../__tests__/ResponseOptionsTest.spec.php | 98 --- php/src/Entities/@shared/DTO/Schema/Id.php | 40 - .../Entities/@shared/TestResponseTrait.php | 51 -- php/src/Entities/Borderos/Borderos.php | 55 -- .../Borderos/Schema/Find/FindResponse.php | 50 -- .../Borderos/Schema/Find/FindResponseData.php | 68 -- .../Find/FindResponseDataPagamentos.php | 66 -- .../Borderos/__tests__/BorderosTest.spec.php | 76 -- .../Borderos/__tests__/delete/response.json | 1 - .../Borderos/__tests__/find/response.json | 26 - php/src/Exceptions/BlingApiException.php | 42 -- php/src/Exceptions/BlingInternalException.php | 10 - php/src/Helpers/functions.php | 27 - php/src/Providers/IoC.php | 27 - php/src/Repositories/BlingRepository.php | 160 ---- php/src/Repositories/IBlingRepository.php | 63 -- {typescript/src => src}/bling.spec.ts | 0 {typescript/src => src}/bling.ts | 0 .../src => src}/entities/@shared/entity.ts | 0 .../@shared/interfaces/error.interface.ts | 0 .../@shared/types/contribuinte.type.ts | 0 .../entities/@shared/types/crt.type.ts | 0 .../@shared/types/frete-por-conta.type.ts | 0 .../modelo-documento-referenciado.type.ts | 0 .../entities/@shared/types/origem.type.ts | 0 .../entities/@shared/types/situacao.type.ts | 0 .../entities/@shared/types/tipo-item.type.ts | 0 .../entities/@shared/types/tipoPessoa.type.ts | 0 .../entities/@shared/types/uf.type.ts | 0 .../borderos/__tests__/delete-response.ts | 0 .../borderos/__tests__/find-response.ts | 0 .../entities/borderos/__tests__/index.spec.ts | 0 .../src => src}/entities/borderos/index.ts | 0 .../borderos/interfaces/delete.interface.ts | 0 .../borderos/interfaces/find.interface.ts | 0 .../__tests__/change-situation-response.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../__tests__/find-by-module-response.ts | 0 .../__tests__/find-response.ts | 0 .../__tests__/get-modules-response.ts | 0 .../__tests__/get-types-response.ts | 0 .../__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/camposCustomizados/index.ts | 0 .../interfaces/change-situation.interface.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find-by-module.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get-modules.interface.ts | 0 .../interfaces/get-types.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../__tests__/find-response.ts | 0 .../categoriasLojas/__tests__/get-response.ts | 0 .../categoriasLojas/__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/categoriasLojas/index.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../__tests__/find-response.ts | 0 .../__tests__/get-response.ts | 0 .../__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/categoriasProdutos/index.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../__tests__/find-response.ts | 0 .../__tests__/get-response.ts | 0 .../__tests__/index.spec.ts | 0 .../categoriasReceitasDespesas/index.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get.interface.ts | 0 .../types/situacao.type.ts | 0 .../types/tipo.type.ts | 0 .../__tests__/find-response.ts | 0 .../contasContabeis/__tests__/get-response.ts | 0 .../contasContabeis/__tests__/index.spec.ts | 0 .../entities/contasContabeis/index.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get.interface.ts | 0 .../contasPagar/__tests__/create-response.ts | 0 .../contasPagar/__tests__/delete-response.ts | 0 .../__tests__/download-response.ts | 0 .../contasPagar/__tests__/find-response.ts | 0 .../contasPagar/__tests__/get-response.ts | 0 .../contasPagar/__tests__/index.spec.ts | 0 .../contasPagar/__tests__/update-response.ts | 0 .../src => src}/entities/contasPagar/index.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/download.interface.ts | 0 .../contasPagar/interfaces/find.interface.ts | 0 .../contasPagar/interfaces/get.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../contasPagar/types/situacao.type.ts | 0 .../__tests__/cancel-bank-slips-response.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../__tests__/download-response.ts | 0 .../contasReceber/__tests__/find-response.ts | 0 .../__tests__/get-bank-slips-response.ts | 0 .../contasReceber/__tests__/get-response.ts | 0 .../contasReceber/__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/contasReceber/index.ts | 0 .../interfaces/cancel-bank-slips.interface.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/download.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get-bank-slips.interface.ts | 0 .../contasReceber/interfaces/get.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../contasReceber/types/situacao.type.ts | 0 .../change-situation-many-response.ts | 0 .../__tests__/change-situation-response.ts | 0 .../contatos/__tests__/create-response.ts | 0 .../__tests__/delete-many-response.ts | 0 .../contatos/__tests__/delete-response.ts | 0 .../contatos/__tests__/find-response.ts | 0 .../contatos/__tests__/find-types-response.ts | 0 .../contatos/__tests__/get-response.ts | 0 .../entities/contatos/__tests__/index.spec.ts | 0 .../contatos/__tests__/update-response.ts | 0 .../src => src}/entities/contatos/index.ts | 0 .../change-situation-many.interface.ts | 0 .../interfaces/change-situation.interface.ts | 0 .../contatos/interfaces/create.interface.ts | 0 .../interfaces/delete-many.interface.ts | 0 .../contatos/interfaces/delete.interface.ts | 0 .../interfaces/find-types.interface.ts | 0 .../contatos/interfaces/find.interface.ts | 0 .../contatos/interfaces/get.interface.ts | 0 .../contatos/interfaces/update.interface.ts | 0 .../entities/contatos/types/criterio.type.ts | 0 .../contatos/types/indicador-ie.type.ts | 0 .../entities/contatos/types/sexo.type.ts | 0 .../entities/contatos/types/situacao.type.ts | 0 .../contatosTipos/__tests__/get-response.ts | 0 .../contatosTipos/__tests__/index.spec.ts | 0 .../entities/contatosTipos/index.ts | 0 .../contatosTipos/interfaces/get.interface.ts | 0 .../contatosTipos/types/criterio.type.ts | 0 .../contatosTipos/types/indicador-ie.type.ts | 0 .../entities/contatosTipos/types/sexo.type.ts | 0 .../contatosTipos/types/situacao.type.ts | 0 .../contratos/__tests__/create-response.ts | 0 .../contratos/__tests__/delete-response.ts | 0 .../contratos/__tests__/find-response.ts | 0 .../contratos/__tests__/get-response.ts | 0 .../contratos/__tests__/index.spec.ts | 0 .../contratos/__tests__/update-response.ts | 0 .../src => src}/entities/contratos/index.ts | 0 .../contratos/interfaces/create.interface.ts | 0 .../contratos/interfaces/delete.interface.ts | 0 .../contratos/interfaces/find.interface.ts | 0 .../contratos/interfaces/get.interface.ts | 0 .../contratos/interfaces/update.interface.ts | 0 ...ota-fiscal-descontar-imposto-renda.type.ts | 0 .../contratos/types/nota-fiscal-gerar.type.ts | 0 .../contratos/types/nota-fiscal-mes.type.ts | 0 .../contratos/types/periodicidade.type.ts | 0 .../entities/contratos/types/situacao.type.ts | 0 .../contratos/types/tipo-manutencao.type.ts | 0 .../contratos/types/tipo-vencimento.type.ts | 0 .../depositos/__tests__/create-response.ts | 0 .../depositos/__tests__/find-response.ts | 0 .../depositos/__tests__/get-response.ts | 0 .../depositos/__tests__/index.spec.ts | 0 .../depositos/__tests__/update-response.ts | 0 .../src => src}/entities/depositos/index.ts | 0 .../depositos/interfaces/create.interface.ts | 0 .../depositos/interfaces/find.interface.ts | 0 .../depositos/interfaces/get.interface.ts | 0 .../depositos/interfaces/update.interface.ts | 0 .../entities/empresas/__tests__/index.spec.ts | 0 .../empresas/__tests__/me-response.ts | 0 .../src => src}/entities/empresas/index.ts | 0 .../empresas/interfaces/me.interface.ts | 0 .../estoques/__tests__/create-response.ts | 0 .../__tests__/find-balance-response.ts | 0 .../__tests__/get-balances-response.ts | 0 .../entities/estoques/__tests__/index.spec.ts | 0 .../estoques/__tests__/update-response.ts | 0 .../src => src}/entities/estoques/index.ts | 0 .../estoques/interfaces/create.interface.ts | 0 .../interfaces/find-balance.interface.ts | 0 .../interfaces/get-balances.interface.ts | 0 .../estoques/interfaces/update.interface.ts | 0 .../entities/estoques/types/operacao.type.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../__tests__/find-response.ts | 0 .../__tests__/get-response.ts | 0 .../formasDePagamento/__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/formasDePagamento/index.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../types/bandeira-cartao.type.ts | 0 .../formasDePagamento/types/destino.type.ts | 0 .../types/finalidade.type.ts | 0 .../formasDePagamento/types/padrao.type.ts | 0 .../types/tipo-cartao.type.ts | 0 .../types/tipo-pagamento.type.ts | 0 .../__tests__/change-situation-response.ts | 0 .../homologacao/__tests__/create-response.ts | 0 .../homologacao/__tests__/delete-response.ts | 0 .../homologacao/__tests__/get-response.ts | 0 .../homologacao/__tests__/index.spec.ts | 0 .../homologacao/__tests__/update-response.ts | 0 .../src => src}/entities/homologacao/index.ts | 0 .../interfaces/change-situation.interface.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../homologacao/interfaces/get.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../logisticas/__tests__/create-response.ts | 0 .../logisticas/__tests__/delete-response.ts | 0 .../logisticas/__tests__/find-response.ts | 0 .../logisticas/__tests__/get-response.ts | 0 .../logisticas/__tests__/index.spec.ts | 0 .../logisticas/__tests__/update-response.ts | 0 .../src => src}/entities/logisticas/index.ts | 0 .../logisticas/interfaces/create.interface.ts | 0 .../logisticas/interfaces/delete.interface.ts | 0 .../logisticas/interfaces/find.interface.ts | 0 .../logisticas/interfaces/get.interface.ts | 0 .../logisticas/interfaces/update.interface.ts | 0 .../logisticas/types/situacao.type.ts | 0 .../logisticas/types/tipo-integracao.type.ts | 0 .../__tests__/get-response.ts | 0 .../__tests__/index.spec.ts | 0 .../entities/logisticasEtiquetas/index.ts | 0 .../interfaces/get.interface.ts | 0 .../logisticasEtiquetas/types/formato.type.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../__tests__/find-response.ts | 0 .../logisticasObjetos/__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/logisticasObjetos/index.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../logisticasObjetos/types/situacao.type.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../__tests__/find-response.ts | 0 .../__tests__/get-by-logistic-response.ts | 0 .../__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/logisticasRemessas/index.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get-by-logistic.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../types/situacao-rastreamento.type.ts | 0 .../logisticasRemessas/types/situacao.type.ts | 0 .../__tests__/change-situation-response.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/find-response.ts | 0 .../__tests__/get-response.ts | 0 .../__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/logisticasServicos/index.ts | 0 .../interfaces/change-situation.interface.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../types/tipo-integracao.type.ts | 0 .../__tests__/calculate-item-tax-response.ts | 0 .../__tests__/get-response.ts | 0 .../__tests__/index.spec.ts | 0 .../entities/naturezasDeOperacoes/index.ts | 0 .../calculate-item-tax.interface.ts | 0 .../interfaces/get.interface.ts | 0 .../modalidade-base-calculo-icms-st.type.ts | 0 .../types/motivo-desoneracao-icms.type.ts | 0 .../naturezasDeOperacoes/types/padrao.type.ts | 0 .../types/tipo-nota.type.ts | 0 .../types/tributacao.type.ts | 0 .../nfces/__tests__/create-response.ts | 0 .../entities/nfces/__tests__/find-response.ts | 0 .../entities/nfces/__tests__/get-response.ts | 0 .../entities/nfces/__tests__/index.spec.ts | 0 .../nfces/__tests__/post-accounts-response.ts | 0 .../__tests__/reverse-accounts-response.ts | 0 .../entities/nfces/__tests__/send-response.ts | 0 .../nfces/__tests__/update-response.ts | 0 .../src => src}/entities/nfces/index.ts | 0 .../nfces/interfaces/create.interface.ts | 0 .../nfces/interfaces/find.interface.ts | 0 .../nfces/interfaces/get.interface.ts | 0 .../interfaces/post-accounts.interface.ts | 0 .../interfaces/reverse-accounts.interface.ts | 0 .../nfces/interfaces/send.interface.ts | 0 .../nfces/interfaces/update.interface.ts | 0 .../entities/nfces/types/finalidade.type.ts | 0 .../entities/nfces/types/situacao.type.ts | 0 .../entities/nfces/types/tipo.type.ts | 0 .../nfes/__tests__/create-response.ts | 0 .../nfes/__tests__/delete-response.ts | 0 .../entities/nfes/__tests__/find-response.ts | 0 .../entities/nfes/__tests__/get-response.ts | 0 .../entities/nfes/__tests__/index.spec.ts | 0 .../nfes/__tests__/post-accounts-response.ts | 0 .../__tests__/reverse-accounts-response.ts | 0 .../entities/nfes/__tests__/send-response.ts | 0 .../nfes/__tests__/update-response.ts | 0 .../src => src}/entities/nfes/index.ts | 0 .../nfes/interfaces/create.interface.ts | 0 .../nfes/interfaces/delete.interface.ts | 0 .../nfes/interfaces/find.interface.ts | 0 .../entities/nfes/interfaces/get.interface.ts | 0 .../interfaces/post-accounts.interface.ts | 0 .../interfaces/reverse-accounts.interface.ts | 0 .../nfes/interfaces/send.interface.ts | 0 .../nfes/interfaces/update.interface.ts | 0 .../entities/nfes/types/finalidade.type.ts | 0 .../entities/nfes/types/situacao.type.ts | 0 .../entities/nfes/types/tipo.type.ts | 0 .../nfses/__tests__/cancel-response.ts | 0 .../nfses/__tests__/create-response.ts | 0 .../nfses/__tests__/delete-response.ts | 0 .../entities/nfses/__tests__/find-response.ts | 0 .../__tests__/get-configurations-response.ts | 0 .../entities/nfses/__tests__/get-response.ts | 0 .../entities/nfses/__tests__/index.spec.ts | 0 .../entities/nfses/__tests__/send-response.ts | 0 .../update-configurations-response.ts | 0 .../src => src}/entities/nfses/index.ts | 0 .../nfses/interfaces/cancel.interface.ts | 0 .../nfses/interfaces/create.interface.ts | 0 .../nfses/interfaces/delete.interface.ts | 0 .../nfses/interfaces/find.interface.ts | 0 .../get-configurations.interface.ts | 0 .../nfses/interfaces/get.interface.ts | 0 .../nfses/interfaces/send.interface.ts | 0 .../update-configurations.interface.ts | 0 .../entities/nfses/types/situacao.type.ts | 0 .../notificacoes/__tests__/create-response.ts | 0 .../notificacoes/__tests__/get-response.ts | 0 .../notificacoes/__tests__/index.spec.ts | 0 .../entities/notificacoes/index.ts | 0 .../interfaces/create.interface.ts | 0 .../notificacoes/interfaces/get.interface.ts | 0 .../__tests__/change-situation-response.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../pedidosCompras/__tests__/find-response.ts | 0 .../pedidosCompras/__tests__/get-response.ts | 0 .../pedidosCompras/__tests__/index.spec.ts | 0 .../__tests__/post-accounts-response.ts | 0 .../__tests__/post-stock-response.ts | 0 .../__tests__/reverse-accounts-response.ts | 0 .../__tests__/reverse-stock-response.ts | 0 .../__tests__/update-response.ts | 0 .../entities/pedidosCompras/index.ts | 0 .../interfaces/change-situation.interface.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get.interface.ts | 0 .../interfaces/post-accounts.interface.ts | 0 .../interfaces/post-stock.interface.ts | 0 .../interfaces/reverse-accounts.interface.ts | 0 .../interfaces/reverse-stock.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../types/desconto-unidade.type.ts | 0 .../pedidosCompras/types/situacao.type.ts | 0 .../__tests__/change-situation-response.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-many-response.ts | 0 .../__tests__/delete-response.ts | 0 .../pedidosVendas/__tests__/find-response.ts | 0 .../__tests__/generate-nfce-response.ts | 0 .../__tests__/generate-nfe-response.ts | 0 .../pedidosVendas/__tests__/get-response.ts | 0 .../pedidosVendas/__tests__/index.spec.ts | 0 .../__tests__/post-accounts-response.ts | 0 .../__tests__/post-stock-response.ts | 0 .../post-stock-to-deposit-response.ts | 0 .../__tests__/reverse-accounts-response.ts | 0 .../__tests__/reverse-stock-response.ts | 0 .../__tests__/update-response.ts | 0 .../entities/pedidosVendas/index.ts | 0 .../interfaces/change-situation.interface.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete-many.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/generate-nfce.interface.ts | 0 .../interfaces/generate-nfe.interface.ts | 0 .../pedidosVendas/interfaces/get.interface.ts | 0 .../interfaces/post-accounts.interface.ts | 0 .../post-stock-to-deposit.interface.ts | 0 .../interfaces/post-stock.interface.ts | 0 .../interfaces/reverse-accounts.interface.ts | 0 .../interfaces/reverse-stock.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../types/desconto-unidade.type.ts | 0 .../change-situation-many-response.ts | 0 .../__tests__/change-situation-response.ts | 0 .../produtos/__tests__/create-response.ts | 0 .../__tests__/delete-many-response.ts | 0 .../produtos/__tests__/delete-response.ts | 0 .../produtos/__tests__/find-response.ts | 0 .../produtos/__tests__/get-response.ts | 0 .../entities/produtos/__tests__/index.spec.ts | 0 .../produtos/__tests__/update-response.ts | 0 .../src => src}/entities/produtos/index.ts | 0 .../change-situation-many.interface.ts | 0 .../interfaces/change-situation.interface.ts | 0 .../produtos/interfaces/create.interface.ts | 0 .../interfaces/delete-many.interface.ts | 0 .../produtos/interfaces/delete.interface.ts | 0 .../produtos/interfaces/find.interface.ts | 0 .../produtos/interfaces/get.interface.ts | 0 .../produtos/interfaces/update.interface.ts | 0 .../produtos/types/action-estoque.type.ts | 0 .../entities/produtos/types/condicao.type.ts | 0 .../entities/produtos/types/criterio.type.ts | 0 .../estrutura-lancamento-estoque.type.ts | 0 .../types/estrutura-tipo-estoque.type.ts | 0 .../entities/produtos/types/formato.type.ts | 0 .../entities/produtos/types/situacao.type.ts | 0 .../produtos/types/tipo-armamento.type.ts | 0 .../produtos/types/tipo-filtro.type.ts | 0 .../produtos/types/tipo-producao.type.ts | 0 .../entities/produtos/types/tipo.type.ts | 0 .../__tests__/add-component-response.ts | 0 .../__tests__/change-component-response.ts | 0 .../__tests__/delete-components-response.ts | 0 .../__tests__/delete-response.ts | 0 .../__tests__/find-response.ts | 0 .../__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/produtosEstruturas/index.ts | 0 .../interfaces/add-component.interface.ts | 0 .../interfaces/change-component.interface.ts | 0 .../interfaces/delete-components.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../types/lancamento-estoque.type.ts | 0 .../types/tipo-estoque.type.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../__tests__/find-response.ts | 0 .../__tests__/get-response.ts | 0 .../__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/produtosFornecedores/index.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/get.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../produtosLojas/__tests__/find-response.ts | 0 .../produtosLojas/__tests__/get-response.ts | 0 .../produtosLojas/__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/produtosLojas/index.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../produtosLojas/interfaces/get.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../change-attribute-name-response.ts | 0 .../__tests__/find-response.ts | 0 .../generate-combinations-response.ts | 0 .../produtosVariacoes/__tests__/index.spec.ts | 0 .../entities/produtosVariacoes/index.ts | 0 .../change-attribute-name.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../generate-combinations.interface.ts | 0 .../types/action-estoque.type.ts | 0 .../produtosVariacoes/types/condicao.type.ts | 0 .../estrutura-lancamento-estoque.type.ts | 0 .../types/estrutura-tipo-estoque.type.ts | 0 .../produtosVariacoes/types/formato.type.ts | 0 .../produtosVariacoes/types/situacao.type.ts | 0 .../types/tipo-armamento.type.ts | 0 .../types/tipo-producao.type.ts | 0 .../produtosVariacoes/types/tipo.type.ts | 0 .../situacoes/__tests__/create-response.ts | 0 .../situacoes/__tests__/delete-response.ts | 0 .../situacoes/__tests__/find-response.ts | 0 .../situacoes/__tests__/index.spec.ts | 0 .../situacoes/__tests__/update-response.ts | 0 .../src => src}/entities/situacoes/index.ts | 0 .../situacoes/interfaces/create.interface.ts | 0 .../situacoes/interfaces/delete.interface.ts | 0 .../situacoes/interfaces/find.interface.ts | 0 .../situacoes/interfaces/update.interface.ts | 0 .../__tests__/get-module-actions-response.ts | 0 .../get-module-situations-response.ts | 0 .../get-module-transitions-response.ts | 0 .../__tests__/get-modules-response.ts | 0 .../situacoesModulos/__tests__/index.spec.ts | 0 .../entities/situacoesModulos/index.ts | 0 .../get-module-actions.interface.ts | 0 .../get-module-situations.interface.ts | 0 .../get-module-transitions.interface.ts | 0 .../interfaces/get-modules.interface.ts | 0 .../__tests__/create-response.ts | 0 .../__tests__/delete-response.ts | 0 .../__tests__/find-response.ts | 0 .../__tests__/index.spec.ts | 0 .../__tests__/update-response.ts | 0 .../entities/situacoesTransicoes/index.ts | 0 .../interfaces/create.interface.ts | 0 .../interfaces/delete.interface.ts | 0 .../interfaces/find.interface.ts | 0 .../interfaces/update.interface.ts | 0 .../__tests__/change-password-response.ts | 0 .../entities/usuarios/__tests__/index.spec.ts | 0 .../__tests__/recover-password-response.ts | 0 .../__tests__/validate-hash-response.ts | 0 .../src => src}/entities/usuarios/index.ts | 0 .../interfaces/recover-password.interface.ts | 0 .../interfaces/validate-hash.interface.ts | 0 .../vendedores/__tests__/find-response.ts | 0 .../vendedores/__tests__/get-response.ts | 0 .../vendedores/__tests__/index.spec.ts | 0 .../src => src}/entities/vendedores/index.ts | 0 .../vendedores/interfaces/find.interface.ts | 0 .../vendedores/interfaces/get.interface.ts | 0 .../vendedores/types/situacao.type.ts | 0 .../exceptions/bling-api.exception.ts | 0 .../exceptions/bling-internal.exception.ts | 0 .../functions/convert-date-to-string.ts | 0 .../src => src}/helpers/types/newable.type.ts | 0 {typescript/src => src}/providers/ioc.ts | 0 .../bling-in-memory.repository.ts | 0 .../bling.repository.interface.ts | 0 .../repositories/bling.repository.ts | 0 ...tsconfig.build.json => tsconfig.build.json | 0 typescript/tsconfig.json => tsconfig.json | 0 typescript/.gitignore | 8 - typescript/README.md | 120 --- 596 files changed, 115 insertions(+), 2532 deletions(-) rename typescript/.eslintrc.json => .eslintrc.json (100%) rename typescript/.prettierrc.json => .prettierrc.json (100%) rename {typescript/demo => demo}/README.md (100%) rename {typescript/demo => demo}/index.html (100%) rename {typescript/demo => demo}/package-lock.json (100%) rename {typescript/demo => demo}/package.json (100%) rename {typescript/demo => demo}/server.ts (100%) rename {typescript/demo => demo}/tsconfig.json (100%) rename typescript/jest.config.ts => jest.config.ts (100%) rename typescript/package-lock.json => package-lock.json (100%) rename typescript/package.json => package.json (90%) delete mode 100644 php/.gitattributes delete mode 100644 php/.gitignore delete mode 100644 php/README.md delete mode 100644 php/demo/composer.json delete mode 100644 php/demo/composer.lock delete mode 100644 php/demo/src/Main.php delete mode 100644 php/phpunit.xml delete mode 100644 php/src/Bling.php delete mode 100644 php/src/BlingTest.spec.php delete mode 100644 php/src/Contracts/IResponseObject.php delete mode 100644 php/src/Contracts/IResponseRootObject.php delete mode 100644 php/src/Entities/@shared/BaseEntity.php delete mode 100644 php/src/Entities/@shared/DTO/Error/Error.php delete mode 100644 php/src/Entities/@shared/DTO/Error/ErrorField.php delete mode 100644 php/src/Entities/@shared/DTO/Error/ErrorFieldCollection.php delete mode 100644 php/src/Entities/@shared/DTO/Error/ErrorResponse.php delete mode 100644 php/src/Entities/@shared/DTO/Error/__tests__/ErrorResponseTest.spec.php delete mode 100644 php/src/Entities/@shared/DTO/Request/Body.php delete mode 100644 php/src/Entities/@shared/DTO/Request/Headers.php delete mode 100644 php/src/Entities/@shared/DTO/Request/QueryParams.php delete mode 100644 php/src/Entities/@shared/DTO/Request/RequestOptions.php delete mode 100644 php/src/Entities/@shared/DTO/Request/ResponseOptions.php delete mode 100644 php/src/Entities/@shared/DTO/Request/__tests__/ResponseOptionsTest.spec.php delete mode 100644 php/src/Entities/@shared/DTO/Schema/Id.php delete mode 100644 php/src/Entities/@shared/TestResponseTrait.php delete mode 100644 php/src/Entities/Borderos/Borderos.php delete mode 100644 php/src/Entities/Borderos/Schema/Find/FindResponse.php delete mode 100644 php/src/Entities/Borderos/Schema/Find/FindResponseData.php delete mode 100644 php/src/Entities/Borderos/Schema/Find/FindResponseDataPagamentos.php delete mode 100644 php/src/Entities/Borderos/__tests__/BorderosTest.spec.php delete mode 100644 php/src/Entities/Borderos/__tests__/delete/response.json delete mode 100644 php/src/Entities/Borderos/__tests__/find/response.json delete mode 100644 php/src/Exceptions/BlingApiException.php delete mode 100644 php/src/Exceptions/BlingInternalException.php delete mode 100644 php/src/Helpers/functions.php delete mode 100644 php/src/Providers/IoC.php delete mode 100644 php/src/Repositories/BlingRepository.php delete mode 100644 php/src/Repositories/IBlingRepository.php rename {typescript/src => src}/bling.spec.ts (100%) rename {typescript/src => src}/bling.ts (100%) rename {typescript/src => src}/entities/@shared/entity.ts (100%) rename {typescript/src => src}/entities/@shared/interfaces/error.interface.ts (100%) rename {typescript/src => src}/entities/@shared/types/contribuinte.type.ts (100%) rename {typescript/src => src}/entities/@shared/types/crt.type.ts (100%) rename {typescript/src => src}/entities/@shared/types/frete-por-conta.type.ts (100%) rename {typescript/src => src}/entities/@shared/types/modelo-documento-referenciado.type.ts (100%) rename {typescript/src => src}/entities/@shared/types/origem.type.ts (100%) rename {typescript/src => src}/entities/@shared/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/@shared/types/tipo-item.type.ts (100%) rename {typescript/src => src}/entities/@shared/types/tipoPessoa.type.ts (100%) rename {typescript/src => src}/entities/@shared/types/uf.type.ts (100%) rename {typescript/src => src}/entities/borderos/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/borderos/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/borderos/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/borderos/index.ts (100%) rename {typescript/src => src}/entities/borderos/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/borderos/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/__tests__/change-situation-response.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/__tests__/find-by-module-response.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/__tests__/get-modules-response.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/__tests__/get-types-response.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/index.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/interfaces/change-situation.interface.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/interfaces/find-by-module.interface.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/interfaces/get-modules.interface.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/interfaces/get-types.interface.ts (100%) rename {typescript/src => src}/entities/camposCustomizados/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/index.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/categoriasLojas/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/index.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/categoriasProdutos/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/categoriasReceitasDespesas/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/categoriasReceitasDespesas/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/categoriasReceitasDespesas/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/categoriasReceitasDespesas/index.ts (100%) rename {typescript/src => src}/entities/categoriasReceitasDespesas/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/categoriasReceitasDespesas/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/categoriasReceitasDespesas/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/categoriasReceitasDespesas/types/tipo.type.ts (100%) rename {typescript/src => src}/entities/contasContabeis/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/contasContabeis/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/contasContabeis/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/contasContabeis/index.ts (100%) rename {typescript/src => src}/entities/contasContabeis/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/contasContabeis/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/contasPagar/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/contasPagar/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/contasPagar/__tests__/download-response.ts (100%) rename {typescript/src => src}/entities/contasPagar/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/contasPagar/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/contasPagar/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/contasPagar/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/contasPagar/index.ts (100%) rename {typescript/src => src}/entities/contasPagar/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/contasPagar/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/contasPagar/interfaces/download.interface.ts (100%) rename {typescript/src => src}/entities/contasPagar/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/contasPagar/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/contasPagar/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/contasPagar/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/contasReceber/__tests__/cancel-bank-slips-response.ts (100%) rename {typescript/src => src}/entities/contasReceber/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/contasReceber/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/contasReceber/__tests__/download-response.ts (100%) rename {typescript/src => src}/entities/contasReceber/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/contasReceber/__tests__/get-bank-slips-response.ts (100%) rename {typescript/src => src}/entities/contasReceber/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/contasReceber/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/contasReceber/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/contasReceber/index.ts (100%) rename {typescript/src => src}/entities/contasReceber/interfaces/cancel-bank-slips.interface.ts (100%) rename {typescript/src => src}/entities/contasReceber/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/contasReceber/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/contasReceber/interfaces/download.interface.ts (100%) rename {typescript/src => src}/entities/contasReceber/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/contasReceber/interfaces/get-bank-slips.interface.ts (100%) rename {typescript/src => src}/entities/contasReceber/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/contasReceber/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/contasReceber/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/contatos/__tests__/change-situation-many-response.ts (100%) rename {typescript/src => src}/entities/contatos/__tests__/change-situation-response.ts (100%) rename {typescript/src => src}/entities/contatos/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/contatos/__tests__/delete-many-response.ts (100%) rename {typescript/src => src}/entities/contatos/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/contatos/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/contatos/__tests__/find-types-response.ts (100%) rename {typescript/src => src}/entities/contatos/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/contatos/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/contatos/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/contatos/index.ts (100%) rename {typescript/src => src}/entities/contatos/interfaces/change-situation-many.interface.ts (100%) rename {typescript/src => src}/entities/contatos/interfaces/change-situation.interface.ts (100%) rename {typescript/src => src}/entities/contatos/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/contatos/interfaces/delete-many.interface.ts (100%) rename {typescript/src => src}/entities/contatos/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/contatos/interfaces/find-types.interface.ts (100%) rename {typescript/src => src}/entities/contatos/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/contatos/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/contatos/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/contatos/types/criterio.type.ts (100%) rename {typescript/src => src}/entities/contatos/types/indicador-ie.type.ts (100%) rename {typescript/src => src}/entities/contatos/types/sexo.type.ts (100%) rename {typescript/src => src}/entities/contatos/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/contatosTipos/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/contatosTipos/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/contatosTipos/index.ts (100%) rename {typescript/src => src}/entities/contatosTipos/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/contatosTipos/types/criterio.type.ts (100%) rename {typescript/src => src}/entities/contatosTipos/types/indicador-ie.type.ts (100%) rename {typescript/src => src}/entities/contatosTipos/types/sexo.type.ts (100%) rename {typescript/src => src}/entities/contatosTipos/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/contratos/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/contratos/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/contratos/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/contratos/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/contratos/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/contratos/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/contratos/index.ts (100%) rename {typescript/src => src}/entities/contratos/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/contratos/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/contratos/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/contratos/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/contratos/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/contratos/types/nota-fiscal-descontar-imposto-renda.type.ts (100%) rename {typescript/src => src}/entities/contratos/types/nota-fiscal-gerar.type.ts (100%) rename {typescript/src => src}/entities/contratos/types/nota-fiscal-mes.type.ts (100%) rename {typescript/src => src}/entities/contratos/types/periodicidade.type.ts (100%) rename {typescript/src => src}/entities/contratos/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/contratos/types/tipo-manutencao.type.ts (100%) rename {typescript/src => src}/entities/contratos/types/tipo-vencimento.type.ts (100%) rename {typescript/src => src}/entities/depositos/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/depositos/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/depositos/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/depositos/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/depositos/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/depositos/index.ts (100%) rename {typescript/src => src}/entities/depositos/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/depositos/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/depositos/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/depositos/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/empresas/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/empresas/__tests__/me-response.ts (100%) rename {typescript/src => src}/entities/empresas/index.ts (100%) rename {typescript/src => src}/entities/empresas/interfaces/me.interface.ts (100%) rename {typescript/src => src}/entities/estoques/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/estoques/__tests__/find-balance-response.ts (100%) rename {typescript/src => src}/entities/estoques/__tests__/get-balances-response.ts (100%) rename {typescript/src => src}/entities/estoques/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/estoques/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/estoques/index.ts (100%) rename {typescript/src => src}/entities/estoques/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/estoques/interfaces/find-balance.interface.ts (100%) rename {typescript/src => src}/entities/estoques/interfaces/get-balances.interface.ts (100%) rename {typescript/src => src}/entities/estoques/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/estoques/types/operacao.type.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/index.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/types/bandeira-cartao.type.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/types/destino.type.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/types/finalidade.type.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/types/padrao.type.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/types/tipo-cartao.type.ts (100%) rename {typescript/src => src}/entities/formasDePagamento/types/tipo-pagamento.type.ts (100%) rename {typescript/src => src}/entities/homologacao/__tests__/change-situation-response.ts (100%) rename {typescript/src => src}/entities/homologacao/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/homologacao/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/homologacao/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/homologacao/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/homologacao/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/homologacao/index.ts (100%) rename {typescript/src => src}/entities/homologacao/interfaces/change-situation.interface.ts (100%) rename {typescript/src => src}/entities/homologacao/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/homologacao/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/homologacao/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/homologacao/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/logisticas/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/logisticas/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/logisticas/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/logisticas/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/logisticas/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/logisticas/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/logisticas/index.ts (100%) rename {typescript/src => src}/entities/logisticas/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/logisticas/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/logisticas/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/logisticas/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/logisticas/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/logisticas/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/logisticas/types/tipo-integracao.type.ts (100%) rename {typescript/src => src}/entities/logisticasEtiquetas/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/logisticasEtiquetas/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/logisticasEtiquetas/index.ts (100%) rename {typescript/src => src}/entities/logisticasEtiquetas/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/logisticasEtiquetas/types/formato.type.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/index.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/logisticasObjetos/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/__tests__/get-by-logistic-response.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/index.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/interfaces/get-by-logistic.interface.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/types/situacao-rastreamento.type.ts (100%) rename {typescript/src => src}/entities/logisticasRemessas/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/__tests__/change-situation-response.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/index.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/interfaces/change-situation.interface.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/logisticasServicos/types/tipo-integracao.type.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/__tests__/calculate-item-tax-response.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/index.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/interfaces/calculate-item-tax.interface.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/types/modalidade-base-calculo-icms-st.type.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/types/motivo-desoneracao-icms.type.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/types/padrao.type.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/types/tipo-nota.type.ts (100%) rename {typescript/src => src}/entities/naturezasDeOperacoes/types/tributacao.type.ts (100%) rename {typescript/src => src}/entities/nfces/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/nfces/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/nfces/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/nfces/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/nfces/__tests__/post-accounts-response.ts (100%) rename {typescript/src => src}/entities/nfces/__tests__/reverse-accounts-response.ts (100%) rename {typescript/src => src}/entities/nfces/__tests__/send-response.ts (100%) rename {typescript/src => src}/entities/nfces/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/nfces/index.ts (100%) rename {typescript/src => src}/entities/nfces/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/nfces/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/nfces/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/nfces/interfaces/post-accounts.interface.ts (100%) rename {typescript/src => src}/entities/nfces/interfaces/reverse-accounts.interface.ts (100%) rename {typescript/src => src}/entities/nfces/interfaces/send.interface.ts (100%) rename {typescript/src => src}/entities/nfces/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/nfces/types/finalidade.type.ts (100%) rename {typescript/src => src}/entities/nfces/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/nfces/types/tipo.type.ts (100%) rename {typescript/src => src}/entities/nfes/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/nfes/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/nfes/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/nfes/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/nfes/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/nfes/__tests__/post-accounts-response.ts (100%) rename {typescript/src => src}/entities/nfes/__tests__/reverse-accounts-response.ts (100%) rename {typescript/src => src}/entities/nfes/__tests__/send-response.ts (100%) rename {typescript/src => src}/entities/nfes/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/nfes/index.ts (100%) rename {typescript/src => src}/entities/nfes/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/nfes/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/nfes/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/nfes/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/nfes/interfaces/post-accounts.interface.ts (100%) rename {typescript/src => src}/entities/nfes/interfaces/reverse-accounts.interface.ts (100%) rename {typescript/src => src}/entities/nfes/interfaces/send.interface.ts (100%) rename {typescript/src => src}/entities/nfes/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/nfes/types/finalidade.type.ts (100%) rename {typescript/src => src}/entities/nfes/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/nfes/types/tipo.type.ts (100%) rename {typescript/src => src}/entities/nfses/__tests__/cancel-response.ts (100%) rename {typescript/src => src}/entities/nfses/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/nfses/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/nfses/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/nfses/__tests__/get-configurations-response.ts (100%) rename {typescript/src => src}/entities/nfses/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/nfses/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/nfses/__tests__/send-response.ts (100%) rename {typescript/src => src}/entities/nfses/__tests__/update-configurations-response.ts (100%) rename {typescript/src => src}/entities/nfses/index.ts (100%) rename {typescript/src => src}/entities/nfses/interfaces/cancel.interface.ts (100%) rename {typescript/src => src}/entities/nfses/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/nfses/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/nfses/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/nfses/interfaces/get-configurations.interface.ts (100%) rename {typescript/src => src}/entities/nfses/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/nfses/interfaces/send.interface.ts (100%) rename {typescript/src => src}/entities/nfses/interfaces/update-configurations.interface.ts (100%) rename {typescript/src => src}/entities/nfses/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/notificacoes/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/notificacoes/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/notificacoes/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/notificacoes/index.ts (100%) rename {typescript/src => src}/entities/notificacoes/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/notificacoes/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/change-situation-response.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/post-accounts-response.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/post-stock-response.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/reverse-accounts-response.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/reverse-stock-response.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/index.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/interfaces/change-situation.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/interfaces/post-accounts.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/interfaces/post-stock.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/interfaces/reverse-accounts.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/interfaces/reverse-stock.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/types/desconto-unidade.type.ts (100%) rename {typescript/src => src}/entities/pedidosCompras/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/change-situation-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/delete-many-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/generate-nfce-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/generate-nfe-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/post-accounts-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/post-stock-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/post-stock-to-deposit-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/reverse-accounts-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/reverse-stock-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/index.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/change-situation.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/delete-many.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/generate-nfce.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/generate-nfe.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/post-accounts.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/post-stock-to-deposit.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/post-stock.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/reverse-accounts.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/reverse-stock.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/pedidosVendas/types/desconto-unidade.type.ts (100%) rename {typescript/src => src}/entities/produtos/__tests__/change-situation-many-response.ts (100%) rename {typescript/src => src}/entities/produtos/__tests__/change-situation-response.ts (100%) rename {typescript/src => src}/entities/produtos/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/produtos/__tests__/delete-many-response.ts (100%) rename {typescript/src => src}/entities/produtos/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/produtos/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/produtos/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/produtos/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/produtos/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/produtos/index.ts (100%) rename {typescript/src => src}/entities/produtos/interfaces/change-situation-many.interface.ts (100%) rename {typescript/src => src}/entities/produtos/interfaces/change-situation.interface.ts (100%) rename {typescript/src => src}/entities/produtos/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/produtos/interfaces/delete-many.interface.ts (100%) rename {typescript/src => src}/entities/produtos/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/produtos/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/produtos/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/produtos/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/produtos/types/action-estoque.type.ts (100%) rename {typescript/src => src}/entities/produtos/types/condicao.type.ts (100%) rename {typescript/src => src}/entities/produtos/types/criterio.type.ts (100%) rename {typescript/src => src}/entities/produtos/types/estrutura-lancamento-estoque.type.ts (100%) rename {typescript/src => src}/entities/produtos/types/estrutura-tipo-estoque.type.ts (100%) rename {typescript/src => src}/entities/produtos/types/formato.type.ts (100%) rename {typescript/src => src}/entities/produtos/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/produtos/types/tipo-armamento.type.ts (100%) rename {typescript/src => src}/entities/produtos/types/tipo-filtro.type.ts (100%) rename {typescript/src => src}/entities/produtos/types/tipo-producao.type.ts (100%) rename {typescript/src => src}/entities/produtos/types/tipo.type.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/__tests__/add-component-response.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/__tests__/change-component-response.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/__tests__/delete-components-response.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/index.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/interfaces/add-component.interface.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/interfaces/change-component.interface.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/interfaces/delete-components.interface.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/types/lancamento-estoque.type.ts (100%) rename {typescript/src => src}/entities/produtosEstruturas/types/tipo-estoque.type.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/index.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/produtosFornecedores/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/produtosLojas/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/produtosLojas/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/produtosLojas/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/produtosLojas/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/produtosLojas/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/produtosLojas/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/produtosLojas/index.ts (100%) rename {typescript/src => src}/entities/produtosLojas/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/produtosLojas/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/produtosLojas/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/produtosLojas/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/produtosLojas/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/__tests__/change-attribute-name-response.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/__tests__/generate-combinations-response.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/index.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/interfaces/change-attribute-name.interface.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/interfaces/generate-combinations.interface.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/types/action-estoque.type.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/types/condicao.type.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/types/estrutura-lancamento-estoque.type.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/types/estrutura-tipo-estoque.type.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/types/formato.type.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/types/situacao.type.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/types/tipo-armamento.type.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/types/tipo-producao.type.ts (100%) rename {typescript/src => src}/entities/produtosVariacoes/types/tipo.type.ts (100%) rename {typescript/src => src}/entities/situacoes/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/situacoes/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/situacoes/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/situacoes/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/situacoes/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/situacoes/index.ts (100%) rename {typescript/src => src}/entities/situacoes/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/situacoes/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/situacoes/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/situacoes/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/situacoesModulos/__tests__/get-module-actions-response.ts (100%) rename {typescript/src => src}/entities/situacoesModulos/__tests__/get-module-situations-response.ts (100%) rename {typescript/src => src}/entities/situacoesModulos/__tests__/get-module-transitions-response.ts (100%) rename {typescript/src => src}/entities/situacoesModulos/__tests__/get-modules-response.ts (100%) rename {typescript/src => src}/entities/situacoesModulos/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/situacoesModulos/index.ts (100%) rename {typescript/src => src}/entities/situacoesModulos/interfaces/get-module-actions.interface.ts (100%) rename {typescript/src => src}/entities/situacoesModulos/interfaces/get-module-situations.interface.ts (100%) rename {typescript/src => src}/entities/situacoesModulos/interfaces/get-module-transitions.interface.ts (100%) rename {typescript/src => src}/entities/situacoesModulos/interfaces/get-modules.interface.ts (100%) rename {typescript/src => src}/entities/situacoesTransicoes/__tests__/create-response.ts (100%) rename {typescript/src => src}/entities/situacoesTransicoes/__tests__/delete-response.ts (100%) rename {typescript/src => src}/entities/situacoesTransicoes/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/situacoesTransicoes/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/situacoesTransicoes/__tests__/update-response.ts (100%) rename {typescript/src => src}/entities/situacoesTransicoes/index.ts (100%) rename {typescript/src => src}/entities/situacoesTransicoes/interfaces/create.interface.ts (100%) rename {typescript/src => src}/entities/situacoesTransicoes/interfaces/delete.interface.ts (100%) rename {typescript/src => src}/entities/situacoesTransicoes/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/situacoesTransicoes/interfaces/update.interface.ts (100%) rename {typescript/src => src}/entities/usuarios/__tests__/change-password-response.ts (100%) rename {typescript/src => src}/entities/usuarios/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/usuarios/__tests__/recover-password-response.ts (100%) rename {typescript/src => src}/entities/usuarios/__tests__/validate-hash-response.ts (100%) rename {typescript/src => src}/entities/usuarios/index.ts (100%) rename {typescript/src => src}/entities/usuarios/interfaces/recover-password.interface.ts (100%) rename {typescript/src => src}/entities/usuarios/interfaces/validate-hash.interface.ts (100%) rename {typescript/src => src}/entities/vendedores/__tests__/find-response.ts (100%) rename {typescript/src => src}/entities/vendedores/__tests__/get-response.ts (100%) rename {typescript/src => src}/entities/vendedores/__tests__/index.spec.ts (100%) rename {typescript/src => src}/entities/vendedores/index.ts (100%) rename {typescript/src => src}/entities/vendedores/interfaces/find.interface.ts (100%) rename {typescript/src => src}/entities/vendedores/interfaces/get.interface.ts (100%) rename {typescript/src => src}/entities/vendedores/types/situacao.type.ts (100%) rename {typescript/src => src}/exceptions/bling-api.exception.ts (100%) rename {typescript/src => src}/exceptions/bling-internal.exception.ts (100%) rename {typescript/src => src}/helpers/functions/convert-date-to-string.ts (100%) rename {typescript/src => src}/helpers/types/newable.type.ts (100%) rename {typescript/src => src}/providers/ioc.ts (100%) rename {typescript/src => src}/repositories/bling-in-memory.repository.ts (100%) rename {typescript/src => src}/repositories/bling.repository.interface.ts (100%) rename {typescript/src => src}/repositories/bling.repository.ts (100%) rename typescript/tsconfig.build.json => tsconfig.build.json (100%) rename typescript/tsconfig.json => tsconfig.json (100%) delete mode 100644 typescript/.gitignore delete mode 100644 typescript/README.md diff --git a/typescript/.eslintrc.json b/.eslintrc.json similarity index 100% rename from typescript/.eslintrc.json rename to .eslintrc.json diff --git a/.gitignore b/.gitignore index e83bd31..90a0c16 100644 --- a/.gitignore +++ b/.gitignore @@ -121,6 +121,3 @@ lib/ # Ignore all local history of files .history .ionide - -# PHP -vendor/ diff --git a/typescript/.prettierrc.json b/.prettierrc.json similarity index 100% rename from typescript/.prettierrc.json rename to .prettierrc.json diff --git a/README.md b/README.md index 374ef4f..ee417b4 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,128 @@ -# Bling ERP API +- [Versão em PHP](https://github.com/AlexandreBellas/bling-erp-api-php/README.md) +- Versão em C# (em breve) -Pacote de integração com a [API v3 do ERP Bling](https://developer.bling.com.br). -O mais completo existente (e se não é, será). +# Bling ERP API - Javascript/Typescript -Disponível para: +[![](https://img.shields.io/npm/v/bling-erp-api.svg)](https://www.npmjs.com/package/bling-erp-api) +[![install size](https://packagephobia.com/badge?p=bling-erp-api)](https://packagephobia.com/result?p=bling-erp-api) +[![code coverage](https://coveralls.io/repos/github/AlexandreBellas/bling-erp-api-js/badge.svg?branch=main)](https://coveralls.io/github/AlexandreBellas/bling-erp-api?branch=main) -- [x] JavaScript ([veja a documentação](https://github.com/AlexandreBellas/bling-erp-api/tree/develop/typescript/README.md)) -- [x] TypeScript ([veja a documentação](https://github.com/AlexandreBellas/bling-erp-api/tree/develop/typescript/README.md)) -- [x] PHP ([veja a documentação](https://github.com/AlexandreBellas/bling-erp-api/tree/develop/php/README.md)) -- [ ] C# (em breve) +Pacote de integração com a [API v3 do ERP Bling](https://developer.bling.com.br) +para Javascript/TypeScript. O mais completo existente. -## Instalação +Atualizado com a versão `v291` da API ([veja o registro de alterações](https://developer.bling.com.br/changelogs#2024-01-31)). + +**Atenção**: a versão 5.0.0+ do `bling-erp-api` para Javascript/TypeScript +utiliza a API v3 do Bling. Caso deseja utilizar a API v2 do Bling, +[utilize a versão 4.0.0](https://github.com/AlexandreBellas/bling-erp-api-js/tree/v4.0.0). -Para instalar, execute o comando de acordo com a linguagem de programação -desejada. +## Instalação -### JavaScript / TypeScript +Para instalar, execute o comando: ```bash npm i bling-erp-api ``` -### PHP +## Importação do módulo + +### CommonJS + +```js +const Bling = require('bling-erp-api') +``` + +### ES6 + +```ts +import Bling from 'bling-erp-api' +``` + +## Criação de uma nova conexão + +Para criar uma conexão ao serviço do Bling, basta instanciar o objeto com a [API key](https://developer.bling.com.br/autenticacao) em seu construtor. + +```js +const apiKey = 'sua_api_key' +const blingConnection = new Bling(apiKey) +``` + +Vale destacar que o fluxo de criação e autorização do aplicativo **não é feito +pela biblioteca**. Ou seja, a biblioteca somente recebe o `access_token` gerado +a partir do _endpoint_ `/token`. [Veja a referência](https://developer.bling.com.br/aplicativos#tokens-de-acesso). + +Para entender na prática como a autenticação citada acima funciona, [veja o +projeto de demonstração](https://github.com/AlexandreBellas/bling-erp-api-js/tree/main/demo). + +## Entidades disponíveis + +Todas as entidades do Bling atualmente são permitidas para interação. São elas: + +- [x] Borderos (`.borderos`) +- [x] Campos customizados (`.camposCustomizados`) +- [x] Categorias - Lojas (`.categoriasLojas`) +- [x] Categorias - Produtos (`.categoriasProdutos`) +- [x] Categorias - Receitas e Despesas (`.categoriasReceitasDespesas`) +- [x] Contas a Pagar (`.contasPagar`) +- [x] Contas a Receber (`.contasReceber`) +- [x] Contas Contábeis (`.contasContabeis`) +- [x] Contatos (`.contatos`) +- [x] Contatos - Tipos (`.contatosTipos`) +- [x] Contratos (`.contratos`) +- [x] Depósitos (`.depositos`) +- [x] Empresas (`.empresas`) +- [x] Estoques (`.estoques`) +- [x] Formas de pagamento (`.formasDePagamento`) +- [x] Homologação (`.homologacao`) +- [x] Logísticas (`.logisticas`) +- [x] Logísticas - Etiquetas (`.logisticasEtiquetas`) +- [x] Logísticas - Objetos (`.logisticasObjetos`) +- [x] Logísticas - Remessas (`.logisticasRemessas`) +- [x] Logísticas - Serviços (`.logisticasServicos`) +- [x] Naturezas de Operações (`.naturezasDeOperacoes`) +- [x] Notas Fiscais de Consumidor Eletrônicas (`.nfces`) +- [x] Notas Fiscais de Serviço Eletrônicas (`.nfses`) +- [x] Notas Fiscais Eletrônicas (`.nfes`) +- [x] Notificações (`.notificacoes`) +- [x] Pedidos - Compras (`.pedidosCompras`) +- [x] Pedidos - Vendas (`.pedidosVendas`) +- [x] Produtos (`.produtos`) +- [x] Produtos - Estruturas (`.produtosEstruturas`) +- [x] Produtos - Fornecedores (`.produtosFornecedores`) +- [x] Produtos - Lojas (`.produtosLojas`) +- [x] Produtos - Variações (`.produtosVariacoes`) +- [x] Situações (`.situacoes`) +- [x] Situações - Módulos (`.situacoesModulos`) +- [x] Situações - Transições (`.situacoesTransicoes`) +- [x] Usuários (`.usuarios`) +- [x] Vendedores (`.vendedores`) + +## Exemplo de uso + +Para listar seus produtos, basta executar: + +```js +// Também disponível como: +// import Bling from 'bling-erp-api' +const Bling = require('bling-erp-api') +const apiKey = 'sua_api_key' + +const blingConnection = new Bling(apiKey) + +const products = await blingConnection.produtos.get() + +console.log(products) +``` + +## Executando os testes do projeto + +Faça o clone do projeto, instale as dependências e execute: ```bash -composer require alebatistella/bling-erp-api +npm run test ``` -## Recursos +## Contribuindo ao projeto -- [Guia de contribuição](https://github.com/AlexandreBellas/bling-erp-api/blob/v5.0.0/CONTRIBUTING.md) +- [Guia de contribuição](https://github.com/AlexandreBellas/bling-erp-api-js/blob/v5.0.0/CONTRIBUTING.md) - [Apoie o projeto](https://www.paypal.com/donate/?hosted_button_id=G2NJKZ5MUMKBS) diff --git a/typescript/demo/README.md b/demo/README.md similarity index 100% rename from typescript/demo/README.md rename to demo/README.md diff --git a/typescript/demo/index.html b/demo/index.html similarity index 100% rename from typescript/demo/index.html rename to demo/index.html diff --git a/typescript/demo/package-lock.json b/demo/package-lock.json similarity index 100% rename from typescript/demo/package-lock.json rename to demo/package-lock.json diff --git a/typescript/demo/package.json b/demo/package.json similarity index 100% rename from typescript/demo/package.json rename to demo/package.json diff --git a/typescript/demo/server.ts b/demo/server.ts similarity index 100% rename from typescript/demo/server.ts rename to demo/server.ts diff --git a/typescript/demo/tsconfig.json b/demo/tsconfig.json similarity index 100% rename from typescript/demo/tsconfig.json rename to demo/tsconfig.json diff --git a/typescript/jest.config.ts b/jest.config.ts similarity index 100% rename from typescript/jest.config.ts rename to jest.config.ts diff --git a/typescript/package-lock.json b/package-lock.json similarity index 100% rename from typescript/package-lock.json rename to package-lock.json diff --git a/typescript/package.json b/package.json similarity index 90% rename from typescript/package.json rename to package.json index 72735a4..4192013 100644 --- a/typescript/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/AlexandreBellas/bling-erp-api.git" + "url": "git+https://github.com/AlexandreBellas/bling-erp-api-js.git" }, "keywords": [ "javascript", @@ -38,9 +38,9 @@ "author": "AlexandreBellas; vitor-san", "license": "ISC", "bugs": { - "url": "https://github.com/AlexandreBellas/bling-erp-api/issues" + "url": "https://github.com/AlexandreBellas/bling-erp-api-js/issues" }, - "homepage": "https://github.com/AlexandreBellas/bling-erp-api#readme", + "homepage": "https://github.com/AlexandreBellas/bling-erp-api-js#readme", "dependencies": { "axios": "^1.6.2" }, @@ -67,4 +67,4 @@ "publishConfig": { "access": "public" } -} +} \ No newline at end of file diff --git a/php/.gitattributes b/php/.gitattributes deleted file mode 100644 index 0555d1b..0000000 --- a/php/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/src/**/__tests__ export-ignore -*.spec.php export-ignore diff --git a/php/.gitignore b/php/.gitignore deleted file mode 100644 index 406abd8..0000000 --- a/php/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Dependencies -vendor/ -.phpunit.cache/ diff --git a/php/README.md b/php/README.md deleted file mode 100644 index 2207686..0000000 --- a/php/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# Bling ERP API - PHP - -Pacote de integração com a [API v3 do ERP Bling](https://developer.bling.com.br) -para PHP 8.2+. O mais completo existente. - -Atualizado com a versão `v291` da API ([veja o registro de alterações](https://developer.bling.com.br/changelogs#2024-01-31)). - -## Instalação - -Para instalar, execute o comando: - -```bash -composer require alebatistella/bling-erp-api -``` - -## Criação de uma nova conexão - -Para criar uma conexão ao serviço do Bling, basta instanciar o objeto com a [API key](https://developer.bling.com.br/autenticacao) em seu construtor. - -```php -use AleBatistella\BlingErpApi\Bling; - -$apiKey = "sua_api_key"; -$blingConnection = new Bling($apiKey); -``` - -Vale destacar que o fluxo de criação e autorização do aplicativo **não é feito -pela biblioteca**. Ou seja, a biblioteca somente recebe o `access_token` gerado -a partir do _endpoint_ `/token`. [Veja a referência](https://developer.bling.com.br/aplicativos#tokens-de-acesso). - -## Entidades disponíveis - -Nem todas as entidades do Bling estão permitidas para interação. As atuais são: - -- [x] Borderos (`->borderos`) -- [ ] Campos customizados (`->camposCustomizados`) -- [ ] Categorias - Lojas (`->categoriasLojas`) -- [ ] Categorias - Produtos (`->categoriasProdutos`) -- [ ] Categorias - Receitas e Despesas (`->categoriasReceitasDespesas`) -- [ ] Contas a Pagar (`->contasPagar`) -- [ ] Contas a Receber (`->contasReceber`) -- [ ] Contas Contábeis (`->contasContabeis`) -- [ ] Contatos (`->contatos`) -- [ ] Contatos - Tipos (`->contatosTipos`) -- [ ] Contratos (`->contratos`) -- [ ] Depósitos (`->depositos`) -- [ ] Empresas (`->empresas`) -- [ ] Estoques (`->estoques`) -- [ ] Formas de pagamento (`->formasDePagamento`) -- [ ] Homologação (`->homologacao`) -- [ ] Logísticas (`->logisticas`) -- [ ] Logísticas - Etiquetas (`->logisticasEtiquetas`) -- [ ] Logísticas - Objetos (`->logisticasObjetos`) -- [ ] Logísticas - Remessas (`->logisticasRemessas`) -- [ ] Logísticas - Serviços (`->logisticasServicos`) -- [ ] Naturezas de Operações (`->naturezasDeOperacoes`) -- [ ] Notas Fiscais de Consumidor Eletrônicas (`->nfces`) -- [ ] Notas Fiscais de Serviço Eletrônicas (`->nfses`) -- [ ] Notas Fiscais Eletrônicas (`->nfes`) -- [ ] Notificações (`->notificacoes`) -- [ ] Pedidos - Compras (`->pedidosCompras`) -- [ ] Pedidos - Vendas (`->pedidosVendas`) -- [ ] Produtos (`->produtos`) -- [ ] Produtos - Estruturas (`->produtosEstruturas`) -- [ ] Produtos - Fornecedores (`->produtosFornecedores`) -- [ ] Produtos - Lojas (`->produtosLojas`) -- [ ] Produtos - Variações (`->produtosVariacoes`) -- [ ] Situações (`->situacoes`) -- [ ] Situações - Módulos (`->situacoesModulos`) -- [ ] Situações - Transições (`->situacoesTransicoes`) -- [ ] Usuários (`->usuarios`) -- [ ] Vendedores (`->vendedores`) - -## Exemplo de uso - -Para listar seus produtos, basta executar: - -```js -use AleBatistella\BlingErpApi\Bling; - -$apiKey = "sua_api_key"; -$blingConnection = new Bling($apiKey); - -$products = $blingConnection->produtos->get(); - -dd($products); -``` - -## Executando os testes do projeto - -Faça o clone do projeto, instale as dependências e execute: - -```bash -vendor/phpunit/phpunit/phpunit -c php/phpunit.xml -``` diff --git a/php/demo/composer.json b/php/demo/composer.json deleted file mode 100644 index c91255e..0000000 --- a/php/demo/composer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "alebatistella/bling-erp-api-demo", - "type": "project", - "minimum-stability": "dev", - "autoload": { - "psr-4": { - "Alebatistella\\BlingErpApiDemo\\": "src/" - } - }, - "authors": [ - { - "name": "Alexandre Batistella Bellas", - "email": "alexandre.bellas@gmail.com" - } - ], - "require": { - "alebatistella/bling-erp-api": "dev-main" - } -} \ No newline at end of file diff --git a/php/demo/composer.lock b/php/demo/composer.lock deleted file mode 100644 index ce56a39..0000000 --- a/php/demo/composer.lock +++ /dev/null @@ -1,687 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "45efe585696fdb98264f4991e155a1e0", - "packages": [ - { - "name": "alebatistella/bling-erp-api", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/AlexandreBellas/bling-erp-api.git", - "reference": "c46df63d657252d1b60211fab02cad406b1e6077" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/AlexandreBellas/bling-erp-api/zipball/c46df63d657252d1b60211fab02cad406b1e6077", - "reference": "c46df63d657252d1b60211fab02cad406b1e6077", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^7.8" - }, - "require-dev": { - "fakerphp/faker": "^1.23", - "laravel/laravel": "^10.2", - "phpunit/phpunit": "^10.5" - }, - "default-branch": true, - "type": "library", - "autoload": { - "files": [ - "./php/src/Helpers/functions.php" - ], - "psr-4": { - "AleBatistella\\BlingErpApi\\": "./php/src/", - "AleBatistella\\BlingErpApi\\Entities\\Shared\\": "./php/src/Entities/@shared/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alexandre Batistella Bellas", - "email": "alexandre.bellas@gmail.com" - } - ], - "description": "Pacote de integração com a API do Bling ERP", - "support": { - "issues": "https://github.com/AlexandreBellas/bling-erp-api/issues", - "source": "https://github.com/AlexandreBellas/bling-erp-api/tree/main" - }, - "funding": [ - { - "url": "https://www.paypal.com/donate/?hosted_button_id=G2NJKZ5MUMKBS", - "type": "custom" - }, - { - "url": "https://github.com/AlexandreBellas", - "type": "github" - }, - { - "url": "https://ko-fi.com/alebatistella", - "type": "ko_fi" - } - ], - "time": "2023-12-27T00:06:54+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "7.9.x-dev", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.1", - "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", - "php": "^7.2.5 || ^8.0", - "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "provide": { - "psr/http-client-implementation": "1.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", - "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", - "psr/log": "^1.1 || ^2.0 || ^3.0" - }, - "suggest": { - "ext-curl": "Required for CURL handler support", - "ext-intl": "Required for Internationalized Domain Name (IDN) support", - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Jeremy Lindblom", - "email": "jeremeamia@gmail.com", - "homepage": "https://github.com/jeremeamia" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "psr-18", - "psr-7", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", - "type": "tidelift" - } - ], - "time": "2023-12-03T20:35:24+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "2.0.x-dev", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" - }, - "default-branch": true, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } - ], - "time": "2023-12-03T20:19:20+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "2.6.x-dev", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1 || ^2.0", - "ralouphie/getallheaders": "^3.0" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "default-branch": true, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.2" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "time": "2023-12-03T20:05:35+00:00" - }, - { - "name": "psr/http-client", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "support": { - "source": "https://github.com/php-fig/http-client" - }, - "time": "2023-09-23T14:17:50+00:00" - }, - { - "name": "psr/http-factory", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "7037f4b0950474e9d1350e8df89b15f1842085f6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/7037f4b0950474e9d1350e8df89b15f1842085f6", - "reference": "7037f4b0950474e9d1350e8df89b15f1842085f6", - "shasum": "" - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory" - }, - "time": "2023-09-22T11:16:44+00:00" - }, - { - "name": "psr/http-message", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/2.0" - }, - "time": "2023-04-04T09:54:51+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-05-23T14:45:45+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "dev", - "stability-flags": { - "alebatistella/bling-erp-api": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.6.0" -} diff --git a/php/demo/src/Main.php b/php/demo/src/Main.php deleted file mode 100644 index 28bff0c..0000000 --- a/php/demo/src/Main.php +++ /dev/null @@ -1,10 +0,0 @@ -borderos->delete(123); diff --git a/php/phpunit.xml b/php/phpunit.xml deleted file mode 100644 index 265ce67..0000000 --- a/php/phpunit.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - ./src/Entities - - - ./src/BlingTest.spec.php - - - - - - - ./src - - - ./src/Entities/@shared - ./vendor - - - \ No newline at end of file diff --git a/php/src/Bling.php b/php/src/Bling.php deleted file mode 100644 index 58e0aa3..0000000 --- a/php/src/Bling.php +++ /dev/null @@ -1,61 +0,0 @@ -repository = IoC::getRepository($accessToken); - $this->modules = []; - } - - /** - * Obtém um módulo através de sua assinatura (seguindo o _pattern_ `Instance`). - * - * @param string $entityClassName O nome da classe da entidade desejada. - * - * @return BaseEntity A instância da entidade. - */ - private function getModule(string $entityClassName): BaseEntity - { - if (!array_key_exists($entityClassName, $this->modules)) { - $this->modules[$entityClassName] = new $entityClassName($this->repository); - } - - return $this->modules[$entityClassName]; - } - - /** - * _Facade_ de busca da entidade correta. - */ - public function __get(string $name) - { - return match ($name) { - 'borderos' => $this->getModule(Borderos::class), - default => throw new BlingInternalException("A entidade \"$name\" não existe.") - }; - } -} diff --git a/php/src/BlingTest.spec.php b/php/src/BlingTest.spec.php deleted file mode 100644 index 8859e34..0000000 --- a/php/src/BlingTest.spec.php +++ /dev/null @@ -1,51 +0,0 @@ -word()); - } - - /** - * Testa a instanciação do módulo. - * - * @return void - */ - public function testShouldInstantiateCorrectly(): void - { - $expected = Bling::class; - - $actual = $this->getInstance(); - - $this->assertInstanceOf($expected, $actual); - } - - /** - * Testa obter a entidade Borderos. - * - * @return void - */ - public function testShouldGetBorderosCorrectly(): void - { - $expected = Borderos::class; - - $actual = $this->getInstance()->borderos; - - $this->assertInstanceOf($expected, $actual); - } -} diff --git a/php/src/Contracts/IResponseObject.php b/php/src/Contracts/IResponseObject.php deleted file mode 100644 index a493c88..0000000 --- a/php/src/Contracts/IResponseObject.php +++ /dev/null @@ -1,25 +0,0 @@ - ErrorField::from($item), - $attributes['fields'] - ) : null, - ); - } - - /** - * @inheritDoc - */ - public function toArray(): array - { - return [ - 'type' => $this->type, - 'message' => $this->message, - 'description' => $this->description, - 'fields' => array_map( - static fn(ErrorField $response): array => $response->toArray(), - $this->fields - ), - ]; - } -} diff --git a/php/src/Entities/@shared/DTO/Error/ErrorField.php b/php/src/Entities/@shared/DTO/Error/ErrorField.php deleted file mode 100644 index 7e5638f..0000000 --- a/php/src/Entities/@shared/DTO/Error/ErrorField.php +++ /dev/null @@ -1,63 +0,0 @@ - ErrorFieldCollection::from($item), - $attributes['collection'] - ) : null, - ); - } - - /** - * @inheritDoc - */ - public function toArray(): array - { - return [ - 'code' => $this->code, - 'msg' => $this->msg, - 'element' => $this->element, - 'namespace' => $this->namespace, - 'collection' => array_map( - static fn(ErrorFieldCollection $response): array => $response->toArray(), - $this->collection - ), - ]; - } -} diff --git a/php/src/Entities/@shared/DTO/Error/ErrorFieldCollection.php b/php/src/Entities/@shared/DTO/Error/ErrorFieldCollection.php deleted file mode 100644 index 59bb99c..0000000 --- a/php/src/Entities/@shared/DTO/Error/ErrorFieldCollection.php +++ /dev/null @@ -1,57 +0,0 @@ - $this->index, - 'code' => $this->code, - 'msg' => $this->msg, - 'element' => $this->element, - 'namespace' => $this->namespace, - ]; - } -} diff --git a/php/src/Entities/@shared/DTO/Error/ErrorResponse.php b/php/src/Entities/@shared/DTO/Error/ErrorResponse.php deleted file mode 100644 index 515ad87..0000000 --- a/php/src/Entities/@shared/DTO/Error/ErrorResponse.php +++ /dev/null @@ -1,49 +0,0 @@ -body->content); - } - - /** - * @inheritDoc - */ - public static function from(array $attributes): static - { - return new self( - error: Error::from($attributes['error']) - ); - } - - /** - * @inheritDoc - */ - public function toArray(): array - { - return [ - 'error' => $this->error->toArray(), - ]; - } -} diff --git a/php/src/Entities/@shared/DTO/Error/__tests__/ErrorResponseTest.spec.php b/php/src/Entities/@shared/DTO/Error/__tests__/ErrorResponseTest.spec.php deleted file mode 100644 index c48f853..0000000 --- a/php/src/Entities/@shared/DTO/Error/__tests__/ErrorResponseTest.spec.php +++ /dev/null @@ -1,136 +0,0 @@ -assertInstanceOf($expected, $actual); - } - - /** - * Testa a instanciação a partir de um `ResponseOptions`. - * - * @return void - */ - public function testShouldInstantiateFromResponseOptions(): void - { - $rawResponse = '{ - "error": { - "type": "VALIDATION_ERROR", - "message": "Não foi possível salvar a venda", - "description": "A venda não pode ser salva, pois ocorreram problemas em sua validação.", - "fields": [ - { - "code": 49, - "msg": "Uma ou mais parcelas da venda possuem erros de validação", - "element": "parcelas", - "namespace": "VENDAS", - "collection": [ - { - "index": 1, - "code": 12, - "msg": "Id da forma de pagamento inválido.", - "element": "formaPagamento", - "namespace": "VENDAS" - } - ] - } - ] - } - }'; - $rawResponseArray = json_decode($rawResponse, true); - $response = new class (endpoint: fake()->word(), - method: fake()->word(), - status: 200, - body: new class ($rawResponseArray) extends Body { }, - ) extends ResponseOptions { - }; - $expected = ErrorResponse::class; - - $actual = ErrorResponse::fromResponse($response); - - $this->assertInstanceOf($expected, $actual); - } - - /** - * Testa a formatação em _array_. - * - * @return void - */ - public function testShouldConvertToArray(): void - { - $rawExpected = '{ - "error": { - "type": "VALIDATION_ERROR", - "message": "Não foi possível salvar a venda", - "description": "A venda não pode ser salva, pois ocorreram problemas em sua validação.", - "fields": [ - { - "code": 49, - "msg": "Uma ou mais parcelas da venda possuem erros de validação", - "element": "parcelas", - "namespace": "VENDAS", - "collection": [ - { - "index": 1, - "code": 12, - "msg": "Id da forma de pagamento inválido.", - "element": "formaPagamento", - "namespace": "VENDAS" - } - ] - } - ] - } - }'; - $expected = json_decode($rawExpected, true); - - $actual = ErrorResponse::from($expected); - - $this->assertEquals($expected, $actual->toArray()); - } -} diff --git a/php/src/Entities/@shared/DTO/Request/Body.php b/php/src/Entities/@shared/DTO/Request/Body.php deleted file mode 100644 index c99f4b0..0000000 --- a/php/src/Entities/@shared/DTO/Request/Body.php +++ /dev/null @@ -1,20 +0,0 @@ - $content - * - * @return self - */ - public function __construct(public readonly array $content) - { - } -} diff --git a/php/src/Entities/@shared/DTO/Request/Headers.php b/php/src/Entities/@shared/DTO/Request/Headers.php deleted file mode 100644 index a2c5a60..0000000 --- a/php/src/Entities/@shared/DTO/Request/Headers.php +++ /dev/null @@ -1,18 +0,0 @@ - $content - */ - public function __construct(public array $content) - { - } -} diff --git a/php/src/Entities/@shared/DTO/Request/QueryParams.php b/php/src/Entities/@shared/DTO/Request/QueryParams.php deleted file mode 100644 index be75569..0000000 --- a/php/src/Entities/@shared/DTO/Request/QueryParams.php +++ /dev/null @@ -1,18 +0,0 @@ - $content - */ - public function __construct(public array $content) - { - } -} diff --git a/php/src/Entities/@shared/DTO/Request/RequestOptions.php b/php/src/Entities/@shared/DTO/Request/RequestOptions.php deleted file mode 100644 index 4d4d15e..0000000 --- a/php/src/Entities/@shared/DTO/Request/RequestOptions.php +++ /dev/null @@ -1,25 +0,0 @@ -= 400) { - try { - $errorResponse = ErrorResponse::fromResponse($this); - throw new BlingApiException(rawResponse: $errorResponse, status: $status); - } catch (\TypeError $e) { - throw new BlingInternalException( - message: "Não foi possível realizar a chamada HTTP: $method $endpoint", - code: $status, - previous: $e - ); - } - } - } -} diff --git a/php/src/Entities/@shared/DTO/Request/__tests__/ResponseOptionsTest.spec.php b/php/src/Entities/@shared/DTO/Request/__tests__/ResponseOptionsTest.spec.php deleted file mode 100644 index dca3667..0000000 --- a/php/src/Entities/@shared/DTO/Request/__tests__/ResponseOptionsTest.spec.php +++ /dev/null @@ -1,98 +0,0 @@ -word(), - method: fake()->word(), - status: 200 - ) extends ResponseOptions { - }; - - $this->assertInstanceOf($expected, $actual); - } - - /** - * Testa o lançamento de erro para requisição mal-sucedida e corpo esperado. - * - * @return void - */ - public function testShouldInstantiateWithErrorAndExpectedBody(): void - { - $this->expectException(BlingApiException::class); - $this->expectExceptionMessage("A venda não pode ser salva, pois ocorreram problemas em sua validação."); - $rawResponse = '{ - "error": { - "type": "VALIDATION_ERROR", - "message": "Não foi possível salvar a venda", - "description": "A venda não pode ser salva, pois ocorreram problemas em sua validação.", - "fields": [ - { - "code": 49, - "msg": "Uma ou mais parcelas da venda possuem erros de validação", - "element": "parcelas", - "namespace": "VENDAS", - "collection": [ - { - "index": 1, - "code": 12, - "msg": "Id da forma de pagamento inválido.", - "element": "formaPagamento", - "namespace": "VENDAS" - } - ] - } - ] - } - }'; - $rawResponseArray = json_decode($rawResponse, true); - - new class (endpoint: fake()->word(), - method: fake()->word(), - status: 400, - body: new class ($rawResponseArray) extends Body { } - ) extends ResponseOptions { - }; - } - - /** - * Testa o lançamento de erro para requisição mal-sucedida e corpo inesperado. - * - * @return void - */ - public function testShouldInstantiateWithErrorAndNotExpectedBody(): void - { - $endpoint = fake()->word(); - $method = fake()->word(); - $this->expectException(BlingInternalException::class); - $this->expectExceptionMessage("Não foi possível realizar a chamada HTTP: $method $endpoint"); - - new class (endpoint: $endpoint, - method: $method, - status: 400, - body: new class (['teste' => '123']) extends Body { } - ) extends ResponseOptions { - }; - } -} diff --git a/php/src/Entities/@shared/DTO/Schema/Id.php b/php/src/Entities/@shared/DTO/Schema/Id.php deleted file mode 100644 index 5c82e33..0000000 --- a/php/src/Entities/@shared/DTO/Schema/Id.php +++ /dev/null @@ -1,40 +0,0 @@ - $this->id, - ]; - } -} diff --git a/php/src/Entities/@shared/TestResponseTrait.php b/php/src/Entities/@shared/TestResponseTrait.php deleted file mode 100644 index c43f539..0000000 --- a/php/src/Entities/@shared/TestResponseTrait.php +++ /dev/null @@ -1,51 +0,0 @@ -word(), - method: $method ?? fake()->word(), - status: $status ?? fake()->numberBetween(200, 500), - headers: $headers, - body: $body, - ) extends ResponseOptions { - }; - } - - /** - * Gera um corpo de requisição. - * - * @param array $content - * - * @return Body - */ - private function buildBody(array $content): Body - { - return new class ($content) extends Body { }; - } -} diff --git a/php/src/Entities/Borderos/Borderos.php b/php/src/Entities/Borderos/Borderos.php deleted file mode 100644 index d8333b4..0000000 --- a/php/src/Entities/Borderos/Borderos.php +++ /dev/null @@ -1,55 +0,0 @@ -repository->destroy(new RequestOptions( - endpoint: "borderos/$idBordero" - )); - - return $response->body; - } - - /** - * Encontra um borderô. - * - * @param params Parâmetros para a busca (somente o ID). - * - * @return FindResponse Os dados do borderô pesquisado. - * @throws BlingApiException|BlingInternalException - * - * @see https://developer.bling.com.br/referencia#/Border%C3%B4s/get_borderos__idBordero_ - */ - public function find(int $idBordero): FindResponse - { - $response = $this->repository->show(new RequestOptions( - endpoint: "borderos/$idBordero" - )); - - return FindResponse::fromResponse($response); - } -} diff --git a/php/src/Entities/Borderos/Schema/Find/FindResponse.php b/php/src/Entities/Borderos/Schema/Find/FindResponse.php deleted file mode 100644 index 1c116fd..0000000 --- a/php/src/Entities/Borderos/Schema/Find/FindResponse.php +++ /dev/null @@ -1,50 +0,0 @@ -body->content); - } - - /** - * @inheritDoc - */ - public static function from(array $attributes): static - { - return new self( - data: FindResponseData::from($attributes['data']) - ); - } - - /** - * @inheritDoc - */ - public function toArray(): array - { - return [ - 'data' => $this->data->toArray(), - ]; - } -} diff --git a/php/src/Entities/Borderos/Schema/Find/FindResponseData.php b/php/src/Entities/Borderos/Schema/Find/FindResponseData.php deleted file mode 100644 index 5f2c5ad..0000000 --- a/php/src/Entities/Borderos/Schema/Find/FindResponseData.php +++ /dev/null @@ -1,68 +0,0 @@ - FindResponseDataPagamentos::from($item), - $attributes['pagamentos'] - ), - ); - } - - /** - * @inheritDoc - */ - public function toArray(): array - { - return [ - 'id' => $this->id, - 'data' => $this->data, - 'historico' => $this->historico, - 'portador' => $this->portador->toArray(), - 'categoria' => $this->categoria->toArray(), - 'pagamentos' => array_map( - static fn(FindResponseDataPagamentos $response): array => $response->toArray(), - $this->pagamentos - ), - ]; - } -} diff --git a/php/src/Entities/Borderos/Schema/Find/FindResponseDataPagamentos.php b/php/src/Entities/Borderos/Schema/Find/FindResponseDataPagamentos.php deleted file mode 100644 index 29401fa..0000000 --- a/php/src/Entities/Borderos/Schema/Find/FindResponseDataPagamentos.php +++ /dev/null @@ -1,66 +0,0 @@ - $this->contato->toArray(), - 'numeroDocumento' => $this->numeroDocumento, - 'valorPago' => $this->valorPago, - 'juros' => $this->juros, - 'desconto' => $this->desconto, - 'acrescimo' => $this->acrescimo, - 'tarifa' => $this->tarifa, - ]; - } -} diff --git a/php/src/Entities/Borderos/__tests__/BorderosTest.spec.php b/php/src/Entities/Borderos/__tests__/BorderosTest.spec.php deleted file mode 100644 index ce3c1fc..0000000 --- a/php/src/Entities/Borderos/__tests__/BorderosTest.spec.php +++ /dev/null @@ -1,76 +0,0 @@ -randomNumber(); - $repository = $this->getMockBuilder(IBlingRepository::class)->getMock(); - $repository->expects($this->once()) - ->method('destroy') - ->with($this->callback(fn(RequestOptions $requestOptions) => - $requestOptions->endpoint === "borderos/$idBordero" - )) - ->willReturn($this->buildResponse(status: 200, body: null)); - - /** @var IBlingRepository $repository */ - $response = $this->getInstance($repository)->delete($idBordero); - - $this->assertNull($response); - } - - /** - * Testa a busca pontual. - * - * @return void - */ - public function testShouldFindSuccessfully(): void - { - $idBordero = fake()->randomNumber(); - $findResponse = json_decode(file_get_contents(__DIR__ . '/find/response.json'), true); - $repository = $this->getMockBuilder(IBlingRepository::class)->getMock(); - $repository->expects($this->once()) - ->method('show') - ->with($this->callback(fn(RequestOptions $requestOptions) => - $requestOptions->endpoint === "borderos/$idBordero" - )) - ->willReturn($this->buildResponse(status: 200, body: $this->buildBody($findResponse))); - - /** @var IBlingRepository $repository */ - $response = $this->getInstance($repository)->find($idBordero); - - $this->assertInstanceOf(FindResponse::class, $response); - $this->assertEquals($findResponse, $response->toArray()); - } -} diff --git a/php/src/Entities/Borderos/__tests__/delete/response.json b/php/src/Entities/Borderos/__tests__/delete/response.json deleted file mode 100644 index ec747fa..0000000 --- a/php/src/Entities/Borderos/__tests__/delete/response.json +++ /dev/null @@ -1 +0,0 @@ -null \ No newline at end of file diff --git a/php/src/Entities/Borderos/__tests__/find/response.json b/php/src/Entities/Borderos/__tests__/find/response.json deleted file mode 100644 index 689b779..0000000 --- a/php/src/Entities/Borderos/__tests__/find/response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "data": { - "id": 12345678, - "data": "2023-01-12", - "historico": "Referente ao pedido nº 12345678", - "portador": { - "id": 12345678 - }, - "categoria": { - "id": 12345678 - }, - "pagamentos": [ - { - "contato": { - "id": 12345678 - }, - "numeroDocumento": "", - "valorPago": 1500.75, - "juros": 10, - "desconto": 10, - "acrescimo": 10, - "tarifa": 10 - } - ] - } -} \ No newline at end of file diff --git a/php/src/Exceptions/BlingApiException.php b/php/src/Exceptions/BlingApiException.php deleted file mode 100644 index 8d601d7..0000000 --- a/php/src/Exceptions/BlingApiException.php +++ /dev/null @@ -1,42 +0,0 @@ -error->description, $status); - } - - /** - * Obtém a resposta da requisição. - */ - public function getResponse(): ErrorResponse - { - return $this->rawResponse; - } - - /** - * Obtém o _status_ HTTP. - * - * @return int - */ - public function getHttpStatus(): int - { - return $this->status; - } -} diff --git a/php/src/Exceptions/BlingInternalException.php b/php/src/Exceptions/BlingInternalException.php deleted file mode 100644 index 34657fd..0000000 --- a/php/src/Exceptions/BlingInternalException.php +++ /dev/null @@ -1,10 +0,0 @@ -format('Y-m-d'); - } -} - -if (!function_exists('fake')) { - /** - * Cria objeto para dados _fake_. - * - * @return \Faker\Generator - */ - function fake(): \Faker\Generator - { - return \Faker\Factory::create(); - } -} diff --git a/php/src/Providers/IoC.php b/php/src/Providers/IoC.php deleted file mode 100644 index a689dae..0000000 --- a/php/src/Providers/IoC.php +++ /dev/null @@ -1,27 +0,0 @@ -client = new Client([ - 'base_uri' => $baseUrl, - 'headers' => [ - 'Authorization' => "Bearer $accessToken", - ], - ]); - } - - /** - * @inheritDoc - */ - public function index(RequestOptions $options): ResponseOptions - { - $response = $this->client->get($options->endpoint, [ - 'query' => $options->queryParams?->content, - 'headers' => $options->headers?->content, - ]); - - return new ResponseOptions( - endpoint: $options->endpoint, - method: 'GET', - status: $response->getStatusCode(), - headers: new Headers($response->getHeaders()), - body: $this->buildResponseBody($response->getBody()->getContents()), - ); - } - - /** - * @inheritDoc - */ - public function show(RequestOptions $options): ResponseOptions - { - return $this->index($options); - } - - /** - * @inheritDoc - */ - public function store(RequestOptions $options): ResponseOptions - { - $response = $this->client->post($options->endpoint, [ - 'query' => $options->queryParams?->content, - 'json' => $options->body?->content, - 'headers' => $options->headers?->content, - ]); - - return new ResponseOptions( - endpoint: $options->endpoint, - method: 'POST', - status: $response->getStatusCode(), - headers: new Headers($response->getHeaders()), - body: $this->buildResponseBody($response->getBody()->getContents()), - ); - } - - /** - * @inheritDoc - */ - public function update(RequestOptions $options): ResponseOptions - { - $response = $this->client->patch($options->endpoint, [ - 'query' => $options->queryParams?->content, - 'json' => $options->body?->content, - 'headers' => $options->headers?->content, - ]); - - return new ResponseOptions( - endpoint: $options->endpoint, - method: 'PATCH', - status: $response->getStatusCode(), - headers: new Headers($response->getHeaders()), - body: $this->buildResponseBody($response->getBody()->getContents()), - ); - } - - /** - * @inheritDoc - */ - public function replace(RequestOptions $options): ResponseOptions - { - $response = $this->client->put($options->endpoint, [ - 'query' => $options->queryParams?->content, - 'json' => $options->body?->content, - 'headers' => $options->headers?->content, - ]); - - return new ResponseOptions( - endpoint: $options->endpoint, - method: 'PUT', - status: $response->getStatusCode(), - headers: new Headers($response->getHeaders()), - body: $this->buildResponseBody($response->getBody()->getContents()), - ); - } - - /** - * @inheritDoc - */ - public function destroy(RequestOptions $options): ResponseOptions - { - $response = $this->client->delete($options->endpoint, [ - 'query' => $options->queryParams?->content, - 'json' => $options->body?->content, - 'headers' => $options->headers?->content, - ]); - - return new ResponseOptions( - endpoint: $options->endpoint, - method: 'DELETE', - status: $response->getStatusCode(), - headers: new Headers($response->getHeaders()), - body: $this->buildResponseBody($response->getBody()->getContents()), - ); - } - - /** - * Monta o corpo da resposta. - * - * @param mixed $contents - * - * @return ?Body - */ - private function buildResponseBody(mixed $contents): ?Body - { - $body = null; - - if (!is_null($contents)) { - $arrResponseBody = json_decode($contents, true); - $body = is_array($arrResponseBody) ? new Body(json_decode($contents, true)) : null; - } - - return $body; - } -} diff --git a/php/src/Repositories/IBlingRepository.php b/php/src/Repositories/IBlingRepository.php deleted file mode 100644 index d950ce5..0000000 --- a/php/src/Repositories/IBlingRepository.php +++ /dev/null @@ -1,63 +0,0 @@ - Date: Sun, 21 Jan 2024 14:55:13 -0300 Subject: [PATCH 2/2] ci: corrigir working directory --- .github/workflows/calculate-coverage.yaml | 3 --- .github/workflows/on-commit-test.yaml | 21 --------------------- 2 files changed, 24 deletions(-) diff --git a/.github/workflows/calculate-coverage.yaml b/.github/workflows/calculate-coverage.yaml index b640a46..efd9b70 100644 --- a/.github/workflows/calculate-coverage.yaml +++ b/.github/workflows/calculate-coverage.yaml @@ -15,15 +15,12 @@ jobs: node-version: 20 - name: Install dependencies - working-directory: ./typescript run: npm install - name: Build project - working-directory: ./typescript run: npm run build - name: Execute tests - working-directory: ./typescript run: npm run test:coverage - name: Send to coveralls diff --git a/.github/workflows/on-commit-test.yaml b/.github/workflows/on-commit-test.yaml index f04162e..c1eb3b5 100644 --- a/.github/workflows/on-commit-test.yaml +++ b/.github/workflows/on-commit-test.yaml @@ -12,31 +12,10 @@ jobs: node-version: 20 - name: Install dependencies - working-directory: ./typescript run: npm install - name: Build project - working-directory: ./typescript run: npm run build - name: Execute tests - working-directory: ./typescript run: npm run test - - php-unit-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "8.2" - - - name: Install dependencies - run: composer update - - - name: Dump autoload classes - run: composer dump-autoload -o - - - name: Execute tests - run: vendor/phpunit/phpunit/phpunit -c php/phpunit.xml