@cargolift-cdi/types 0.1.85 → 0.1.87

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.
@@ -23,8 +23,10 @@ export declare class IntegrationInbound {
23
23
  transformation?: string | null;
24
24
  /** Regra global (BRE RulesConfiguration) */
25
25
  rules?: Record<string, any> | null;
26
+ refExtraction?: string | null;
27
+ refType?: string | null;
28
+ additionalRefsExtraction?: string | null;
26
29
  /** Opções adicionais (reservado para uso futuro) */
27
- options?: Record<string, any> | null;
28
30
  createdAt: Date;
29
31
  updatedAt: Date;
30
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"integration-inbound.entity.d.ts","sourceRoot":"","sources":["../../src/entities/integration-inbound.entity.ts"],"names":[],"mappings":"AAuBA;;;;GAIG;AACH,qBAOa,kBAAkB;IAE7B,EAAE,EAAG,MAAM,CAAC;IAEZ,sCAAsC;IAEtC,MAAM,EAAG,MAAM,CAAC;IAEhB,8BAA8B;IAE9B,KAAK,EAAG,MAAM,CAAC;IAEb,oDAAoD;IAEtD,MAAM,EAAG,MAAM,CAAC;IAEhB,gHAAgH;IAEhH,OAAO,EAAG,MAAM,CAAC;IAEjB,0BAA0B;IAE1B,MAAM,EAAG,OAAO,CAAC;IAEjB,6CAA6C;IAE7C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,0CAA0C;IAE1C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAExC,yBAAyB;IAEzB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,4CAA4C;IAE5C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAEnC,oDAAoD;IAEpD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAGrC,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAElB"}
1
+ {"version":3,"file":"integration-inbound.entity.d.ts","sourceRoot":"","sources":["../../src/entities/integration-inbound.entity.ts"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,qBAMa,kBAAkB;IAE7B,EAAE,EAAG,MAAM,CAAC;IAEZ,sCAAsC;IAEtC,MAAM,EAAG,MAAM,CAAC;IAEhB,8BAA8B;IAE9B,KAAK,EAAG,MAAM,CAAC;IAEf,oDAAoD;IAEpD,MAAM,EAAG,MAAM,CAAC;IAEhB,gHAAgH;IAEhH,OAAO,EAAG,MAAM,CAAC;IAEjB,0BAA0B;IAE1B,MAAM,EAAG,OAAO,CAAC;IAEjB,6CAA6C;IAE7C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,0CAA0C;IAE1C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAExC,yBAAyB;IAEzB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,4CAA4C;IAE5C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAInC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAI9B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAIxB,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC,oDAAoD;IAKpD,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAClB"}
@@ -16,7 +16,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
16
16
  *
17
17
 
18
18
  */
19
- import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn, } from "typeorm";
19
+ import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
20
20
  /**
21
21
  * Eventos de integração (tms.driver) - Ocorre na integração de entrada (inbound) antes do roteamento.
22
22
  * Define expressões JSONata para transformar mensagens de eventos externos em formato JSON canônico interno.
@@ -42,8 +42,15 @@ let IntegrationInbound = class IntegrationInbound {
42
42
  transformation;
43
43
  /** Regra global (BRE RulesConfiguration) */
44
44
  rules;
45
+ // Expressão JSONNata para extração da referência externa (código do cadastro, número do documento, etc) a partir do payload canônico (transformado)
46
+ refExtraction;
47
+ // Nome do tipo de referência externa (e.g., 'cte', 'cnpj', 'viagem', etc)
48
+ refType;
49
+ // Expressão JSONNata para extração de referências adicionais (e.g., múltiplos códigos relacionados em formato Json) a partir do payload canônico (transformado)
50
+ additionalRefsExtraction;
45
51
  /** Opções adicionais (reservado para uso futuro) */
46
- options;
52
+ // @Column({ type: "jsonb", nullable: true })
53
+ // options?: Record<string, any> | null;
47
54
  createdAt;
48
55
  updatedAt;
49
56
  };
@@ -75,11 +82,17 @@ __decorate([
75
82
  Column({ type: "text", nullable: true })
76
83
  ], IntegrationInbound.prototype, "transformation", void 0);
77
84
  __decorate([
78
- Column({ type: 'jsonb', nullable: true })
85
+ Column({ type: "jsonb", nullable: true })
79
86
  ], IntegrationInbound.prototype, "rules", void 0);
80
87
  __decorate([
81
- Column({ type: "jsonb", nullable: true })
82
- ], IntegrationInbound.prototype, "options", void 0);
88
+ Column({ type: 'text', nullable: true })
89
+ ], IntegrationInbound.prototype, "refExtraction", void 0);
90
+ __decorate([
91
+ Column({ type: 'varchar', nullable: true })
92
+ ], IntegrationInbound.prototype, "refType", void 0);
93
+ __decorate([
94
+ Column({ type: 'text', nullable: true })
95
+ ], IntegrationInbound.prototype, "additionalRefsExtraction", void 0);
83
96
  __decorate([
84
97
  CreateDateColumn({ name: "created_at", type: "timestamptz" })
85
98
  ], IntegrationInbound.prototype, "createdAt", void 0);
@@ -13,6 +13,10 @@ export declare class LogIntegrationInbound {
13
13
  action: string;
14
14
  /** Correlation Id */
15
15
  correlationId: string;
16
+ /** Status final do processamento */
17
+ status: IntegrationStatus;
18
+ /** Motivo do status (mensagem curta) */
19
+ statusReason?: string | null;
16
20
  /** Timestamp de início da requisição na API */
17
21
  timestampStart?: Date | string;
18
22
  /** Timestamp do início do processamento no ESB */
@@ -25,10 +29,6 @@ export declare class LogIntegrationInbound {
25
29
  durationProcessMs?: number | null;
26
30
  /** Duração total em milissegundos */
27
31
  durationMs?: number | null;
28
- /** Status final do processamento */
29
- status: IntegrationStatus;
30
- /** Motivo do status (mensagem curta) */
31
- statusReason?: string | null;
32
32
  /** Quantidade de tentativas realizadas até o sucesso ou falha definitiva */
33
33
  retries?: number | null;
34
34
  /** Cabeçalhos enviados ao destino após sanitização */
@@ -46,9 +46,13 @@ export declare class LogIntegrationInbound {
46
46
  /** Stack completo quando disponível (mantido para investigações) */
47
47
  errorStack?: string | null;
48
48
  /** Classificação do erro para o mecanismo de DLQ/retry */
49
- errorClassification?: 'application' | 'business';
49
+ errorClassification?: 'application' | 'business' | 'business_fatal' | 'application_fatal' | null;
50
+ /** Mensagens de avisos e alertas não críticas */
51
+ warns?: string | null;
50
52
  /** Indica se este log veio de um replay manual ou DLQ */
51
- wasReplayedFromDlq: boolean;
53
+ integrationRef?: string | null;
54
+ integrationRefType?: string | null;
55
+ integrationAdditionalRefs?: Record<string, any> | null;
52
56
  /** ID da tabela integration_inbound */
53
57
  inboundId: string;
54
58
  createdAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"log-integration-inbound.entity.d.ts","sourceRoot":"","sources":["../../src/entities/log-integration-inbound.entity.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE;;;GAGG;AACH,qBAKa,qBAAqB;IAEhC,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,E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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,iDAAiD;IAEjD,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,yDAAyD;IAMzD,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAI/B,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKnC,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAEvD,uCAAuC;IAEvC,SAAS,EAAG,MAAM,CAAC;IAGnB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAClB"}
@@ -19,6 +19,10 @@ let LogIntegrationInbound = class LogIntegrationInbound {
19
19
  action;
20
20
  /** Correlation Id */
21
21
  correlationId;
22
+ /** Status final do processamento */
23
+ status;
24
+ /** Motivo do status (mensagem curta) */
25
+ statusReason;
22
26
  /** Timestamp de início da requisição na API */
23
27
  timestampStart;
24
28
  /** Timestamp do início do processamento no ESB */
@@ -31,10 +35,6 @@ let LogIntegrationInbound = class LogIntegrationInbound {
31
35
  durationProcessMs;
32
36
  /** Duração total em milissegundos */
33
37
  durationMs;
34
- /** Status final do processamento */
35
- status;
36
- /** Motivo do status (mensagem curta) */
37
- statusReason;
38
38
  /** Quantidade de tentativas realizadas até o sucesso ou falha definitiva */
39
39
  retries;
40
40
  /** Cabeçalhos enviados ao destino após sanitização */
@@ -53,8 +53,18 @@ let LogIntegrationInbound = class LogIntegrationInbound {
53
53
  errorStack;
54
54
  /** Classificação do erro para o mecanismo de DLQ/retry */
55
55
  errorClassification;
56
+ /** Mensagens de avisos e alertas não críticas */
57
+ warns;
56
58
  /** Indica se este log veio de um replay manual ou DLQ */
57
- wasReplayedFromDlq;
59
+ // @Column({ type: 'boolean', default: false })
60
+ // wasReplayedFromDlq!: boolean;
61
+ // Referência externa associada (código do cadastro, número do documento, etc)
62
+ integrationRef;
63
+ // Tipo da referência externa ('cpf', 'número do cte', etc)
64
+ integrationRefType;
65
+ // Campos para múltiplas referências externas
66
+ // TODO: Criar migration para índice GIN
67
+ integrationAdditionalRefs;
58
68
  /** ID da tabela integration_inbound */
59
69
  inboundId; // manter string no TS para bigint seguro
60
70
  createdAt;
@@ -75,6 +85,12 @@ __decorate([
75
85
  __decorate([
76
86
  Column({ name: "correlation_id", type: "varchar", length: 36 })
77
87
  ], LogIntegrationInbound.prototype, "correlationId", void 0);
88
+ __decorate([
89
+ Column({ type: 'varchar', length: 10, nullable: false })
90
+ ], LogIntegrationInbound.prototype, "status", void 0);
91
+ __decorate([
92
+ Column({ type: 'varchar', length: 255, nullable: true })
93
+ ], LogIntegrationInbound.prototype, "statusReason", void 0);
78
94
  __decorate([
79
95
  Column({ name: "timestamp_start", type: "timestamptz", nullable: true })
80
96
  ], LogIntegrationInbound.prototype, "timestampStart", void 0);
@@ -93,12 +109,6 @@ __decorate([
93
109
  __decorate([
94
110
  Column({ name: "duration_ms", type: "int", nullable: true })
95
111
  ], LogIntegrationInbound.prototype, "durationMs", void 0);
96
- __decorate([
97
- Column({ type: 'varchar', length: 10, nullable: false })
98
- ], LogIntegrationInbound.prototype, "status", void 0);
99
- __decorate([
100
- Column({ type: 'varchar', length: 255, nullable: true })
101
- ], LogIntegrationInbound.prototype, "statusReason", void 0);
102
112
  __decorate([
103
113
  Column({ type: 'int', nullable: true })
104
114
  ], LogIntegrationInbound.prototype, "retries", void 0);
@@ -124,11 +134,20 @@ __decorate([
124
134
  Column({ type: 'text', nullable: true })
125
135
  ], LogIntegrationInbound.prototype, "errorStack", void 0);
126
136
  __decorate([
127
- Column({ type: 'varchar', length: 11, nullable: true })
137
+ Column({ type: 'varchar', length: 17, nullable: true })
128
138
  ], LogIntegrationInbound.prototype, "errorClassification", void 0);
129
139
  __decorate([
130
- Column({ type: 'boolean', default: false })
131
- ], LogIntegrationInbound.prototype, "wasReplayedFromDlq", void 0);
140
+ Column({ type: 'text', nullable: true })
141
+ ], LogIntegrationInbound.prototype, "warns", void 0);
142
+ __decorate([
143
+ Column({ type: 'varchar', length: 100, nullable: true })
144
+ ], LogIntegrationInbound.prototype, "integrationRef", void 0);
145
+ __decorate([
146
+ Column({ type: 'varchar', length: 100, nullable: true })
147
+ ], LogIntegrationInbound.prototype, "integrationRefType", void 0);
148
+ __decorate([
149
+ Column({ type: 'jsonb', nullable: true })
150
+ ], LogIntegrationInbound.prototype, "integrationAdditionalRefs", void 0);
132
151
  __decorate([
133
152
  Column({ type: 'bigint', nullable: true })
134
153
  ], LogIntegrationInbound.prototype, "inboundId", void 0);
@@ -140,6 +159,7 @@ __decorate([
140
159
  ], LogIntegrationInbound.prototype, "updatedAt", void 0);
141
160
  LogIntegrationInbound = __decorate([
142
161
  Entity({ name: "log_integration_inbound" }),
162
+ Index(["id"], { unique: true }),
143
163
  Index(["correlationId"], { unique: true }),
144
164
  Index(["system", "event", "action"]),
145
165
  Index(["status", "updatedAt"]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargolift-cdi/types",
3
- "version": "0.1.85",
3
+ "version": "0.1.87",
4
4
  "description": "TypeScript types e interfaces comuns para projetos Cargolift CDI",
5
5
  "keywords": [
6
6
  "typescript",