Compare commits
No commits in common. "766514ed84d42228403bc8b82dc91508aac49c50" and "08789cdce60c0985f70f6b4b20334be7aded4e10" have entirely different histories.
766514ed84
...
08789cdce6
|
|
@ -18,20 +18,21 @@ Retorna a lista de impressoras instaladas no servidor onde a API está rodando.
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"Name": "POS-80",
|
"name": "POS-80",
|
||||||
"DriverName": "Generic / Text Only",
|
"portName": "USB001",
|
||||||
"PrinterStatus": 0
|
"driverName": "Generic / Text Only",
|
||||||
|
"printerStatus": 0,
|
||||||
|
"deviceId": "POS-80"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "Microsoft Print to PDF",
|
"name": "Microsoft Print to PDF",
|
||||||
"DriverName": "Microsoft Print To PDF",
|
"portName": "PORTPROMPT:",
|
||||||
"PrinterStatus": 0
|
"driverName": "Microsoft Print To PDF",
|
||||||
|
"printerStatus": 0
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
> Nota: atualmente esse endpoint repassa o resultado do PowerShell `Get-Printer` (Windows) com chaves em PascalCase.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 2. Imprimir HTML (Etiquetas/Layouts)
|
### 2. Imprimir HTML (Etiquetas/Layouts)
|
||||||
|
|
@ -52,16 +53,6 @@ Converte um código HTML (com suporte a Tailwind CSS) para PDF e imprime na impr
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Exemplo de Resposta:**
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"success": true,
|
|
||||||
"message": "Tarefa enviada para a fila de impressão",
|
|
||||||
"jobId": "123"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Detalhes:**
|
- **Detalhes:**
|
||||||
- O backend injeta automaticamente o script do Tailwind CSS.
|
- O backend injeta automaticamente o script do Tailwind CSS.
|
||||||
- O HTML é renderizado via Puppeteer (Chrome headless).
|
- O HTML é renderizado via Puppeteer (Chrome headless).
|
||||||
|
|
@ -91,29 +82,22 @@ Envia comandos de texto diretamente para a impressora. Ideal para cupons simples
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Exemplo de Resposta:**
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"success": true,
|
|
||||||
"message": "Print successful!"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Tipos (TypeScript Interfaces)
|
## Tipos (TypeScript Interfaces)
|
||||||
|
|
||||||
Se estiver usando TypeScript no Frontend, utilize estas interfaces:
|
Se estiver usando TypeScript no Frontend, utilize estas interfaces:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
export interface Printer {
|
export interface Printer {
|
||||||
Name: string;
|
name: string;
|
||||||
DriverName?: string;
|
portName?: string;
|
||||||
PrinterStatus?: number;
|
driverName?: string;
|
||||||
|
printerStatus?: number;
|
||||||
|
deviceId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PrintHtmlPayload {
|
export interface PrintHtmlPayload {
|
||||||
html: string;
|
html: string;
|
||||||
printerName?: string;
|
printerName: string;
|
||||||
width?: string;
|
width?: string;
|
||||||
height?: string;
|
height?: string;
|
||||||
jobId?: string;
|
jobId?: string;
|
||||||
|
|
@ -125,17 +109,6 @@ export interface PrintTextPayload {
|
||||||
upsideDown?: boolean;
|
upsideDown?: boolean;
|
||||||
printerInterface?: string;
|
printerInterface?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PrintHtmlResponse {
|
|
||||||
success: boolean;
|
|
||||||
message: string;
|
|
||||||
jobId?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PrintTextResponse {
|
|
||||||
success: boolean;
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Swagger
|
## Swagger
|
||||||
|
|
|
||||||
14
README.md
14
README.md
|
|
@ -28,18 +28,13 @@ A solução utiliza uma arquitetura baseada em filas para assegurar a resiliênc
|
||||||
O serviço utiliza as seguintes definições no arquivo `.env`:
|
O serviço utiliza as seguintes definições no arquivo `.env`:
|
||||||
|
|
||||||
| Variável | Descrição | Exemplo |
|
| Variável | Descrição | Exemplo |
|
||||||
| :------------------- | :-------------------------------------------- | :------------------------ |
|
| :------------------- | :------------------------------- | :------------------------ |
|
||||||
| `BODY_LIMIT` | Limite do body (JSON/urlencoded) | `2mb` |
|
|
||||||
| `REDIS_HOST` | Endereço do servidor Redis | `localhost` |
|
| `REDIS_HOST` | Endereço do servidor Redis | `localhost` |
|
||||||
| `REDIS_PORT` | Porta do servidor Redis | `6379` |
|
| `REDIS_PORT` | Porta do servidor Redis | `6379` |
|
||||||
| `REDIS_PASSWORD` | Senha do Redis (opcional) | `minha-senha` |
|
|
||||||
| `DB_ENABLED` | Habilita inicialização do Oracle/TypeORM | `true` |
|
|
||||||
| `DB_USERNAME` | Usuário do Banco de Dados Oracle | `admin` |
|
| `DB_USERNAME` | Usuário do Banco de Dados Oracle | `admin` |
|
||||||
| `DB_PASSWORD` | Senha do Banco de Dados Oracle | `1234` |
|
| `DB_PASSWORD` | Senha do Banco de Dados Oracle | `1234` |
|
||||||
| `DB_CONNECT_STRING` | String de conexão Oracle | `(DESCRIPTION=...)` |
|
| `DB_CONNECT_STRING` | String de conexão Oracle | `(DESCRIPTION=...)` |
|
||||||
| `DB_RETRY_ATTEMPTS` | Tentativas de conexão ao iniciar | `5` |
|
| `ORACLE_CLIENT_PATH` | Caminho do Oracle Instant Client | `C:\oracle\instantclient` |
|
||||||
| `DB_RETRY_DELAY_MS` | Delay base (ms) entre tentativas | `2000` |
|
|
||||||
| `ORACLE_CLIENT_PATH` | Caminho do Oracle Instant Client (thick mode) | `C:\oracle\instantclient` |
|
|
||||||
|
|
||||||
### Pré-requisitos
|
### Pré-requisitos
|
||||||
|
|
||||||
|
|
@ -107,10 +102,9 @@ A interface de monitoramento em tempo real das filas está disponível no endpoi
|
||||||
|
|
||||||
Permite a visualização de tarefas ativas, concluídas e falhas, além da reinjeção manual de jobs.
|
Permite a visualização de tarefas ativas, concluídas e falhas, além da reinjeção manual de jobs.
|
||||||
|
|
||||||
### Swagger
|
### Telemetria
|
||||||
|
|
||||||
A documentação interativa (OpenAPI) está disponível em:
|
O serviço está instrumentado com **OpenTelemetry**, exportando traces via protocolo OTLP para análise de performance e rastreabilidade distribuída.
|
||||||
`http://localhost:3000/api`
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
apps: [{
|
|
||||||
name: 'nest-api',
|
|
||||||
script: 'dist/main.js',
|
|
||||||
instances: 1,
|
|
||||||
exec_mode: 'fork',
|
|
||||||
watch: false,
|
|
||||||
env: { NODE_ENV: 'development' },
|
|
||||||
env_production: { NODE_ENV: 'production' }
|
|
||||||
}],
|
|
||||||
|
|
||||||
deploy : {
|
|
||||||
production : {
|
|
||||||
user : 'SSH_USERNAME',
|
|
||||||
host : 'SSH_HOSTMACHINE',
|
|
||||||
ref : 'origin/master',
|
|
||||||
repo : 'GIT_REPOSITORY',
|
|
||||||
path : 'DESTINATION_PATH',
|
|
||||||
'pre-deploy-local': '',
|
|
||||||
'post-deploy' : 'npm install && pm2 reload ecosystem.config.js --env production',
|
|
||||||
'pre-setup': ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -327,6 +327,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.0.tgz",
|
||||||
"integrity": "sha512-97z/ju/Jy1rZmDxybphrBuI+jtJjFVoz7Mr9yUQVVVi+DNZE333uFQeMOqcCIy1x3WYBIbWftUSLmbNXNT7qFQ==",
|
"integrity": "sha512-97z/ju/Jy1rZmDxybphrBuI+jtJjFVoz7Mr9yUQVVVi+DNZE333uFQeMOqcCIy1x3WYBIbWftUSLmbNXNT7qFQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ampproject/remapping": "^2.2.0",
|
"@ampproject/remapping": "^2.2.0",
|
||||||
"@babel/code-frame": "^7.22.13",
|
"@babel/code-frame": "^7.22.13",
|
||||||
|
|
@ -874,6 +875,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/@bull-board/api/-/api-6.16.4.tgz",
|
"resolved": "https://registry.npmjs.org/@bull-board/api/-/api-6.16.4.tgz",
|
||||||
"integrity": "sha512-fn4O+QbA3mRj0rEE41mvwbvtiiv0UYgnxQ9ErWb9n74EwIC/yZbiyxQ+Gh/ehU9u7B0PuaNyR0IOG/h3DGo1Mg==",
|
"integrity": "sha512-fn4O+QbA3mRj0rEE41mvwbvtiiv0UYgnxQ9ErWb9n74EwIC/yZbiyxQ+Gh/ehU9u7B0PuaNyR0IOG/h3DGo1Mg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"redis-info": "^3.1.0"
|
"redis-info": "^3.1.0"
|
||||||
},
|
},
|
||||||
|
|
@ -1090,6 +1092,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/@bull-board/ui/-/ui-6.16.4.tgz",
|
"resolved": "https://registry.npmjs.org/@bull-board/ui/-/ui-6.16.4.tgz",
|
||||||
"integrity": "sha512-5Yv+4g0rDvBBq2RxaUewSEwD8ywvqCX6lKlzPM5Aaf0+4cxGoENQRZNcBaAIKX4+fAzAbdVB4VGP4NUgtx5LVg==",
|
"integrity": "sha512-5Yv+4g0rDvBBq2RxaUewSEwD8ywvqCX6lKlzPM5Aaf0+4cxGoENQRZNcBaAIKX4+fAzAbdVB4VGP4NUgtx5LVg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@bull-board/api": "6.16.4"
|
"@bull-board/api": "6.16.4"
|
||||||
}
|
}
|
||||||
|
|
@ -1108,7 +1111,7 @@
|
||||||
"version": "0.8.1",
|
"version": "0.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
|
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
|
||||||
"integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
|
"integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jridgewell/trace-mapping": "0.3.9"
|
"@jridgewell/trace-mapping": "0.3.9"
|
||||||
},
|
},
|
||||||
|
|
@ -1120,7 +1123,7 @@
|
||||||
"version": "0.3.9",
|
"version": "0.3.9",
|
||||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
|
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
|
||||||
"integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
|
"integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jridgewell/resolve-uri": "^3.0.3",
|
"@jridgewell/resolve-uri": "^3.0.3",
|
||||||
"@jridgewell/sourcemap-codec": "^1.4.10"
|
"@jridgewell/sourcemap-codec": "^1.4.10"
|
||||||
|
|
@ -2073,7 +2076,7 @@
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
|
||||||
"integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
|
"integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.0.0"
|
"node": ">=6.0.0"
|
||||||
}
|
}
|
||||||
|
|
@ -2101,7 +2104,7 @@
|
||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
|
||||||
"integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
|
"integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@jridgewell/trace-mapping": {
|
"node_modules/@jridgewell/trace-mapping": {
|
||||||
|
|
@ -2211,6 +2214,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/@nestjs/bull-shared/-/bull-shared-11.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@nestjs/bull-shared/-/bull-shared-11.0.4.tgz",
|
||||||
"integrity": "sha512-VBJcDHSAzxQnpcDfA0kt9MTGUD1XZzfByV70su0W0eDCQ9aqIEBlzWRW21tv9FG9dIut22ysgDidshdjlnczLw==",
|
"integrity": "sha512-VBJcDHSAzxQnpcDfA0kt9MTGUD1XZzfByV70su0W0eDCQ9aqIEBlzWRW21tv9FG9dIut22ysgDidshdjlnczLw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tslib": "2.8.1"
|
"tslib": "2.8.1"
|
||||||
},
|
},
|
||||||
|
|
@ -2335,6 +2339,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.0.17.tgz",
|
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.0.17.tgz",
|
||||||
"integrity": "sha512-FwKylI/hVxaNvzBJdWMMG1LH0cLKz4Oh4jKOHet2JUVMM9j6CuodRbrSnL++KL6PJY/b2E6AY58UDPLNeCqJWw==",
|
"integrity": "sha512-FwKylI/hVxaNvzBJdWMMG1LH0cLKz4Oh4jKOHet2JUVMM9j6CuodRbrSnL++KL6PJY/b2E6AY58UDPLNeCqJWw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"iterare": "1.2.1",
|
"iterare": "1.2.1",
|
||||||
"tslib": "2.8.1",
|
"tslib": "2.8.1",
|
||||||
|
|
@ -2395,6 +2400,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.0.1.tgz",
|
||||||
"integrity": "sha512-Yn7X2aInjmX7yxpH8TjJmgC0JPvs+tcreETkquSRmKbuK5J28dZDi8loiaw3eRTLLvzzUovv5mlqFxmVhDESOw==",
|
"integrity": "sha512-Yn7X2aInjmX7yxpH8TjJmgC0JPvs+tcreETkquSRmKbuK5J28dZDi8loiaw3eRTLLvzzUovv5mlqFxmVhDESOw==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/opencollective": "0.4.1",
|
"@nuxt/opencollective": "0.4.1",
|
||||||
"fast-safe-stringify": "2.1.1",
|
"fast-safe-stringify": "2.1.1",
|
||||||
|
|
@ -2454,6 +2460,7 @@
|
||||||
"version": "11.0.1",
|
"version": "11.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-11.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-11.0.1.tgz",
|
||||||
"integrity": "sha512-vkAcm4Lm/aAvvpYtRcRKuwzsliy4SqoSp0saHOIx6VdphIb1k7ziRkjDbLFDczDZmkiyX1pJ9kI5SHjoQzVDPw==",
|
"integrity": "sha512-vkAcm4Lm/aAvvpYtRcRKuwzsliy4SqoSp0saHOIx6VdphIb1k7ziRkjDbLFDczDZmkiyX1pJ9kI5SHjoQzVDPw==",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "1.20.3",
|
"body-parser": "1.20.3",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
|
|
@ -2893,6 +2900,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/@swc/cli/-/cli-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@swc/cli/-/cli-0.6.0.tgz",
|
||||||
"integrity": "sha512-Q5FsI3Cw0fGMXhmsg7c08i4EmXCrcl+WnAxb6LYOLHw4JFFC3yzmx9LaXZ7QMbA+JZXbigU2TirI7RAfO0Qlnw==",
|
"integrity": "sha512-Q5FsI3Cw0fGMXhmsg7c08i4EmXCrcl+WnAxb6LYOLHw4JFFC3yzmx9LaXZ7QMbA+JZXbigU2TirI7RAfO0Qlnw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@swc/counter": "^0.1.3",
|
"@swc/counter": "^0.1.3",
|
||||||
"@xhmikosr/bin-wrapper": "^13.0.5",
|
"@xhmikosr/bin-wrapper": "^13.0.5",
|
||||||
|
|
@ -2962,6 +2970,7 @@
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@swc/counter": "^0.1.3",
|
"@swc/counter": "^0.1.3",
|
||||||
"@swc/types": "^0.1.17"
|
"@swc/types": "^0.1.17"
|
||||||
|
|
@ -3207,25 +3216,25 @@
|
||||||
"version": "1.0.9",
|
"version": "1.0.9",
|
||||||
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
|
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
|
||||||
"integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==",
|
"integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==",
|
||||||
"dev": true
|
"devOptional": true
|
||||||
},
|
},
|
||||||
"node_modules/@tsconfig/node12": {
|
"node_modules/@tsconfig/node12": {
|
||||||
"version": "1.0.11",
|
"version": "1.0.11",
|
||||||
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
|
||||||
"integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
|
"integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
|
||||||
"dev": true
|
"devOptional": true
|
||||||
},
|
},
|
||||||
"node_modules/@tsconfig/node14": {
|
"node_modules/@tsconfig/node14": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
|
||||||
"integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
|
"integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
|
||||||
"dev": true
|
"devOptional": true
|
||||||
},
|
},
|
||||||
"node_modules/@tsconfig/node16": {
|
"node_modules/@tsconfig/node16": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
|
||||||
"integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
|
"integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
|
||||||
"dev": true
|
"devOptional": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/babel__core": {
|
"node_modules/@types/babel__core": {
|
||||||
"version": "7.20.2",
|
"version": "7.20.2",
|
||||||
|
|
@ -3296,6 +3305,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.2.tgz",
|
||||||
"integrity": "sha512-uQDwm1wFHmbBbCZCqAlq6Do9LYwByNZHWzXppSnay9SuwJ+VRbjkbLABer54kcPnMSlG6Fdiy2yaFXm/z9Z5gw==",
|
"integrity": "sha512-uQDwm1wFHmbBbCZCqAlq6Do9LYwByNZHWzXppSnay9SuwJ+VRbjkbLABer54kcPnMSlG6Fdiy2yaFXm/z9Z5gw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/estree": "*",
|
"@types/estree": "*",
|
||||||
"@types/json-schema": "*"
|
"@types/json-schema": "*"
|
||||||
|
|
@ -3423,6 +3433,7 @@
|
||||||
"version": "22.10.7",
|
"version": "22.10.7",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.7.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.7.tgz",
|
||||||
"integrity": "sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==",
|
"integrity": "sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~6.20.0"
|
"undici-types": "~6.20.0"
|
||||||
}
|
}
|
||||||
|
|
@ -3542,6 +3553,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.20.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.20.0.tgz",
|
||||||
"integrity": "sha512-gKXG7A5HMyjDIedBi6bUrDcun8GIjnI8qOwVLiY3rx6T/sHP/19XLJOnIq/FgQvWLHja5JN/LSE7eklNBr612g==",
|
"integrity": "sha512-gKXG7A5HMyjDIedBi6bUrDcun8GIjnI8qOwVLiY3rx6T/sHP/19XLJOnIq/FgQvWLHja5JN/LSE7eklNBr612g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "8.20.0",
|
"@typescript-eslint/scope-manager": "8.20.0",
|
||||||
"@typescript-eslint/types": "8.20.0",
|
"@typescript-eslint/types": "8.20.0",
|
||||||
|
|
@ -4536,7 +4548,8 @@
|
||||||
"version": "8.14.0",
|
"version": "8.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
|
||||||
"integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
|
"integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"acorn": "bin/acorn"
|
"acorn": "bin/acorn"
|
||||||
},
|
},
|
||||||
|
|
@ -4557,7 +4570,7 @@
|
||||||
"version": "8.2.0",
|
"version": "8.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
|
|
@ -4576,6 +4589,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||||
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fast-deep-equal": "^3.1.1",
|
"fast-deep-equal": "^3.1.1",
|
||||||
"fast-json-stable-stringify": "^2.0.0",
|
"fast-json-stable-stringify": "^2.0.0",
|
||||||
|
|
@ -4755,7 +4769,7 @@
|
||||||
"version": "4.1.3",
|
"version": "4.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||||
"dev": true
|
"devOptional": true
|
||||||
},
|
},
|
||||||
"node_modules/argparse": {
|
"node_modules/argparse": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
|
|
@ -4939,21 +4953,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||||
},
|
},
|
||||||
"node_modules/bare-events": {
|
|
||||||
"version": "2.8.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz",
|
|
||||||
"integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"optional": true,
|
|
||||||
"peerDependencies": {
|
|
||||||
"bare-abort-controller": "*"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"bare-abort-controller": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/bare-fs": {
|
"node_modules/bare-fs": {
|
||||||
"version": "4.5.2",
|
"version": "4.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.2.tgz",
|
||||||
|
|
@ -5208,6 +5207,7 @@
|
||||||
"url": "https://github.com/sponsors/ai"
|
"url": "https://github.com/sponsors/ai"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"caniuse-lite": "^1.0.30001688",
|
"caniuse-lite": "^1.0.30001688",
|
||||||
"electron-to-chromium": "^1.5.73",
|
"electron-to-chromium": "^1.5.73",
|
||||||
|
|
@ -5284,6 +5284,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.66.6.tgz",
|
"resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.66.6.tgz",
|
||||||
"integrity": "sha512-4EAwZQqbTugEAfI1OI8EhaicSFDNBoDrUlrigPO/KH+4+1UeOWQ2h2OQx+92js957q2L/bLhxvK7/sylzMcgPg==",
|
"integrity": "sha512-4EAwZQqbTugEAfI1OI8EhaicSFDNBoDrUlrigPO/KH+4+1UeOWQ2h2OQx+92js957q2L/bLhxvK7/sylzMcgPg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cron-parser": "4.9.0",
|
"cron-parser": "4.9.0",
|
||||||
"ioredis": "5.9.1",
|
"ioredis": "5.9.1",
|
||||||
|
|
@ -5461,6 +5462,7 @@
|
||||||
"integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
|
"integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"readdirp": "^4.0.1"
|
"readdirp": "^4.0.1"
|
||||||
},
|
},
|
||||||
|
|
@ -5850,7 +5852,7 @@
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||||
"dev": true
|
"devOptional": true
|
||||||
},
|
},
|
||||||
"node_modules/cron-parser": {
|
"node_modules/cron-parser": {
|
||||||
"version": "4.9.0",
|
"version": "4.9.0",
|
||||||
|
|
@ -6087,7 +6089,8 @@
|
||||||
"version": "0.0.1534754",
|
"version": "0.0.1534754",
|
||||||
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1534754.tgz",
|
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1534754.tgz",
|
||||||
"integrity": "sha512-26T91cV5dbOYnXdJi5qQHoTtUoNEqwkHcAyu/IKtjIAxiEqPMrDiRkDOPWVsGfNZGmlQVHQbZRSjD8sxagWVsQ==",
|
"integrity": "sha512-26T91cV5dbOYnXdJi5qQHoTtUoNEqwkHcAyu/IKtjIAxiEqPMrDiRkDOPWVsGfNZGmlQVHQbZRSjD8sxagWVsQ==",
|
||||||
"license": "BSD-3-Clause"
|
"license": "BSD-3-Clause",
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"node_modules/dezalgo": {
|
"node_modules/dezalgo": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
|
|
@ -6103,7 +6106,7 @@
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.3.1"
|
"node": ">=0.3.1"
|
||||||
}
|
}
|
||||||
|
|
@ -6346,6 +6349,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz",
|
||||||
"integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==",
|
"integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.12.1",
|
"@eslint-community/regexpp": "^4.12.1",
|
||||||
|
|
@ -6405,6 +6409,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz",
|
||||||
"integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==",
|
"integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"eslint-config-prettier": "build/bin/cli.js"
|
"eslint-config-prettier": "build/bin/cli.js"
|
||||||
},
|
},
|
||||||
|
|
@ -6645,6 +6650,7 @@
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/express/-/express-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/express/-/express-5.0.1.tgz",
|
||||||
"integrity": "sha512-ORF7g6qGnD+YtUG9yx4DFoqCShNMmUKiXuT5oWMHiOvt/4WFbHC6yCwQMTSBMno7AqntNCAzzcnnjowRkTL9eQ==",
|
"integrity": "sha512-ORF7g6qGnD+YtUG9yx4DFoqCShNMmUKiXuT5oWMHiOvt/4WFbHC6yCwQMTSBMno7AqntNCAzzcnnjowRkTL9eQ==",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"accepts": "^2.0.0",
|
"accepts": "^2.0.0",
|
||||||
"body-parser": "^2.0.1",
|
"body-parser": "^2.0.1",
|
||||||
|
|
@ -8165,6 +8171,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz",
|
||||||
"integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==",
|
"integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jest/core": "^29.7.0",
|
"@jest/core": "^29.7.0",
|
||||||
"@jest/types": "^29.6.3",
|
"@jest/types": "^29.6.3",
|
||||||
|
|
@ -9000,7 +9007,7 @@
|
||||||
"version": "1.3.6",
|
"version": "1.3.6",
|
||||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||||
"dev": true
|
"devOptional": true
|
||||||
},
|
},
|
||||||
"node_modules/makeerror": {
|
"node_modules/makeerror": {
|
||||||
"version": "1.0.12",
|
"version": "1.0.12",
|
||||||
|
|
@ -9526,6 +9533,7 @@
|
||||||
"integrity": "sha512-kGUumXmrEWbSpBuKJyb9Ip3rXcNgKK6grunI3/cLPzrRvboZ6ZoLi9JQ+z6M/RIG924tY8BLflihL4CKKQAYMA==",
|
"integrity": "sha512-kGUumXmrEWbSpBuKJyb9Ip3rXcNgKK6grunI3/cLPzrRvboZ6ZoLi9JQ+z6M/RIG924tY8BLflihL4CKKQAYMA==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "(Apache-2.0 OR UPL-1.0)",
|
"license": "(Apache-2.0 OR UPL-1.0)",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.17"
|
"node": ">=14.17"
|
||||||
}
|
}
|
||||||
|
|
@ -9891,6 +9899,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
|
||||||
"integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
|
"integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"prettier": "bin/prettier.cjs"
|
"prettier": "bin/prettier.cjs"
|
||||||
},
|
},
|
||||||
|
|
@ -10267,7 +10276,8 @@
|
||||||
"node_modules/reflect-metadata": {
|
"node_modules/reflect-metadata": {
|
||||||
"version": "0.2.2",
|
"version": "0.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",
|
||||||
"integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q=="
|
"integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==",
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"node_modules/repeat-string": {
|
"node_modules/repeat-string": {
|
||||||
"version": "1.6.1",
|
"version": "1.6.1",
|
||||||
|
|
@ -10439,6 +10449,7 @@
|
||||||
"version": "7.8.1",
|
"version": "7.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
|
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
|
||||||
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
|
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tslib": "^2.1.0"
|
"tslib": "^2.1.0"
|
||||||
}
|
}
|
||||||
|
|
@ -11266,6 +11277,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
|
||||||
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "^3.1.3",
|
||||||
"fast-uri": "^3.0.1",
|
"fast-uri": "^3.0.1",
|
||||||
|
|
@ -11555,7 +11567,8 @@
|
||||||
"version": "10.9.2",
|
"version": "10.9.2",
|
||||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
|
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
|
||||||
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
|
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cspotcode/source-map-support": "^0.8.0",
|
"@cspotcode/source-map-support": "^0.8.0",
|
||||||
"@tsconfig/node10": "^1.0.7",
|
"@tsconfig/node10": "^1.0.7",
|
||||||
|
|
@ -11720,6 +11733,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.28.tgz",
|
"resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.28.tgz",
|
||||||
"integrity": "sha512-6GH7wXhtfq2D33ZuRXYwIsl/qM5685WZcODZb7noOOcRMteM9KF2x2ap3H0EBjnSV0VO4gNAfJT5Ukp0PkOlvg==",
|
"integrity": "sha512-6GH7wXhtfq2D33ZuRXYwIsl/qM5685WZcODZb7noOOcRMteM9KF2x2ap3H0EBjnSV0VO4gNAfJT5Ukp0PkOlvg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sqltools/formatter": "^1.2.5",
|
"@sqltools/formatter": "^1.2.5",
|
||||||
"ansis": "^4.2.0",
|
"ansis": "^4.2.0",
|
||||||
|
|
@ -11935,7 +11949,8 @@
|
||||||
"version": "5.7.3",
|
"version": "5.7.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
|
||||||
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
|
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
|
|
@ -12111,7 +12126,7 @@
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
|
||||||
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
|
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
|
||||||
"dev": true
|
"devOptional": true
|
||||||
},
|
},
|
||||||
"node_modules/v8-to-istanbul": {
|
"node_modules/v8-to-istanbul": {
|
||||||
"version": "9.1.0",
|
"version": "9.1.0",
|
||||||
|
|
@ -12184,6 +12199,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz",
|
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz",
|
||||||
"integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==",
|
"integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/eslint-scope": "^3.7.7",
|
"@types/eslint-scope": "^3.7.7",
|
||||||
"@types/estree": "^1.0.6",
|
"@types/estree": "^1.0.6",
|
||||||
|
|
@ -12466,7 +12482,7 @@
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,13 @@ import { Module } from '@nestjs/common';
|
||||||
import { AppController } from './app.controller';
|
import { AppController } from './app.controller';
|
||||||
import { AppService } from './app.service';
|
import { AppService } from './app.service';
|
||||||
import { PrinterController } from './controller/printer.controller';
|
import { PrinterController } from './controller/printer.controller';
|
||||||
import { PedidoSevenController } from './controller/pedido-seven.controller';
|
|
||||||
import { PrinterService } from './services/printer.service';
|
import { PrinterService } from './services/printer.service';
|
||||||
import { PrinterProcessor } from './services/printer.processor';
|
import { PrinterProcessor } from './services/printer.processor';
|
||||||
import { InfrastructureModule } from './infrastructure/infrastructure.module';
|
import { InfrastructureModule } from './infrastructure/infrastructure.module';
|
||||||
import { PedidoSevenService } from './services/pedido-seven.service';
|
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [InfrastructureModule],
|
imports: [InfrastructureModule],
|
||||||
controllers: [AppController, PrinterController, PedidoSevenController],
|
controllers: [AppController, PrinterController],
|
||||||
providers: [AppService, PrinterService, PrinterProcessor, PedidoSevenService],
|
providers: [AppService, PrinterService, PrinterProcessor],
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule {}
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ export function createTypeOrmOptions(
|
||||||
): TypeOrmModuleOptions {
|
): TypeOrmModuleOptions {
|
||||||
const baseOptions: DataSourceOptions = {
|
const baseOptions: DataSourceOptions = {
|
||||||
type: 'oracle',
|
type: 'oracle',
|
||||||
username: configService.get<string>('DB_USERNAME') || 'SEVEN',
|
username: configService.get<string>('DB_USERNAME') || 'teste',
|
||||||
password: configService.get<string>('DB_PASSWORD') || 'USR54SEV',
|
password: configService.get<string>('DB_PASSWORD') || 'teste',
|
||||||
connectString:
|
connectString:
|
||||||
configService.get<string>('DB_CONNECT_STRING') ||
|
configService.get<string>('DB_CONNECT_STRING') ||
|
||||||
'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.1.241)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=WINT)))',
|
'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.1.241)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=BDTESTE)))',
|
||||||
synchronize: false,
|
synchronize: false,
|
||||||
logging: true,
|
logging: true,
|
||||||
entities: [__dirname + '/../**/*.{entity,view}.{js,ts}'],
|
entities: [__dirname + '/../**/*.{entity,view}.{js,ts}'],
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
import { Controller, Get, Param, ParseIntPipe } from '@nestjs/common';
|
|
||||||
import {
|
|
||||||
ApiNotFoundResponse,
|
|
||||||
ApiOkResponse,
|
|
||||||
ApiOperation,
|
|
||||||
ApiParam,
|
|
||||||
ApiServiceUnavailableResponse,
|
|
||||||
ApiTags,
|
|
||||||
} from '@nestjs/swagger';
|
|
||||||
import { PedidoSevenService } from '../services/pedido-seven.service';
|
|
||||||
import { PedidoCondVenda7RowDto } from '../dto/pedido-condvenda7-row.dto';
|
|
||||||
|
|
||||||
@ApiTags('Pedidos')
|
|
||||||
@Controller('pedidos')
|
|
||||||
export class PedidoSevenController {
|
|
||||||
constructor(private readonly pedidoSevenService: PedidoSevenService) {}
|
|
||||||
|
|
||||||
@Get('condvenda-7/:numped7')
|
|
||||||
@ApiOperation({
|
|
||||||
summary: 'Consulta pedido (CONDVENDA=7) por NUMPEDENTFUT',
|
|
||||||
})
|
|
||||||
@ApiParam({
|
|
||||||
name: 'numped7',
|
|
||||||
example: 123456,
|
|
||||||
description: 'Valor para PCPEDC.NUMPEDENTFUT',
|
|
||||||
})
|
|
||||||
@ApiOkResponse({
|
|
||||||
description: 'Linhas retornadas pela consulta (pedido x itens)',
|
|
||||||
type: [PedidoCondVenda7RowDto],
|
|
||||||
})
|
|
||||||
@ApiNotFoundResponse({
|
|
||||||
description: 'Pedido nao encontrado para o NUMPEDENTFUT informado',
|
|
||||||
})
|
|
||||||
@ApiServiceUnavailableResponse({
|
|
||||||
description: 'Banco de dados indisponivel (DataSource nao inicializado)',
|
|
||||||
})
|
|
||||||
async consultar(@Param('numped7', ParseIntPipe) numped7: number) {
|
|
||||||
return this.pedidoSevenService.consultarPorNumped7(numped7);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -7,22 +7,12 @@ import {
|
||||||
HttpStatus,
|
HttpStatus,
|
||||||
Param,
|
Param,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import {
|
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
|
||||||
ApiBody,
|
|
||||||
ApiNotFoundResponse,
|
|
||||||
ApiOkResponse,
|
|
||||||
ApiOperation,
|
|
||||||
ApiParam,
|
|
||||||
ApiTags,
|
|
||||||
} from '@nestjs/swagger';
|
|
||||||
import { PrinterService } from '../services/printer.service';
|
import { PrinterService } from '../services/printer.service';
|
||||||
import { PrintDataDto } from '../dto/print-data.dto';
|
import { PrintDataDto } from '../dto/print-data.dto';
|
||||||
import { PrintHtmlDto } from '../dto/print-html.dto';
|
import { PrintHtmlDto } from '../dto/print-html.dto';
|
||||||
import { PrinterDto } from '../dto/printer.dto';
|
import { PrinterDto } from '../dto/printer.dto';
|
||||||
import { getPrinters } from '../services/get-printer';
|
import { getPrinters } from '../services/get-printer';
|
||||||
import { PrintResultDto } from '../dto/print-result.dto';
|
|
||||||
import { PrintHtmlResultDto } from '../dto/print-html-result.dto';
|
|
||||||
import { PrintJobStatusDto } from '../dto/print-job-status.dto';
|
|
||||||
|
|
||||||
@ApiTags('Printer')
|
@ApiTags('Printer')
|
||||||
@Controller('printer')
|
@Controller('printer')
|
||||||
|
|
@ -34,15 +24,7 @@ export class PrinterController {
|
||||||
@ApiOperation({
|
@ApiOperation({
|
||||||
summary: 'Envia um comando de impressão de texto simples (ESC/POS)',
|
summary: 'Envia um comando de impressão de texto simples (ESC/POS)',
|
||||||
})
|
})
|
||||||
@ApiParam({
|
@ApiResponse({ status: 200, description: 'Impressão enviada com sucesso' })
|
||||||
name: 'printerName',
|
|
||||||
example: 'POS-80',
|
|
||||||
description: 'Nome da impressora (será usado como printerInterface)',
|
|
||||||
})
|
|
||||||
@ApiOkResponse({
|
|
||||||
description: 'Impressão enviada com sucesso',
|
|
||||||
type: PrintResultDto,
|
|
||||||
})
|
|
||||||
async print(
|
async print(
|
||||||
@Param('printerName') printerName: string,
|
@Param('printerName') printerName: string,
|
||||||
@Body() printData: PrintDataDto,
|
@Body() printData: PrintDataDto,
|
||||||
|
|
@ -54,15 +36,6 @@ export class PrinterController {
|
||||||
@Post('print')
|
@Post('print')
|
||||||
@HttpCode(HttpStatus.OK)
|
@HttpCode(HttpStatus.OK)
|
||||||
@ApiOperation({ summary: 'Envia um comando de impressão (Compatibilidade)' })
|
@ApiOperation({ summary: 'Envia um comando de impressão (Compatibilidade)' })
|
||||||
@ApiBody({
|
|
||||||
type: PrintDataDto,
|
|
||||||
description:
|
|
||||||
'Compatibilidade: informe printerInterface no body ou use /printer/:printerName/print.',
|
|
||||||
})
|
|
||||||
@ApiOkResponse({
|
|
||||||
description: 'Impressão enviada com sucesso',
|
|
||||||
type: PrintResultDto,
|
|
||||||
})
|
|
||||||
async printLegacy(@Body() printData: PrintDataDto) {
|
async printLegacy(@Body() printData: PrintDataDto) {
|
||||||
return this.printerService.printReceipt(printData);
|
return this.printerService.printReceipt(printData);
|
||||||
}
|
}
|
||||||
|
|
@ -73,15 +46,7 @@ export class PrinterController {
|
||||||
summary:
|
summary:
|
||||||
'Converte HTML para PDF e imprime na impressora especificada na URL',
|
'Converte HTML para PDF e imprime na impressora especificada na URL',
|
||||||
})
|
})
|
||||||
@ApiParam({
|
@ApiResponse({ status: 200, description: 'HTML enviado para impressão' })
|
||||||
name: 'printerName',
|
|
||||||
example: 'POS-80',
|
|
||||||
description: 'Nome da impressora para o spooler (pdf-to-printer)',
|
|
||||||
})
|
|
||||||
@ApiOkResponse({
|
|
||||||
description: 'HTML enviado para impressão (job enfileirado)',
|
|
||||||
type: PrintHtmlResultDto,
|
|
||||||
})
|
|
||||||
async printHtml(
|
async printHtml(
|
||||||
@Param('printerName') printerName: string,
|
@Param('printerName') printerName: string,
|
||||||
@Body() printHtmlDto: PrintHtmlDto,
|
@Body() printHtmlDto: PrintHtmlDto,
|
||||||
|
|
@ -93,44 +58,18 @@ export class PrinterController {
|
||||||
@Post('print-html')
|
@Post('print-html')
|
||||||
@HttpCode(HttpStatus.OK)
|
@HttpCode(HttpStatus.OK)
|
||||||
@ApiOperation({ summary: 'Converte HTML para PDF (Compatibilidade)' })
|
@ApiOperation({ summary: 'Converte HTML para PDF (Compatibilidade)' })
|
||||||
@ApiBody({
|
|
||||||
type: PrintHtmlDto,
|
|
||||||
description:
|
|
||||||
'Compatibilidade: informe printerName no body ou use /printer/:printerName/print-html.',
|
|
||||||
})
|
|
||||||
@ApiOkResponse({
|
|
||||||
description: 'HTML enviado para impressão (job enfileirado)',
|
|
||||||
type: PrintHtmlResultDto,
|
|
||||||
})
|
|
||||||
async printHtmlLegacy(@Body() printHtmlDto: PrintHtmlDto) {
|
async printHtmlLegacy(@Body() printHtmlDto: PrintHtmlDto) {
|
||||||
return this.printerService.printHtml(printHtmlDto);
|
return this.printerService.printHtml(printHtmlDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('list')
|
@Get('list')
|
||||||
@ApiOperation({ summary: 'Lista impressoras disponíveis no sistema' })
|
@ApiOperation({ summary: 'Lista impressoras disponíveis no sistema' })
|
||||||
@ApiOkResponse({
|
@ApiResponse({
|
||||||
|
status: 200,
|
||||||
description: 'Lista de impressoras encontradas',
|
description: 'Lista de impressoras encontradas',
|
||||||
type: [PrinterDto],
|
type: [PrinterDto],
|
||||||
})
|
})
|
||||||
async listPrinters() {
|
async listPrinters() {
|
||||||
return getPrinters();
|
return getPrinters();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('jobs/:jobId')
|
|
||||||
@ApiOperation({ summary: 'Consulta o status de um job de impressão' })
|
|
||||||
@ApiParam({
|
|
||||||
name: 'jobId',
|
|
||||||
example: '123',
|
|
||||||
description: 'ID do job enfileirado (BullMQ job id)',
|
|
||||||
})
|
|
||||||
@ApiOkResponse({
|
|
||||||
description: 'Status atual do job',
|
|
||||||
type: PrintJobStatusDto,
|
|
||||||
})
|
|
||||||
@ApiNotFoundResponse({
|
|
||||||
description: 'Job não encontrado',
|
|
||||||
})
|
|
||||||
async getJobStatus(@Param('jobId') jobId: string) {
|
|
||||||
return this.printerService.getPrintJobStatus(jobId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
|
||||||
|
|
||||||
export class PedidoCondVenda7RowDto {
|
|
||||||
@ApiProperty({ example: 123456 })
|
|
||||||
numped!: number;
|
|
||||||
|
|
||||||
@ApiProperty({ example: '12345678000199' })
|
|
||||||
cgc!: string;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'MINHA EMPRESA LTDA' })
|
|
||||||
razaosocial!: string;
|
|
||||||
|
|
||||||
@ApiProperty({ description: 'SYSDATE', type: String, format: 'date-time' })
|
|
||||||
dtemissao!: Date;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 1 })
|
|
||||||
codfilial!: number;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'FILIAL CENTRO' })
|
|
||||||
filialvenda!: string;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 2 })
|
|
||||||
codfilialretira!: number;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'FILIAL RETIRA' })
|
|
||||||
filialretira!: string;
|
|
||||||
|
|
||||||
@ApiProperty({ type: String, format: 'date-time' })
|
|
||||||
data!: Date;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 999 })
|
|
||||||
numcar!: number;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 123 })
|
|
||||||
codcli!: number;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'CLIENTE TESTE' })
|
|
||||||
cliente!: string;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 10 })
|
|
||||||
codusur!: number;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'VENDEDOR' })
|
|
||||||
vendedor!: string;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 25.5 })
|
|
||||||
vlfrete!: number;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 199.9 })
|
|
||||||
valor!: number;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'ENTREGA' })
|
|
||||||
tipoentrega!: string;
|
|
||||||
|
|
||||||
@ApiProperty({
|
|
||||||
type: String,
|
|
||||||
format: 'date-time',
|
|
||||||
required: false,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
dtentrega!: Date | null;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 98765 })
|
|
||||||
codprod!: number;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'PRODUTO X' })
|
|
||||||
descricao!: string;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 2 })
|
|
||||||
qt!: number;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'e10adc3949ba59abbe56e057f20f883e' })
|
|
||||||
hash!: string;
|
|
||||||
}
|
|
||||||
|
|
@ -2,12 +2,8 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||||
|
|
||||||
export class PrintDataDto {
|
export class PrintDataDto {
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
example: [
|
example: ['--------------------------------', ' TESTE DE IMPRESSAO ', '--------------------------------'],
|
||||||
'--------------------------------',
|
description: 'Lista de linhas de texto para imprimir'
|
||||||
' TESTE DE IMPRESSAO ',
|
|
||||||
'--------------------------------',
|
|
||||||
],
|
|
||||||
description: 'Lista de linhas de texto para imprimir',
|
|
||||||
})
|
})
|
||||||
lines: string[];
|
lines: string[];
|
||||||
|
|
||||||
|
|
@ -15,22 +11,21 @@ export class PrintDataDto {
|
||||||
required: false,
|
required: false,
|
||||||
enum: ['left', 'center', 'right'],
|
enum: ['left', 'center', 'right'],
|
||||||
example: 'center',
|
example: 'center',
|
||||||
description: 'Alinhamento do texto',
|
description: 'Alinhamento do texto'
|
||||||
})
|
})
|
||||||
alignment?: 'left' | 'center' | 'right';
|
alignment?: 'left' | 'center' | 'right';
|
||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
required: false,
|
required: false,
|
||||||
example: false,
|
example: false,
|
||||||
description: 'Se verdadeiro, imprime de cabeça para baixo (se suportado)',
|
description: 'Se verdadeiro, imprime de cabeça para baixo (se suportado)'
|
||||||
})
|
})
|
||||||
upsideDown?: boolean;
|
upsideDown?: boolean;
|
||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
required: false,
|
required: false,
|
||||||
example: 'tcp://10.1.119.13',
|
example: 'tcp://10.1.119.13',
|
||||||
description:
|
description: 'Interface da impressora. Ex: tcp://ip:porta ou printer:NomeDaImpressora'
|
||||||
'Interface da impressora. Obrigatorio ao usar /printer/print; ignorado ao usar /printer/:printerName/print. Ex: tcp://ip:porta ou printer:NomeDaImpressora',
|
|
||||||
})
|
})
|
||||||
printerInterface?: string;
|
printerInterface?: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
|
||||||
import { PrintResultDto } from './print-result.dto';
|
|
||||||
|
|
||||||
export class PrintHtmlResultDto extends PrintResultDto {
|
|
||||||
@ApiProperty({
|
|
||||||
required: false,
|
|
||||||
example: '123',
|
|
||||||
description: 'ID do job enfileirado no BullMQ',
|
|
||||||
})
|
|
||||||
jobId?: string;
|
|
||||||
}
|
|
||||||
|
|
@ -3,36 +3,26 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||||
export class PrintHtmlDto {
|
export class PrintHtmlDto {
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
example: '<h1>Titulo</h1><p>Conteudo do pedido...</p>',
|
example: '<h1>Titulo</h1><p>Conteudo do pedido...</p>',
|
||||||
description: 'Conteúdo HTML para impressão',
|
description: 'Conteúdo HTML para impressão'
|
||||||
})
|
})
|
||||||
html: string;
|
html: string;
|
||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
example: 'POS-80',
|
example: 'POS-80',
|
||||||
required: false,
|
description: 'Nome da impressora onde será impresso o PDF gerado'
|
||||||
description:
|
|
||||||
'Nome da impressora. Obrigatorio ao usar /printer/print-html; ignorado ao usar /printer/:printerName/print-html.',
|
|
||||||
})
|
})
|
||||||
printerName?: string;
|
printerName: string;
|
||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({ example: '60mm', required: false, description: 'Largura da etiqueta (default: 80mm)' })
|
||||||
example: '60mm',
|
|
||||||
required: false,
|
|
||||||
description: 'Largura da etiqueta (default: 80mm)',
|
|
||||||
})
|
|
||||||
width?: string;
|
width?: string;
|
||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({ example: '40mm', required: false, description: 'Altura da etiqueta (default: auto)' })
|
||||||
example: '40mm',
|
|
||||||
required: false,
|
|
||||||
description: 'Altura da etiqueta (default: auto)',
|
|
||||||
})
|
|
||||||
height?: string;
|
height?: string;
|
||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
example: 'impresso-12345',
|
example: 'impresso-12345',
|
||||||
required: false,
|
required: false,
|
||||||
description: 'ID único do job para idempotência (evita duplicados)',
|
description: 'ID único do job para idempotência (evita duplicados)'
|
||||||
})
|
})
|
||||||
jobId?: string;
|
jobId?: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
|
||||||
|
|
||||||
export class PrintJobStatusDto {
|
|
||||||
@ApiProperty({ example: '123' })
|
|
||||||
jobId: string;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'print-html-job' })
|
|
||||||
name: string;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'completed' })
|
|
||||||
state: string;
|
|
||||||
|
|
||||||
@ApiProperty({ required: false, example: 'POS-80' })
|
|
||||||
printerName?: string;
|
|
||||||
|
|
||||||
@ApiProperty({ required: false, example: 0 })
|
|
||||||
attemptsMade?: number;
|
|
||||||
|
|
||||||
@ApiProperty({ required: false, example: 1738200000000 })
|
|
||||||
timestamp?: number;
|
|
||||||
|
|
||||||
@ApiProperty({ required: false, example: 1738200000100 })
|
|
||||||
processedOn?: number;
|
|
||||||
|
|
||||||
@ApiProperty({ required: false, example: 1738200000500 })
|
|
||||||
finishedOn?: number;
|
|
||||||
|
|
||||||
@ApiProperty({ required: false, example: 'Some error message' })
|
|
||||||
failedReason?: string;
|
|
||||||
|
|
||||||
@ApiProperty({ required: false })
|
|
||||||
result?: unknown;
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
|
||||||
|
|
||||||
export class PrintResultDto {
|
|
||||||
@ApiProperty({ example: true })
|
|
||||||
success: boolean;
|
|
||||||
|
|
||||||
@ApiProperty({ example: 'Print successful!' })
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +1,18 @@
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
|
|
||||||
export class PrinterDto {
|
export class PrinterDto {
|
||||||
@ApiProperty({
|
@ApiProperty({ example: 'POS-80', description: 'Nome da impressora' })
|
||||||
example: 'POS-80',
|
name: string;
|
||||||
description: 'Nome da impressora (retornado pelo PowerShell: Get-Printer)',
|
|
||||||
})
|
|
||||||
Name: string;
|
|
||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({ example: 'USB001', description: 'Porta da impressora (Win32)' })
|
||||||
example: 'Generic / Text Only',
|
portName?: string;
|
||||||
required: false,
|
|
||||||
description: 'Nome do driver (retornado pelo PowerShell: Get-Printer)',
|
|
||||||
})
|
|
||||||
DriverName?: string;
|
|
||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({ example: 'Generic / Text Only', description: 'Nome do driver' })
|
||||||
example: 0,
|
driverName?: string;
|
||||||
required: false,
|
|
||||||
description:
|
@ApiProperty({ example: 0, description: 'Status da impressora (0 = Idle)' })
|
||||||
'Status da impressora (retornado pelo PowerShell: Get-Printer)',
|
printerStatus?: number;
|
||||||
})
|
|
||||||
PrinterStatus?: number;
|
@ApiProperty({ example: 'POS-80', description: 'ID do dispositivo (usado para impressão)' })
|
||||||
|
deviceId?: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,9 @@ async function bootstrap() {
|
||||||
app.use(urlencoded({ extended: true, limit: bodyLimit }));
|
app.use(urlencoded({ extended: true, limit: bodyLimit }));
|
||||||
|
|
||||||
const config = new DocumentBuilder()
|
const config = new DocumentBuilder()
|
||||||
.setTitle('Servico de Impressao')
|
.setTitle('API Documentation')
|
||||||
.setDescription(
|
.setDescription('The API description')
|
||||||
'Microservico NestJS para impressao local (ESC/POS e HTML->PDF), com processamento assincrono via BullMQ/Redis e opcional integracao Oracle via TypeORM.',
|
.setVersion('1.0')
|
||||||
)
|
|
||||||
.setVersion('1.0.0')
|
|
||||||
.build();
|
.build();
|
||||||
const document = SwaggerModule.createDocument(app, config);
|
const document = SwaggerModule.createDocument(app, config);
|
||||||
SwaggerModule.setup('api', app, document);
|
SwaggerModule.setup('api', app, document);
|
||||||
|
|
|
||||||
|
|
@ -1,224 +0,0 @@
|
||||||
import {
|
|
||||||
Injectable,
|
|
||||||
InternalServerErrorException,
|
|
||||||
NotFoundException,
|
|
||||||
Optional,
|
|
||||||
ServiceUnavailableException,
|
|
||||||
} from '@nestjs/common';
|
|
||||||
import { DataSource } from 'typeorm';
|
|
||||||
import { PedidoCondVenda7RowDto } from '../dto/pedido-condvenda7-row.dto';
|
|
||||||
|
|
||||||
@Injectable()
|
|
||||||
export class PedidoSevenService {
|
|
||||||
constructor(@Optional() private readonly dataSource?: DataSource) {}
|
|
||||||
|
|
||||||
private static toNumber(value: unknown, field: string): number {
|
|
||||||
if (typeof value === 'number' && Number.isFinite(value)) return value;
|
|
||||||
if (typeof value === 'string' && value.trim() !== '') {
|
|
||||||
const n = Number(value);
|
|
||||||
if (Number.isFinite(n)) return n;
|
|
||||||
}
|
|
||||||
throw new InternalServerErrorException(`Campo ${field} invalido`);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static asString(value: unknown, field: string): string {
|
|
||||||
if (typeof value === 'string') return value;
|
|
||||||
if (value == null) return '';
|
|
||||||
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
||||||
return String(value);
|
|
||||||
}
|
|
||||||
throw new InternalServerErrorException(`Campo ${field} invalido`);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static toDate(value: unknown, field: string): Date {
|
|
||||||
if (value instanceof Date && !Number.isNaN(value.getTime())) return value;
|
|
||||||
if (typeof value === 'string' || typeof value === 'number') {
|
|
||||||
const d = new Date(value);
|
|
||||||
if (!Number.isNaN(d.getTime())) return d;
|
|
||||||
}
|
|
||||||
throw new InternalServerErrorException(`Campo ${field} invalido`);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static toNullableNumber(value: unknown): number {
|
|
||||||
if (value == null) return 0;
|
|
||||||
if (typeof value === 'number' && Number.isFinite(value)) return value;
|
|
||||||
if (typeof value === 'string' && value.trim() !== '') {
|
|
||||||
const n = Number(value);
|
|
||||||
if (Number.isFinite(n)) return n;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static toNullableDate(value: unknown): Date | null {
|
|
||||||
if (value == null) return null;
|
|
||||||
if (value instanceof Date && !Number.isNaN(value.getTime())) return value;
|
|
||||||
if (typeof value === 'string' || typeof value === 'number') {
|
|
||||||
const d = new Date(value);
|
|
||||||
if (!Number.isNaN(d.getTime())) return d;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static pick(row: Record<string, unknown>, key: string): unknown {
|
|
||||||
return (
|
|
||||||
row[key] ??
|
|
||||||
row[key.toUpperCase()] ??
|
|
||||||
row[key.toLowerCase()] ??
|
|
||||||
row[key.replace(/_/g, '')] ??
|
|
||||||
row[key.toUpperCase().replace(/_/g, '')]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static mapRow(row: Record<string, unknown>): PedidoCondVenda7RowDto {
|
|
||||||
const dto = new PedidoCondVenda7RowDto();
|
|
||||||
|
|
||||||
dto.numped = this.toNumber(this.pick(row, 'NUMPED'), 'NUMPED');
|
|
||||||
dto.cgc = this.asString(this.pick(row, 'CGC'), 'CGC');
|
|
||||||
dto.razaosocial = this.asString(
|
|
||||||
this.pick(row, 'RAZAOSOCIAL'),
|
|
||||||
'RAZAOSOCIAL',
|
|
||||||
);
|
|
||||||
dto.dtemissao = this.toDate(this.pick(row, 'DTEMISSAO'), 'DTEMISSAO');
|
|
||||||
|
|
||||||
dto.codfilial = this.toNumber(this.pick(row, 'CODFILIAL'), 'CODFILIAL');
|
|
||||||
dto.filialvenda = this.asString(
|
|
||||||
this.pick(row, 'FILIALVENDA'),
|
|
||||||
'FILIALVENDA',
|
|
||||||
);
|
|
||||||
|
|
||||||
dto.codfilialretira = this.toNumber(
|
|
||||||
this.pick(row, 'CODFILIALRETIRA'),
|
|
||||||
'CODFILIALRETIRA',
|
|
||||||
);
|
|
||||||
dto.filialretira = this.asString(
|
|
||||||
this.pick(row, 'FILIALRETIRA'),
|
|
||||||
'FILIALRETIRA',
|
|
||||||
);
|
|
||||||
|
|
||||||
dto.data = this.toDate(this.pick(row, 'DATA'), 'DATA');
|
|
||||||
dto.numcar = this.toNumber(this.pick(row, 'NUMCAR'), 'NUMCAR');
|
|
||||||
dto.codcli = this.toNumber(this.pick(row, 'CODCLI'), 'CODCLI');
|
|
||||||
dto.cliente = this.asString(this.pick(row, 'CLIENTE'), 'CLIENTE');
|
|
||||||
dto.codusur = this.toNumber(this.pick(row, 'CODUSUR'), 'CODUSUR');
|
|
||||||
dto.vendedor = this.asString(this.pick(row, 'VENDEDOR'), 'VENDEDOR');
|
|
||||||
dto.vlfrete = this.toNumber(this.pick(row, 'VLFRETE'), 'VLFRETE');
|
|
||||||
dto.valor = this.toNullableNumber(this.pick(row, 'VALOR'));
|
|
||||||
dto.tipoentrega = this.asString(
|
|
||||||
this.pick(row, 'TIPOENTREGA'),
|
|
||||||
'TIPOENTREGA',
|
|
||||||
);
|
|
||||||
dto.dtentrega = this.toNullableDate(this.pick(row, 'DTENTREGA'));
|
|
||||||
dto.codprod = this.toNumber(this.pick(row, 'CODPROD'), 'CODPROD');
|
|
||||||
dto.descricao = this.asString(this.pick(row, 'DESCRICAO'), 'DESCRICAO');
|
|
||||||
dto.qt = this.toNumber(this.pick(row, 'QT'), 'QT');
|
|
||||||
dto.hash = this.asString(this.pick(row, 'HASH'), 'HASH');
|
|
||||||
|
|
||||||
return dto;
|
|
||||||
}
|
|
||||||
|
|
||||||
async consultarPorNumped7(
|
|
||||||
numped7: number,
|
|
||||||
): Promise<PedidoCondVenda7RowDto[]> {
|
|
||||||
if (!this.dataSource) {
|
|
||||||
throw new ServiceUnavailableException('DataSource nao disponivel');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.dataSource.isInitialized) {
|
|
||||||
throw new ServiceUnavailableException(
|
|
||||||
'Banco de dados indisponivel (DataSource nao inicializado)',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const sql = `
|
|
||||||
SELECT
|
|
||||||
PCPEDC.NUMPED,
|
|
||||||
PCFILIAL.CGC,
|
|
||||||
PCFILIAL.RAZAOSOCIAL,
|
|
||||||
SYSDATE DTEMISSAO,
|
|
||||||
PCPEDC.CODFILIAL,
|
|
||||||
PCFILIAL.FANTASIA FILIALVENDA,
|
|
||||||
PCPEDI.CODFILIALRETIRA,
|
|
||||||
RETIRA.FANTASIA FILIALRETIRA,
|
|
||||||
PCPEDC.DATA,
|
|
||||||
PCPEDC.NUMCAR,
|
|
||||||
PCPEDC.CODCLI,
|
|
||||||
PCCLIENT.CLIENTE CLIENTE,
|
|
||||||
PCNFSAID.CODUSUR,
|
|
||||||
PCUSUARI.NOME VENDEDOR,
|
|
||||||
PCPEDC.VLFRETE,
|
|
||||||
CASE
|
|
||||||
WHEN ROW_NUMBER() OVER (
|
|
||||||
PARTITION BY PCPEDC.NUMPEDENTFUT
|
|
||||||
ORDER BY PCPEDC.NUMPED, PCPEDI.ROWID
|
|
||||||
) = 1
|
|
||||||
THEN CASE
|
|
||||||
WHEN NVL(PCNFSAID.VLTOTGER, 0) = 0 THEN PCNFSAID.VLTOTAL
|
|
||||||
ELSE PCNFSAID.VLTOTGER
|
|
||||||
END
|
|
||||||
ELSE NULL
|
|
||||||
END VALOR,
|
|
||||||
DECODE(
|
|
||||||
PCPEDI.TIPOENTREGA,
|
|
||||||
'EN', 'ENTREGA',
|
|
||||||
'EF', 'ENCOMENDA',
|
|
||||||
'RP', 'RETIRA POSTERIOR',
|
|
||||||
'RI', 'RETIRA IMEDIATA',
|
|
||||||
'RETIRA IMEDIATA'
|
|
||||||
) TIPOENTREGA,
|
|
||||||
PCPEDC.DTENTREGA,
|
|
||||||
PCPEDI.CODPROD,
|
|
||||||
PCPRODUT.DESCRICAO,
|
|
||||||
PCPEDI.QT,
|
|
||||||
MD5(PCNFSAID.NUMPED || '@Juru2025$') HASH
|
|
||||||
FROM
|
|
||||||
PCPEDC,
|
|
||||||
PCPEDI,
|
|
||||||
PCNFSAID,
|
|
||||||
PCCLIENT,
|
|
||||||
PCUSUARI,
|
|
||||||
PCPRODUT,
|
|
||||||
PCFILIAL,
|
|
||||||
PCFILIAL RETIRA
|
|
||||||
WHERE
|
|
||||||
PCNFSAID.NUMPED = PCPEDC.NUMPEDENTFUT
|
|
||||||
AND PCPEDC.CODFILIAL = PCFILIAL.CODIGO
|
|
||||||
AND PCPEDI.CODFILIALRETIRA = RETIRA.CODIGO
|
|
||||||
AND PCPEDI.CODPROD = PCPRODUT.CODPROD
|
|
||||||
AND PCPEDC.CODCLI = PCCLIENT.CODCLI
|
|
||||||
AND PCNFSAID.CODUSUR = PCUSUARI.CODUSUR
|
|
||||||
AND PCPEDC.NUMPED = PCPEDI.NUMPED
|
|
||||||
AND PCNFSAID.DTCANCEL IS NULL
|
|
||||||
AND PCNFSAID.CONDVENDA = 7
|
|
||||||
AND PCPEDC.NUMPEDENTFUT = :1
|
|
||||||
ORDER BY
|
|
||||||
PCPEDC.NUMPED,
|
|
||||||
PCPEDI.CODPROD
|
|
||||||
`;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const rows = (await this.dataSource.query(sql, [numped7])) as unknown;
|
|
||||||
if (!Array.isArray(rows)) {
|
|
||||||
throw new InternalServerErrorException('Resposta invalida do banco');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rows.length === 0) {
|
|
||||||
throw new NotFoundException(
|
|
||||||
`Pedido nao encontrado para NUMPEDENTFUT=${numped7}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return rows.map((r) => {
|
|
||||||
if (r && typeof r === 'object' && !Array.isArray(r)) {
|
|
||||||
return PedidoSevenService.mapRow(r as Record<string, unknown>);
|
|
||||||
}
|
|
||||||
throw new InternalServerErrorException(
|
|
||||||
'Linha invalida retornada pelo banco',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
throw new InternalServerErrorException(
|
|
||||||
`Erro ao executar a consulta: ${err instanceof Error ? err.message : String(err)}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
import { Injectable, NotFoundException } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { InjectQueue } from '@nestjs/bullmq';
|
import { InjectQueue } from '@nestjs/bullmq';
|
||||||
import { Queue } from 'bullmq';
|
import { Queue } from 'bullmq';
|
||||||
import { PrintDataDto } from '../dto/print-data.dto';
|
import { PrintDataDto } from '../dto/print-data.dto';
|
||||||
import { PrintHtmlDto } from '../dto/print-html.dto';
|
import { PrintHtmlDto } from '../dto/print-html.dto';
|
||||||
import { ThermalPrinter, PrinterTypes } from 'node-thermal-printer';
|
import { ThermalPrinter, PrinterTypes } from 'node-thermal-printer';
|
||||||
import { PrintJobStatusDto } from '../dto/print-job-status.dto';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PrinterService {
|
export class PrinterService {
|
||||||
|
|
@ -93,26 +92,4 @@ export class PrinterService {
|
||||||
jobId: job.id,
|
jobId: job.id,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPrintJobStatus(jobId: string): Promise<PrintJobStatusDto> {
|
|
||||||
const job = await this.printerQueue.getJob(jobId);
|
|
||||||
if (!job) {
|
|
||||||
throw new NotFoundException(`Job not found: ${jobId}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const state = await job.getState();
|
|
||||||
|
|
||||||
return {
|
|
||||||
jobId: String(job.id),
|
|
||||||
name: job.name,
|
|
||||||
state,
|
|
||||||
printerName: (job.data as any)?.printerName,
|
|
||||||
attemptsMade: job.attemptsMade,
|
|
||||||
timestamp: job.timestamp,
|
|
||||||
processedOn: job.processedOn,
|
|
||||||
finishedOn: job.finishedOn,
|
|
||||||
failedReason: job.failedReason || undefined,
|
|
||||||
result: job.returnvalue ?? undefined,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue