phx-node 1.0.38 → 1.0.40
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.
|
@@ -4,6 +4,10 @@ export interface GrpcRequestType {
|
|
|
4
4
|
hostname: string;
|
|
5
5
|
variables?: Record<string, any> | null | undefined;
|
|
6
6
|
}
|
|
7
|
+
export interface GrpcRequestDataCenterType {
|
|
8
|
+
query: string;
|
|
9
|
+
variables?: Record<string, any> | null | undefined;
|
|
10
|
+
}
|
|
7
11
|
export declare class PHXGrpcClientSystemService {
|
|
8
12
|
private readonly httpService;
|
|
9
13
|
private readonly logger;
|
|
@@ -13,4 +17,6 @@ export declare class PHXGrpcClientSystemService {
|
|
|
13
17
|
debug(hostname: string): void;
|
|
14
18
|
query({ query, variables, hostname, }: GrpcRequestType): Promise<any>;
|
|
15
19
|
mutation({ query, variables, hostname, }: GrpcRequestType): Promise<any>;
|
|
20
|
+
queryDataCenter({ query, variables, }: GrpcRequestDataCenterType): Promise<any>;
|
|
21
|
+
mutationDataCenter({ query, variables, }: GrpcRequestDataCenterType): Promise<any>;
|
|
16
22
|
}
|
|
@@ -65,6 +65,34 @@ let PHXGrpcClientSystemService = PHXGrpcClientSystemService_1 = class PHXGrpcCli
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
+
queryDataCenter(_a) {
|
|
69
|
+
return __awaiter(this, arguments, void 0, function* ({ query, variables, }) {
|
|
70
|
+
try {
|
|
71
|
+
const response = yield this.httpService
|
|
72
|
+
.post(`${this.grpcGatewayUrl}/grpc-client/query`, Object.assign(Object.assign({}, (variables && { variables })), { source: this.projectSource, query, headers: { hostname: "data-center" } }))
|
|
73
|
+
.toPromise();
|
|
74
|
+
return response.data;
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.log("error", error);
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
mutationDataCenter(_a) {
|
|
83
|
+
return __awaiter(this, arguments, void 0, function* ({ query, variables, }) {
|
|
84
|
+
try {
|
|
85
|
+
const response = yield this.httpService
|
|
86
|
+
.post(`${this.grpcGatewayUrl}/grpc-client/mutation`, Object.assign(Object.assign({}, (variables && { variables })), { source: this.projectSource, query, headers: { hostname: "data-center" } }))
|
|
87
|
+
.toPromise();
|
|
88
|
+
return response.data;
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
console.log("error", error);
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
68
96
|
};
|
|
69
97
|
exports.PHXGrpcClientSystemService = PHXGrpcClientSystemService;
|
|
70
98
|
exports.PHXGrpcClientSystemService = PHXGrpcClientSystemService = PHXGrpcClientSystemService_1 = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grpc-client-system.service.js","sourceRoot":"","sources":["../../../src/module/grpc-client/grpc-client-system.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,yCAA4C;
|
|
1
|
+
{"version":3,"file":"grpc-client-system.service.js","sourceRoot":"","sources":["../../../src/module/grpc-client/grpc-client-system.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,yCAA4C;AAarC,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IAKrC,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;QAJpC,WAAM,GAAG,IAAI,eAAM,CAAC,4BAA0B,CAAC,IAAI,CAAC,CAAC;QAKpE,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QAC/C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAClD,CAAC;IAEM,KAAK,CAAC,QAAgB;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC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