@cargolift-cdi/types 0.1.85 → 0.1.86

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,11 @@ 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
50
  /** Indica se este log veio de um replay manual ou DLQ */
51
- wasReplayedFromDlq: boolean;
51
+ integrationRef?: string | null;
52
+ integrationRefType?: string | null;
53
+ integrationAdditionalRefs?: Record<string, any> | null;
52
54
  /** ID da tabela integration_inbound */
53
55
  inboundId: string;
54
56
  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,EAAG,MAAM,CAAC;IAEvB,+CAA+C;IAE/C,cAAc,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AAmD;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;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 */
@@ -54,7 +54,15 @@ let LogIntegrationInbound = class LogIntegrationInbound {
54
54
  /** Classificação do erro para o mecanismo de DLQ/retry */
55
55
  errorClassification;
56
56
  /** Indica se este log veio de um replay manual ou DLQ */
57
- wasReplayedFromDlq;
57
+ // @Column({ type: 'boolean', default: false })
58
+ // wasReplayedFromDlq!: boolean;
59
+ // Referência externa associada (código do cadastro, número do documento, etc)
60
+ integrationRef;
61
+ // Tipo da referência externa ('cpf', 'número do cte', etc)
62
+ integrationRefType;
63
+ // Campos para múltiplas referências externas
64
+ // TODO: Criar migration para índice GIN
65
+ integrationAdditionalRefs;
58
66
  /** ID da tabela integration_inbound */
59
67
  inboundId; // manter string no TS para bigint seguro
60
68
  createdAt;
@@ -75,6 +83,12 @@ __decorate([
75
83
  __decorate([
76
84
  Column({ name: "correlation_id", type: "varchar", length: 36 })
77
85
  ], LogIntegrationInbound.prototype, "correlationId", void 0);
86
+ __decorate([
87
+ Column({ type: 'varchar', length: 10, nullable: false })
88
+ ], LogIntegrationInbound.prototype, "status", void 0);
89
+ __decorate([
90
+ Column({ type: 'varchar', length: 255, nullable: true })
91
+ ], LogIntegrationInbound.prototype, "statusReason", void 0);
78
92
  __decorate([
79
93
  Column({ name: "timestamp_start", type: "timestamptz", nullable: true })
80
94
  ], LogIntegrationInbound.prototype, "timestampStart", void 0);
@@ -93,12 +107,6 @@ __decorate([
93
107
  __decorate([
94
108
  Column({ name: "duration_ms", type: "int", nullable: true })
95
109
  ], 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
110
  __decorate([
103
111
  Column({ type: 'int', nullable: true })
104
112
  ], LogIntegrationInbound.prototype, "retries", void 0);
@@ -124,11 +132,17 @@ __decorate([
124
132
  Column({ type: 'text', nullable: true })
125
133
  ], LogIntegrationInbound.prototype, "errorStack", void 0);
126
134
  __decorate([
127
- Column({ type: 'varchar', length: 11, nullable: true })
135
+ Column({ type: 'varchar', length: 17, nullable: true })
128
136
  ], LogIntegrationInbound.prototype, "errorClassification", void 0);
129
137
  __decorate([
130
- Column({ type: 'boolean', default: false })
131
- ], LogIntegrationInbound.prototype, "wasReplayedFromDlq", void 0);
138
+ Column({ type: 'varchar', length: 100, nullable: true })
139
+ ], LogIntegrationInbound.prototype, "integrationRef", void 0);
140
+ __decorate([
141
+ Column({ type: 'varchar', length: 100, nullable: true })
142
+ ], LogIntegrationInbound.prototype, "integrationRefType", void 0);
143
+ __decorate([
144
+ Column({ type: 'jsonb', nullable: true })
145
+ ], LogIntegrationInbound.prototype, "integrationAdditionalRefs", void 0);
132
146
  __decorate([
133
147
  Column({ type: 'bigint', nullable: true })
134
148
  ], LogIntegrationInbound.prototype, "inboundId", void 0);
@@ -140,6 +154,7 @@ __decorate([
140
154
  ], LogIntegrationInbound.prototype, "updatedAt", void 0);
141
155
  LogIntegrationInbound = __decorate([
142
156
  Entity({ name: "log_integration_inbound" }),
157
+ Index(["id"], { unique: true }),
143
158
  Index(["correlationId"], { unique: true }),
144
159
  Index(["system", "event", "action"]),
145
160
  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.86",
4
4
  "description": "TypeScript types e interfaces comuns para projetos Cargolift CDI",
5
5
  "keywords": [
6
6
  "typescript",