@aceplus/smartace-api 3.4.0-alpha.8 → 3.5.0-alpha.1
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/package.json +1 -1
- package/spic.asset_pb.d.ts +10 -3
- package/spic.asset_pb.js +98 -34
- package/spic.history_pb.d.ts +142 -0
- package/spic.history_pb.js +1130 -0
- package/spic.history_pb_service.d.ts +63 -0
- package/spic.history_pb_service.js +61 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// package: Spic
|
|
2
|
+
// file: spic.history.proto
|
|
3
|
+
|
|
4
|
+
import * as spic_history_pb from "./spic.history_pb";
|
|
5
|
+
import {grpc} from "@improbable-eng/grpc-web";
|
|
6
|
+
|
|
7
|
+
type HistoryGRPCSearch = {
|
|
8
|
+
readonly methodName: string;
|
|
9
|
+
readonly service: typeof HistoryGRPC;
|
|
10
|
+
readonly requestStream: false;
|
|
11
|
+
readonly responseStream: false;
|
|
12
|
+
readonly requestType: typeof spic_history_pb.HistoryProto.SearchRequest;
|
|
13
|
+
readonly responseType: typeof spic_history_pb.HistoryProto.SearchReply;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export class HistoryGRPC {
|
|
17
|
+
static readonly serviceName: string;
|
|
18
|
+
static readonly Search: HistoryGRPCSearch;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
|
|
22
|
+
export type Status = { details: string, code: number; metadata: grpc.Metadata }
|
|
23
|
+
|
|
24
|
+
interface UnaryResponse {
|
|
25
|
+
cancel(): void;
|
|
26
|
+
}
|
|
27
|
+
interface ResponseStream<T> {
|
|
28
|
+
cancel(): void;
|
|
29
|
+
on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
|
|
30
|
+
on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
|
|
31
|
+
on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
|
|
32
|
+
}
|
|
33
|
+
interface RequestStream<T> {
|
|
34
|
+
write(message: T): RequestStream<T>;
|
|
35
|
+
end(): void;
|
|
36
|
+
cancel(): void;
|
|
37
|
+
on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
|
|
38
|
+
on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
|
|
39
|
+
}
|
|
40
|
+
interface BidirectionalStream<ReqT, ResT> {
|
|
41
|
+
write(message: ReqT): BidirectionalStream<ReqT, ResT>;
|
|
42
|
+
end(): void;
|
|
43
|
+
cancel(): void;
|
|
44
|
+
on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
|
|
45
|
+
on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
|
|
46
|
+
on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class HistoryGRPCClient {
|
|
50
|
+
readonly serviceHost: string;
|
|
51
|
+
|
|
52
|
+
constructor(serviceHost: string, options?: grpc.RpcOptions);
|
|
53
|
+
search(
|
|
54
|
+
requestMessage: spic_history_pb.HistoryProto.SearchRequest,
|
|
55
|
+
metadata: grpc.Metadata,
|
|
56
|
+
callback: (error: ServiceError|null, responseMessage: spic_history_pb.HistoryProto.SearchReply|null) => void
|
|
57
|
+
): UnaryResponse;
|
|
58
|
+
search(
|
|
59
|
+
requestMessage: spic_history_pb.HistoryProto.SearchRequest,
|
|
60
|
+
callback: (error: ServiceError|null, responseMessage: spic_history_pb.HistoryProto.SearchReply|null) => void
|
|
61
|
+
): UnaryResponse;
|
|
62
|
+
}
|
|
63
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// package: Spic
|
|
2
|
+
// file: spic.history.proto
|
|
3
|
+
|
|
4
|
+
var spic_history_pb = require("./spic.history_pb");
|
|
5
|
+
var grpc = require("@improbable-eng/grpc-web").grpc;
|
|
6
|
+
|
|
7
|
+
var HistoryGRPC = (function () {
|
|
8
|
+
function HistoryGRPC() {}
|
|
9
|
+
HistoryGRPC.serviceName = "Spic.HistoryGRPC";
|
|
10
|
+
return HistoryGRPC;
|
|
11
|
+
}());
|
|
12
|
+
|
|
13
|
+
HistoryGRPC.Search = {
|
|
14
|
+
methodName: "Search",
|
|
15
|
+
service: HistoryGRPC,
|
|
16
|
+
requestStream: false,
|
|
17
|
+
responseStream: false,
|
|
18
|
+
requestType: spic_history_pb.HistoryProto.SearchRequest,
|
|
19
|
+
responseType: spic_history_pb.HistoryProto.SearchReply
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.HistoryGRPC = HistoryGRPC;
|
|
23
|
+
|
|
24
|
+
function HistoryGRPCClient(serviceHost, options) {
|
|
25
|
+
this.serviceHost = serviceHost;
|
|
26
|
+
this.options = options || {};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
HistoryGRPCClient.prototype.search = function search(requestMessage, metadata, callback) {
|
|
30
|
+
if (arguments.length === 2) {
|
|
31
|
+
callback = arguments[1];
|
|
32
|
+
}
|
|
33
|
+
var client = grpc.unary(HistoryGRPC.Search, {
|
|
34
|
+
request: requestMessage,
|
|
35
|
+
host: this.serviceHost,
|
|
36
|
+
metadata: metadata,
|
|
37
|
+
transport: this.options.transport,
|
|
38
|
+
debug: this.options.debug,
|
|
39
|
+
onEnd: function (response) {
|
|
40
|
+
if (callback) {
|
|
41
|
+
if (response.status !== grpc.Code.OK) {
|
|
42
|
+
var err = new Error(response.statusMessage);
|
|
43
|
+
err.code = response.status;
|
|
44
|
+
err.metadata = response.trailers;
|
|
45
|
+
callback(err, null);
|
|
46
|
+
} else {
|
|
47
|
+
callback(null, response.message);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
cancel: function () {
|
|
54
|
+
callback = null;
|
|
55
|
+
client.close();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.HistoryGRPCClient = HistoryGRPCClient;
|
|
61
|
+
|