@cargolift-cdi/types 0.1.31 → 0.1.33

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 (40) hide show
  1. package/dist/db/entities/integration/integration-credential.entity.d.ts +42 -0
  2. package/dist/db/entities/integration/integration-credential.entity.d.ts.map +1 -0
  3. package/dist/db/entities/integration/integration-credential.entity.js +75 -0
  4. package/dist/db/entities/integration/integration-endpoint.d.ts +87 -0
  5. package/dist/db/entities/integration/integration-endpoint.d.ts.map +1 -0
  6. package/dist/db/entities/integration/integration-endpoint.js +137 -0
  7. package/dist/db/entities/integration/integration-inbound.entity.d.ts.map +1 -0
  8. package/dist/db/entities/{integration-inbound.entity.js → integration/integration-inbound.entity.js} +2 -2
  9. package/dist/db/entities/{integration-outbound.entity.d.ts → integration/integration-outbound.entity.d.ts} +4 -2
  10. package/dist/db/entities/integration/integration-outbound.entity.d.ts.map +1 -0
  11. package/dist/db/entities/{integration-outbound.entity.js → integration/integration-outbound.entity.js} +39 -6
  12. package/dist/db/entities/{integration-system.entity.d.ts → integration/integration-system.entity.d.ts} +2 -0
  13. package/dist/db/entities/integration/integration-system.entity.d.ts.map +1 -0
  14. package/dist/db/entities/{integration-system.entity.js → integration/integration-system.entity.js} +9 -1
  15. package/dist/db/entities/integration/integration.enums.d.ts +22 -0
  16. package/dist/db/entities/integration/integration.enums.d.ts.map +1 -0
  17. package/dist/db/entities/integration/integration.enums.js +38 -0
  18. package/dist/db/repository/diagnostic-latency-repository.service.d.ts +1 -1
  19. package/dist/db/repository/diagnostic-latency-repository.service.d.ts.map +1 -1
  20. package/dist/db/repository/diagnostic-latency-repository.service.js +3 -4
  21. package/dist/db/repository/integration-credential-repository.service.d.ts +8 -0
  22. package/dist/db/repository/integration-credential-repository.service.d.ts.map +1 -0
  23. package/dist/db/repository/integration-credential-repository.service.js +26 -0
  24. package/dist/db/repository/integration-endpoint-repository.service.d.ts +8 -0
  25. package/dist/db/repository/integration-endpoint-repository.service.d.ts.map +1 -0
  26. package/dist/db/repository/integration-endpoint-repository.service.js +26 -0
  27. package/dist/db/repository/integration-inbound-repository.service.d.ts +1 -1
  28. package/dist/db/repository/integration-inbound-repository.service.d.ts.map +1 -1
  29. package/dist/db/repository/integration-inbound-repository.service.js +1 -1
  30. package/dist/db/repository/integration-outbound-repository.service.d.ts +2 -1
  31. package/dist/db/repository/integration-outbound-repository.service.d.ts.map +1 -1
  32. package/dist/db/repository/integration-outbound-repository.service.js +4 -1
  33. package/dist/index.d.ts +6 -3
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +8 -4
  36. package/package.json +1 -1
  37. package/dist/db/entities/integration-inbound.entity.d.ts.map +0 -1
  38. package/dist/db/entities/integration-outbound.entity.d.ts.map +0 -1
  39. package/dist/db/entities/integration-system.entity.d.ts.map +0 -1
  40. /package/dist/db/entities/{integration-inbound.entity.d.ts → integration/integration-inbound.entity.d.ts} +0 -0
@@ -0,0 +1,42 @@
1
+ import { AuthType } from './integration.enums.js';
2
+ /**
3
+ * Perfil de credenciais reutilizáveis para autenticação (API Key, Basic, Bearer, OAuth2).
4
+ * Utilize credentialId no IntegrationOutbound para referenciar estas credenciais.
5
+ */
6
+ export declare class IntegrationCredential {
7
+ id: string;
8
+ /** Nome amigável único (ex.: 'erp-prod', 'wms-staging') */
9
+ name: string;
10
+ /** Se a credencial está ativa */
11
+ active: boolean;
12
+ /**
13
+ * Tipo de autenticação: 'apiKey' | 'basic' | 'bearer' | 'oauth2'
14
+ * Mantido como string para flexibilidade sem precisar de enum em migrations.
15
+ */
16
+ type: AuthType;
17
+ /**
18
+ * Configuração não sensível:
19
+ * - apiKey: { headerName?: string, queryName?: string, prefix?: string }
20
+ * - basic: { usernameField?: string }
21
+ * - bearer: { headerName?: string, prefix?: string }
22
+ * - oauth2: { tokenUrl: string, clientId: string, scopes?: string[], audience?: string, resource?: string, authStyle?: 'body'|'basic' }
23
+ */
24
+ config?: Record<string, any> | null;
25
+ /**
26
+ * Segredos sensíveis (não selecionados por padrão):
27
+ * - apiKey: { value: string }
28
+ * - basic: { username: string, password: string }
29
+ * - bearer: { token: string }
30
+ * - oauth2: { clientSecret: string, username?: string, password?: string, privateKey?: string }
31
+ */
32
+ secrets?: Record<string, any> | null;
33
+ /** Metadados de rotação/expiração de credenciais */
34
+ rotation?: {
35
+ rotatedAt?: string;
36
+ expiresAt?: string;
37
+ notes?: string;
38
+ } | null;
39
+ createdAt: Date;
40
+ updatedAt: Date;
41
+ }
42
+ //# sourceMappingURL=integration-credential.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-credential.entity.d.ts","sourceRoot":"","sources":["../../../../src/db/entities/integration/integration-credential.entity.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD;;;GAGG;AACH,qBAEa,qBAAqB;IAEhC,EAAE,EAAG,MAAM,CAAC;IAEZ,2DAA2D;IAE3D,IAAI,EAAG,MAAM,CAAC;IAEd,iCAAiC;IAEjC,MAAM,EAAG,OAAO,CAAC;IAEjB;;;OAGG;IAEH,IAAI,EAAG,QAAQ,CAAC;IAEhB;;;;;;OAMG;IAEH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAEpC;;;;;;OAMG;IAEH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAIrC,oDAAoD;IAEpD,QAAQ,CAAC,EAAE;QACT,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,IAAI,CAAC;IAGT,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAElB"}
@@ -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
+ import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn, } from 'typeorm';
8
+ /**
9
+ * Perfil de credenciais reutilizáveis para autenticação (API Key, Basic, Bearer, OAuth2).
10
+ * Utilize credentialId no IntegrationOutbound para referenciar estas credenciais.
11
+ */
12
+ let IntegrationCredential = class IntegrationCredential {
13
+ id;
14
+ /** Nome amigável único (ex.: 'erp-prod', 'wms-staging') */
15
+ name;
16
+ /** Se a credencial está ativa */
17
+ active;
18
+ /**
19
+ * Tipo de autenticação: 'apiKey' | 'basic' | 'bearer' | 'oauth2'
20
+ * Mantido como string para flexibilidade sem precisar de enum em migrations.
21
+ */
22
+ type;
23
+ /**
24
+ * Configuração não sensível:
25
+ * - apiKey: { headerName?: string, queryName?: string, prefix?: string }
26
+ * - basic: { usernameField?: string }
27
+ * - bearer: { headerName?: string, prefix?: string }
28
+ * - oauth2: { tokenUrl: string, clientId: string, scopes?: string[], audience?: string, resource?: string, authStyle?: 'body'|'basic' }
29
+ */
30
+ config;
31
+ /**
32
+ * Segredos sensíveis (não selecionados por padrão):
33
+ * - apiKey: { value: string }
34
+ * - basic: { username: string, password: string }
35
+ * - bearer: { token: string }
36
+ * - oauth2: { clientSecret: string, username?: string, password?: string, privateKey?: string }
37
+ */
38
+ secrets;
39
+ /** Metadados de rotação/expiração de credenciais */
40
+ rotation;
41
+ createdAt;
42
+ updatedAt;
43
+ };
44
+ __decorate([
45
+ PrimaryGeneratedColumn('uuid')
46
+ ], IntegrationCredential.prototype, "id", void 0);
47
+ __decorate([
48
+ Column({ type: 'varchar', length: 120 })
49
+ ], IntegrationCredential.prototype, "name", void 0);
50
+ __decorate([
51
+ Column({ type: 'boolean', default: true })
52
+ ], IntegrationCredential.prototype, "active", void 0);
53
+ __decorate([
54
+ Column({ type: 'varchar', length: 30 })
55
+ ], IntegrationCredential.prototype, "type", void 0);
56
+ __decorate([
57
+ Column({ type: 'jsonb', nullable: true })
58
+ ], IntegrationCredential.prototype, "config", void 0);
59
+ __decorate([
60
+ Column({ type: 'jsonb', nullable: true, select: false })
61
+ ], IntegrationCredential.prototype, "secrets", void 0);
62
+ __decorate([
63
+ Column({ type: 'jsonb', nullable: true })
64
+ ], IntegrationCredential.prototype, "rotation", void 0);
65
+ __decorate([
66
+ CreateDateColumn({ name: "create_at", type: "timestamptz" })
67
+ ], IntegrationCredential.prototype, "createdAt", void 0);
68
+ __decorate([
69
+ UpdateDateColumn({ name: "update_at", type: "timestamptz" })
70
+ ], IntegrationCredential.prototype, "updatedAt", void 0);
71
+ IntegrationCredential = __decorate([
72
+ Entity({ name: 'integration_credential' }),
73
+ Index(['name'], { unique: true })
74
+ ], IntegrationCredential);
75
+ export { IntegrationCredential };
@@ -0,0 +1,87 @@
1
+ import { HttpMethod, TransportProtocol } from "./integration.enums.js";
2
+ /**
3
+ * Definição de roteamento de saída por chave (evento) e destino.
4
+ * Agora inclui também as configurações de Target/Delivery (protocolo, endpoint, templates, políticas, etc.).
5
+ */
6
+ export declare class IntegrationEndpoint {
7
+ id: string;
8
+ /** Sistema do endpoint (e.g., 'tms') */
9
+ name: string;
10
+ active: boolean;
11
+ /** ===================== Target/Delivery (simplificado no próprio Outbound) ===================== */
12
+ /**
13
+ * Transporte de saída: 'REST' | 'SOAP' | 'AMQP' | etc
14
+ */
15
+ transportProtocol: TransportProtocol;
16
+ /**
17
+ * Endpoint principal:
18
+ * - http(s): baseUrl (ex.: https://api.exemplo.com)
19
+ * - amqp: uri/host (ex.: amqp://broker:5672)
20
+ * - kafka: bootstrap servers (ex.: broker1:9092,broker2:9092)
21
+ * - sqs/pubsub: pode ser arn/topic/queue ou projeto+tópico
22
+ */
23
+ endpoint: string;
24
+ httpMethod: HttpMethod;
25
+ /**
26
+ * Config HTTP específica (quando transport = 'http'):
27
+ * {
28
+ * method: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE',
29
+ * pathTemplate?: string, // ex.: /v1/drivers/{{id}}
30
+ * headersTemplate?: Record<string, string>, // valores podem conter templates
31
+ * queryTemplate?: Record<string, any>,
32
+ * bodyTemplate?: any, // JSONata/Liquid/Handlebars
33
+ * contentType?: 'application/json' | 'application/xml' | 'text/plain' | string,
34
+ * timeoutMs?: number,
35
+ * compression?: { type?: 'gzip' | 'deflate' | 'br' }
36
+ * }
37
+ */
38
+ httpConfig?: Record<string, any> | null;
39
+ /**
40
+ * Config de fila/stream (quando transport = 'amqp' | 'kafka' | 'sqs' | 'pubsub'):
41
+ * {
42
+ * topic?: string, queue?: string, exchange?: string, routingKey?: string,
43
+ * partitionKey?: string, messageKey?: string,
44
+ * headersTemplate?: Record<string, string>,
45
+ * properties?: Record<string, any>, // amqp/kafka props
46
+ * payloadTemplate?: any
47
+ * }
48
+ */
49
+ queueConfig?: Record<string, any> | null;
50
+ /**
51
+ * Referência a credenciais reutilizáveis (IntegrationCredential.id).
52
+ */
53
+ credentialId?: string | null;
54
+ /**
55
+ * Opções de TLS/MTLS, certificados, SNI etc.
56
+ * Ex.: { rejectUnauthorized: true, ca?: string, cert?: string, key?: string, servername?: string }
57
+ */
58
+ tls?: Record<string, any> | null;
59
+ /**
60
+ * Política de retentativa:
61
+ * { maxAttempts: 3, strategy: 'exponential' | 'fixed', delayMs: 1000, maxDelayMs?: 60000, jitter?: true }
62
+ */
63
+ retryPolicy?: {
64
+ maxAttempts?: number;
65
+ strategy?: 'exponential' | 'fixed';
66
+ delayMs?: number;
67
+ maxDelayMs?: number;
68
+ jitter?: boolean;
69
+ } | null;
70
+ /**
71
+ * Rate limiting por rota:
72
+ * { limit: 100, intervalMs: 1000, burst?: 50, key?: 'targetSystem' | 'endpoint' | 'custom' }
73
+ */
74
+ rateLimit?: {
75
+ limit?: number;
76
+ intervalMs?: number;
77
+ burst?: number;
78
+ } | null;
79
+ /**
80
+ * Idempotência:
81
+ * { strategy: 'header' | 'bodyHash' | 'custom', headerName?: 'Idempotency-Key', ttlMs?: 300000 }
82
+ */
83
+ idempotency?: Record<string, any> | null;
84
+ createdAt: Date;
85
+ updatedAt: Date;
86
+ }
87
+ //# sourceMappingURL=integration-endpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-endpoint.d.ts","sourceRoot":"","sources":["../../../../src/db/entities/integration/integration-endpoint.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAGvE;;;GAGG;AACH,qBAGa,mBAAmB;IAE9B,EAAE,EAAG,MAAM,CAAC;IAEZ,wCAAwC;IAExC,IAAI,EAAG,MAAM,CAAC;IAGd,MAAM,EAAG,OAAO,CAAC;IAEjB,qGAAqG;IAErG;;OAEG;IAEH,iBAAiB,EAAG,iBAAiB,CAAC;IAEtC;;;;;;OAMG;IAEH,QAAQ,EAAG,MAAM,CAAC;IAGlB,UAAU,EAAG,UAAU,CAAC;IAExB;;;;;;;;;;;;OAYG;IAEH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAExC;;;;;;;;;OASG;IAEH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAGzC;;OAEG;IAEH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;;OAGG;IAEH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IAEH,WAAW,CAAC,EAAE;QACZ,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;QACnC,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,GAAG,IAAI,CAAC;IAET;;;OAGG;IAEH,SAAS,CAAC,EAAE;QACV,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,IAAI,CAAC;IAET;;;OAGG;IAEH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAGzC,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAElB"}
@@ -0,0 +1,137 @@
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
+ /**
8
+ */
9
+ // src/integration/entities/integration-outbound.entity.ts
10
+ //
11
+ import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn, } from "typeorm";
12
+ /**
13
+ * Definição de roteamento de saída por chave (evento) e destino.
14
+ * Agora inclui também as configurações de Target/Delivery (protocolo, endpoint, templates, políticas, etc.).
15
+ */
16
+ let IntegrationEndpoint = class IntegrationEndpoint {
17
+ id;
18
+ /** Sistema do endpoint (e.g., 'tms') */
19
+ name;
20
+ active;
21
+ /** ===================== Target/Delivery (simplificado no próprio Outbound) ===================== */
22
+ /**
23
+ * Transporte de saída: 'REST' | 'SOAP' | 'AMQP' | etc
24
+ */
25
+ transportProtocol;
26
+ /**
27
+ * Endpoint principal:
28
+ * - http(s): baseUrl (ex.: https://api.exemplo.com)
29
+ * - amqp: uri/host (ex.: amqp://broker:5672)
30
+ * - kafka: bootstrap servers (ex.: broker1:9092,broker2:9092)
31
+ * - sqs/pubsub: pode ser arn/topic/queue ou projeto+tópico
32
+ */
33
+ endpoint;
34
+ httpMethod;
35
+ /**
36
+ * Config HTTP específica (quando transport = 'http'):
37
+ * {
38
+ * method: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE',
39
+ * pathTemplate?: string, // ex.: /v1/drivers/{{id}}
40
+ * headersTemplate?: Record<string, string>, // valores podem conter templates
41
+ * queryTemplate?: Record<string, any>,
42
+ * bodyTemplate?: any, // JSONata/Liquid/Handlebars
43
+ * contentType?: 'application/json' | 'application/xml' | 'text/plain' | string,
44
+ * timeoutMs?: number,
45
+ * compression?: { type?: 'gzip' | 'deflate' | 'br' }
46
+ * }
47
+ */
48
+ httpConfig;
49
+ /**
50
+ * Config de fila/stream (quando transport = 'amqp' | 'kafka' | 'sqs' | 'pubsub'):
51
+ * {
52
+ * topic?: string, queue?: string, exchange?: string, routingKey?: string,
53
+ * partitionKey?: string, messageKey?: string,
54
+ * headersTemplate?: Record<string, string>,
55
+ * properties?: Record<string, any>, // amqp/kafka props
56
+ * payloadTemplate?: any
57
+ * }
58
+ */
59
+ queueConfig;
60
+ /**
61
+ * Referência a credenciais reutilizáveis (IntegrationCredential.id).
62
+ */
63
+ credentialId;
64
+ /**
65
+ * Opções de TLS/MTLS, certificados, SNI etc.
66
+ * Ex.: { rejectUnauthorized: true, ca?: string, cert?: string, key?: string, servername?: string }
67
+ */
68
+ tls;
69
+ /**
70
+ * Política de retentativa:
71
+ * { maxAttempts: 3, strategy: 'exponential' | 'fixed', delayMs: 1000, maxDelayMs?: 60000, jitter?: true }
72
+ */
73
+ retryPolicy;
74
+ /**
75
+ * Rate limiting por rota:
76
+ * { limit: 100, intervalMs: 1000, burst?: 50, key?: 'targetSystem' | 'endpoint' | 'custom' }
77
+ */
78
+ rateLimit;
79
+ /**
80
+ * Idempotência:
81
+ * { strategy: 'header' | 'bodyHash' | 'custom', headerName?: 'Idempotency-Key', ttlMs?: 300000 }
82
+ */
83
+ idempotency;
84
+ createdAt;
85
+ updatedAt;
86
+ };
87
+ __decorate([
88
+ PrimaryGeneratedColumn("uuid")
89
+ ], IntegrationEndpoint.prototype, "id", void 0);
90
+ __decorate([
91
+ Column({ type: "varchar", length: 80 })
92
+ ], IntegrationEndpoint.prototype, "name", void 0);
93
+ __decorate([
94
+ Column({ type: "boolean", default: true })
95
+ ], IntegrationEndpoint.prototype, "active", void 0);
96
+ __decorate([
97
+ Column({ name: "transport_protocol", type: "varchar", length: 20 })
98
+ ], IntegrationEndpoint.prototype, "transportProtocol", void 0);
99
+ __decorate([
100
+ Column({ type: "varchar", length: 500 })
101
+ ], IntegrationEndpoint.prototype, "endpoint", void 0);
102
+ __decorate([
103
+ Column({ name: "http_method", type: "varchar", length: 10, default: 'POST' })
104
+ ], IntegrationEndpoint.prototype, "httpMethod", void 0);
105
+ __decorate([
106
+ Column({ name: "http_config", type: "jsonb", nullable: true })
107
+ ], IntegrationEndpoint.prototype, "httpConfig", void 0);
108
+ __decorate([
109
+ Column({ name: "queue_config", type: "jsonb", nullable: true })
110
+ ], IntegrationEndpoint.prototype, "queueConfig", void 0);
111
+ __decorate([
112
+ Column({ name: "credential_id", type: "uuid", nullable: true })
113
+ ], IntegrationEndpoint.prototype, "credentialId", void 0);
114
+ __decorate([
115
+ Column({ type: "jsonb", nullable: true })
116
+ ], IntegrationEndpoint.prototype, "tls", void 0);
117
+ __decorate([
118
+ Column({ name: "retry_policy", type: "jsonb", nullable: true })
119
+ ], IntegrationEndpoint.prototype, "retryPolicy", void 0);
120
+ __decorate([
121
+ Column({ name: "rate_limit", type: "jsonb", nullable: true })
122
+ ], IntegrationEndpoint.prototype, "rateLimit", void 0);
123
+ __decorate([
124
+ Column({ type: "jsonb", nullable: true })
125
+ ], IntegrationEndpoint.prototype, "idempotency", void 0);
126
+ __decorate([
127
+ CreateDateColumn({ name: "create_at", type: "timestamptz" })
128
+ ], IntegrationEndpoint.prototype, "createdAt", void 0);
129
+ __decorate([
130
+ UpdateDateColumn({ name: "update_at", type: "timestamptz" })
131
+ ], IntegrationEndpoint.prototype, "updatedAt", void 0);
132
+ IntegrationEndpoint = __decorate([
133
+ Entity({ name: "integration_endpoint" }),
134
+ Index(["name", "active"], { unique: true }),
135
+ Index(["credentialId"])
136
+ ], IntegrationEndpoint);
137
+ export { IntegrationEndpoint };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-inbound.entity.d.ts","sourceRoot":"","sources":["../../../../src/db/entities/integration/integration-inbound.entity.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,qBAEa,kBAAkB;IAE7B,EAAE,EAAG,MAAM,CAAC;IAEZ,sCAAsC;IAEtC,MAAM,EAAG,MAAM,CAAC;IAEhB,8BAA8B;IAE9B,KAAK,EAAG,MAAM,CAAC;IAEf,gHAAgH;IAEhH,OAAO,EAAG,MAAM,CAAC;IAEjB,6CAA6C;IAE7C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,0CAA0C;IAE1C,UAAU,EAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEjC,yBAAyB;IAEzB,cAAc,EAAG,MAAM,CAAC;IAExB,4CAA4C;IAE5C,KAAK,EAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE5B,0BAA0B;IAE1B,MAAM,EAAG,OAAO,CAAC;IAEjB,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"}
@@ -64,10 +64,10 @@ __decorate([
64
64
  Column({ type: "jsonb", nullable: true })
65
65
  ], IntegrationInbound.prototype, "options", void 0);
66
66
  __decorate([
67
- CreateDateColumn({ type: "timestamptz" })
67
+ CreateDateColumn({ name: "create_at", type: "timestamptz" })
68
68
  ], IntegrationInbound.prototype, "createdAt", void 0);
69
69
  __decorate([
70
- UpdateDateColumn({ type: "timestamptz" })
70
+ UpdateDateColumn({ name: "update_at", type: "timestamptz" })
71
71
  ], IntegrationInbound.prototype, "updatedAt", void 0);
72
72
  IntegrationInbound = __decorate([
73
73
  Entity({ name: "integration_inbound" }),
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Outbound routing definition per source key. One row per target (e.g., WMS, TMS).
2
+ * Definição de roteamento de saída por chave (evento) e destino.
3
+ * Agora inclui também as configurações de Target/Delivery (protocolo, endpoint, templates, políticas, etc.).
3
4
  */
4
5
  export declare class IntegrationOutbound {
5
6
  id: string;
@@ -17,7 +18,8 @@ export declare class IntegrationOutbound {
17
18
  rules: Record<string, any>;
18
19
  /** Se a rota está ativa */
19
20
  active: boolean;
20
- /** Opções adicionais de roteamento (reservado para uso futuro) */
21
+ endpointId?: string | null;
22
+ /** Opções adicionais (reservado para uso futuro) */
21
23
  options?: Record<string, any> | null;
22
24
  createdAt: Date;
23
25
  updatedAt: Date;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-outbound.entity.d.ts","sourceRoot":"","sources":["../../../../src/db/entities/integration/integration-outbound.entity.ts"],"names":[],"mappings":"AAmCA;;;GAGG;AACH,qBAGa,mBAAmB;IAE9B,EAAE,EAAG,MAAM,CAAC;IAEZ,sCAAsC;IAEtC,MAAM,EAAG,MAAM,CAAC;IAEhB,8CAA8C;IAE9C,YAAY,EAAG,MAAM,CAAC;IAEtB,0DAA0D;IAE1D,KAAK,EAAG,MAAM,CAAC;IAEf,gHAAgH;IAEhH,OAAO,EAAG,MAAM,CAAC;IAEjB,gBAAgB;IAEhB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,sCAAsC;IAEtC,KAAK,EAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE5B,2BAA2B;IAE3B,MAAM,EAAG,OAAO,CAAC;IAIjB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,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"}
@@ -4,9 +4,36 @@ 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
+ /**
8
+ * Representa a definição de roteamento outbound para eventos originados por um sistema.
9
+ *
10
+ * Esta entidade mapeia uma rota de saída por chave de origem e destino, armazenando
11
+ * regras e metadados necessários para encaminhar eventos (por exemplo, do TMS para o WMS).
12
+ * Cada registro corresponde a um alvo (targetSystem) para um evento específico e versão.
13
+ *
14
+ * @remarks
15
+ * - Há um índice único composto por (system, event, targetSystem, version) garantindo que
16
+ * não existam duplicatas de rota para a mesma combinação.
17
+ * - Somente a versão mais recente de uma rota pode estar ativa; versões anteriores devem ser imutáveis.
18
+ *
19
+ * @property id UUID gerada automaticamente que identifica unicamente a rota.
20
+ * @property system Sistema de origem (ex.: "tms"), usado para agrupar/filtrar rotas por emissor.
21
+ * @property targetSystem Sistema de destino (ex.: "erp", "wms") para o qual o evento será encaminhado.
22
+ * @property event Chave do evento (ex.: "driver", "driver.created") que aciona esta rota.
23
+ * @property version Versão da rota. Versões anteriores não devem ser modificadas; apenas a última pode estar ativa.
24
+ * @property description Texto descritivo opcional da rota (até 500 caracteres).
25
+ * @property rules Configuração de regras (BRE) em formato JSONB utilizada para avaliar/executar o roteamento.
26
+ * @property active Indicador se a rota está ativa e deve ser considerada pelo mecanismo de envio.
27
+ * @property options Campo JSONB opcional para opções adicionais de roteamento (reservado para uso futuro).
28
+ * @property createdAt Timestamp (timestamptz) de criação do registro.
29
+ * @property updatedAt Timestamp (timestamptz) da última atualização do registro.
30
+ */
31
+ // src/integration/entities/integration-outbound.entity.ts
32
+ //
7
33
  import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn, } from "typeorm";
8
34
  /**
9
- * Outbound routing definition per source key. One row per target (e.g., WMS, TMS).
35
+ * Definição de roteamento de saída por chave (evento) e destino.
36
+ * Agora inclui também as configurações de Target/Delivery (protocolo, endpoint, templates, políticas, etc.).
10
37
  */
11
38
  let IntegrationOutbound = class IntegrationOutbound {
12
39
  id;
@@ -24,7 +51,9 @@ let IntegrationOutbound = class IntegrationOutbound {
24
51
  rules;
25
52
  /** Se a rota está ativa */
26
53
  active;
27
- /** Opções adicionais de roteamento (reservado para uso futuro) */
54
+ /* Referência o perfil de endpoint (IntegrationEndpoint.id). */
55
+ endpointId;
56
+ /** Opções adicionais (reservado para uso futuro) */
28
57
  options;
29
58
  createdAt;
30
59
  updatedAt;
@@ -36,7 +65,7 @@ __decorate([
36
65
  Column({ type: "varchar", length: 80 })
37
66
  ], IntegrationOutbound.prototype, "system", void 0);
38
67
  __decorate([
39
- Column({ type: "varchar", length: 80 })
68
+ Column({ name: "target_system", type: "varchar", length: 80 })
40
69
  ], IntegrationOutbound.prototype, "targetSystem", void 0);
41
70
  __decorate([
42
71
  Column({ type: "varchar", length: 80 })
@@ -53,17 +82,21 @@ __decorate([
53
82
  __decorate([
54
83
  Column({ type: "boolean", default: true })
55
84
  ], IntegrationOutbound.prototype, "active", void 0);
85
+ __decorate([
86
+ Column({ name: "endpoint_id", type: "uuid", nullable: true })
87
+ ], IntegrationOutbound.prototype, "endpointId", void 0);
56
88
  __decorate([
57
89
  Column({ type: "jsonb", nullable: true })
58
90
  ], IntegrationOutbound.prototype, "options", void 0);
59
91
  __decorate([
60
- CreateDateColumn({ type: "timestamptz" })
92
+ CreateDateColumn({ name: "create_at", type: "timestamptz" })
61
93
  ], IntegrationOutbound.prototype, "createdAt", void 0);
62
94
  __decorate([
63
- UpdateDateColumn({ type: "timestamptz" })
95
+ UpdateDateColumn({ name: "update_at", type: "timestamptz" })
64
96
  ], IntegrationOutbound.prototype, "updatedAt", void 0);
65
97
  IntegrationOutbound = __decorate([
66
98
  Entity({ name: "integration_outbound" }),
67
- Index(["system", "event", "targetSystem", "version"], { unique: true })
99
+ Index(["system", "event", "targetSystem", "version"], { unique: true }),
100
+ Index(["endpointId"])
68
101
  ], IntegrationOutbound);
69
102
  export { IntegrationOutbound };
@@ -5,5 +5,7 @@ export declare class IntegrationSystem {
5
5
  system: string;
6
6
  /** Se o sistema está ativo */
7
7
  active: boolean;
8
+ createdAt: Date;
9
+ updatedAt: Date;
8
10
  }
9
11
  //# sourceMappingURL=integration-system.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-system.entity.d.ts","sourceRoot":"","sources":["../../../../src/db/entities/integration/integration-system.entity.ts"],"names":[],"mappings":"AAEA,qBACa,iBAAiB;IAC5B,mDAAmD;IAEnD,EAAE,EAAG,MAAM,CAAC;IAEZ,yDAAyD;IAGzD,MAAM,EAAG,MAAM,CAAC;IAEhB,8BAA8B;IAE9B,MAAM,EAAG,OAAO,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAElB"}
@@ -4,7 +4,7 @@ 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, Entity, PrimaryGeneratedColumn, Index } from 'typeorm';
7
+ import { Column, Entity, PrimaryGeneratedColumn, Index, CreateDateColumn, UpdateDateColumn } from 'typeorm';
8
8
  let IntegrationSystem = class IntegrationSystem {
9
9
  /** Identificador único do sistema de integração */
10
10
  id;
@@ -12,6 +12,8 @@ let IntegrationSystem = class IntegrationSystem {
12
12
  system;
13
13
  /** Se o sistema está ativo */
14
14
  active;
15
+ createdAt;
16
+ updatedAt;
15
17
  };
16
18
  __decorate([
17
19
  PrimaryGeneratedColumn('uuid')
@@ -23,6 +25,12 @@ __decorate([
23
25
  __decorate([
24
26
  Column({ type: 'boolean', default: true })
25
27
  ], IntegrationSystem.prototype, "active", void 0);
28
+ __decorate([
29
+ CreateDateColumn({ name: "create_at", type: "timestamptz" })
30
+ ], IntegrationSystem.prototype, "createdAt", void 0);
31
+ __decorate([
32
+ UpdateDateColumn({ name: "update_at", type: "timestamptz" })
33
+ ], IntegrationSystem.prototype, "updatedAt", void 0);
26
34
  IntegrationSystem = __decorate([
27
35
  Entity({ name: 'integration_system' })
28
36
  ], IntegrationSystem);
@@ -0,0 +1,22 @@
1
+ export declare enum TransportProtocol {
2
+ REST = "REST",
3
+ SOAP = "SOAP",
4
+ GRAPHQL = "GRAPHQL",
5
+ AMQP = "AMQP"
6
+ }
7
+ export declare enum HttpMethod {
8
+ GET = "GET",
9
+ POST = "POST",
10
+ PUT = "PUT",
11
+ PATCH = "PATCH",
12
+ DELETE = "DELETE"
13
+ }
14
+ export declare enum AuthType {
15
+ NONE = "NONE",
16
+ API_KEY = "API_KEY",
17
+ BASIC = "BASIC",
18
+ BEARER_STATIC = "BEARER_STATIC",
19
+ OAUTH2_CLIENT_CREDENTIALS = "OAUTH2_CLIENT_CREDENTIALS",
20
+ OAUTH2_PASSWORD = "OAUTH2_PASSWORD"
21
+ }
22
+ //# sourceMappingURL=integration.enums.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.enums.d.ts","sourceRoot":"","sources":["../../../../src/db/entities/integration/integration.enums.ts"],"names":[],"mappings":"AACA,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAID,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,aAAa,kBAAkB;IAC/B,yBAAyB,8BAA8B;IACvD,eAAe,oBAAoB;CACpC"}
@@ -0,0 +1,38 @@
1
+ // src/integration/enums.ts
2
+ export var TransportProtocol;
3
+ (function (TransportProtocol) {
4
+ TransportProtocol["REST"] = "REST";
5
+ TransportProtocol["SOAP"] = "SOAP";
6
+ TransportProtocol["GRAPHQL"] = "GRAPHQL";
7
+ TransportProtocol["AMQP"] = "AMQP";
8
+ })(TransportProtocol || (TransportProtocol = {}));
9
+ export var HttpMethod;
10
+ (function (HttpMethod) {
11
+ HttpMethod["GET"] = "GET";
12
+ HttpMethod["POST"] = "POST";
13
+ HttpMethod["PUT"] = "PUT";
14
+ HttpMethod["PATCH"] = "PATCH";
15
+ HttpMethod["DELETE"] = "DELETE";
16
+ })(HttpMethod || (HttpMethod = {}));
17
+ export var AuthType;
18
+ (function (AuthType) {
19
+ AuthType["NONE"] = "NONE";
20
+ AuthType["API_KEY"] = "API_KEY";
21
+ AuthType["BASIC"] = "BASIC";
22
+ AuthType["BEARER_STATIC"] = "BEARER_STATIC";
23
+ AuthType["OAUTH2_CLIENT_CREDENTIALS"] = "OAUTH2_CLIENT_CREDENTIALS";
24
+ AuthType["OAUTH2_PASSWORD"] = "OAUTH2_PASSWORD";
25
+ })(AuthType || (AuthType = {}));
26
+ /*
27
+ export enum ApiKeyIn {
28
+ HEADER = 'HEADER',
29
+ QUERY = 'QUERY',
30
+ }
31
+ */
32
+ /*
33
+ export enum BackoffStrategy {
34
+ FIXED = 'FIXED',
35
+ EXPONENTIAL = 'EXPONENTIAL',
36
+ EXPONENTIAL_JITTER = 'EXPONENTIAL_JITTER',
37
+ }
38
+ */
@@ -14,6 +14,6 @@ export declare class DiagnosticLatencyRepositoryService {
14
14
  * @param timestamp_start
15
15
  * @returns
16
16
  */
17
- create(correlation_id: string, timestamp_start: Date, data?: Record<string, any>): Promise<DiagnosticLatency>;
17
+ create(correlation_id: string, timestamp_start: Date, timestamp_end: Date, data?: Record<string, any>): Promise<DiagnosticLatency>;
18
18
  }
19
19
  //# sourceMappingURL=diagnostic-latency-repository.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostic-latency-repository.service.d.ts","sourceRoot":"","sources":["../../../src/db/repository/diagnostic-latency-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E;;;GAGG;AACH,qBACa,kCAAkC;IAG3C,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,iBAAiB,CAAC;IAGtD;;;;;;OAMG;IACG,MAAM,CACV,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,IAAI,EACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACzB,OAAO,CAAC,iBAAiB,CAAC;CAe9B"}
1
+ {"version":3,"file":"diagnostic-latency-repository.service.d.ts","sourceRoot":"","sources":["../../../src/db/repository/diagnostic-latency-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E;;;GAGG;AACH,qBACa,kCAAkC;IAG3C,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,iBAAiB,CAAC;IAGtD;;;;;;OAMG;IACG,MAAM,CACV,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,IAAI,EACrB,aAAa,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACzB,OAAO,CAAC,iBAAiB,CAAC;CAc9B"}
@@ -26,13 +26,12 @@ let DiagnosticLatencyRepositoryService = class DiagnosticLatencyRepositoryServic
26
26
  * @param timestamp_start
27
27
  * @returns
28
28
  */
29
- async create(correlation_id, timestamp_start, data) {
30
- const now = new Date();
29
+ async create(correlation_id, timestamp_start, timestamp_end, data) {
31
30
  const entity = this.repo.create({
32
31
  correlationId: correlation_id,
33
32
  timestamp_start,
34
- timestamp_end: now,
35
- latencyMs: now.getTime() - timestamp_start.getTime(),
33
+ timestamp_end,
34
+ latencyMs: timestamp_end.getTime() - timestamp_start.getTime(),
36
35
  data
37
36
  });
38
37
  return this.repo.save(entity);
@@ -0,0 +1,8 @@
1
+ import { Repository } from 'typeorm';
2
+ import { IntegrationCredential } from '../entities/integration/integration-credential.entity.js';
3
+ export declare class CredentialRepositoryService {
4
+ private readonly repo;
5
+ constructor(repo: Repository<IntegrationCredential>);
6
+ findOne(credentialId: string): Promise<IntegrationCredential | null>;
7
+ }
8
+ //# sourceMappingURL=integration-credential-repository.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-credential-repository.service.d.ts","sourceRoot":"","sources":["../../../src/db/repository/integration-credential-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AAGjG,qBACa,2BAA2B;IAGpC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAGpD,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;CAG3E"}
@@ -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 { IntegrationCredential } from '../entities/integration/integration-credential.entity.js';
13
+ let CredentialRepositoryService = class CredentialRepositoryService {
14
+ repo;
15
+ constructor(repo) {
16
+ this.repo = repo;
17
+ }
18
+ async findOne(credentialId) {
19
+ return await this.repo.findOne({ where: { id: credentialId, active: true } });
20
+ }
21
+ };
22
+ CredentialRepositoryService = __decorate([
23
+ Injectable(),
24
+ __param(0, InjectRepository(IntegrationCredential))
25
+ ], CredentialRepositoryService);
26
+ export { CredentialRepositoryService };
@@ -0,0 +1,8 @@
1
+ import { Repository } from 'typeorm';
2
+ import { IntegrationEndpoint } from '../entities/integration/integration-endpoint.js';
3
+ export declare class EndpointRepositoryService {
4
+ private readonly repo;
5
+ constructor(repo: Repository<IntegrationEndpoint>);
6
+ findOne(endpointId: string): Promise<IntegrationEndpoint | null>;
7
+ }
8
+ //# sourceMappingURL=integration-endpoint-repository.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-endpoint-repository.service.d.ts","sourceRoot":"","sources":["../../../src/db/repository/integration-endpoint-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAGtF,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC;IAGlD,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;CAGvE"}
@@ -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 { IntegrationEndpoint } from '../entities/integration/integration-endpoint.js';
13
+ let EndpointRepositoryService = class EndpointRepositoryService {
14
+ repo;
15
+ constructor(repo) {
16
+ this.repo = repo;
17
+ }
18
+ async findOne(endpointId) {
19
+ return await this.repo.findOne({ where: { id: endpointId, active: true } });
20
+ }
21
+ };
22
+ EndpointRepositoryService = __decorate([
23
+ Injectable(),
24
+ __param(0, InjectRepository(IntegrationEndpoint))
25
+ ], EndpointRepositoryService);
26
+ export { EndpointRepositoryService };
@@ -1,5 +1,5 @@
1
1
  import { Repository } from "typeorm";
2
- import { IntegrationInbound } from "../entities/integration-inbound.entity.js";
2
+ import { IntegrationInbound } from "../entities/integration/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/db/repository/integration-inbound-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAG/E,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/db/repository/integration-inbound-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAG3F,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"}
@@ -9,7 +9,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
9
9
  };
10
10
  import { Injectable } from "@nestjs/common";
11
11
  import { InjectRepository } from "@nestjs/typeorm";
12
- import { IntegrationInbound } from "../entities/integration-inbound.entity.js";
12
+ import { IntegrationInbound } from "../entities/integration/integration-inbound.entity.js";
13
13
  let InboundRepositoryService = class InboundRepositoryService {
14
14
  repo;
15
15
  constructor(repo) {
@@ -1,8 +1,9 @@
1
1
  import { Repository } from 'typeorm';
2
- import { IntegrationOutbound } from '../entities/integration-outbound.entity.js';
2
+ import { IntegrationOutbound } from '../entities/integration/integration-outbound.entity.js';
3
3
  export declare class OutboundRepositoryService {
4
4
  private readonly repo;
5
5
  constructor(repo: Repository<IntegrationOutbound>);
6
6
  getRoutes(system: string, event: string): Promise<IntegrationOutbound[]>;
7
+ findOne(system: string, event: string): Promise<IntegrationOutbound | null>;
7
8
  }
8
9
  //# sourceMappingURL=integration-outbound-repository.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"integration-outbound-repository.service.d.ts","sourceRoot":"","sources":["../../../src/db/repository/integration-outbound-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAGjF,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/db/repository/integration-outbound-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAG7F,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;IAKxE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;CAGlF"}
@@ -9,7 +9,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
9
9
  };
10
10
  import { Injectable } from '@nestjs/common';
11
11
  import { InjectRepository } from '@nestjs/typeorm';
12
- import { IntegrationOutbound } from '../entities/integration-outbound.entity.js';
12
+ import { IntegrationOutbound } from '../entities/integration/integration-outbound.entity.js';
13
13
  let OutboundRepositoryService = class OutboundRepositoryService {
14
14
  repo;
15
15
  constructor(repo) {
@@ -18,6 +18,9 @@ let OutboundRepositoryService = class OutboundRepositoryService {
18
18
  async getRoutes(system, event) {
19
19
  return this.repo.find({ where: { system, event, active: true }, order: { version: 'DESC' } });
20
20
  }
21
+ async findOne(system, event) {
22
+ return this.repo.findOne({ where: { system, event, active: true }, order: { version: 'DESC' } });
23
+ }
21
24
  };
22
25
  OutboundRepositoryService = __decorate([
23
26
  Injectable(),
package/dist/index.d.ts CHANGED
@@ -6,9 +6,12 @@ export * from './rabbitmq.interfaces.js';
6
6
  export * from './rabbitmq-envelope-message.js';
7
7
  export * from './context-message.interface.js';
8
8
  export * from './publish-meta.interface.js';
9
- export * from './db/entities/integration-system.entity.js';
10
- export * from './db/entities/integration-inbound.entity.js';
11
- export * from './db/entities/integration-outbound.entity.js';
9
+ export * from './db/entities/integration/integration.enums.js';
10
+ export * from './db/entities/integration/integration-system.entity.js';
11
+ export * from './db/entities/integration/integration-inbound.entity.js';
12
+ export * from './db/entities/integration/integration-outbound.entity.js';
13
+ export * from './db/entities/integration/integration-endpoint.js';
14
+ export * from './db/entities/integration/integration-credential.entity.js';
12
15
  export * from './db/entities/diagnostic-latency.entity.js';
13
16
  export * from './db/repository/integration-inbound-repository.service.js';
14
17
  export * from './db/repository/integration-outbound-repository.service.js';
@@ -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;AAG5C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAE3D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,0DAA0D,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;AAG5C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AACxE,cAAc,0DAA0D,CAAC;AACzE,cAAc,mDAAmD,CAAC;AAClE,cAAc,4DAA4D,CAAC;AAE3E,cAAc,4CAA4C,CAAC;AAG3D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,0DAA0D,CAAC"}
package/dist/index.js CHANGED
@@ -6,11 +6,15 @@ export * from './rabbitmq.interfaces.js';
6
6
  export * from './rabbitmq-envelope-message.js';
7
7
  export * from './context-message.interface.js';
8
8
  export * from './publish-meta.interface.js';
9
- // Entidades e repositórios TypeORM
10
- export * from './db/entities/integration-system.entity.js';
11
- export * from './db/entities/integration-inbound.entity.js';
12
- export * from './db/entities/integration-outbound.entity.js';
9
+ // Entidades
10
+ export * from './db/entities/integration/integration.enums.js';
11
+ export * from './db/entities/integration/integration-system.entity.js';
12
+ export * from './db/entities/integration/integration-inbound.entity.js';
13
+ export * from './db/entities/integration/integration-outbound.entity.js';
14
+ export * from './db/entities/integration/integration-endpoint.js';
15
+ export * from './db/entities/integration/integration-credential.entity.js';
13
16
  export * from './db/entities/diagnostic-latency.entity.js';
17
+ // Repositórios
14
18
  export * from './db/repository/integration-inbound-repository.service.js';
15
19
  export * from './db/repository/integration-outbound-repository.service.js';
16
20
  export * from './db/repository/diagnostic-latency-repository.service.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargolift-cdi/types",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "TypeScript types e interfaces comuns para projetos Cargolift CDI",
5
5
  "keywords": [
6
6
  "typescript",
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-inbound.entity.d.ts","sourceRoot":"","sources":["../../../src/db/entities/integration-inbound.entity.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,qBAEa,kBAAkB;IAE7B,EAAE,EAAG,MAAM,CAAC;IAEZ,sCAAsC;IAEtC,MAAM,EAAG,MAAM,CAAC;IAEhB,8BAA8B;IAE9B,KAAK,EAAG,MAAM,CAAC;IAEf,gHAAgH;IAEhH,OAAO,EAAG,MAAM,CAAC;IAEjB,6CAA6C;IAE7C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,0CAA0C;IAE1C,UAAU,EAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEjC,yBAAyB;IAEzB,cAAc,EAAG,MAAM,CAAC;IAExB,4CAA4C;IAE5C,KAAK,EAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE5B,0BAA0B;IAE1B,MAAM,EAAG,OAAO,CAAC;IAEjB,oDAAoD;IAEpD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAGrC,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAClB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-outbound.entity.d.ts","sourceRoot":"","sources":["../../../src/db/entities/integration-outbound.entity.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,qBAEa,mBAAmB;IAE9B,EAAE,EAAG,MAAM,CAAC;IAEZ,sCAAsC;IAEtC,MAAM,EAAG,MAAM,CAAC;IAEhB,8CAA8C;IAE9C,YAAY,EAAG,MAAM,CAAC;IAEtB,0DAA0D;IAE1D,KAAK,EAAG,MAAM,CAAC;IAEf,gHAAgH;IAEhH,OAAO,EAAG,MAAM,CAAC;IAEjB,gBAAgB;IAEhB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,sCAAsC;IAEtC,KAAK,EAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE5B,2BAA2B;IAE3B,MAAM,EAAG,OAAO,CAAC;IAEjB,kEAAkE;IAElE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAGrC,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAClB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-system.entity.d.ts","sourceRoot":"","sources":["../../../src/db/entities/integration-system.entity.ts"],"names":[],"mappings":"AAEA,qBACa,iBAAiB;IAC5B,mDAAmD;IAEnD,EAAE,EAAG,MAAM,CAAC;IAEZ,yDAAyD;IAGzD,MAAM,EAAG,MAAM,CAAC;IAEhB,8BAA8B;IAE9B,MAAM,EAAG,OAAO,CAAC;CAClB"}