@gitpod/ide-metrics-api-grpcweb 0.0.1-pd-ide-metrics-http.6 → 0.0.1-pd-sf-error-report.6

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.
@@ -19,6 +19,8 @@ goog.exportSymbol('proto.ide_metrics_api.AddCounterRequest', null, global);
19
19
  goog.exportSymbol('proto.ide_metrics_api.AddCounterResponse', null, global);
20
20
  goog.exportSymbol('proto.ide_metrics_api.ObserveHistogramRequest', null, global);
21
21
  goog.exportSymbol('proto.ide_metrics_api.ObserveHistogramResponse', null, global);
22
+ goog.exportSymbol('proto.ide_metrics_api.ReportErrorRequest', null, global);
23
+ goog.exportSymbol('proto.ide_metrics_api.ReportErrorResponse', null, global);
22
24
  /**
23
25
  * Generated by JsPbCodeGenerator.
24
26
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -103,6 +105,48 @@ if (goog.DEBUG && !COMPILED) {
103
105
  */
104
106
  proto.ide_metrics_api.ObserveHistogramResponse.displayName = 'proto.ide_metrics_api.ObserveHistogramResponse';
105
107
  }
108
+ /**
109
+ * Generated by JsPbCodeGenerator.
110
+ * @param {Array=} opt_data Optional initial data array, typically from a
111
+ * server response, or constructed directly in Javascript. The array is used
112
+ * in place and becomes part of the constructed object. It is not cloned.
113
+ * If no data is provided, the constructed object will be empty, but still
114
+ * valid.
115
+ * @extends {jspb.Message}
116
+ * @constructor
117
+ */
118
+ proto.ide_metrics_api.ReportErrorRequest = function(opt_data) {
119
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
120
+ };
121
+ goog.inherits(proto.ide_metrics_api.ReportErrorRequest, jspb.Message);
122
+ if (goog.DEBUG && !COMPILED) {
123
+ /**
124
+ * @public
125
+ * @override
126
+ */
127
+ proto.ide_metrics_api.ReportErrorRequest.displayName = 'proto.ide_metrics_api.ReportErrorRequest';
128
+ }
129
+ /**
130
+ * Generated by JsPbCodeGenerator.
131
+ * @param {Array=} opt_data Optional initial data array, typically from a
132
+ * server response, or constructed directly in Javascript. The array is used
133
+ * in place and becomes part of the constructed object. It is not cloned.
134
+ * If no data is provided, the constructed object will be empty, but still
135
+ * valid.
136
+ * @extends {jspb.Message}
137
+ * @constructor
138
+ */
139
+ proto.ide_metrics_api.ReportErrorResponse = function(opt_data) {
140
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
141
+ };
142
+ goog.inherits(proto.ide_metrics_api.ReportErrorResponse, jspb.Message);
143
+ if (goog.DEBUG && !COMPILED) {
144
+ /**
145
+ * @public
146
+ * @override
147
+ */
148
+ proto.ide_metrics_api.ReportErrorResponse.displayName = 'proto.ide_metrics_api.ReportErrorResponse';
149
+ }
106
150
 
107
151
 
108
152
 
@@ -228,8 +272,8 @@ proto.ide_metrics_api.AddCounterRequest.serializeBinaryToWriter = function(messa
228
272
  if (f && f.getLength() > 0) {
229
273
  f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
230
274
  }
231
- f = /** @type {number} */ (jspb.Message.getField(message, 3));
232
- if (f != null) {
275
+ f = message.getValue();
276
+ if (f !== 0) {
233
277
  writer.writeInt32(
234
278
  3,
235
279
  f
@@ -292,25 +336,7 @@ proto.ide_metrics_api.AddCounterRequest.prototype.getValue = function() {
292
336
  * @return {!proto.ide_metrics_api.AddCounterRequest} returns this
293
337
  */
294
338
  proto.ide_metrics_api.AddCounterRequest.prototype.setValue = function(value) {
295
- return jspb.Message.setField(this, 3, value);
296
- };
297
-
298
-
299
- /**
300
- * Clears the field making it undefined.
301
- * @return {!proto.ide_metrics_api.AddCounterRequest} returns this
302
- */
303
- proto.ide_metrics_api.AddCounterRequest.prototype.clearValue = function() {
304
- return jspb.Message.setField(this, 3, undefined);
305
- };
306
-
307
-
308
- /**
309
- * Returns whether this field is set.
310
- * @return {boolean}
311
- */
312
- proto.ide_metrics_api.AddCounterRequest.prototype.hasValue = function() {
313
- return jspb.Message.getField(this, 3) != null;
339
+ return jspb.Message.setProto3IntField(this, 3, value);
314
340
  };
315
341
 
316
342
 
@@ -709,4 +735,478 @@ proto.ide_metrics_api.ObserveHistogramResponse.serializeBinaryToWriter = functio
709
735
  };
710
736
 
711
737
 
738
+
739
+
740
+
741
+ if (jspb.Message.GENERATE_TO_OBJECT) {
742
+ /**
743
+ * Creates an object representation of this proto.
744
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
745
+ * Optional fields that are not set will be set to undefined.
746
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
747
+ * For the list of reserved names please see:
748
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
749
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
750
+ * JSPB instance for transitional soy proto support:
751
+ * http://goto/soy-param-migration
752
+ * @return {!Object}
753
+ */
754
+ proto.ide_metrics_api.ReportErrorRequest.prototype.toObject = function(opt_includeInstance) {
755
+ return proto.ide_metrics_api.ReportErrorRequest.toObject(opt_includeInstance, this);
756
+ };
757
+
758
+
759
+ /**
760
+ * Static version of the {@see toObject} method.
761
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
762
+ * the JSPB instance for transitional soy proto support:
763
+ * http://goto/soy-param-migration
764
+ * @param {!proto.ide_metrics_api.ReportErrorRequest} msg The msg instance to transform.
765
+ * @return {!Object}
766
+ * @suppress {unusedLocalVariables} f is only used for nested messages
767
+ */
768
+ proto.ide_metrics_api.ReportErrorRequest.toObject = function(includeInstance, msg) {
769
+ var f, obj = {
770
+ errorStack: jspb.Message.getFieldWithDefault(msg, 1, ""),
771
+ component: jspb.Message.getFieldWithDefault(msg, 2, ""),
772
+ version: jspb.Message.getFieldWithDefault(msg, 3, ""),
773
+ userId: jspb.Message.getFieldWithDefault(msg, 4, ""),
774
+ workspaceId: jspb.Message.getFieldWithDefault(msg, 5, ""),
775
+ instanceId: jspb.Message.getFieldWithDefault(msg, 6, ""),
776
+ propertiesMap: (f = msg.getPropertiesMap()) ? f.toObject(includeInstance, undefined) : [],
777
+ name: jspb.Message.getFieldWithDefault(msg, 8, ""),
778
+ message: jspb.Message.getFieldWithDefault(msg, 9, "")
779
+ };
780
+
781
+ if (includeInstance) {
782
+ obj.$jspbMessageInstance = msg;
783
+ }
784
+ return obj;
785
+ };
786
+ }
787
+
788
+
789
+ /**
790
+ * Deserializes binary data (in protobuf wire format).
791
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
792
+ * @return {!proto.ide_metrics_api.ReportErrorRequest}
793
+ */
794
+ proto.ide_metrics_api.ReportErrorRequest.deserializeBinary = function(bytes) {
795
+ var reader = new jspb.BinaryReader(bytes);
796
+ var msg = new proto.ide_metrics_api.ReportErrorRequest;
797
+ return proto.ide_metrics_api.ReportErrorRequest.deserializeBinaryFromReader(msg, reader);
798
+ };
799
+
800
+
801
+ /**
802
+ * Deserializes binary data (in protobuf wire format) from the
803
+ * given reader into the given message object.
804
+ * @param {!proto.ide_metrics_api.ReportErrorRequest} msg The message object to deserialize into.
805
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
806
+ * @return {!proto.ide_metrics_api.ReportErrorRequest}
807
+ */
808
+ proto.ide_metrics_api.ReportErrorRequest.deserializeBinaryFromReader = function(msg, reader) {
809
+ while (reader.nextField()) {
810
+ if (reader.isEndGroup()) {
811
+ break;
812
+ }
813
+ var field = reader.getFieldNumber();
814
+ switch (field) {
815
+ case 1:
816
+ var value = /** @type {string} */ (reader.readString());
817
+ msg.setErrorStack(value);
818
+ break;
819
+ case 2:
820
+ var value = /** @type {string} */ (reader.readString());
821
+ msg.setComponent(value);
822
+ break;
823
+ case 3:
824
+ var value = /** @type {string} */ (reader.readString());
825
+ msg.setVersion(value);
826
+ break;
827
+ case 4:
828
+ var value = /** @type {string} */ (reader.readString());
829
+ msg.setUserId(value);
830
+ break;
831
+ case 5:
832
+ var value = /** @type {string} */ (reader.readString());
833
+ msg.setWorkspaceId(value);
834
+ break;
835
+ case 6:
836
+ var value = /** @type {string} */ (reader.readString());
837
+ msg.setInstanceId(value);
838
+ break;
839
+ case 7:
840
+ var value = msg.getPropertiesMap();
841
+ reader.readMessage(value, function(message, reader) {
842
+ jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
843
+ });
844
+ break;
845
+ case 8:
846
+ var value = /** @type {string} */ (reader.readString());
847
+ msg.setName(value);
848
+ break;
849
+ case 9:
850
+ var value = /** @type {string} */ (reader.readString());
851
+ msg.setMessage(value);
852
+ break;
853
+ default:
854
+ reader.skipField();
855
+ break;
856
+ }
857
+ }
858
+ return msg;
859
+ };
860
+
861
+
862
+ /**
863
+ * Serializes the message to binary data (in protobuf wire format).
864
+ * @return {!Uint8Array}
865
+ */
866
+ proto.ide_metrics_api.ReportErrorRequest.prototype.serializeBinary = function() {
867
+ var writer = new jspb.BinaryWriter();
868
+ proto.ide_metrics_api.ReportErrorRequest.serializeBinaryToWriter(this, writer);
869
+ return writer.getResultBuffer();
870
+ };
871
+
872
+
873
+ /**
874
+ * Serializes the given message to binary data (in protobuf wire
875
+ * format), writing to the given BinaryWriter.
876
+ * @param {!proto.ide_metrics_api.ReportErrorRequest} message
877
+ * @param {!jspb.BinaryWriter} writer
878
+ * @suppress {unusedLocalVariables} f is only used for nested messages
879
+ */
880
+ proto.ide_metrics_api.ReportErrorRequest.serializeBinaryToWriter = function(message, writer) {
881
+ var f = undefined;
882
+ f = message.getErrorStack();
883
+ if (f.length > 0) {
884
+ writer.writeString(
885
+ 1,
886
+ f
887
+ );
888
+ }
889
+ f = message.getComponent();
890
+ if (f.length > 0) {
891
+ writer.writeString(
892
+ 2,
893
+ f
894
+ );
895
+ }
896
+ f = message.getVersion();
897
+ if (f.length > 0) {
898
+ writer.writeString(
899
+ 3,
900
+ f
901
+ );
902
+ }
903
+ f = message.getUserId();
904
+ if (f.length > 0) {
905
+ writer.writeString(
906
+ 4,
907
+ f
908
+ );
909
+ }
910
+ f = message.getWorkspaceId();
911
+ if (f.length > 0) {
912
+ writer.writeString(
913
+ 5,
914
+ f
915
+ );
916
+ }
917
+ f = message.getInstanceId();
918
+ if (f.length > 0) {
919
+ writer.writeString(
920
+ 6,
921
+ f
922
+ );
923
+ }
924
+ f = message.getPropertiesMap(true);
925
+ if (f && f.getLength() > 0) {
926
+ f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
927
+ }
928
+ f = message.getName();
929
+ if (f.length > 0) {
930
+ writer.writeString(
931
+ 8,
932
+ f
933
+ );
934
+ }
935
+ f = message.getMessage();
936
+ if (f.length > 0) {
937
+ writer.writeString(
938
+ 9,
939
+ f
940
+ );
941
+ }
942
+ };
943
+
944
+
945
+ /**
946
+ * optional string error_stack = 1;
947
+ * @return {string}
948
+ */
949
+ proto.ide_metrics_api.ReportErrorRequest.prototype.getErrorStack = function() {
950
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
951
+ };
952
+
953
+
954
+ /**
955
+ * @param {string} value
956
+ * @return {!proto.ide_metrics_api.ReportErrorRequest} returns this
957
+ */
958
+ proto.ide_metrics_api.ReportErrorRequest.prototype.setErrorStack = function(value) {
959
+ return jspb.Message.setProto3StringField(this, 1, value);
960
+ };
961
+
962
+
963
+ /**
964
+ * optional string component = 2;
965
+ * @return {string}
966
+ */
967
+ proto.ide_metrics_api.ReportErrorRequest.prototype.getComponent = function() {
968
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
969
+ };
970
+
971
+
972
+ /**
973
+ * @param {string} value
974
+ * @return {!proto.ide_metrics_api.ReportErrorRequest} returns this
975
+ */
976
+ proto.ide_metrics_api.ReportErrorRequest.prototype.setComponent = function(value) {
977
+ return jspb.Message.setProto3StringField(this, 2, value);
978
+ };
979
+
980
+
981
+ /**
982
+ * optional string version = 3;
983
+ * @return {string}
984
+ */
985
+ proto.ide_metrics_api.ReportErrorRequest.prototype.getVersion = function() {
986
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
987
+ };
988
+
989
+
990
+ /**
991
+ * @param {string} value
992
+ * @return {!proto.ide_metrics_api.ReportErrorRequest} returns this
993
+ */
994
+ proto.ide_metrics_api.ReportErrorRequest.prototype.setVersion = function(value) {
995
+ return jspb.Message.setProto3StringField(this, 3, value);
996
+ };
997
+
998
+
999
+ /**
1000
+ * optional string user_id = 4;
1001
+ * @return {string}
1002
+ */
1003
+ proto.ide_metrics_api.ReportErrorRequest.prototype.getUserId = function() {
1004
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
1005
+ };
1006
+
1007
+
1008
+ /**
1009
+ * @param {string} value
1010
+ * @return {!proto.ide_metrics_api.ReportErrorRequest} returns this
1011
+ */
1012
+ proto.ide_metrics_api.ReportErrorRequest.prototype.setUserId = function(value) {
1013
+ return jspb.Message.setProto3StringField(this, 4, value);
1014
+ };
1015
+
1016
+
1017
+ /**
1018
+ * optional string workspace_id = 5;
1019
+ * @return {string}
1020
+ */
1021
+ proto.ide_metrics_api.ReportErrorRequest.prototype.getWorkspaceId = function() {
1022
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
1023
+ };
1024
+
1025
+
1026
+ /**
1027
+ * @param {string} value
1028
+ * @return {!proto.ide_metrics_api.ReportErrorRequest} returns this
1029
+ */
1030
+ proto.ide_metrics_api.ReportErrorRequest.prototype.setWorkspaceId = function(value) {
1031
+ return jspb.Message.setProto3StringField(this, 5, value);
1032
+ };
1033
+
1034
+
1035
+ /**
1036
+ * optional string instance_id = 6;
1037
+ * @return {string}
1038
+ */
1039
+ proto.ide_metrics_api.ReportErrorRequest.prototype.getInstanceId = function() {
1040
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
1041
+ };
1042
+
1043
+
1044
+ /**
1045
+ * @param {string} value
1046
+ * @return {!proto.ide_metrics_api.ReportErrorRequest} returns this
1047
+ */
1048
+ proto.ide_metrics_api.ReportErrorRequest.prototype.setInstanceId = function(value) {
1049
+ return jspb.Message.setProto3StringField(this, 6, value);
1050
+ };
1051
+
1052
+
1053
+ /**
1054
+ * map<string, string> properties = 7;
1055
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
1056
+ * empty, instead returning `undefined`
1057
+ * @return {!jspb.Map<string,string>}
1058
+ */
1059
+ proto.ide_metrics_api.ReportErrorRequest.prototype.getPropertiesMap = function(opt_noLazyCreate) {
1060
+ return /** @type {!jspb.Map<string,string>} */ (
1061
+ jspb.Message.getMapField(this, 7, opt_noLazyCreate,
1062
+ null));
1063
+ };
1064
+
1065
+
1066
+ /**
1067
+ * Clears values from the map. The map will be non-null.
1068
+ * @return {!proto.ide_metrics_api.ReportErrorRequest} returns this
1069
+ */
1070
+ proto.ide_metrics_api.ReportErrorRequest.prototype.clearPropertiesMap = function() {
1071
+ this.getPropertiesMap().clear();
1072
+ return this;};
1073
+
1074
+
1075
+ /**
1076
+ * optional string name = 8;
1077
+ * @return {string}
1078
+ */
1079
+ proto.ide_metrics_api.ReportErrorRequest.prototype.getName = function() {
1080
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
1081
+ };
1082
+
1083
+
1084
+ /**
1085
+ * @param {string} value
1086
+ * @return {!proto.ide_metrics_api.ReportErrorRequest} returns this
1087
+ */
1088
+ proto.ide_metrics_api.ReportErrorRequest.prototype.setName = function(value) {
1089
+ return jspb.Message.setProto3StringField(this, 8, value);
1090
+ };
1091
+
1092
+
1093
+ /**
1094
+ * optional string message = 9;
1095
+ * @return {string}
1096
+ */
1097
+ proto.ide_metrics_api.ReportErrorRequest.prototype.getMessage = function() {
1098
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
1099
+ };
1100
+
1101
+
1102
+ /**
1103
+ * @param {string} value
1104
+ * @return {!proto.ide_metrics_api.ReportErrorRequest} returns this
1105
+ */
1106
+ proto.ide_metrics_api.ReportErrorRequest.prototype.setMessage = function(value) {
1107
+ return jspb.Message.setProto3StringField(this, 9, value);
1108
+ };
1109
+
1110
+
1111
+
1112
+
1113
+
1114
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1115
+ /**
1116
+ * Creates an object representation of this proto.
1117
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1118
+ * Optional fields that are not set will be set to undefined.
1119
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1120
+ * For the list of reserved names please see:
1121
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1122
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1123
+ * JSPB instance for transitional soy proto support:
1124
+ * http://goto/soy-param-migration
1125
+ * @return {!Object}
1126
+ */
1127
+ proto.ide_metrics_api.ReportErrorResponse.prototype.toObject = function(opt_includeInstance) {
1128
+ return proto.ide_metrics_api.ReportErrorResponse.toObject(opt_includeInstance, this);
1129
+ };
1130
+
1131
+
1132
+ /**
1133
+ * Static version of the {@see toObject} method.
1134
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1135
+ * the JSPB instance for transitional soy proto support:
1136
+ * http://goto/soy-param-migration
1137
+ * @param {!proto.ide_metrics_api.ReportErrorResponse} msg The msg instance to transform.
1138
+ * @return {!Object}
1139
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1140
+ */
1141
+ proto.ide_metrics_api.ReportErrorResponse.toObject = function(includeInstance, msg) {
1142
+ var f, obj = {
1143
+
1144
+ };
1145
+
1146
+ if (includeInstance) {
1147
+ obj.$jspbMessageInstance = msg;
1148
+ }
1149
+ return obj;
1150
+ };
1151
+ }
1152
+
1153
+
1154
+ /**
1155
+ * Deserializes binary data (in protobuf wire format).
1156
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1157
+ * @return {!proto.ide_metrics_api.ReportErrorResponse}
1158
+ */
1159
+ proto.ide_metrics_api.ReportErrorResponse.deserializeBinary = function(bytes) {
1160
+ var reader = new jspb.BinaryReader(bytes);
1161
+ var msg = new proto.ide_metrics_api.ReportErrorResponse;
1162
+ return proto.ide_metrics_api.ReportErrorResponse.deserializeBinaryFromReader(msg, reader);
1163
+ };
1164
+
1165
+
1166
+ /**
1167
+ * Deserializes binary data (in protobuf wire format) from the
1168
+ * given reader into the given message object.
1169
+ * @param {!proto.ide_metrics_api.ReportErrorResponse} msg The message object to deserialize into.
1170
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1171
+ * @return {!proto.ide_metrics_api.ReportErrorResponse}
1172
+ */
1173
+ proto.ide_metrics_api.ReportErrorResponse.deserializeBinaryFromReader = function(msg, reader) {
1174
+ while (reader.nextField()) {
1175
+ if (reader.isEndGroup()) {
1176
+ break;
1177
+ }
1178
+ var field = reader.getFieldNumber();
1179
+ switch (field) {
1180
+ default:
1181
+ reader.skipField();
1182
+ break;
1183
+ }
1184
+ }
1185
+ return msg;
1186
+ };
1187
+
1188
+
1189
+ /**
1190
+ * Serializes the message to binary data (in protobuf wire format).
1191
+ * @return {!Uint8Array}
1192
+ */
1193
+ proto.ide_metrics_api.ReportErrorResponse.prototype.serializeBinary = function() {
1194
+ var writer = new jspb.BinaryWriter();
1195
+ proto.ide_metrics_api.ReportErrorResponse.serializeBinaryToWriter(this, writer);
1196
+ return writer.getResultBuffer();
1197
+ };
1198
+
1199
+
1200
+ /**
1201
+ * Serializes the given message to binary data (in protobuf wire
1202
+ * format), writing to the given BinaryWriter.
1203
+ * @param {!proto.ide_metrics_api.ReportErrorResponse} message
1204
+ * @param {!jspb.BinaryWriter} writer
1205
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1206
+ */
1207
+ proto.ide_metrics_api.ReportErrorResponse.serializeBinaryToWriter = function(message, writer) {
1208
+ var f = undefined;
1209
+ };
1210
+
1211
+
712
1212
  goog.object.extend(exports, proto.ide_metrics_api);
@@ -0,0 +1,101 @@
1
+ // package: ide_metrics_api
2
+ // file: idemetrics.proto
3
+
4
+ import * as idemetrics_pb from "./idemetrics_pb";
5
+ import {grpc} from "@improbable-eng/grpc-web";
6
+
7
+ type MetricsServiceAddCounter = {
8
+ readonly methodName: string;
9
+ readonly service: typeof MetricsService;
10
+ readonly requestStream: false;
11
+ readonly responseStream: false;
12
+ readonly requestType: typeof idemetrics_pb.AddCounterRequest;
13
+ readonly responseType: typeof idemetrics_pb.AddCounterResponse;
14
+ };
15
+
16
+ type MetricsServiceObserveHistogram = {
17
+ readonly methodName: string;
18
+ readonly service: typeof MetricsService;
19
+ readonly requestStream: false;
20
+ readonly responseStream: false;
21
+ readonly requestType: typeof idemetrics_pb.ObserveHistogramRequest;
22
+ readonly responseType: typeof idemetrics_pb.ObserveHistogramResponse;
23
+ };
24
+
25
+ type MetricsServicereportError = {
26
+ readonly methodName: string;
27
+ readonly service: typeof MetricsService;
28
+ readonly requestStream: false;
29
+ readonly responseStream: false;
30
+ readonly requestType: typeof idemetrics_pb.ReportErrorRequest;
31
+ readonly responseType: typeof idemetrics_pb.ReportErrorResponse;
32
+ };
33
+
34
+ export class MetricsService {
35
+ static readonly serviceName: string;
36
+ static readonly AddCounter: MetricsServiceAddCounter;
37
+ static readonly ObserveHistogram: MetricsServiceObserveHistogram;
38
+ static readonly reportError: MetricsServicereportError;
39
+ }
40
+
41
+ export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
42
+ export type Status = { details: string, code: number; metadata: grpc.Metadata }
43
+
44
+ interface UnaryResponse {
45
+ cancel(): void;
46
+ }
47
+ interface ResponseStream<T> {
48
+ cancel(): void;
49
+ on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
50
+ on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
51
+ on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
52
+ }
53
+ interface RequestStream<T> {
54
+ write(message: T): RequestStream<T>;
55
+ end(): void;
56
+ cancel(): void;
57
+ on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
58
+ on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
59
+ }
60
+ interface BidirectionalStream<ReqT, ResT> {
61
+ write(message: ReqT): BidirectionalStream<ReqT, ResT>;
62
+ end(): void;
63
+ cancel(): void;
64
+ on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
65
+ on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
66
+ on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
67
+ }
68
+
69
+ export class MetricsServiceClient {
70
+ readonly serviceHost: string;
71
+
72
+ constructor(serviceHost: string, options?: grpc.RpcOptions);
73
+ addCounter(
74
+ requestMessage: idemetrics_pb.AddCounterRequest,
75
+ metadata: grpc.Metadata,
76
+ callback: (error: ServiceError|null, responseMessage: idemetrics_pb.AddCounterResponse|null) => void
77
+ ): UnaryResponse;
78
+ addCounter(
79
+ requestMessage: idemetrics_pb.AddCounterRequest,
80
+ callback: (error: ServiceError|null, responseMessage: idemetrics_pb.AddCounterResponse|null) => void
81
+ ): UnaryResponse;
82
+ observeHistogram(
83
+ requestMessage: idemetrics_pb.ObserveHistogramRequest,
84
+ metadata: grpc.Metadata,
85
+ callback: (error: ServiceError|null, responseMessage: idemetrics_pb.ObserveHistogramResponse|null) => void
86
+ ): UnaryResponse;
87
+ observeHistogram(
88
+ requestMessage: idemetrics_pb.ObserveHistogramRequest,
89
+ callback: (error: ServiceError|null, responseMessage: idemetrics_pb.ObserveHistogramResponse|null) => void
90
+ ): UnaryResponse;
91
+ reportError(
92
+ requestMessage: idemetrics_pb.ReportErrorRequest,
93
+ metadata: grpc.Metadata,
94
+ callback: (error: ServiceError|null, responseMessage: idemetrics_pb.ReportErrorResponse|null) => void
95
+ ): UnaryResponse;
96
+ reportError(
97
+ requestMessage: idemetrics_pb.ReportErrorRequest,
98
+ callback: (error: ServiceError|null, responseMessage: idemetrics_pb.ReportErrorResponse|null) => void
99
+ ): UnaryResponse;
100
+ }
101
+