@cargolift-cdi/types 0.1.32 → 0.1.34
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.
- package/dist/db/entities/integration/integration-credential.entity.d.ts +42 -0
- package/dist/db/entities/integration/integration-credential.entity.d.ts.map +1 -0
- package/dist/db/entities/integration/integration-credential.entity.js +75 -0
- package/dist/db/entities/integration/integration-endpoint.d.ts +89 -0
- package/dist/db/entities/integration/integration-endpoint.d.ts.map +1 -0
- package/dist/db/entities/integration/integration-endpoint.js +142 -0
- package/dist/db/entities/integration/integration-inbound.entity.d.ts.map +1 -0
- package/dist/db/entities/{integration-inbound.entity.js → integration/integration-inbound.entity.js} +2 -2
- package/dist/db/entities/{integration-outbound.entity.d.ts → integration/integration-outbound.entity.d.ts} +3 -2
- package/dist/db/entities/integration/integration-outbound.entity.d.ts.map +1 -0
- package/dist/db/entities/{integration-outbound.entity.js → integration/integration-outbound.entity.js} +34 -6
- package/dist/db/entities/{integration-system.entity.d.ts → integration/integration-system.entity.d.ts} +2 -0
- package/dist/db/entities/integration/integration-system.entity.d.ts.map +1 -0
- package/dist/db/entities/{integration-system.entity.js → integration/integration-system.entity.js} +9 -1
- package/dist/db/entities/integration/integration.enums.d.ts +22 -0
- package/dist/db/entities/integration/integration.enums.d.ts.map +1 -0
- package/dist/db/entities/integration/integration.enums.js +38 -0
- package/dist/db/repository/integration-credential-repository.service.d.ts +8 -0
- package/dist/db/repository/integration-credential-repository.service.d.ts.map +1 -0
- package/dist/db/repository/integration-credential-repository.service.js +26 -0
- package/dist/db/repository/integration-endpoint-repository.service.d.ts +11 -0
- package/dist/db/repository/integration-endpoint-repository.service.d.ts.map +1 -0
- package/dist/db/repository/integration-endpoint-repository.service.js +33 -0
- package/dist/db/repository/integration-inbound-repository.service.d.ts +1 -1
- package/dist/db/repository/integration-inbound-repository.service.d.ts.map +1 -1
- package/dist/db/repository/integration-inbound-repository.service.js +1 -1
- package/dist/db/repository/integration-outbound-repository.service.d.ts +3 -2
- package/dist/db/repository/integration-outbound-repository.service.d.ts.map +1 -1
- package/dist/db/repository/integration-outbound-repository.service.js +7 -4
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -4
- package/package.json +1 -1
- package/dist/db/entities/integration-inbound.entity.d.ts.map +0 -1
- package/dist/db/entities/integration-outbound.entity.d.ts.map +0 -1
- package/dist/db/entities/integration-system.entity.d.ts.map +0 -1
- /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,89 @@
|
|
|
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 de destino (e.g., 'erp', 'wms') */
|
|
9
|
+
system: string;
|
|
10
|
+
/** Evento (chave) (e.g., 'driver' or 'driver.created') */
|
|
11
|
+
event: string;
|
|
12
|
+
active: boolean;
|
|
13
|
+
/** ===================== Target/Delivery (simplificado no próprio Outbound) ===================== */
|
|
14
|
+
/**
|
|
15
|
+
* Transporte de saída: 'REST' | 'SOAP' | 'AMQP' | etc
|
|
16
|
+
*/
|
|
17
|
+
transportProtocol: TransportProtocol;
|
|
18
|
+
/**
|
|
19
|
+
* Endpoint principal:
|
|
20
|
+
* - http(s): baseUrl (ex.: https://api.exemplo.com)
|
|
21
|
+
* - amqp: uri/host (ex.: amqp://broker:5672)
|
|
22
|
+
* - kafka: bootstrap servers (ex.: broker1:9092,broker2:9092)
|
|
23
|
+
* - sqs/pubsub: pode ser arn/topic/queue ou projeto+tópico
|
|
24
|
+
*/
|
|
25
|
+
endpoint: string;
|
|
26
|
+
httpMethod: HttpMethod;
|
|
27
|
+
/**
|
|
28
|
+
* Config HTTP específica (quando transport = 'http'):
|
|
29
|
+
* {
|
|
30
|
+
* method: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE',
|
|
31
|
+
* pathTemplate?: string, // ex.: /v1/drivers/{{id}}
|
|
32
|
+
* headersTemplate?: Record<string, string>, // valores podem conter templates
|
|
33
|
+
* queryTemplate?: Record<string, any>,
|
|
34
|
+
* bodyTemplate?: any, // JSONata/Liquid/Handlebars
|
|
35
|
+
* contentType?: 'application/json' | 'application/xml' | 'text/plain' | string,
|
|
36
|
+
* timeoutMs?: number,
|
|
37
|
+
* compression?: { type?: 'gzip' | 'deflate' | 'br' }
|
|
38
|
+
* }
|
|
39
|
+
*/
|
|
40
|
+
httpConfig?: Record<string, any> | null;
|
|
41
|
+
/**
|
|
42
|
+
* Config de fila/stream (quando transport = 'amqp' | 'kafka' | 'sqs' | 'pubsub'):
|
|
43
|
+
* {
|
|
44
|
+
* topic?: string, queue?: string, exchange?: string, routingKey?: string,
|
|
45
|
+
* partitionKey?: string, messageKey?: string,
|
|
46
|
+
* headersTemplate?: Record<string, string>,
|
|
47
|
+
* properties?: Record<string, any>, // amqp/kafka props
|
|
48
|
+
* payloadTemplate?: any
|
|
49
|
+
* }
|
|
50
|
+
*/
|
|
51
|
+
queueConfig?: Record<string, any> | null;
|
|
52
|
+
/**
|
|
53
|
+
* Referência a credenciais reutilizáveis (IntegrationCredential.id).
|
|
54
|
+
*/
|
|
55
|
+
credentialId?: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* Opções de TLS/MTLS, certificados, SNI etc.
|
|
58
|
+
* Ex.: { rejectUnauthorized: true, ca?: string, cert?: string, key?: string, servername?: string }
|
|
59
|
+
*/
|
|
60
|
+
tls?: Record<string, any> | null;
|
|
61
|
+
/**
|
|
62
|
+
* Política de retentativa:
|
|
63
|
+
* { maxAttempts: 3, strategy: 'exponential' | 'fixed', delayMs: 1000, maxDelayMs?: 60000, jitter?: true }
|
|
64
|
+
*/
|
|
65
|
+
retryPolicy?: {
|
|
66
|
+
maxAttempts?: number;
|
|
67
|
+
strategy?: 'exponential' | 'fixed';
|
|
68
|
+
delayMs?: number;
|
|
69
|
+
maxDelayMs?: number;
|
|
70
|
+
jitter?: boolean;
|
|
71
|
+
} | null;
|
|
72
|
+
/**
|
|
73
|
+
* Rate limiting por rota:
|
|
74
|
+
* { limit: 100, intervalMs: 1000, burst?: 50, key?: 'targetSystem' | 'endpoint' | 'custom' }
|
|
75
|
+
*/
|
|
76
|
+
rateLimit?: {
|
|
77
|
+
limit?: number;
|
|
78
|
+
intervalMs?: number;
|
|
79
|
+
burst?: number;
|
|
80
|
+
} | null;
|
|
81
|
+
/**
|
|
82
|
+
* Idempotência:
|
|
83
|
+
* { strategy: 'header' | 'bodyHash' | 'custom', headerName?: 'Idempotency-Key', ttlMs?: 300000 }
|
|
84
|
+
*/
|
|
85
|
+
idempotency?: Record<string, any> | null;
|
|
86
|
+
createdAt: Date;
|
|
87
|
+
updatedAt: Date;
|
|
88
|
+
}
|
|
89
|
+
//# 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,8CAA8C;IAE9C,MAAM,EAAG,MAAM,CAAC;IAEhB,0DAA0D;IAE1D,KAAK,EAAG,MAAM,CAAC;IAGf,MAAM,EAAG,OAAO,CAAC;IAGjB,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,142 @@
|
|
|
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 de destino (e.g., 'erp', 'wms') */
|
|
19
|
+
system;
|
|
20
|
+
/** Evento (chave) (e.g., 'driver' or 'driver.created') */
|
|
21
|
+
event;
|
|
22
|
+
active;
|
|
23
|
+
/** ===================== Target/Delivery (simplificado no próprio Outbound) ===================== */
|
|
24
|
+
/**
|
|
25
|
+
* Transporte de saída: 'REST' | 'SOAP' | 'AMQP' | etc
|
|
26
|
+
*/
|
|
27
|
+
transportProtocol;
|
|
28
|
+
/**
|
|
29
|
+
* Endpoint principal:
|
|
30
|
+
* - http(s): baseUrl (ex.: https://api.exemplo.com)
|
|
31
|
+
* - amqp: uri/host (ex.: amqp://broker:5672)
|
|
32
|
+
* - kafka: bootstrap servers (ex.: broker1:9092,broker2:9092)
|
|
33
|
+
* - sqs/pubsub: pode ser arn/topic/queue ou projeto+tópico
|
|
34
|
+
*/
|
|
35
|
+
endpoint;
|
|
36
|
+
httpMethod;
|
|
37
|
+
/**
|
|
38
|
+
* Config HTTP específica (quando transport = 'http'):
|
|
39
|
+
* {
|
|
40
|
+
* method: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE',
|
|
41
|
+
* pathTemplate?: string, // ex.: /v1/drivers/{{id}}
|
|
42
|
+
* headersTemplate?: Record<string, string>, // valores podem conter templates
|
|
43
|
+
* queryTemplate?: Record<string, any>,
|
|
44
|
+
* bodyTemplate?: any, // JSONata/Liquid/Handlebars
|
|
45
|
+
* contentType?: 'application/json' | 'application/xml' | 'text/plain' | string,
|
|
46
|
+
* timeoutMs?: number,
|
|
47
|
+
* compression?: { type?: 'gzip' | 'deflate' | 'br' }
|
|
48
|
+
* }
|
|
49
|
+
*/
|
|
50
|
+
httpConfig;
|
|
51
|
+
/**
|
|
52
|
+
* Config de fila/stream (quando transport = 'amqp' | 'kafka' | 'sqs' | 'pubsub'):
|
|
53
|
+
* {
|
|
54
|
+
* topic?: string, queue?: string, exchange?: string, routingKey?: string,
|
|
55
|
+
* partitionKey?: string, messageKey?: string,
|
|
56
|
+
* headersTemplate?: Record<string, string>,
|
|
57
|
+
* properties?: Record<string, any>, // amqp/kafka props
|
|
58
|
+
* payloadTemplate?: any
|
|
59
|
+
* }
|
|
60
|
+
*/
|
|
61
|
+
queueConfig;
|
|
62
|
+
/**
|
|
63
|
+
* Referência a credenciais reutilizáveis (IntegrationCredential.id).
|
|
64
|
+
*/
|
|
65
|
+
credentialId;
|
|
66
|
+
/**
|
|
67
|
+
* Opções de TLS/MTLS, certificados, SNI etc.
|
|
68
|
+
* Ex.: { rejectUnauthorized: true, ca?: string, cert?: string, key?: string, servername?: string }
|
|
69
|
+
*/
|
|
70
|
+
tls;
|
|
71
|
+
/**
|
|
72
|
+
* Política de retentativa:
|
|
73
|
+
* { maxAttempts: 3, strategy: 'exponential' | 'fixed', delayMs: 1000, maxDelayMs?: 60000, jitter?: true }
|
|
74
|
+
*/
|
|
75
|
+
retryPolicy;
|
|
76
|
+
/**
|
|
77
|
+
* Rate limiting por rota:
|
|
78
|
+
* { limit: 100, intervalMs: 1000, burst?: 50, key?: 'targetSystem' | 'endpoint' | 'custom' }
|
|
79
|
+
*/
|
|
80
|
+
rateLimit;
|
|
81
|
+
/**
|
|
82
|
+
* Idempotência:
|
|
83
|
+
* { strategy: 'header' | 'bodyHash' | 'custom', headerName?: 'Idempotency-Key', ttlMs?: 300000 }
|
|
84
|
+
*/
|
|
85
|
+
idempotency;
|
|
86
|
+
createdAt;
|
|
87
|
+
updatedAt;
|
|
88
|
+
};
|
|
89
|
+
__decorate([
|
|
90
|
+
PrimaryGeneratedColumn("uuid")
|
|
91
|
+
], IntegrationEndpoint.prototype, "id", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
Column({ name: "target_system", type: "varchar", length: 80 })
|
|
94
|
+
], IntegrationEndpoint.prototype, "system", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
Column({ type: "varchar", length: 80 })
|
|
97
|
+
], IntegrationEndpoint.prototype, "event", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
Column({ type: "boolean", default: true })
|
|
100
|
+
], IntegrationEndpoint.prototype, "active", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
Column({ name: "transport_protocol", type: "varchar", length: 20 })
|
|
103
|
+
], IntegrationEndpoint.prototype, "transportProtocol", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
Column({ type: "varchar", length: 500 })
|
|
106
|
+
], IntegrationEndpoint.prototype, "endpoint", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
Column({ name: "http_method", type: "varchar", length: 10, default: 'POST' })
|
|
109
|
+
], IntegrationEndpoint.prototype, "httpMethod", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
Column({ name: "http_config", type: "jsonb", nullable: true })
|
|
112
|
+
], IntegrationEndpoint.prototype, "httpConfig", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
Column({ name: "queue_config", type: "jsonb", nullable: true })
|
|
115
|
+
], IntegrationEndpoint.prototype, "queueConfig", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
Column({ name: "credential_id", type: "uuid", nullable: true })
|
|
118
|
+
], IntegrationEndpoint.prototype, "credentialId", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
Column({ type: "jsonb", nullable: true })
|
|
121
|
+
], IntegrationEndpoint.prototype, "tls", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
Column({ name: "retry_policy", type: "jsonb", nullable: true })
|
|
124
|
+
], IntegrationEndpoint.prototype, "retryPolicy", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
Column({ name: "rate_limit", type: "jsonb", nullable: true })
|
|
127
|
+
], IntegrationEndpoint.prototype, "rateLimit", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
Column({ type: "jsonb", nullable: true })
|
|
130
|
+
], IntegrationEndpoint.prototype, "idempotency", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
CreateDateColumn({ name: "create_at", type: "timestamptz" })
|
|
133
|
+
], IntegrationEndpoint.prototype, "createdAt", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
UpdateDateColumn({ name: "update_at", type: "timestamptz" })
|
|
136
|
+
], IntegrationEndpoint.prototype, "updatedAt", void 0);
|
|
137
|
+
IntegrationEndpoint = __decorate([
|
|
138
|
+
Entity({ name: "integration_endpoint" }),
|
|
139
|
+
Index(["system", "event", "active"], { unique: true }),
|
|
140
|
+
Index(["credentialId"])
|
|
141
|
+
], IntegrationEndpoint);
|
|
142
|
+
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"}
|
package/dist/db/entities/{integration-inbound.entity.js → integration/integration-inbound.entity.js}
RENAMED
|
@@ -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
|
-
*
|
|
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,7 @@ 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
|
|
21
|
+
/** Opções adicionais (reservado para uso futuro) */
|
|
21
22
|
options?: Record<string, any> | null;
|
|
22
23
|
createdAt: Date;
|
|
23
24
|
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;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"}
|
|
@@ -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
|
-
*
|
|
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,7 @@ let IntegrationOutbound = class IntegrationOutbound {
|
|
|
24
51
|
rules;
|
|
25
52
|
/** Se a rota está ativa */
|
|
26
53
|
active;
|
|
27
|
-
/** Opções adicionais
|
|
54
|
+
/** Opções adicionais (reservado para uso futuro) */
|
|
28
55
|
options;
|
|
29
56
|
createdAt;
|
|
30
57
|
updatedAt;
|
|
@@ -36,7 +63,7 @@ __decorate([
|
|
|
36
63
|
Column({ type: "varchar", length: 80 })
|
|
37
64
|
], IntegrationOutbound.prototype, "system", void 0);
|
|
38
65
|
__decorate([
|
|
39
|
-
Column({ type: "varchar", length: 80 })
|
|
66
|
+
Column({ name: "target_system", type: "varchar", length: 80 })
|
|
40
67
|
], IntegrationOutbound.prototype, "targetSystem", void 0);
|
|
41
68
|
__decorate([
|
|
42
69
|
Column({ type: "varchar", length: 80 })
|
|
@@ -57,13 +84,14 @@ __decorate([
|
|
|
57
84
|
Column({ type: "jsonb", nullable: true })
|
|
58
85
|
], IntegrationOutbound.prototype, "options", void 0);
|
|
59
86
|
__decorate([
|
|
60
|
-
CreateDateColumn({ type: "timestamptz" })
|
|
87
|
+
CreateDateColumn({ name: "create_at", type: "timestamptz" })
|
|
61
88
|
], IntegrationOutbound.prototype, "createdAt", void 0);
|
|
62
89
|
__decorate([
|
|
63
|
-
UpdateDateColumn({ type: "timestamptz" })
|
|
90
|
+
UpdateDateColumn({ name: "update_at", type: "timestamptz" })
|
|
64
91
|
], IntegrationOutbound.prototype, "updatedAt", void 0);
|
|
65
92
|
IntegrationOutbound = __decorate([
|
|
66
93
|
Entity({ name: "integration_outbound" }),
|
|
67
|
-
Index(["system", "event", "targetSystem", "version"], { unique: true })
|
|
94
|
+
Index(["system", "event", "targetSystem", "version"], { unique: true }),
|
|
95
|
+
Index(["endpointId"])
|
|
68
96
|
], IntegrationOutbound);
|
|
69
97
|
export { IntegrationOutbound };
|
|
@@ -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"}
|
package/dist/db/entities/{integration-system.entity.js → integration/integration-system.entity.js}
RENAMED
|
@@ -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
|
+
*/
|
|
@@ -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
|
+
find(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,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;CAGxE"}
|
|
@@ -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 find(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,11 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { IntegrationEndpoint } from '../entities/integration/integration-endpoint.js';
|
|
3
|
+
import { IntegrationCredential } from '../entities/integration/integration-credential.entity.js';
|
|
4
|
+
export declare class EndpointRepositoryService {
|
|
5
|
+
private readonly repo;
|
|
6
|
+
private readonly repoCredential;
|
|
7
|
+
constructor(repo: Repository<IntegrationEndpoint>, repoCredential: Repository<IntegrationCredential>);
|
|
8
|
+
find(system: string, event: string): Promise<IntegrationEndpoint | null>;
|
|
9
|
+
getCredential(endpoint: IntegrationEndpoint): Promise<IntegrationCredential | null>;
|
|
10
|
+
}
|
|
11
|
+
//# 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;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AAGjG,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBADd,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,EACrC,cAAc,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAG9D,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAIxE,aAAa,CAAC,QAAQ,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;CAI1F"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
repoCredential;
|
|
16
|
+
constructor(repo, repoCredential) {
|
|
17
|
+
this.repo = repo;
|
|
18
|
+
this.repoCredential = repoCredential;
|
|
19
|
+
}
|
|
20
|
+
async find(system, event) {
|
|
21
|
+
return await this.repo.findOne({ where: { system, event, active: true } });
|
|
22
|
+
}
|
|
23
|
+
async getCredential(endpoint) {
|
|
24
|
+
if (!endpoint?.credentialId)
|
|
25
|
+
return null;
|
|
26
|
+
return await this.repoCredential.findOne({ where: { id: endpoint.credentialId, active: true } });
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
EndpointRepositoryService = __decorate([
|
|
30
|
+
Injectable(),
|
|
31
|
+
__param(0, InjectRepository(IntegrationEndpoint))
|
|
32
|
+
], EndpointRepositoryService);
|
|
33
|
+
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,
|
|
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
|
-
import { Repository } from
|
|
2
|
-
import { IntegrationOutbound } from
|
|
1
|
+
import { Repository } from "typeorm";
|
|
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
|
+
find(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,
|
|
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;AAE7F,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;IAIxE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;CAG/E"}
|
|
@@ -7,16 +7,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
|
-
import { Injectable } from
|
|
11
|
-
import { InjectRepository } from
|
|
12
|
-
import { IntegrationOutbound } from
|
|
10
|
+
import { Injectable } from "@nestjs/common";
|
|
11
|
+
import { InjectRepository } from "@nestjs/typeorm";
|
|
12
|
+
import { IntegrationOutbound } from "../entities/integration/integration-outbound.entity.js";
|
|
13
13
|
let OutboundRepositoryService = class OutboundRepositoryService {
|
|
14
14
|
repo;
|
|
15
15
|
constructor(repo) {
|
|
16
16
|
this.repo = repo;
|
|
17
17
|
}
|
|
18
18
|
async getRoutes(system, event) {
|
|
19
|
-
return this.repo.find({ where: { system, event, active: true }, order: { version:
|
|
19
|
+
return this.repo.find({ where: { system, event, active: true }, order: { version: "DESC" } });
|
|
20
|
+
}
|
|
21
|
+
async find(system, event) {
|
|
22
|
+
return this.repo.findOne({ where: { system, event, active: true }, order: { version: "DESC" } });
|
|
20
23
|
}
|
|
21
24
|
};
|
|
22
25
|
OutboundRepositoryService = __decorate([
|
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
|
|
10
|
-
export * from './db/entities/integration-
|
|
11
|
-
export * from './db/entities/integration-
|
|
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';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
|
10
|
-
export * from './db/entities/integration
|
|
11
|
-
export * from './db/entities/integration-
|
|
12
|
-
export * from './db/entities/integration-
|
|
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 +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"}
|
|
File without changes
|