@cargolift-cdi/types 0.1.149 → 0.1.151
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-system.entity.d.ts.map +1 -1
- package/dist/repository/integration-system-repository.service.d.ts +10 -0
- package/dist/repository/integration-system-repository.service.d.ts.map +1 -0
- package/dist/repository/integration-system-repository.service.js +34 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { IntegrationSystem } from "../entities/integration-system.entity.js";
|
|
13
|
+
let SystemRepositoryService = class SystemRepositoryService {
|
|
14
|
+
repo;
|
|
15
|
+
constructor(repo) {
|
|
16
|
+
this.repo = repo;
|
|
17
|
+
}
|
|
18
|
+
async get(system) {
|
|
19
|
+
return await this.repo.findOne({ where: { system, active: true } });
|
|
20
|
+
}
|
|
21
|
+
// Busca todos os sistemas ativos
|
|
22
|
+
async getAllActive() {
|
|
23
|
+
return await this.repo.find({ where: { active: true } });
|
|
24
|
+
}
|
|
25
|
+
// Busca o sistema com base no clientId do KeyCloak
|
|
26
|
+
async getByApiClientId(apiClientId) {
|
|
27
|
+
return await this.repo.findOne({ where: { apiClientId, active: true } });
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
SystemRepositoryService = __decorate([
|
|
31
|
+
Injectable(),
|
|
32
|
+
__param(0, InjectRepository(IntegrationSystem))
|
|
33
|
+
], SystemRepositoryService);
|
|
34
|
+
export { SystemRepositoryService };
|