@cargolift-cdi/types 0.1.79 → 0.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { IntegrationStatus
|
|
1
|
+
import { IntegrationStatus } from "../enum/integration.enums.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Armazena
|
|
5
|
-
* além do ID de correlação para rastreamento.
|
|
3
|
+
* Mantém o histórico de chamadas de integração de entrada (inbound).
|
|
4
|
+
* Armazena o request e response para auditoria e troubleshooting.
|
|
6
5
|
*/
|
|
7
6
|
export declare class LogIntegrationOutbound {
|
|
8
7
|
id: string;
|
|
@@ -12,56 +11,45 @@ export declare class LogIntegrationOutbound {
|
|
|
12
11
|
event: string;
|
|
13
12
|
/** Ação (e.g., 'create', 'update', 'delete', etc) */
|
|
14
13
|
action: string;
|
|
14
|
+
/** Correlation Id */
|
|
15
15
|
correlationId: string;
|
|
16
|
-
/** Timestamp de início da requisição */
|
|
17
|
-
timestampStart
|
|
18
|
-
/** Timestamp do
|
|
19
|
-
|
|
16
|
+
/** Timestamp de início da requisição na API */
|
|
17
|
+
timestampStart?: Date | string;
|
|
18
|
+
/** Timestamp do início do processamento no ESB */
|
|
19
|
+
timestampProcess?: Date | null;
|
|
20
|
+
/** Timestamp final do processamento no ESB */
|
|
21
|
+
timestampEnd?: Date | null;
|
|
22
|
+
/** Duração total em milissegundos */
|
|
23
|
+
durationRequest?: number | null;
|
|
24
|
+
/** Duração do processamento em milissegundos no ESB */
|
|
25
|
+
durationProcessMs?: number | null;
|
|
20
26
|
/** Duração total em milissegundos */
|
|
21
27
|
durationMs?: number | null;
|
|
22
|
-
/**
|
|
23
|
-
durationLastMs?: number | null;
|
|
24
|
-
/** Status final da operação */
|
|
28
|
+
/** Status final do processamento */
|
|
25
29
|
status: IntegrationStatus;
|
|
30
|
+
/** Motivo do status (mensagem curta) */
|
|
26
31
|
statusReason?: string | null;
|
|
27
|
-
/** Transporte de saída: 'REST' | 'SOAP' | 'AMQP' | etc */
|
|
28
|
-
transportProtocol: TransportProtocol;
|
|
29
|
-
/** Método HTTP efetivamente disparado (GET/POST/PUT/...) */
|
|
30
|
-
httpMethod?: string | null;
|
|
31
|
-
/** Ação SOAP informada no envelope quando aplicável */
|
|
32
|
-
soapAction?: string | null;
|
|
33
|
-
/** URL final depois de aplicar templates, path params e query string */
|
|
34
|
-
url?: string | null;
|
|
35
|
-
/** Cabeçalhos enviados ao destino após sanitização */
|
|
36
|
-
requestHeaders?: Record<string, string> | null;
|
|
37
|
-
/** Query string resolvida (após merge com templates) */
|
|
38
|
-
requestQuery?: Record<string, unknown> | null;
|
|
39
|
-
/** Payload enviado na requisição */
|
|
40
|
-
requestPayload?: string | null;
|
|
41
|
-
/** Cabeçalhos recebidos da resposta */
|
|
42
|
-
responseHeaders?: Record<string, string> | null;
|
|
43
|
-
/** Payload recebido da resposta */
|
|
44
|
-
responsePayload?: string;
|
|
45
|
-
/** Código HTTP retornado pelo destino */
|
|
46
|
-
httpStatusCode: number;
|
|
47
32
|
/** Quantidade de tentativas realizadas até o sucesso ou falha definitiva */
|
|
48
33
|
retries?: number | null;
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
/**
|
|
34
|
+
/** Cabeçalhos enviados ao destino após sanitização */
|
|
35
|
+
headers?: string | null;
|
|
36
|
+
/** Envelope da requisição */
|
|
37
|
+
envelope?: string | null;
|
|
38
|
+
/** Corpo sanitizado da requisição sem o envelope */
|
|
39
|
+
payload?: string | null;
|
|
40
|
+
/** Payload transformado em formato canônico após aplicação da transformação JSONata */
|
|
41
|
+
transformedPayload?: string | null;
|
|
42
|
+
/** Payload após enriquecimento de regras do BRE */
|
|
43
|
+
enrichedPayload?: string | null;
|
|
44
|
+
/** Mensagem completa do erro */
|
|
52
45
|
errorMessage?: string | null;
|
|
53
|
-
/** Stack completo quando disponível (mantido para investigações
|
|
46
|
+
/** Stack completo quando disponível (mantido para investigações) */
|
|
54
47
|
errorStack?: string | null;
|
|
55
48
|
/** Classificação do erro para o mecanismo de DLQ/retry */
|
|
56
|
-
errorClassification?: '
|
|
49
|
+
errorClassification?: 'application' | 'business' | 'business_fatal' | 'application_fatal' | null;
|
|
57
50
|
/** Indica se este log veio de um replay manual ou DLQ */
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
metadata?: Record<string, any>;
|
|
61
|
-
/** Identificador do registro outbound associado */
|
|
62
|
-
outboundId: string;
|
|
63
|
-
/** Identificador do endpoint utilizado */
|
|
64
|
-
endpointId: string;
|
|
51
|
+
/** ID da tabela integration_inbound */
|
|
52
|
+
inboundId: string;
|
|
65
53
|
createdAt: Date;
|
|
66
54
|
updatedAt: Date;
|
|
67
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-integration-outbound.entity.d.ts","sourceRoot":"","sources":["../../src/entities/log-integration-outbound.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log-integration-outbound.entity.d.ts","sourceRoot":"","sources":["../../src/entities/log-integration-outbound.entity.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE;;;GAGG;AACH,qBAMa,sBAAsB;IAEjC,EAAE,EAAG,MAAM,CAAC;IAEZ,8CAA8C;IAE9C,MAAM,EAAG,MAAM,CAAC;IAEhB,0DAA0D;IAE1D,KAAK,EAAG,MAAM,CAAC;IAEf,qDAAqD;IAErD,MAAM,EAAG,MAAM,CAAC;IAEhB,qBAAqB;IAErB,aAAa,EAAG,MAAM,CAAC;IAEvB,+CAA+C;IAE/C,cAAc,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAE/B,kDAAkD;IAElD,gBAAgB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAE/B,8CAA8C;IAE9C,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAE3B,qCAAqC;IAErC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,uDAAuD;IAEvD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC,qCAAqC;IAErC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,oCAAoC;IAEpC,MAAM,EAAG,iBAAiB,CAAC;IAE3B,wCAAwC;IAExC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,4EAA4E;IAE5E,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,sDAAsD;IAEtD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,6BAA6B;IAE7B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,oDAAoD;IAEpD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,uFAAuF;IAEvF,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC,mDAAmD;IAEnD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,gCAAgC;IAEhC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,oEAAoE;IAEpE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,0DAA0D;IAE1D,mBAAmB,CAAC,EAAE,aAAa,GAAG,UAAU,GAAG,gBAAgB,GAAG,mBAAmB,GAAG,IAAI,CAAC;IAEjG,yDAAyD;IAIzD,uCAAuC;IAEvC,SAAS,EAAG,MAAM,CAAC;IAGnB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAClB"}
|
|
@@ -4,70 +4,60 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn } from
|
|
7
|
+
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn, } from "typeorm";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* Armazena
|
|
11
|
-
* além do ID de correlação para rastreamento.
|
|
9
|
+
* Mantém o histórico de chamadas de integração de entrada (inbound).
|
|
10
|
+
* Armazena o request e response para auditoria e troubleshooting.
|
|
12
11
|
*/
|
|
13
12
|
let LogIntegrationOutbound = class LogIntegrationOutbound {
|
|
14
|
-
id;
|
|
13
|
+
id; // manter string no TS para bigint seguro
|
|
15
14
|
/** Sistema de destino (e.g., 'erp', 'wms') */
|
|
16
15
|
system;
|
|
17
16
|
/** Evento (chave) (e.g., 'driver' or 'driver.created') */
|
|
18
17
|
event;
|
|
19
18
|
/** Ação (e.g., 'create', 'update', 'delete', etc) */
|
|
20
19
|
action;
|
|
20
|
+
/** Correlation Id */
|
|
21
21
|
correlationId;
|
|
22
|
-
/** Timestamp de início da requisição */
|
|
22
|
+
/** Timestamp de início da requisição na API */
|
|
23
23
|
timestampStart;
|
|
24
|
-
/** Timestamp do
|
|
25
|
-
|
|
24
|
+
/** Timestamp do início do processamento no ESB */
|
|
25
|
+
timestampProcess;
|
|
26
|
+
/** Timestamp final do processamento no ESB */
|
|
27
|
+
timestampEnd;
|
|
28
|
+
/** Duração total em milissegundos */
|
|
29
|
+
durationRequest;
|
|
30
|
+
/** Duração do processamento em milissegundos no ESB */
|
|
31
|
+
durationProcessMs;
|
|
26
32
|
/** Duração total em milissegundos */
|
|
27
33
|
durationMs;
|
|
28
|
-
/**
|
|
29
|
-
durationLastMs;
|
|
30
|
-
/** Status final da operação */
|
|
34
|
+
/** Status final do processamento */
|
|
31
35
|
status;
|
|
36
|
+
/** Motivo do status (mensagem curta) */
|
|
32
37
|
statusReason;
|
|
33
|
-
/** Transporte de saída: 'REST' | 'SOAP' | 'AMQP' | etc */
|
|
34
|
-
transportProtocol;
|
|
35
|
-
/** Método HTTP efetivamente disparado (GET/POST/PUT/...) */
|
|
36
|
-
httpMethod;
|
|
37
|
-
/** Ação SOAP informada no envelope quando aplicável */
|
|
38
|
-
soapAction;
|
|
39
|
-
/** URL final depois de aplicar templates, path params e query string */
|
|
40
|
-
url;
|
|
41
|
-
/** Cabeçalhos enviados ao destino após sanitização */
|
|
42
|
-
requestHeaders;
|
|
43
|
-
/** Query string resolvida (após merge com templates) */
|
|
44
|
-
requestQuery;
|
|
45
|
-
/** Payload enviado na requisição */
|
|
46
|
-
requestPayload;
|
|
47
|
-
/** Cabeçalhos recebidos da resposta */
|
|
48
|
-
responseHeaders;
|
|
49
|
-
/** Payload recebido da resposta */
|
|
50
|
-
responsePayload;
|
|
51
|
-
/** Código HTTP retornado pelo destino */
|
|
52
|
-
httpStatusCode;
|
|
53
38
|
/** Quantidade de tentativas realizadas até o sucesso ou falha definitiva */
|
|
54
39
|
retries;
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
/**
|
|
40
|
+
/** Cabeçalhos enviados ao destino após sanitização */
|
|
41
|
+
headers;
|
|
42
|
+
/** Envelope da requisição */
|
|
43
|
+
envelope;
|
|
44
|
+
/** Corpo sanitizado da requisição sem o envelope */
|
|
45
|
+
payload;
|
|
46
|
+
/** Payload transformado em formato canônico após aplicação da transformação JSONata */
|
|
47
|
+
transformedPayload;
|
|
48
|
+
/** Payload após enriquecimento de regras do BRE */
|
|
49
|
+
enrichedPayload;
|
|
50
|
+
/** Mensagem completa do erro */
|
|
58
51
|
errorMessage;
|
|
59
|
-
/** Stack completo quando disponível (mantido para investigações
|
|
52
|
+
/** Stack completo quando disponível (mantido para investigações) */
|
|
60
53
|
errorStack;
|
|
61
54
|
/** Classificação do erro para o mecanismo de DLQ/retry */
|
|
62
55
|
errorClassification;
|
|
63
56
|
/** Indica se este log veio de um replay manual ou DLQ */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
outboundId;
|
|
69
|
-
/** Identificador do endpoint utilizado */
|
|
70
|
-
endpointId;
|
|
57
|
+
// @Column({ type: 'boolean', default: false })
|
|
58
|
+
// wasReplayedFromDlq!: boolean;
|
|
59
|
+
/** ID da tabela integration_inbound */
|
|
60
|
+
inboundId; // manter string no TS para bigint seguro
|
|
71
61
|
createdAt;
|
|
72
62
|
updatedAt;
|
|
73
63
|
};
|
|
@@ -87,59 +77,47 @@ __decorate([
|
|
|
87
77
|
Column({ name: "correlation_id", type: "varchar", length: 36 })
|
|
88
78
|
], LogIntegrationOutbound.prototype, "correlationId", void 0);
|
|
89
79
|
__decorate([
|
|
90
|
-
Column({ name: "timestamp_start", type: "timestamptz" })
|
|
80
|
+
Column({ name: "timestamp_start", type: "timestamptz", nullable: true })
|
|
91
81
|
], LogIntegrationOutbound.prototype, "timestampStart", void 0);
|
|
92
82
|
__decorate([
|
|
93
|
-
Column({ name: "
|
|
94
|
-
], LogIntegrationOutbound.prototype, "
|
|
83
|
+
Column({ name: "timestamp_process", type: "timestamptz", nullable: true })
|
|
84
|
+
], LogIntegrationOutbound.prototype, "timestampProcess", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
Column({ name: "timestamp_end", type: "timestamptz", nullable: true })
|
|
87
|
+
], LogIntegrationOutbound.prototype, "timestampEnd", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
Column({ name: "duration_request_ms", type: "int", nullable: true })
|
|
90
|
+
], LogIntegrationOutbound.prototype, "durationRequest", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
Column({ name: "duration_process_ms", type: "int", nullable: true })
|
|
93
|
+
], LogIntegrationOutbound.prototype, "durationProcessMs", void 0);
|
|
95
94
|
__decorate([
|
|
96
95
|
Column({ name: "duration_ms", type: "int", nullable: true })
|
|
97
96
|
], LogIntegrationOutbound.prototype, "durationMs", void 0);
|
|
98
97
|
__decorate([
|
|
99
|
-
Column({
|
|
100
|
-
], LogIntegrationOutbound.prototype, "durationLastMs", void 0);
|
|
101
|
-
__decorate([
|
|
102
|
-
Column({ type: 'varchar', length: 10 })
|
|
98
|
+
Column({ type: 'varchar', length: 10, nullable: false })
|
|
103
99
|
], LogIntegrationOutbound.prototype, "status", void 0);
|
|
104
100
|
__decorate([
|
|
105
101
|
Column({ type: 'varchar', length: 255, nullable: true })
|
|
106
102
|
], LogIntegrationOutbound.prototype, "statusReason", void 0);
|
|
107
103
|
__decorate([
|
|
108
|
-
Column({
|
|
109
|
-
], LogIntegrationOutbound.prototype, "
|
|
110
|
-
__decorate([
|
|
111
|
-
Column({ type: 'varchar', length: 10, nullable: true })
|
|
112
|
-
], LogIntegrationOutbound.prototype, "httpMethod", void 0);
|
|
113
|
-
__decorate([
|
|
114
|
-
Column({ type: 'varchar', length: 120, nullable: true })
|
|
115
|
-
], LogIntegrationOutbound.prototype, "soapAction", void 0);
|
|
104
|
+
Column({ type: 'int', nullable: true })
|
|
105
|
+
], LogIntegrationOutbound.prototype, "retries", void 0);
|
|
116
106
|
__decorate([
|
|
117
107
|
Column({ type: 'text', nullable: true })
|
|
118
|
-
], LogIntegrationOutbound.prototype, "
|
|
119
|
-
__decorate([
|
|
120
|
-
Column({ type: 'json', nullable: true })
|
|
121
|
-
], LogIntegrationOutbound.prototype, "requestHeaders", void 0);
|
|
122
|
-
__decorate([
|
|
123
|
-
Column({ type: 'json', nullable: true })
|
|
124
|
-
], LogIntegrationOutbound.prototype, "requestQuery", void 0);
|
|
108
|
+
], LogIntegrationOutbound.prototype, "headers", void 0);
|
|
125
109
|
__decorate([
|
|
126
110
|
Column({ type: 'text', nullable: true })
|
|
127
|
-
], LogIntegrationOutbound.prototype, "
|
|
128
|
-
__decorate([
|
|
129
|
-
Column({ type: 'json', nullable: true })
|
|
130
|
-
], LogIntegrationOutbound.prototype, "responseHeaders", void 0);
|
|
131
|
-
__decorate([
|
|
132
|
-
Column({ type: 'text' })
|
|
133
|
-
], LogIntegrationOutbound.prototype, "responsePayload", void 0);
|
|
111
|
+
], LogIntegrationOutbound.prototype, "envelope", void 0);
|
|
134
112
|
__decorate([
|
|
135
|
-
Column({ type: '
|
|
136
|
-
], LogIntegrationOutbound.prototype, "
|
|
113
|
+
Column({ type: 'text', nullable: true })
|
|
114
|
+
], LogIntegrationOutbound.prototype, "payload", void 0);
|
|
137
115
|
__decorate([
|
|
138
|
-
Column({ type: '
|
|
139
|
-
], LogIntegrationOutbound.prototype, "
|
|
116
|
+
Column({ type: 'text', nullable: true })
|
|
117
|
+
], LogIntegrationOutbound.prototype, "transformedPayload", void 0);
|
|
140
118
|
__decorate([
|
|
141
|
-
Column({ type: '
|
|
142
|
-
], LogIntegrationOutbound.prototype, "
|
|
119
|
+
Column({ type: 'text', nullable: true })
|
|
120
|
+
], LogIntegrationOutbound.prototype, "enrichedPayload", void 0);
|
|
143
121
|
__decorate([
|
|
144
122
|
Column({ type: 'text', nullable: true })
|
|
145
123
|
], LogIntegrationOutbound.prototype, "errorMessage", void 0);
|
|
@@ -147,20 +125,11 @@ __decorate([
|
|
|
147
125
|
Column({ type: 'text', nullable: true })
|
|
148
126
|
], LogIntegrationOutbound.prototype, "errorStack", void 0);
|
|
149
127
|
__decorate([
|
|
150
|
-
Column({ type: 'varchar', length:
|
|
128
|
+
Column({ type: 'varchar', length: 11, nullable: true })
|
|
151
129
|
], LogIntegrationOutbound.prototype, "errorClassification", void 0);
|
|
152
130
|
__decorate([
|
|
153
|
-
Column({ type: '
|
|
154
|
-
], LogIntegrationOutbound.prototype, "
|
|
155
|
-
__decorate([
|
|
156
|
-
Column({ type: 'json', nullable: true, default: () => "'{}'" })
|
|
157
|
-
], LogIntegrationOutbound.prototype, "metadata", void 0);
|
|
158
|
-
__decorate([
|
|
159
|
-
Column({ type: 'bigint' })
|
|
160
|
-
], LogIntegrationOutbound.prototype, "outboundId", void 0);
|
|
161
|
-
__decorate([
|
|
162
|
-
Column({ type: 'bigint' })
|
|
163
|
-
], LogIntegrationOutbound.prototype, "endpointId", void 0);
|
|
131
|
+
Column({ type: 'bigint', nullable: true })
|
|
132
|
+
], LogIntegrationOutbound.prototype, "inboundId", void 0);
|
|
164
133
|
__decorate([
|
|
165
134
|
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
166
135
|
], LogIntegrationOutbound.prototype, "createdAt", void 0);
|
|
@@ -168,9 +137,10 @@ __decorate([
|
|
|
168
137
|
UpdateDateColumn({ name: "updated_at", type: "timestamptz" })
|
|
169
138
|
], LogIntegrationOutbound.prototype, "updatedAt", void 0);
|
|
170
139
|
LogIntegrationOutbound = __decorate([
|
|
171
|
-
Entity({ name:
|
|
140
|
+
Entity({ name: "log_integration_inbound" }),
|
|
141
|
+
Index(["id"], { unique: true }),
|
|
142
|
+
Index(["correlationId"], { unique: true }),
|
|
172
143
|
Index(["system", "event", "action"]),
|
|
173
|
-
Index(["correlationId"]),
|
|
174
144
|
Index(["status", "updatedAt"]),
|
|
175
145
|
Index(["system", "event", "updatedAt"])
|
|
176
146
|
], LogIntegrationOutbound);
|