@aceplus/smartace-api 2.10.0 → 2.11.0-alpha.2

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.
@@ -0,0 +1,120 @@
1
+ // package: Spic
2
+ // file: spic.config.proto
3
+
4
+ import * as spic_config_pb from "./spic.config_pb";
5
+ import {grpc} from "@improbable-eng/grpc-web";
6
+
7
+ type ConfigGRPCCreate = {
8
+ readonly methodName: string;
9
+ readonly service: typeof ConfigGRPC;
10
+ readonly requestStream: false;
11
+ readonly responseStream: false;
12
+ readonly requestType: typeof spic_config_pb.ConfigProto.CreateRequest;
13
+ readonly responseType: typeof spic_config_pb.ConfigProto;
14
+ };
15
+
16
+ type ConfigGRPCRetrieve = {
17
+ readonly methodName: string;
18
+ readonly service: typeof ConfigGRPC;
19
+ readonly requestStream: false;
20
+ readonly responseStream: false;
21
+ readonly requestType: typeof spic_config_pb.ConfigProto.RetrieveRequest;
22
+ readonly responseType: typeof spic_config_pb.ConfigProto;
23
+ };
24
+
25
+ type ConfigGRPCUpdate = {
26
+ readonly methodName: string;
27
+ readonly service: typeof ConfigGRPC;
28
+ readonly requestStream: false;
29
+ readonly responseStream: false;
30
+ readonly requestType: typeof spic_config_pb.ConfigProto.UpdateRequest;
31
+ readonly responseType: typeof spic_config_pb.ConfigProto;
32
+ };
33
+
34
+ type ConfigGRPCSearch = {
35
+ readonly methodName: string;
36
+ readonly service: typeof ConfigGRPC;
37
+ readonly requestStream: false;
38
+ readonly responseStream: false;
39
+ readonly requestType: typeof spic_config_pb.ConfigProto.SearchRequest;
40
+ readonly responseType: typeof spic_config_pb.ConfigProto.SearchReply;
41
+ };
42
+
43
+ export class ConfigGRPC {
44
+ static readonly serviceName: string;
45
+ static readonly Create: ConfigGRPCCreate;
46
+ static readonly Retrieve: ConfigGRPCRetrieve;
47
+ static readonly Update: ConfigGRPCUpdate;
48
+ static readonly Search: ConfigGRPCSearch;
49
+ }
50
+
51
+ export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
52
+ export type Status = { details: string, code: number; metadata: grpc.Metadata }
53
+
54
+ interface UnaryResponse {
55
+ cancel(): void;
56
+ }
57
+ interface ResponseStream<T> {
58
+ cancel(): void;
59
+ on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
60
+ on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
61
+ on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
62
+ }
63
+ interface RequestStream<T> {
64
+ write(message: T): RequestStream<T>;
65
+ end(): void;
66
+ cancel(): void;
67
+ on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
68
+ on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
69
+ }
70
+ interface BidirectionalStream<ReqT, ResT> {
71
+ write(message: ReqT): BidirectionalStream<ReqT, ResT>;
72
+ end(): void;
73
+ cancel(): void;
74
+ on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
75
+ on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
76
+ on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
77
+ }
78
+
79
+ export class ConfigGRPCClient {
80
+ readonly serviceHost: string;
81
+
82
+ constructor(serviceHost: string, options?: grpc.RpcOptions);
83
+ create(
84
+ requestMessage: spic_config_pb.ConfigProto.CreateRequest,
85
+ metadata: grpc.Metadata,
86
+ callback: (error: ServiceError|null, responseMessage: spic_config_pb.ConfigProto|null) => void
87
+ ): UnaryResponse;
88
+ create(
89
+ requestMessage: spic_config_pb.ConfigProto.CreateRequest,
90
+ callback: (error: ServiceError|null, responseMessage: spic_config_pb.ConfigProto|null) => void
91
+ ): UnaryResponse;
92
+ retrieve(
93
+ requestMessage: spic_config_pb.ConfigProto.RetrieveRequest,
94
+ metadata: grpc.Metadata,
95
+ callback: (error: ServiceError|null, responseMessage: spic_config_pb.ConfigProto|null) => void
96
+ ): UnaryResponse;
97
+ retrieve(
98
+ requestMessage: spic_config_pb.ConfigProto.RetrieveRequest,
99
+ callback: (error: ServiceError|null, responseMessage: spic_config_pb.ConfigProto|null) => void
100
+ ): UnaryResponse;
101
+ update(
102
+ requestMessage: spic_config_pb.ConfigProto.UpdateRequest,
103
+ metadata: grpc.Metadata,
104
+ callback: (error: ServiceError|null, responseMessage: spic_config_pb.ConfigProto|null) => void
105
+ ): UnaryResponse;
106
+ update(
107
+ requestMessage: spic_config_pb.ConfigProto.UpdateRequest,
108
+ callback: (error: ServiceError|null, responseMessage: spic_config_pb.ConfigProto|null) => void
109
+ ): UnaryResponse;
110
+ search(
111
+ requestMessage: spic_config_pb.ConfigProto.SearchRequest,
112
+ metadata: grpc.Metadata,
113
+ callback: (error: ServiceError|null, responseMessage: spic_config_pb.ConfigProto.SearchReply|null) => void
114
+ ): UnaryResponse;
115
+ search(
116
+ requestMessage: spic_config_pb.ConfigProto.SearchRequest,
117
+ callback: (error: ServiceError|null, responseMessage: spic_config_pb.ConfigProto.SearchReply|null) => void
118
+ ): UnaryResponse;
119
+ }
120
+
@@ -0,0 +1,181 @@
1
+ // package: Spic
2
+ // file: spic.config.proto
3
+
4
+ var spic_config_pb = require("./spic.config_pb");
5
+ var grpc = require("@improbable-eng/grpc-web").grpc;
6
+
7
+ var ConfigGRPC = (function () {
8
+ function ConfigGRPC() {}
9
+ ConfigGRPC.serviceName = "Spic.ConfigGRPC";
10
+ return ConfigGRPC;
11
+ }());
12
+
13
+ ConfigGRPC.Create = {
14
+ methodName: "Create",
15
+ service: ConfigGRPC,
16
+ requestStream: false,
17
+ responseStream: false,
18
+ requestType: spic_config_pb.ConfigProto.CreateRequest,
19
+ responseType: spic_config_pb.ConfigProto
20
+ };
21
+
22
+ ConfigGRPC.Retrieve = {
23
+ methodName: "Retrieve",
24
+ service: ConfigGRPC,
25
+ requestStream: false,
26
+ responseStream: false,
27
+ requestType: spic_config_pb.ConfigProto.RetrieveRequest,
28
+ responseType: spic_config_pb.ConfigProto
29
+ };
30
+
31
+ ConfigGRPC.Update = {
32
+ methodName: "Update",
33
+ service: ConfigGRPC,
34
+ requestStream: false,
35
+ responseStream: false,
36
+ requestType: spic_config_pb.ConfigProto.UpdateRequest,
37
+ responseType: spic_config_pb.ConfigProto
38
+ };
39
+
40
+ ConfigGRPC.Search = {
41
+ methodName: "Search",
42
+ service: ConfigGRPC,
43
+ requestStream: false,
44
+ responseStream: false,
45
+ requestType: spic_config_pb.ConfigProto.SearchRequest,
46
+ responseType: spic_config_pb.ConfigProto.SearchReply
47
+ };
48
+
49
+ exports.ConfigGRPC = ConfigGRPC;
50
+
51
+ function ConfigGRPCClient(serviceHost, options) {
52
+ this.serviceHost = serviceHost;
53
+ this.options = options || {};
54
+ }
55
+
56
+ ConfigGRPCClient.prototype.create = function create(requestMessage, metadata, callback) {
57
+ if (arguments.length === 2) {
58
+ callback = arguments[1];
59
+ }
60
+ var client = grpc.unary(ConfigGRPC.Create, {
61
+ request: requestMessage,
62
+ host: this.serviceHost,
63
+ metadata: metadata,
64
+ transport: this.options.transport,
65
+ debug: this.options.debug,
66
+ onEnd: function (response) {
67
+ if (callback) {
68
+ if (response.status !== grpc.Code.OK) {
69
+ var err = new Error(response.statusMessage);
70
+ err.code = response.status;
71
+ err.metadata = response.trailers;
72
+ callback(err, null);
73
+ } else {
74
+ callback(null, response.message);
75
+ }
76
+ }
77
+ }
78
+ });
79
+ return {
80
+ cancel: function () {
81
+ callback = null;
82
+ client.close();
83
+ }
84
+ };
85
+ };
86
+
87
+ ConfigGRPCClient.prototype.retrieve = function retrieve(requestMessage, metadata, callback) {
88
+ if (arguments.length === 2) {
89
+ callback = arguments[1];
90
+ }
91
+ var client = grpc.unary(ConfigGRPC.Retrieve, {
92
+ request: requestMessage,
93
+ host: this.serviceHost,
94
+ metadata: metadata,
95
+ transport: this.options.transport,
96
+ debug: this.options.debug,
97
+ onEnd: function (response) {
98
+ if (callback) {
99
+ if (response.status !== grpc.Code.OK) {
100
+ var err = new Error(response.statusMessage);
101
+ err.code = response.status;
102
+ err.metadata = response.trailers;
103
+ callback(err, null);
104
+ } else {
105
+ callback(null, response.message);
106
+ }
107
+ }
108
+ }
109
+ });
110
+ return {
111
+ cancel: function () {
112
+ callback = null;
113
+ client.close();
114
+ }
115
+ };
116
+ };
117
+
118
+ ConfigGRPCClient.prototype.update = function update(requestMessage, metadata, callback) {
119
+ if (arguments.length === 2) {
120
+ callback = arguments[1];
121
+ }
122
+ var client = grpc.unary(ConfigGRPC.Update, {
123
+ request: requestMessage,
124
+ host: this.serviceHost,
125
+ metadata: metadata,
126
+ transport: this.options.transport,
127
+ debug: this.options.debug,
128
+ onEnd: function (response) {
129
+ if (callback) {
130
+ if (response.status !== grpc.Code.OK) {
131
+ var err = new Error(response.statusMessage);
132
+ err.code = response.status;
133
+ err.metadata = response.trailers;
134
+ callback(err, null);
135
+ } else {
136
+ callback(null, response.message);
137
+ }
138
+ }
139
+ }
140
+ });
141
+ return {
142
+ cancel: function () {
143
+ callback = null;
144
+ client.close();
145
+ }
146
+ };
147
+ };
148
+
149
+ ConfigGRPCClient.prototype.search = function search(requestMessage, metadata, callback) {
150
+ if (arguments.length === 2) {
151
+ callback = arguments[1];
152
+ }
153
+ var client = grpc.unary(ConfigGRPC.Search, {
154
+ request: requestMessage,
155
+ host: this.serviceHost,
156
+ metadata: metadata,
157
+ transport: this.options.transport,
158
+ debug: this.options.debug,
159
+ onEnd: function (response) {
160
+ if (callback) {
161
+ if (response.status !== grpc.Code.OK) {
162
+ var err = new Error(response.statusMessage);
163
+ err.code = response.status;
164
+ err.metadata = response.trailers;
165
+ callback(err, null);
166
+ } else {
167
+ callback(null, response.message);
168
+ }
169
+ }
170
+ }
171
+ });
172
+ return {
173
+ cancel: function () {
174
+ callback = null;
175
+ client.close();
176
+ }
177
+ };
178
+ };
179
+
180
+ exports.ConfigGRPCClient = ConfigGRPCClient;
181
+