@cargolift-cdi/types 0.1.152 → 0.1.154
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/entities/integration-agent.entity.d.ts +12 -0
- package/dist/entities/integration-agent.entity.d.ts.map +1 -0
- package/dist/entities/{integration-system.entity.js → integration-agent.entity.js} +21 -21
- package/dist/entities/integration-endpoint.entity.d.ts +6 -6
- package/dist/entities/integration-endpoint.entity.d.ts.map +1 -1
- package/dist/entities/integration-endpoint.entity.js +18 -14
- package/dist/entities/integration-entity.entity.d.ts +22 -0
- package/dist/entities/integration-entity.entity.d.ts.map +1 -0
- package/dist/entities/{integration-event.entity.js → integration-entity.entity.js} +28 -28
- package/dist/entities/integration-inbound.entity.d.ts +29 -20
- package/dist/entities/integration-inbound.entity.d.ts.map +1 -1
- package/dist/entities/integration-inbound.entity.js +40 -29
- package/dist/entities/integration-outbound.entity.d.ts +24 -7
- package/dist/entities/integration-outbound.entity.d.ts.map +1 -1
- package/dist/entities/integration-outbound.entity.js +28 -23
- package/dist/entities/log-integration-inbound.entity.d.ts +10 -9
- package/dist/entities/log-integration-inbound.entity.d.ts.map +1 -1
- package/dist/entities/log-integration-inbound.entity.js +20 -16
- package/dist/entities/log-integration-outbound.entity.d.ts +3 -3
- package/dist/entities/log-integration-outbound.entity.d.ts.map +1 -1
- package/dist/entities/log-integration-outbound.entity.js +8 -8
- package/dist/enum/integration.enums.d.ts +6 -0
- package/dist/enum/integration.enums.d.ts.map +1 -1
- package/dist/enum/integration.enums.js +7 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/interfaces/envelope-message.interface.d.ts +2 -2
- package/dist/interfaces/envelope-message.interface.d.ts.map +1 -1
- package/dist/interfaces/integration.interface.d.ts.map +1 -1
- package/dist/repository/integration-agent-repository.service.d.ts +10 -0
- package/dist/repository/integration-agent-repository.service.d.ts.map +1 -0
- package/dist/repository/{integration-system-repository.service.js → integration-agent-repository.service.js} +10 -10
- package/dist/repository/integration-endpoint-repository.service.d.ts +1 -1
- package/dist/repository/integration-endpoint-repository.service.d.ts.map +1 -1
- package/dist/repository/integration-endpoint-repository.service.js +3 -3
- package/dist/repository/integration-entity-repository.service.d.ts +10 -0
- package/dist/repository/integration-entity-repository.service.d.ts.map +1 -0
- package/dist/repository/{integration-event-repository.service.js → integration-entity-repository.service.js} +10 -10
- package/dist/repository/integration-inbound-repository.service.d.ts +2 -2
- package/dist/repository/integration-inbound-repository.service.d.ts.map +1 -1
- package/dist/repository/integration-inbound-repository.service.js +22 -22
- package/dist/repository/integration-outbound-repository.service.d.ts +2 -2
- package/dist/repository/integration-outbound-repository.service.d.ts.map +1 -1
- package/dist/repository/integration-outbound-repository.service.js +6 -6
- package/package.json +1 -1
- package/dist/entities/integration-event.entity.d.ts +0 -22
- package/dist/entities/integration-event.entity.d.ts.map +0 -1
- package/dist/entities/integration-system.entity.d.ts +0 -12
- package/dist/entities/integration-system.entity.d.ts.map +0 -1
- package/dist/repository/integration-event-repository.service.d.ts +0 -10
- package/dist/repository/integration-event-repository.service.d.ts.map +0 -1
- package/dist/repository/integration-system-repository.service.d.ts +0 -10
- package/dist/repository/integration-system-repository.service.d.ts.map +0 -1
|
@@ -15,48 +15,48 @@ let InboundRepositoryService = class InboundRepositoryService {
|
|
|
15
15
|
constructor(repo) {
|
|
16
16
|
this.repo = repo;
|
|
17
17
|
}
|
|
18
|
-
async get(
|
|
18
|
+
async get(agent, entity, method) {
|
|
19
19
|
const qb = this.repo
|
|
20
20
|
.createQueryBuilder("integration_inbound")
|
|
21
|
-
.where("integration_inbound.
|
|
22
|
-
.andWhere("integration_inbound.
|
|
21
|
+
.where("integration_inbound.agent = :agent", { agent })
|
|
22
|
+
.andWhere("integration_inbound.entity = :entity", { entity })
|
|
23
23
|
.andWhere("integration_inbound.active = :active", { active: true })
|
|
24
24
|
.andWhere(`(
|
|
25
|
-
integration_inbound.
|
|
26
|
-
integration_inbound.
|
|
27
|
-
integration_inbound.
|
|
28
|
-
integration_inbound.
|
|
29
|
-
integration_inbound.
|
|
25
|
+
integration_inbound.method = 'all' OR
|
|
26
|
+
integration_inbound.method = :method OR
|
|
27
|
+
integration_inbound.method LIKE :methodListPrefix OR
|
|
28
|
+
integration_inbound.method LIKE :methodListInfix OR
|
|
29
|
+
integration_inbound.method LIKE :methodListSuffix
|
|
30
30
|
)`, {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
method,
|
|
32
|
+
methodListPrefix: `${method},%`,
|
|
33
|
+
methodListInfix: `%,${method},%`,
|
|
34
|
+
methodListSuffix: `%,${method}`,
|
|
35
35
|
});
|
|
36
36
|
const rows = await qb
|
|
37
37
|
.orderBy(`CASE
|
|
38
|
-
WHEN integration_inbound.
|
|
39
|
-
WHEN integration_inbound.
|
|
40
|
-
integration_inbound.
|
|
41
|
-
integration_inbound.
|
|
42
|
-
WHEN integration_inbound.
|
|
38
|
+
WHEN integration_inbound.method = :method THEN 1
|
|
39
|
+
WHEN integration_inbound.method LIKE :methodListPrefix OR
|
|
40
|
+
integration_inbound.method LIKE :methodListInfix OR
|
|
41
|
+
integration_inbound.method LIKE :methodListSuffix THEN 2
|
|
42
|
+
WHEN integration_inbound.method = 'all' THEN 3
|
|
43
43
|
ELSE 4
|
|
44
44
|
END`, "ASC")
|
|
45
|
-
.addOrderBy("integration_inbound.
|
|
46
|
-
.addOrderBy("integration_inbound.
|
|
45
|
+
.addOrderBy("integration_inbound.agent", "ASC")
|
|
46
|
+
.addOrderBy("integration_inbound.entity", "ASC")
|
|
47
47
|
.addOrderBy("integration_inbound.version", "DESC")
|
|
48
48
|
.getMany();
|
|
49
49
|
const resultMap = new Map();
|
|
50
50
|
for (const row of rows) {
|
|
51
|
-
const key = `${row.
|
|
51
|
+
const key = `${row.agent}::${row.entity}::${row.method}`;
|
|
52
52
|
if (!resultMap.has(key)) {
|
|
53
53
|
resultMap.set(key, row);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
return Array.from(resultMap.values());
|
|
57
57
|
}
|
|
58
|
-
async getFirstActive(
|
|
59
|
-
const records = await this.get(
|
|
58
|
+
async getFirstActive(agent, entity, method) {
|
|
59
|
+
const records = await this.get(agent, entity, method);
|
|
60
60
|
return records.length > 0 ? records[0] : null;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
@@ -3,7 +3,7 @@ import { IntegrationOutbound } from "../entities/integration-outbound.entity.js"
|
|
|
3
3
|
export declare class OutboundRepositoryService {
|
|
4
4
|
private readonly repo;
|
|
5
5
|
constructor(repo: Repository<IntegrationOutbound>);
|
|
6
|
-
getRoutes(
|
|
7
|
-
find(
|
|
6
|
+
getRoutes(agent: string, entity: string, action: string): Promise<IntegrationOutbound[]>;
|
|
7
|
+
find(agent: string, entity: string, action: string): Promise<IntegrationOutbound | null>;
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=integration-outbound-repository.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-outbound-repository.service.d.ts","sourceRoot":"","sources":["../../src/repository/integration-outbound-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC;IAGlD,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"integration-outbound-repository.service.d.ts","sourceRoot":"","sources":["../../src/repository/integration-outbound-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC;IAGlD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAqCxF,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;CAoC/F"}
|
|
@@ -15,11 +15,11 @@ let OutboundRepositoryService = class OutboundRepositoryService {
|
|
|
15
15
|
constructor(repo) {
|
|
16
16
|
this.repo = repo;
|
|
17
17
|
}
|
|
18
|
-
async getRoutes(
|
|
18
|
+
async getRoutes(agent, entity, action) {
|
|
19
19
|
const qb = this.repo
|
|
20
20
|
.createQueryBuilder("integration_outbound")
|
|
21
|
-
.where("integration_outbound.
|
|
22
|
-
.andWhere("integration_outbound.
|
|
21
|
+
.where("integration_outbound.agent = :agent", { agent })
|
|
22
|
+
.andWhere("integration_outbound.entity = :entity", { entity })
|
|
23
23
|
.andWhere("integration_outbound.active = :active", { active: true })
|
|
24
24
|
.andWhere(`(
|
|
25
25
|
integration_outbound.action = 'all' OR
|
|
@@ -44,11 +44,11 @@ let OutboundRepositoryService = class OutboundRepositoryService {
|
|
|
44
44
|
.addOrderBy("integration_outbound.version", "DESC");
|
|
45
45
|
return qb.getMany();
|
|
46
46
|
}
|
|
47
|
-
async find(
|
|
47
|
+
async find(agent, entity, action) {
|
|
48
48
|
const qb = this.repo
|
|
49
49
|
.createQueryBuilder("integration_outbound")
|
|
50
|
-
.where("integration_outbound.
|
|
51
|
-
.andWhere("integration_outbound.
|
|
50
|
+
.where("integration_outbound.agent = :agent", { agent })
|
|
51
|
+
.andWhere("integration_outbound.entity = :entity", { entity })
|
|
52
52
|
.andWhere("integration_outbound.active = :active", { active: true })
|
|
53
53
|
.andWhere(`(
|
|
54
54
|
integration_outbound.action = 'all' OR
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare class IntegrationEvent {
|
|
2
|
-
id: string;
|
|
3
|
-
/** Evento (e.g., 'driver') */
|
|
4
|
-
event: string;
|
|
5
|
-
/** Versão do evento. Apenas a última versão pode estar ativa. Versões anteriores não podem sofrer modificações */
|
|
6
|
-
version: number;
|
|
7
|
-
/**Se a evento está ativa */
|
|
8
|
-
active: boolean;
|
|
9
|
-
/** Descrição opcional amigável ao usuário */
|
|
10
|
-
description?: string | null;
|
|
11
|
-
/**
|
|
12
|
-
* Modo de roteamento do evento
|
|
13
|
-
* - 'direct': Roteia diretamente para sistemas de destino sem passar pelo ODS
|
|
14
|
-
* - 'ods': Roteia para o ODS (Operational Data Store) antes de enviar para sistemas de destino
|
|
15
|
-
* - 'mdm': Roteia para fila de dados mestres (MDM) antes de enviar para sistemas de destino
|
|
16
|
-
*/
|
|
17
|
-
routingMode: "direct" | "ods" | "mdm";
|
|
18
|
-
/** Opções adicionais (reservado para uso futuro) */
|
|
19
|
-
createdAt: Date;
|
|
20
|
-
updatedAt: Date;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=integration-event.entity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integration-event.entity.d.ts","sourceRoot":"","sources":["../../src/entities/integration-event.entity.ts"],"names":[],"mappings":"AAcA,qBAMa,gBAAgB;IAE3B,EAAE,EAAG,MAAM,CAAC;IAEZ,8BAA8B;IAE9B,KAAK,EAAG,MAAM,CAAC;IAEf,kHAAkH;IAElH,OAAO,EAAG,MAAM,CAAC;IAEjB,4BAA4B;IAE5B,MAAM,EAAG,OAAO,CAAC;IAEjB,6CAA6C;IAE7C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;;;OAKG;IAEH,WAAW,EAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;IAEvC,oDAAoD;IAKpD,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAClB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class IntegrationSystem {
|
|
2
|
-
/** Identificador único do sistema de integração */
|
|
3
|
-
id: string;
|
|
4
|
-
/** Nome do sistema de integração (e.g., 'erp', 'tms') */
|
|
5
|
-
system: string;
|
|
6
|
-
/** Se o sistema está ativo */
|
|
7
|
-
active: boolean;
|
|
8
|
-
apiClientId?: string;
|
|
9
|
-
createdAt: Date;
|
|
10
|
-
updatedAt: Date;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=integration-system.entity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integration-system.entity.d.ts","sourceRoot":"","sources":["../../src/entities/integration-system.entity.ts"],"names":[],"mappings":"AAaA,qBAEa,iBAAiB;IAC5B,mDAAmD;IAEnD,EAAE,EAAG,MAAM,CAAC;IAEZ,yDAAyD;IAEzD,MAAM,EAAG,MAAM,CAAC;IAEhB,8BAA8B;IAE9B,MAAM,EAAG,OAAO,CAAC;IAIjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;CAClB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Repository } from "typeorm";
|
|
2
|
-
import { IntegrationEvent } from "../entities/integration-event.entity.js";
|
|
3
|
-
export declare class EventRepositoryService {
|
|
4
|
-
private readonly repo;
|
|
5
|
-
constructor(repo: Repository<IntegrationEvent>);
|
|
6
|
-
getFirstActive(event: string): Promise<IntegrationEvent | null>;
|
|
7
|
-
getAllActive(): Promise<IntegrationEvent[]>;
|
|
8
|
-
getAllActiveByRoutingMode(routingMode: IntegrationEvent["routingMode"]): Promise<IntegrationEvent[]>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=integration-event-repository.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integration-event-repository.service.d.ts","sourceRoot":"","sources":["../../src/repository/integration-event-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,qBACa,sBAAsB;IAG/B,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;IAG/C,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAK/D,YAAY,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAK3C,yBAAyB,CAAC,WAAW,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAG3G"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Repository } from "typeorm";
|
|
2
|
-
import { IntegrationSystem } from "../entities/integration-system.entity.js";
|
|
3
|
-
export declare class SystemRepositoryService {
|
|
4
|
-
private readonly repo;
|
|
5
|
-
constructor(repo: Repository<IntegrationSystem>);
|
|
6
|
-
get(system: string): Promise<IntegrationSystem | null>;
|
|
7
|
-
getAllActive(): Promise<IntegrationSystem[]>;
|
|
8
|
-
getByApiClientId(apiClientId: string): Promise<IntegrationSystem | null>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=integration-system-repository.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integration-system-repository.service.d.ts","sourceRoot":"","sources":["../../src/repository/integration-system-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,qBACa,uBAAuB;IAGhC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,iBAAiB,CAAC;IAGhD,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAKtD,YAAY,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAK5C,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;CAG/E"}
|