@sui-tracker/shared 1.0.41 → 1.0.43
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.
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { ClientGrpc } from "@nestjs/microservices";
|
|
2
|
-
import { PickOneRequest, PickOneResponse
|
|
2
|
+
import { PickOneRequest, PickOneResponse } from "../interfaces/proxy.interface";
|
|
3
3
|
export declare class ProxyGrpcService {
|
|
4
4
|
private grpcClient;
|
|
5
5
|
private readonly logger;
|
|
6
6
|
constructor(grpcClient: ClientGrpc);
|
|
7
7
|
pickOne(data: PickOneRequest): Promise<PickOneResponse>;
|
|
8
|
-
getAllProxy(data: GetAllProxyRequest): Promise<GetAllProxyResponse>;
|
|
9
|
-
testProxy(data: TestProxyRequest): Promise<TestProxyResponse>;
|
|
10
8
|
}
|
|
@@ -25,25 +25,11 @@ let ProxyGrpcService = ProxyGrpcService_1 = class ProxyGrpcService {
|
|
|
25
25
|
return new Promise((resolve, reject) => {
|
|
26
26
|
proxyService.pickOne(data).subscribe({
|
|
27
27
|
next: (response) => resolve(response),
|
|
28
|
-
error: (error) =>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const proxyService = this.grpcClient.getService("ProxyService");
|
|
34
|
-
return new Promise((resolve, reject) => {
|
|
35
|
-
proxyService.getAllProxy(data).subscribe({
|
|
36
|
-
next: (response) => resolve(response),
|
|
37
|
-
error: (error) => reject(error),
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
async testProxy(data) {
|
|
42
|
-
const proxyService = this.grpcClient.getService("ProxyService");
|
|
43
|
-
return new Promise((resolve, reject) => {
|
|
44
|
-
proxyService.testProxy(data).subscribe({
|
|
45
|
-
next: (response) => resolve(response),
|
|
46
|
-
error: (error) => reject(error),
|
|
28
|
+
error: (error) => resolve({
|
|
29
|
+
data: null,
|
|
30
|
+
message: error,
|
|
31
|
+
success: false,
|
|
32
|
+
}),
|
|
47
33
|
});
|
|
48
34
|
});
|
|
49
35
|
}
|
|
@@ -51,7 +37,7 @@ let ProxyGrpcService = ProxyGrpcService_1 = class ProxyGrpcService {
|
|
|
51
37
|
exports.ProxyGrpcService = ProxyGrpcService;
|
|
52
38
|
exports.ProxyGrpcService = ProxyGrpcService = ProxyGrpcService_1 = __decorate([
|
|
53
39
|
(0, common_1.Injectable)(),
|
|
54
|
-
__param(0, (0, common_1.Inject)(
|
|
40
|
+
__param(0, (0, common_1.Inject)("PROXY")),
|
|
55
41
|
__metadata("design:paramtypes", [Object])
|
|
56
42
|
], ProxyGrpcService);
|
|
57
43
|
//# sourceMappingURL=proxy-grpc.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-grpc.service.js","sourceRoot":"","sources":["../../../src/modules/grpc-services/proxy-grpc.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"proxy-grpc.service.js","sourceRoot":"","sources":["../../../src/modules/grpc-services/proxy-grpc.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA4D;AASrD,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAG3B,YAA6B,UAA8B;QAAtB,eAAU,GAAV,UAAU,CAAY;QAF1C,WAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;IAEE,CAAC;IAG/D,KAAK,CAAC,OAAO,CAAC,IAAoB;QAChC,MAAM,YAAY,GAChB,IAAI,CAAC,UAAU,CAAC,UAAU,CAAe,cAAc,CAAC,CAAC;QAE3D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC;gBACnC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;gBACrC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC;oBACxB,IAAI,EAAE,IAAI;oBACV,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,KAAK;iBACf,CAAC;aACH,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AArBY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAIE,WAAA,IAAA,eAAM,EAAC,OAAO,CAAC,CAAA;;GAHjB,gBAAgB,CAqB5B"}
|