@cargolift-cdi/types 0.1.19 → 0.1.21

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.
Files changed (28) hide show
  1. package/dist/context-message.interface.js +1 -0
  2. package/dist/entities/diagnostic-latency.entity.d.ts +16 -0
  3. package/dist/entities/diagnostic-latency.entity.d.ts.map +1 -0
  4. package/dist/entities/diagnostic-latency.entity.js +41 -0
  5. package/dist/entities/integration-inbound.entity.js +76 -0
  6. package/dist/entities/integration-outbound.entity.js +69 -0
  7. package/dist/entities/integration-system.entity.js +29 -0
  8. package/dist/entities/repository/diagnostic-latency-repository.service.d.ts +22 -0
  9. package/dist/entities/repository/diagnostic-latency-repository.service.d.ts.map +1 -0
  10. package/dist/entities/repository/diagnostic-latency-repository.service.js +75 -0
  11. package/dist/entities/repository/integration-inbound-repository.entity.d.ts +2 -0
  12. package/dist/entities/repository/integration-inbound-repository.entity.d.ts.map +1 -0
  13. package/dist/entities/repository/integration-inbound-repository.entity.js +1 -0
  14. package/dist/entities/repository/integration-inbound-repository.service.d.ts +1 -1
  15. package/dist/entities/repository/integration-inbound-repository.service.d.ts.map +1 -1
  16. package/dist/entities/repository/integration-inbound-repository.service.js +35 -0
  17. package/dist/entities/repository/integration-outbound-repository.service.d.ts +1 -1
  18. package/dist/entities/repository/integration-outbound-repository.service.d.ts.map +1 -1
  19. package/dist/entities/repository/integration-outbound-repository.service.js +26 -0
  20. package/dist/index.d.ts +2 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +15 -0
  23. package/dist/publish-meta.interface.js +1 -0
  24. package/dist/rabbitmq-envelope-message.d.ts +3 -3
  25. package/dist/rabbitmq-envelope-message.d.ts.map +1 -1
  26. package/dist/rabbitmq-envelope-message.js +1 -0
  27. package/dist/rabbitmq.interfaces.js +1 -0
  28. package/package.json +7 -2
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Entidade de diagnóstico de latência.
3
+ * Armazena o número de hits (requisições / eventos), histórico de log em JSON
4
+ * e timestamps de início e último registro.
5
+ */
6
+ export declare class DiagnosticLatency {
7
+ id: string;
8
+ hit: number;
9
+ /**
10
+ * Histórico de ocorrências. Mantido como array JSON (jsonb) para facilitar append.
11
+ */
12
+ log: any[];
13
+ timestamp_start: Date;
14
+ timestamp_last: Date;
15
+ }
16
+ //# sourceMappingURL=diagnostic-latency.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostic-latency.entity.d.ts","sourceRoot":"","sources":["../../src/entities/diagnostic-latency.entity.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,qBACa,iBAAiB;IAE5B,EAAE,EAAG,MAAM,CAAC;IAGZ,GAAG,EAAG,MAAM,CAAC;IAEb;;OAEG;IAEH,GAAG,EAAG,GAAG,EAAE,CAAC;IAGZ,eAAe,EAAG,IAAI,CAAC;IAGvB,cAAc,EAAG,IAAI,CAAC;CACvB"}
@@ -0,0 +1,41 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Column, Entity, PrimaryColumn } from 'typeorm';
8
+ /**
9
+ * Entidade de diagnóstico de latência.
10
+ * Armazena o número de hits (requisições / eventos), histórico de log em JSON
11
+ * e timestamps de início e último registro.
12
+ */
13
+ let DiagnosticLatency = class DiagnosticLatency {
14
+ id;
15
+ hit;
16
+ /**
17
+ * Histórico de ocorrências. Mantido como array JSON (jsonb) para facilitar append.
18
+ */
19
+ log;
20
+ timestamp_start;
21
+ timestamp_last;
22
+ };
23
+ __decorate([
24
+ PrimaryColumn({ type: 'varchar', length: 80 })
25
+ ], DiagnosticLatency.prototype, "id", void 0);
26
+ __decorate([
27
+ Column({ type: 'int', default: 1 })
28
+ ], DiagnosticLatency.prototype, "hit", void 0);
29
+ __decorate([
30
+ Column({ type: 'jsonb', nullable: true, default: () => "'[]'::jsonb" })
31
+ ], DiagnosticLatency.prototype, "log", void 0);
32
+ __decorate([
33
+ Column({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' })
34
+ ], DiagnosticLatency.prototype, "timestamp_start", void 0);
35
+ __decorate([
36
+ Column({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' })
37
+ ], DiagnosticLatency.prototype, "timestamp_last", void 0);
38
+ DiagnosticLatency = __decorate([
39
+ Entity({ name: 'diagnostic_latency' })
40
+ ], DiagnosticLatency);
41
+ export { DiagnosticLatency };
@@ -0,0 +1,76 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn, } from "typeorm";
8
+ /**
9
+ * Eventos de integração (tms.driver) - Ocorre na integração de entrada (inbound) antes do roteamento.
10
+ * Define expressões JSONata para transformar mensagens de eventos externos em formato JSON canônico interno.
11
+ * Também armazena configurações de regras global (BRE) associadas ao evento.
12
+ */
13
+ let IntegrationInbound = class IntegrationInbound {
14
+ id;
15
+ /** Sistema de origem (e.g., 'erp') */
16
+ system;
17
+ /** Evento (e.g., 'driver') */
18
+ event;
19
+ /** Versão da rota. Apenas a última versão pode estar ativa. Versões anteriores não podem sofrer modificações */
20
+ version;
21
+ /** Descrição opcional amigável ao usuário */
22
+ description;
23
+ /** Pré-validação do payload de origem */
24
+ validation;
25
+ /** Expressão JSONata */
26
+ transformation;
27
+ /** Regra global (BRE RulesConfiguration) */
28
+ rules;
29
+ /**Se a rota está ativa */
30
+ active;
31
+ /** Opções adicionais (reservado para uso futuro) */
32
+ options;
33
+ createdAt;
34
+ updatedAt;
35
+ };
36
+ __decorate([
37
+ PrimaryGeneratedColumn("uuid")
38
+ ], IntegrationInbound.prototype, "id", void 0);
39
+ __decorate([
40
+ Column({ type: "varchar", length: 80 })
41
+ ], IntegrationInbound.prototype, "system", void 0);
42
+ __decorate([
43
+ Column({ type: "varchar", length: 80 })
44
+ ], IntegrationInbound.prototype, "event", void 0);
45
+ __decorate([
46
+ Column({ type: "int", default: 1 })
47
+ ], IntegrationInbound.prototype, "version", void 0);
48
+ __decorate([
49
+ Column({ type: "varchar", length: 500, nullable: true })
50
+ ], IntegrationInbound.prototype, "description", void 0);
51
+ __decorate([
52
+ Column({ type: "jsonb", nullable: true })
53
+ ], IntegrationInbound.prototype, "validation", void 0);
54
+ __decorate([
55
+ Column({ type: "text", nullable: true })
56
+ ], IntegrationInbound.prototype, "transformation", void 0);
57
+ __decorate([
58
+ Column({ type: 'jsonb', nullable: true })
59
+ ], IntegrationInbound.prototype, "rules", void 0);
60
+ __decorate([
61
+ Column({ type: "boolean", default: true })
62
+ ], IntegrationInbound.prototype, "active", void 0);
63
+ __decorate([
64
+ Column({ type: "jsonb", nullable: true })
65
+ ], IntegrationInbound.prototype, "options", void 0);
66
+ __decorate([
67
+ CreateDateColumn({ type: "timestamptz" })
68
+ ], IntegrationInbound.prototype, "createdAt", void 0);
69
+ __decorate([
70
+ UpdateDateColumn({ type: "timestamptz" })
71
+ ], IntegrationInbound.prototype, "updatedAt", void 0);
72
+ IntegrationInbound = __decorate([
73
+ Entity({ name: "integration_inbound" }),
74
+ Index(["system", "event", "version"], { unique: true })
75
+ ], IntegrationInbound);
76
+ export { IntegrationInbound };
@@ -0,0 +1,69 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn, } from "typeorm";
8
+ /**
9
+ * Outbound routing definition per source key. One row per target (e.g., WMS, TMS).
10
+ */
11
+ let IntegrationOutbound = class IntegrationOutbound {
12
+ id;
13
+ /** Sistema de origem (e.g., 'tms') */
14
+ system;
15
+ /** Sistema de destino (e.g., 'erp', 'wms') */
16
+ targetSystem;
17
+ /** Evento (chave) (e.g., 'driver' or 'driver.created') */
18
+ event;
19
+ /** Versão da rota. Apenas a última versão pode estar ativa. Versões anteriores não podem sofrer modificações */
20
+ version;
21
+ /** Descrição */
22
+ description;
23
+ /** Regras (BRE RulesConfiguration) */
24
+ rules;
25
+ /** Se a rota está ativa */
26
+ active;
27
+ /** Opções adicionais de roteamento (reservado para uso futuro) */
28
+ options;
29
+ createdAt;
30
+ updatedAt;
31
+ };
32
+ __decorate([
33
+ PrimaryGeneratedColumn("uuid")
34
+ ], IntegrationOutbound.prototype, "id", void 0);
35
+ __decorate([
36
+ Column({ type: "varchar", length: 80 })
37
+ ], IntegrationOutbound.prototype, "system", void 0);
38
+ __decorate([
39
+ Column({ type: "varchar", length: 80 })
40
+ ], IntegrationOutbound.prototype, "targetSystem", void 0);
41
+ __decorate([
42
+ Column({ type: "varchar", length: 80 })
43
+ ], IntegrationOutbound.prototype, "event", void 0);
44
+ __decorate([
45
+ Column({ type: "int", default: 1 })
46
+ ], IntegrationOutbound.prototype, "version", void 0);
47
+ __decorate([
48
+ Column({ type: "varchar", length: 500, nullable: true })
49
+ ], IntegrationOutbound.prototype, "description", void 0);
50
+ __decorate([
51
+ Column({ type: "jsonb" })
52
+ ], IntegrationOutbound.prototype, "rules", void 0);
53
+ __decorate([
54
+ Column({ type: "boolean", default: true })
55
+ ], IntegrationOutbound.prototype, "active", void 0);
56
+ __decorate([
57
+ Column({ type: "jsonb", nullable: true })
58
+ ], IntegrationOutbound.prototype, "options", void 0);
59
+ __decorate([
60
+ CreateDateColumn({ type: "timestamptz" })
61
+ ], IntegrationOutbound.prototype, "createdAt", void 0);
62
+ __decorate([
63
+ UpdateDateColumn({ type: "timestamptz" })
64
+ ], IntegrationOutbound.prototype, "updatedAt", void 0);
65
+ IntegrationOutbound = __decorate([
66
+ Entity({ name: "integration_outbound" }),
67
+ Index(["system", "event", "targetSystem", "version"], { unique: true })
68
+ ], IntegrationOutbound);
69
+ export { IntegrationOutbound };
@@ -0,0 +1,29 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Column, Entity, PrimaryGeneratedColumn, Index } from 'typeorm';
8
+ let IntegrationSystem = class IntegrationSystem {
9
+ /** Identificador único do sistema de integração */
10
+ id;
11
+ /** Nome do sistema de integração (e.g., 'erp', 'tms') */
12
+ system;
13
+ /** Se o sistema está ativo */
14
+ active;
15
+ };
16
+ __decorate([
17
+ PrimaryGeneratedColumn('uuid')
18
+ ], IntegrationSystem.prototype, "id", void 0);
19
+ __decorate([
20
+ Index({ unique: true }),
21
+ Column({ type: 'varchar', length: 80 })
22
+ ], IntegrationSystem.prototype, "system", void 0);
23
+ __decorate([
24
+ Column({ type: 'boolean', default: true })
25
+ ], IntegrationSystem.prototype, "active", void 0);
26
+ IntegrationSystem = __decorate([
27
+ Entity({ name: 'integration_system' })
28
+ ], IntegrationSystem);
29
+ export { IntegrationSystem };
@@ -0,0 +1,22 @@
1
+ import { Repository } from 'typeorm';
2
+ import { DiagnosticLatency } from '../diagnostic-latency.entity.js';
3
+ /**
4
+ * Repositório de diagnóstico de latência.
5
+ * Responsável por criar/atualizar registros de latência associados a um id.
6
+ */
7
+ export declare class DiagnosticLatencyRepositoryService {
8
+ private readonly repo;
9
+ constructor(repo: Repository<DiagnosticLatency>);
10
+ /**
11
+ * Upsert de latência: cria se não existir, senão incrementa hit e atualiza timestamp_last.
12
+ * Opcionalmente adiciona entrada no histórico (log).
13
+ * @param id Identificador único do fluxo / teste.
14
+ * @param logEntry Objeto livre para compor histórico.
15
+ */
16
+ upsert(id: string, logEntry?: Record<string, any>): Promise<DiagnosticLatency>;
17
+ /** Recupera registro pelo id. */
18
+ get(id: string): Promise<DiagnosticLatency | null>;
19
+ /** Reinicia os contadores e histórico para o id informado. */
20
+ reset(id: string): Promise<DiagnosticLatency>;
21
+ }
22
+ //# sourceMappingURL=diagnostic-latency-repository.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostic-latency-repository.service.d.ts","sourceRoot":"","sources":["../../../src/entities/repository/diagnostic-latency-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE;;;GAGG;AACH,qBACa,kCAAkC;IAG3C,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,iBAAiB,CAAC;IAGtD;;;;;OAKG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAwBpF,iCAAiC;IAC3B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAIxD,8DAA8D;IACxD,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAapD"}
@@ -0,0 +1,75 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ };
10
+ import { Injectable } from '@nestjs/common';
11
+ import { InjectRepository } from '@nestjs/typeorm';
12
+ import { DiagnosticLatency } from '../diagnostic-latency.entity.js';
13
+ /**
14
+ * Repositório de diagnóstico de latência.
15
+ * Responsável por criar/atualizar registros de latência associados a um id.
16
+ */
17
+ let DiagnosticLatencyRepositoryService = class DiagnosticLatencyRepositoryService {
18
+ repo;
19
+ constructor(repo) {
20
+ this.repo = repo;
21
+ }
22
+ /**
23
+ * Upsert de latência: cria se não existir, senão incrementa hit e atualiza timestamp_last.
24
+ * Opcionalmente adiciona entrada no histórico (log).
25
+ * @param id Identificador único do fluxo / teste.
26
+ * @param logEntry Objeto livre para compor histórico.
27
+ */
28
+ async upsert(id, logEntry) {
29
+ let entity = await this.repo.findOne({ where: { id } });
30
+ const now = new Date();
31
+ if (entity) {
32
+ entity.hit = (entity.hit || 0) + 1;
33
+ entity.timestamp_last = now;
34
+ if (logEntry) {
35
+ if (!Array.isArray(entity.log))
36
+ entity.log = [];
37
+ entity.log.push(logEntry);
38
+ }
39
+ }
40
+ else {
41
+ entity = this.repo.create({
42
+ id,
43
+ hit: 1,
44
+ log: logEntry ? [logEntry] : [],
45
+ timestamp_start: now,
46
+ timestamp_last: now,
47
+ });
48
+ }
49
+ return this.repo.save(entity);
50
+ }
51
+ /** Recupera registro pelo id. */
52
+ async get(id) {
53
+ return this.repo.findOne({ where: { id } });
54
+ }
55
+ /** Reinicia os contadores e histórico para o id informado. */
56
+ async reset(id) {
57
+ let entity = await this.repo.findOne({ where: { id } });
58
+ const now = new Date();
59
+ if (entity) {
60
+ entity.hit = 0;
61
+ entity.log = [];
62
+ entity.timestamp_start = now;
63
+ entity.timestamp_last = now;
64
+ }
65
+ else {
66
+ entity = this.repo.create({ id, hit: 0, log: [], timestamp_start: now, timestamp_last: now });
67
+ }
68
+ return this.repo.save(entity);
69
+ }
70
+ };
71
+ DiagnosticLatencyRepositoryService = __decorate([
72
+ Injectable(),
73
+ __param(0, InjectRepository(DiagnosticLatency))
74
+ ], DiagnosticLatencyRepositoryService);
75
+ export { DiagnosticLatencyRepositoryService };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=integration-inbound-repository.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-inbound-repository.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/repository/integration-inbound-repository.entity.ts"],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { Repository } from "typeorm";
2
- import { IntegrationInbound } from "../integration-inbound.entity";
2
+ import { IntegrationInbound } from "../integration-inbound.entity.js";
3
3
  export declare class InboundRepositoryService {
4
4
  private readonly repo;
5
5
  constructor(repo: Repository<IntegrationInbound>);
@@ -1 +1 @@
1
- {"version":3,"file":"integration-inbound-repository.service.d.ts","sourceRoot":"","sources":["../../../src/entities/repository/integration-inbound-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,qBACa,wBAAwB;IAGjC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,kBAAkB,CAAC;IAGjD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;CA+C7E"}
1
+ {"version":3,"file":"integration-inbound-repository.service.d.ts","sourceRoot":"","sources":["../../../src/entities/repository/integration-inbound-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGtE,qBACa,wBAAwB;IAGjC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,kBAAkB,CAAC;IAGjD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;CA+C7E"}
@@ -0,0 +1,35 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ };
10
+ import { Injectable } from "@nestjs/common";
11
+ import { InjectRepository } from "@nestjs/typeorm";
12
+ import { IntegrationInbound } from "../integration-inbound.entity.js";
13
+ let InboundRepositoryService = class InboundRepositoryService {
14
+ repo;
15
+ constructor(repo) {
16
+ this.repo = repo;
17
+ }
18
+ async getEvent(system, event) {
19
+ return this.repo.find({
20
+ where: { system, event, active: true },
21
+ order: { version: "DESC" },
22
+ })
23
+ .then((events) => {
24
+ return events;
25
+ })
26
+ .catch((err) => {
27
+ throw err;
28
+ });
29
+ }
30
+ };
31
+ InboundRepositoryService = __decorate([
32
+ Injectable(),
33
+ __param(0, InjectRepository(IntegrationInbound))
34
+ ], InboundRepositoryService);
35
+ export { InboundRepositoryService };
@@ -1,5 +1,5 @@
1
1
  import { Repository } from 'typeorm';
2
- import { IntegrationOutbound } from '../integration-outbound.entity';
2
+ import { IntegrationOutbound } from '../integration-outbound.entity.js';
3
3
  export declare class OutboundRepositoryService {
4
4
  private readonly repo;
5
5
  constructor(repo: Repository<IntegrationOutbound>);
@@ -1 +1 @@
1
- {"version":3,"file":"integration-outbound-repository.service.d.ts","sourceRoot":"","sources":["../../../src/entities/repository/integration-outbound-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAGrE,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC;IAGlD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAG/E"}
1
+ {"version":3,"file":"integration-outbound-repository.service.d.ts","sourceRoot":"","sources":["../../../src/entities/repository/integration-outbound-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAGxE,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC;IAGlD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAG/E"}
@@ -0,0 +1,26 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ };
10
+ import { Injectable } from '@nestjs/common';
11
+ import { InjectRepository } from '@nestjs/typeorm';
12
+ import { IntegrationOutbound } from '../integration-outbound.entity.js';
13
+ let OutboundRepositoryService = class OutboundRepositoryService {
14
+ repo;
15
+ constructor(repo) {
16
+ this.repo = repo;
17
+ }
18
+ async getRoutes(system, event) {
19
+ return this.repo.find({ where: { system, event, active: true }, order: { version: 'DESC' } });
20
+ }
21
+ };
22
+ OutboundRepositoryService = __decorate([
23
+ Injectable(),
24
+ __param(0, InjectRepository(IntegrationOutbound))
25
+ ], OutboundRepositoryService);
26
+ export { OutboundRepositoryService };
package/dist/index.d.ts CHANGED
@@ -11,4 +11,6 @@ export * from './entities/integration-inbound.entity.js';
11
11
  export * from './entities/integration-outbound.entity.js';
12
12
  export * from './entities/repository/integration-inbound-repository.service.js';
13
13
  export * from './entities/repository/integration-outbound-repository.service.js';
14
+ export * from './entities/diagnostic-latency.entity.js';
15
+ export * from './entities/repository/diagnostic-latency-repository.service.js';
14
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iEAAiE,CAAC;AAChF,cAAc,kEAAkE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iEAAiE,CAAC;AAChF,cAAc,kEAAkE,CAAC;AACjF,cAAc,yCAAyC,CAAC;AACxD,cAAc,gEAAgE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Public export surface for shared types.
3
+ * Keep exports stable to avoid breaking downstream projects.
4
+ */
5
+ export * from './rabbitmq.interfaces.js';
6
+ export * from './rabbitmq-envelope-message.js';
7
+ export * from './context-message.interface.js';
8
+ export * from './publish-meta.interface.js';
9
+ export * from './entities/integration-system.entity.js';
10
+ export * from './entities/integration-inbound.entity.js';
11
+ export * from './entities/integration-outbound.entity.js';
12
+ export * from './entities/repository/integration-inbound-repository.service.js';
13
+ export * from './entities/repository/integration-outbound-repository.service.js';
14
+ export * from './entities/diagnostic-latency.entity.js';
15
+ export * from './entities/repository/diagnostic-latency-repository.service.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import type contextMessage = require("./context-message.interface.js");
1
+ import { ContextSource, ContextError } from "./context-message.interface.js";
2
2
  /**
3
3
  * Envelope (metadados) da mensagem publicada.
4
4
  */
@@ -10,8 +10,8 @@ export interface EnvelopeMessage {
10
10
  method?: string;
11
11
  record_id?: string;
12
12
  timestamp?: string;
13
- source?: contextMessage.ContextSource;
14
- error?: contextMessage.ContextError;
13
+ source?: ContextSource;
14
+ error?: ContextError;
15
15
  extraData?: {
16
16
  [key: string]: any;
17
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rabbitmq-envelope-message.d.ts","sourceRoot":"","sources":["../src/rabbitmq-envelope-message.ts"],"names":[],"mappings":"AAAA,YAAY,cAAc,GAAG,QAAQ,gCAAgC,CAAC,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC;IACtC,KAAK,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC;IACpC,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACpC"}
1
+ {"version":3,"file":"rabbitmq-envelope-message.d.ts","sourceRoot":"","sources":["../src/rabbitmq-envelope-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAG7E;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACpC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargolift-cdi/types",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "TypeScript types e interfaces comuns para projetos Cargolift CDI",
5
5
  "keywords": [
6
6
  "typescript",
@@ -20,11 +20,16 @@
20
20
  },
21
21
  "homepage": "https://github.com/cargolift-cdi/types#readme",
22
22
  "sideEffects": false,
23
+ "type": "module",
23
24
  "publishConfig": {
24
25
  "access": "public"
25
26
  },
27
+ "types": "./dist/index.d.ts",
26
28
  "exports": {
27
- ".": "./dist/index.d.ts"
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js"
32
+ }
28
33
  },
29
34
  "files": [
30
35
  "dist/**/*",