@cargolift-cdi/types 0.1.157 → 0.1.159

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/index.d.ts +0 -8
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +0 -9
  4. package/package.json +2 -4
  5. package/dist/repository/diagnostic-latency-repository.service.d.ts +0 -19
  6. package/dist/repository/diagnostic-latency-repository.service.d.ts.map +0 -1
  7. package/dist/repository/diagnostic-latency-repository.service.js +0 -44
  8. package/dist/repository/integration-agent-repository.service.d.ts +0 -10
  9. package/dist/repository/integration-agent-repository.service.d.ts.map +0 -1
  10. package/dist/repository/integration-agent-repository.service.js +0 -34
  11. package/dist/repository/integration-credential-repository.service.d.ts +0 -8
  12. package/dist/repository/integration-credential-repository.service.d.ts.map +0 -1
  13. package/dist/repository/integration-credential-repository.service.js +0 -26
  14. package/dist/repository/integration-endpoint-repository.service.d.ts +0 -11
  15. package/dist/repository/integration-endpoint-repository.service.d.ts.map +0 -1
  16. package/dist/repository/integration-endpoint-repository.service.js +0 -61
  17. package/dist/repository/integration-entity-repository.service.d.ts +0 -10
  18. package/dist/repository/integration-entity-repository.service.d.ts.map +0 -1
  19. package/dist/repository/integration-entity-repository.service.js +0 -34
  20. package/dist/repository/integration-inbound-repository.service.d.ts +0 -9
  21. package/dist/repository/integration-inbound-repository.service.d.ts.map +0 -1
  22. package/dist/repository/integration-inbound-repository.service.js +0 -67
  23. package/dist/repository/integration-outbound-repository.service.d.ts +0 -9
  24. package/dist/repository/integration-outbound-repository.service.d.ts.map +0 -1
  25. package/dist/repository/integration-outbound-repository.service.js +0 -81
  26. package/dist/repository/log-integration-inbound.service.d.ts +0 -20
  27. package/dist/repository/log-integration-inbound.service.d.ts.map +0 -1
  28. package/dist/repository/log-integration-inbound.service.js +0 -58
package/dist/index.d.ts CHANGED
@@ -20,12 +20,4 @@ export * from './entities/log-integration-inbound.entity.js';
20
20
  export * from './entities/log-integration-outbound.entity.js';
21
21
  export * from './enum/integration.enums.js';
22
22
  export * from './enum/error-type.enum.js';
23
- export * from './repository/integration-agent-repository.service.js';
24
- export * from './repository/integration-entity-repository.service.js';
25
- export * from './repository/integration-inbound-repository.service.js';
26
- export * from './repository/integration-outbound-repository.service.js';
27
- export * from './repository/integration-endpoint-repository.service.js';
28
- export * from './repository/integration-credential-repository.service.js';
29
- export * from './repository/diagnostic-latency-repository.service.js';
30
- export * from './repository/log-integration-inbound.service.js';
31
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,qCAAqC,CAAC;AACpD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAG5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAG9D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAG1C,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AACxE,cAAc,yDAAyD,CAAC;AACxE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,iDAAiD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,qCAAqC,CAAC;AACpD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAG5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAG9D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -22,12 +22,3 @@ export * from './entities/log-integration-outbound.entity.js';
22
22
  // Enum
23
23
  export * from './enum/integration.enums.js';
24
24
  export * from './enum/error-type.enum.js';
25
- // Repositórios
26
- export * from './repository/integration-agent-repository.service.js';
27
- export * from './repository/integration-entity-repository.service.js';
28
- export * from './repository/integration-inbound-repository.service.js';
29
- export * from './repository/integration-outbound-repository.service.js';
30
- export * from './repository/integration-endpoint-repository.service.js';
31
- export * from './repository/integration-credential-repository.service.js';
32
- export * from './repository/diagnostic-latency-repository.service.js';
33
- export * from './repository/log-integration-inbound.service.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargolift-cdi/types",
3
- "version": "0.1.157",
3
+ "version": "0.1.159",
4
4
  "description": "TypeScript types e interfaces comuns para projetos Cargolift CDI",
5
5
  "keywords": [
6
6
  "typescript",
@@ -49,8 +49,6 @@
49
49
  "typescript": "^5.6.2"
50
50
  },
51
51
  "dependencies": {
52
- "@nestjs/common": "^11.1.8",
53
- "@nestjs/typeorm": "^11.0.0",
54
- "typeorm": "^0.3.27"
52
+ "typeorm": "^0.3.28"
55
53
  }
56
54
  }
@@ -1,19 +0,0 @@
1
- import { Repository } from 'typeorm';
2
- import { DiagnosticLatency } from '../entities/diagnostic-latency.entity.js';
3
- /**
4
- * Repositório de diagnóstico de latência.
5
- * Responsável por criar/atualizar registros de latência associados a um id.
6
- */
7
- export declare class DiagnosticLatencyRepositoryService {
8
- private readonly repo;
9
- constructor(repo: Repository<DiagnosticLatency>);
10
- /**
11
- * Cria um novo registro de latência.
12
- * @param id
13
- * @param correlation_id
14
- * @param timestamp_start
15
- * @returns
16
- */
17
- create(correlation_id: string, timestamp_start: Date, timestamp_end: Date, data?: Record<string, any>): Promise<DiagnosticLatency>;
18
- }
19
- //# sourceMappingURL=diagnostic-latency-repository.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnostic-latency-repository.service.d.ts","sourceRoot":"","sources":["../../src/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"}
@@ -1,44 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __param = (this && this.__param) || function (paramIndex, decorator) {
8
- return function (target, key) { decorator(target, key, paramIndex); }
9
- };
10
- import { Injectable } from '@nestjs/common';
11
- import { InjectRepository } from '@nestjs/typeorm';
12
- import { DiagnosticLatency } from '../entities/diagnostic-latency.entity.js';
13
- /**
14
- * Repositório de diagnóstico de latência.
15
- * Responsável por criar/atualizar registros de latência associados a um id.
16
- */
17
- let DiagnosticLatencyRepositoryService = class DiagnosticLatencyRepositoryService {
18
- repo;
19
- constructor(repo) {
20
- this.repo = repo;
21
- }
22
- /**
23
- * Cria um novo registro de latência.
24
- * @param id
25
- * @param correlation_id
26
- * @param timestamp_start
27
- * @returns
28
- */
29
- async create(correlation_id, timestamp_start, timestamp_end, data) {
30
- const entity = this.repo.create({
31
- correlationId: correlation_id,
32
- timestamp_start,
33
- timestamp_end,
34
- latencyMs: timestamp_end.getTime() - timestamp_start.getTime(),
35
- data
36
- });
37
- return this.repo.save(entity);
38
- }
39
- };
40
- DiagnosticLatencyRepositoryService = __decorate([
41
- Injectable(),
42
- __param(0, InjectRepository(DiagnosticLatency))
43
- ], DiagnosticLatencyRepositoryService);
44
- export { DiagnosticLatencyRepositoryService };
@@ -1,10 +0,0 @@
1
- import { Repository } from "typeorm";
2
- import { IntegrationAgent } from "../entities/integration-agent.entity.js";
3
- export declare class AgentRepositoryService {
4
- private readonly repo;
5
- constructor(repo: Repository<IntegrationAgent>);
6
- get(agent: string): Promise<IntegrationAgent | null>;
7
- getAllActive(): Promise<IntegrationAgent[]>;
8
- getByApiClientId(apiClientId: string): Promise<IntegrationAgent | null>;
9
- }
10
- //# sourceMappingURL=integration-agent-repository.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-agent-repository.service.d.ts","sourceRoot":"","sources":["../../src/repository/integration-agent-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,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAKpD,YAAY,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAK3C,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;CAG9E"}
@@ -1,34 +0,0 @@
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 { IntegrationAgent } from "../entities/integration-agent.entity.js";
13
- let AgentRepositoryService = class AgentRepositoryService {
14
- repo;
15
- constructor(repo) {
16
- this.repo = repo;
17
- }
18
- async get(agent) {
19
- return await this.repo.findOne({ where: { agent, active: true } });
20
- }
21
- // Busca todos os entidades ativos
22
- async getAllActive() {
23
- return await this.repo.find({ where: { active: true } });
24
- }
25
- // Busca a entidade com base no clientId do KeyCloak
26
- async getByApiClientId(apiClientId) {
27
- return await this.repo.findOne({ where: { apiClientId, active: true } });
28
- }
29
- };
30
- AgentRepositoryService = __decorate([
31
- Injectable(),
32
- __param(0, InjectRepository(IntegrationAgent))
33
- ], AgentRepositoryService);
34
- export { AgentRepositoryService };
@@ -1,8 +0,0 @@
1
- import { Repository } from 'typeorm';
2
- import { IntegrationCredential } from '../entities/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
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-credential-repository.service.d.ts","sourceRoot":"","sources":["../../src/repository/integration-credential-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAGrF,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"}
@@ -1,26 +0,0 @@
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-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 };
@@ -1,11 +0,0 @@
1
- import { Repository } from 'typeorm';
2
- import { IntegrationEndpoint } from '../entities/integration-endpoint.entity.js';
3
- import { IntegrationCredential } from '../entities/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(agent: string, entity: string, action: string): Promise<IntegrationEndpoint | null>;
9
- getCredential(endpoint: IntegrationEndpoint): Promise<IntegrationCredential | null>;
10
- }
11
- //# sourceMappingURL=integration-endpoint-repository.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-endpoint-repository.service.d.ts","sourceRoot":"","sources":["../../src/repository/integration-endpoint-repository.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAGrF,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,IAAI;IAErB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAFd,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,EAErC,cAAc,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAG9D,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAqCxF,aAAa,CAAC,QAAQ,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;CAI1F"}
@@ -1,61 +0,0 @@
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-endpoint.entity.js';
13
- import { IntegrationCredential } from '../entities/integration-credential.entity.js';
14
- let EndpointRepositoryService = class EndpointRepositoryService {
15
- repo;
16
- repoCredential;
17
- constructor(repo, repoCredential) {
18
- this.repo = repo;
19
- this.repoCredential = repoCredential;
20
- }
21
- async find(agent, entity, action) {
22
- const qb = this.repo
23
- .createQueryBuilder('integration_endpoint')
24
- .where('integration_endpoint.agent = :agent', { agent })
25
- .andWhere('integration_endpoint.entity = :entity', { entity })
26
- .andWhere('integration_endpoint.active = :active', { active: true })
27
- .andWhere(`(
28
- integration_endpoint.action = 'all' OR
29
- integration_endpoint.action = :action OR
30
- integration_endpoint.action LIKE :actionListPrefix OR
31
- integration_endpoint.action LIKE :actionListInfix OR
32
- integration_endpoint.action LIKE :actionListSuffix
33
- )`, {
34
- action,
35
- actionListPrefix: `${action},%`,
36
- actionListInfix: `%,${action},%`,
37
- actionListSuffix: `%,${action}`,
38
- })
39
- .orderBy(`CASE
40
- WHEN integration_endpoint.action = :action THEN 1
41
- WHEN integration_endpoint.action LIKE :actionListPrefix OR
42
- integration_endpoint.action LIKE :actionListInfix OR
43
- integration_endpoint.action LIKE :actionListSuffix THEN 2
44
- WHEN integration_endpoint.action = 'all' THEN 3
45
- ELSE 4
46
- END`, 'ASC')
47
- .addOrderBy('integration_endpoint.version', 'DESC');
48
- return await qb.getOne();
49
- }
50
- async getCredential(endpoint) {
51
- if (!endpoint?.credentialId)
52
- return null;
53
- return await this.repoCredential.findOne({ where: { id: endpoint.credentialId, active: true } });
54
- }
55
- };
56
- EndpointRepositoryService = __decorate([
57
- Injectable(),
58
- __param(0, InjectRepository(IntegrationEndpoint)),
59
- __param(1, InjectRepository(IntegrationCredential))
60
- ], EndpointRepositoryService);
61
- export { EndpointRepositoryService };
@@ -1,10 +0,0 @@
1
- import { Repository } from "typeorm";
2
- import { IntegrationEntity } from "../entities/integration-entity.entity.js";
3
- export declare class EntityRepositoryService {
4
- private readonly repo;
5
- constructor(repo: Repository<IntegrationEntity>);
6
- getFirstActive(entity: string): Promise<IntegrationEntity | null>;
7
- getAllActive(): Promise<IntegrationEntity[]>;
8
- getAllActiveByRoutingMode(routingMode: IntegrationEntity["routingMode"]): Promise<IntegrationEntity[]>;
9
- }
10
- //# sourceMappingURL=integration-entity-repository.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-entity-repository.service.d.ts","sourceRoot":"","sources":["../../src/repository/integration-entity-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,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAKjE,YAAY,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAK5C,yBAAyB,CAAC,WAAW,EAAE,iBAAiB,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAG7G"}
@@ -1,34 +0,0 @@
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 { IntegrationEntity } from "../entities/integration-entity.entity.js";
13
- let EntityRepositoryService = class EntityRepositoryService {
14
- repo;
15
- constructor(repo) {
16
- this.repo = repo;
17
- }
18
- async getFirstActive(entity) {
19
- return await this.repo.findOne({ where: { entity, active: true }, order: { version: "DESC" } });
20
- }
21
- // Busca todos os entityos ativos
22
- async getAllActive() {
23
- return await this.repo.find({ where: { active: true } });
24
- }
25
- // Busca todos os entityos ativos
26
- async getAllActiveByRoutingMode(routingMode) {
27
- return await this.repo.find({ where: { active: true, routingMode } });
28
- }
29
- };
30
- EntityRepositoryService = __decorate([
31
- Injectable(),
32
- __param(0, InjectRepository(IntegrationEntity))
33
- ], EntityRepositoryService);
34
- export { EntityRepositoryService };
@@ -1,9 +0,0 @@
1
- import { Repository } from "typeorm";
2
- import { IntegrationInbound } from "../entities/integration-inbound.entity.js";
3
- export declare class InboundRepositoryService {
4
- private readonly repo;
5
- constructor(repo: Repository<IntegrationInbound>);
6
- get(agent: string, entity: string, method: string): Promise<IntegrationInbound[]>;
7
- getFirstActive(agent: string, entity: string, method: string): Promise<IntegrationInbound | null>;
8
- }
9
- //# sourceMappingURL=integration-inbound-repository.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-inbound-repository.service.d.ts","sourceRoot":"","sources":["../../src/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,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAmDjF,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;CAKxG"}
@@ -1,67 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __param = (this && this.__param) || function (paramIndex, decorator) {
8
- return function (target, key) { decorator(target, key, paramIndex); }
9
- };
10
- import { Injectable } from "@nestjs/common";
11
- import { InjectRepository } from "@nestjs/typeorm";
12
- import { IntegrationInbound } from "../entities/integration-inbound.entity.js";
13
- let InboundRepositoryService = class InboundRepositoryService {
14
- repo;
15
- constructor(repo) {
16
- this.repo = repo;
17
- }
18
- async get(agent, entity, method) {
19
- const qb = this.repo
20
- .createQueryBuilder("integration_inbound")
21
- .where("integration_inbound.agent = :agent", { agent })
22
- .andWhere("integration_inbound.entity = :entity", { entity })
23
- .andWhere("integration_inbound.active = :active", { active: true })
24
- .andWhere(`(
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
- )`, {
31
- method,
32
- methodListPrefix: `${method},%`,
33
- methodListInfix: `%,${method},%`,
34
- methodListSuffix: `%,${method}`,
35
- });
36
- const rows = await qb
37
- .orderBy(`CASE
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
- ELSE 4
44
- END`, "ASC")
45
- .addOrderBy("integration_inbound.agent", "ASC")
46
- .addOrderBy("integration_inbound.entity", "ASC")
47
- .addOrderBy("integration_inbound.version", "DESC")
48
- .getMany();
49
- const resultMap = new Map();
50
- for (const row of rows) {
51
- const key = `${row.agent}::${row.entity}::${row.method}`;
52
- if (!resultMap.has(key)) {
53
- resultMap.set(key, row);
54
- }
55
- }
56
- return Array.from(resultMap.values());
57
- }
58
- async getFirstActive(agent, entity, method) {
59
- const records = await this.get(agent, entity, method);
60
- return records.length > 0 ? records[0] : null;
61
- }
62
- };
63
- InboundRepositoryService = __decorate([
64
- Injectable(),
65
- __param(0, InjectRepository(IntegrationInbound))
66
- ], InboundRepositoryService);
67
- export { InboundRepositoryService };
@@ -1,9 +0,0 @@
1
- import { Repository } from "typeorm";
2
- import { IntegrationOutbound } from "../entities/integration-outbound.entity.js";
3
- export declare class OutboundRepositoryService {
4
- private readonly repo;
5
- constructor(repo: Repository<IntegrationOutbound>);
6
- getRoutes(agent: string, entity: string, action: string): Promise<IntegrationOutbound[]>;
7
- find(agent: string, entity: string, action: string): Promise<IntegrationOutbound | null>;
8
- }
9
- //# sourceMappingURL=integration-outbound-repository.service.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,81 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __param = (this && this.__param) || function (paramIndex, decorator) {
8
- return function (target, key) { decorator(target, key, paramIndex); }
9
- };
10
- import { Injectable } from "@nestjs/common";
11
- import { InjectRepository } from "@nestjs/typeorm";
12
- import { IntegrationOutbound } from "../entities/integration-outbound.entity.js";
13
- let OutboundRepositoryService = class OutboundRepositoryService {
14
- repo;
15
- constructor(repo) {
16
- this.repo = repo;
17
- }
18
- async getRoutes(agent, entity, action) {
19
- const qb = this.repo
20
- .createQueryBuilder("integration_outbound")
21
- .where("integration_outbound.agent = :agent", { agent })
22
- .andWhere("integration_outbound.entity = :entity", { entity })
23
- .andWhere("integration_outbound.active = :active", { active: true })
24
- .andWhere(`(
25
- integration_outbound.action = 'all' OR
26
- integration_outbound.action = :action OR
27
- integration_outbound.action LIKE :actionListPrefix OR
28
- integration_outbound.action LIKE :actionListInfix OR
29
- integration_outbound.action LIKE :actionListSuffix
30
- )`, {
31
- action,
32
- actionListPrefix: `${action},%`,
33
- actionListInfix: `%,${action},%`,
34
- actionListSuffix: `%,${action}`,
35
- })
36
- .orderBy(`CASE
37
- WHEN integration_outbound.action = :action THEN 1
38
- WHEN integration_outbound.action LIKE :actionListPrefix OR
39
- integration_outbound.action LIKE :actionListInfix OR
40
- integration_outbound.action LIKE :actionListSuffix THEN 2
41
- WHEN integration_outbound.action = 'all' THEN 3
42
- ELSE 4
43
- END`, "ASC")
44
- .addOrderBy("integration_outbound.version", "DESC");
45
- return qb.getMany();
46
- }
47
- async find(agent, entity, action) {
48
- const qb = this.repo
49
- .createQueryBuilder("integration_outbound")
50
- .where("integration_outbound.agent = :agent", { agent })
51
- .andWhere("integration_outbound.entity = :entity", { entity })
52
- .andWhere("integration_outbound.active = :active", { active: true })
53
- .andWhere(`(
54
- integration_outbound.action = 'all' OR
55
- integration_outbound.action = :action OR
56
- integration_outbound.action LIKE :actionListPrefix OR
57
- integration_outbound.action LIKE :actionListInfix OR
58
- integration_outbound.action LIKE :actionListSuffix
59
- )`, {
60
- action,
61
- actionListPrefix: `${action},%`,
62
- actionListInfix: `%,${action},%`,
63
- actionListSuffix: `%,${action}`,
64
- })
65
- .orderBy(`CASE
66
- WHEN integration_outbound.action = :action THEN 1
67
- WHEN integration_outbound.action LIKE :actionListPrefix OR
68
- integration_outbound.action LIKE :actionListInfix OR
69
- integration_outbound.action LIKE :actionListSuffix THEN 2
70
- WHEN integration_outbound.action = 'all' THEN 3
71
- ELSE 4
72
- END`, "ASC")
73
- .addOrderBy("integration_outbound.version", "DESC");
74
- return qb.getOne();
75
- }
76
- };
77
- OutboundRepositoryService = __decorate([
78
- Injectable(),
79
- __param(0, InjectRepository(IntegrationOutbound))
80
- ], OutboundRepositoryService);
81
- export { OutboundRepositoryService };
@@ -1,20 +0,0 @@
1
- import { Repository } from 'typeorm';
2
- import { LogIntegrationInbound } from '../entities/log-integration-inbound.entity.js';
3
- /**
4
- * Repositório de log de integração de entrada (inbound).
5
- * Responsável por criar/atualizar registros de latência associados a um id.
6
- * Possibilidade de reprocessamento e auditoria.
7
- */
8
- export declare class LogInboundRepositoryService {
9
- private readonly repo;
10
- constructor(repo: Repository<LogIntegrationInbound>);
11
- /**
12
- * Cria um novo registro de latência.
13
- * @param id
14
- * @param correlation_id
15
- * @param timestamp_start
16
- * @returns
17
- */
18
- register(correlationId: string, data?: Partial<LogIntegrationInbound>): Promise<LogIntegrationInbound | null>;
19
- }
20
- //# sourceMappingURL=log-integration-inbound.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-integration-inbound.service.d.ts","sourceRoot":"","sources":["../../src/repository/log-integration-inbound.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAGtF;;;;GAIG;AACH,qBACa,2BAA2B;IAGpC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAG1D;;;;;;OAMG;IACG,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;CA0BxH"}
@@ -1,58 +0,0 @@
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 { LogIntegrationInbound } from '../entities/log-integration-inbound.entity.js';
13
- import { IntegrationStatus } from '../enum/integration.enums.js';
14
- /**
15
- * Repositório de log de integração de entrada (inbound).
16
- * Responsável por criar/atualizar registros de latência associados a um id.
17
- * Possibilidade de reprocessamento e auditoria.
18
- */
19
- let LogInboundRepositoryService = class LogInboundRepositoryService {
20
- repo;
21
- constructor(repo) {
22
- this.repo = repo;
23
- }
24
- /**
25
- * Cria um novo registro de latência.
26
- * @param id
27
- * @param correlation_id
28
- * @param timestamp_start
29
- * @returns
30
- */
31
- async register(correlationId, data = {}) {
32
- const payload = {
33
- correlationId,
34
- durationProcessMs: data.timestampProcess
35
- ? Date.now() - new Date(data.timestampProcess || "").getTime()
36
- : undefined,
37
- ...data,
38
- };
39
- if (data.status === IntegrationStatus.SUCCESS || data.status === IntegrationStatus.FAILED) {
40
- const endTime = Date.now();
41
- payload.timestampEnd = new Date();
42
- if (payload.timestampStart) {
43
- payload.durationMs = endTime - new Date(payload.timestampStart).getTime();
44
- }
45
- }
46
- await this.repo.upsert(payload, ["correlationId"]);
47
- return this.repo.findOne({
48
- where: {
49
- correlationId,
50
- },
51
- });
52
- }
53
- };
54
- LogInboundRepositoryService = __decorate([
55
- Injectable(),
56
- __param(0, InjectRepository(LogIntegrationInbound))
57
- ], LogInboundRepositoryService);
58
- export { LogInboundRepositoryService };