protobuf-platform 1.0.294 → 1.0.295

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.
@@ -12,6 +12,8 @@ service Cashback {
12
12
  rpc deleteSingleCashback(GetCashbackRequest) returns (CashbackStatusResponse);
13
13
  rpc readListCashbacks(PaginationRequest) returns (CashbackItemsResponse);
14
14
  rpc setCashbackConfig(CashbackConfigRequest) returns (CashbackConfigItem);
15
+ //User
16
+ rpc getCashbackForUserByType(CashbackUserRequest) returns (CashbackResponse);
15
17
  }
16
18
  //Technical
17
19
  message PingRequest { string ping = 1; }
@@ -84,4 +86,9 @@ message CashbackConfigItem {
84
86
  optional float max = 4;
85
87
  optional float percentage = 5;
86
88
  }
89
+ //User
90
+ message CashbackUserRequest {
91
+ int32 user_id = 1;
92
+ optional string cashback_type = 2;
93
+ }
87
94
 
@@ -70,6 +70,17 @@ function deserialize_cashback_CashbackStatusResponse(buffer_arg) {
70
70
  return cashback_pb.CashbackStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
71
71
  }
72
72
 
73
+ function serialize_cashback_CashbackUserRequest(arg) {
74
+ if (!(arg instanceof cashback_pb.CashbackUserRequest)) {
75
+ throw new Error('Expected argument of type cashback.CashbackUserRequest');
76
+ }
77
+ return Buffer.from(arg.serializeBinary());
78
+ }
79
+
80
+ function deserialize_cashback_CashbackUserRequest(buffer_arg) {
81
+ return cashback_pb.CashbackUserRequest.deserializeBinary(new Uint8Array(buffer_arg));
82
+ }
83
+
73
84
  function serialize_cashback_File(arg) {
74
85
  if (!(arg instanceof cashback_pb.File)) {
75
86
  throw new Error('Expected argument of type cashback.File');
@@ -227,6 +238,18 @@ createSingleCashback: {
227
238
  responseSerialize: serialize_cashback_CashbackConfigItem,
228
239
  responseDeserialize: deserialize_cashback_CashbackConfigItem,
229
240
  },
241
+ // User
242
+ getCashbackForUserByType: {
243
+ path: '/cashback.Cashback/getCashbackForUserByType',
244
+ requestStream: false,
245
+ responseStream: false,
246
+ requestType: cashback_pb.CashbackUserRequest,
247
+ responseType: cashback_pb.CashbackResponse,
248
+ requestSerialize: serialize_cashback_CashbackUserRequest,
249
+ requestDeserialize: deserialize_cashback_CashbackUserRequest,
250
+ responseSerialize: serialize_cashback_CashbackResponse,
251
+ responseDeserialize: deserialize_cashback_CashbackResponse,
252
+ },
230
253
  };
231
254
 
232
255
  exports.CashbackClient = grpc.makeGenericClientConstructor(CashbackService);
@@ -30,6 +30,7 @@ goog.exportSymbol('proto.cashback.CashbackRequest', null, global);
30
30
  goog.exportSymbol('proto.cashback.CashbackRequest.RequestCase', null, global);
31
31
  goog.exportSymbol('proto.cashback.CashbackResponse', null, global);
32
32
  goog.exportSymbol('proto.cashback.CashbackStatusResponse', null, global);
33
+ goog.exportSymbol('proto.cashback.CashbackUserRequest', null, global);
33
34
  goog.exportSymbol('proto.cashback.File', null, global);
34
35
  goog.exportSymbol('proto.cashback.GetCashbackRequest', null, global);
35
36
  goog.exportSymbol('proto.cashback.GetFileRequest', null, global);
@@ -352,6 +353,27 @@ if (goog.DEBUG && !COMPILED) {
352
353
  */
353
354
  proto.cashback.CashbackConfigItem.displayName = 'proto.cashback.CashbackConfigItem';
354
355
  }
356
+ /**
357
+ * Generated by JsPbCodeGenerator.
358
+ * @param {Array=} opt_data Optional initial data array, typically from a
359
+ * server response, or constructed directly in Javascript. The array is used
360
+ * in place and becomes part of the constructed object. It is not cloned.
361
+ * If no data is provided, the constructed object will be empty, but still
362
+ * valid.
363
+ * @extends {jspb.Message}
364
+ * @constructor
365
+ */
366
+ proto.cashback.CashbackUserRequest = function(opt_data) {
367
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
368
+ };
369
+ goog.inherits(proto.cashback.CashbackUserRequest, jspb.Message);
370
+ if (goog.DEBUG && !COMPILED) {
371
+ /**
372
+ * @public
373
+ * @override
374
+ */
375
+ proto.cashback.CashbackUserRequest.displayName = 'proto.cashback.CashbackUserRequest';
376
+ }
355
377
 
356
378
 
357
379
 
@@ -4044,4 +4066,182 @@ proto.cashback.CashbackConfigItem.prototype.hasPercentage = function() {
4044
4066
  };
4045
4067
 
4046
4068
 
4069
+
4070
+
4071
+
4072
+ if (jspb.Message.GENERATE_TO_OBJECT) {
4073
+ /**
4074
+ * Creates an object representation of this proto.
4075
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
4076
+ * Optional fields that are not set will be set to undefined.
4077
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
4078
+ * For the list of reserved names please see:
4079
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
4080
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
4081
+ * JSPB instance for transitional soy proto support:
4082
+ * http://goto/soy-param-migration
4083
+ * @return {!Object}
4084
+ */
4085
+ proto.cashback.CashbackUserRequest.prototype.toObject = function(opt_includeInstance) {
4086
+ return proto.cashback.CashbackUserRequest.toObject(opt_includeInstance, this);
4087
+ };
4088
+
4089
+
4090
+ /**
4091
+ * Static version of the {@see toObject} method.
4092
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
4093
+ * the JSPB instance for transitional soy proto support:
4094
+ * http://goto/soy-param-migration
4095
+ * @param {!proto.cashback.CashbackUserRequest} msg The msg instance to transform.
4096
+ * @return {!Object}
4097
+ * @suppress {unusedLocalVariables} f is only used for nested messages
4098
+ */
4099
+ proto.cashback.CashbackUserRequest.toObject = function(includeInstance, msg) {
4100
+ var f, obj = {
4101
+ userId: jspb.Message.getFieldWithDefault(msg, 1, 0),
4102
+ cashbackType: jspb.Message.getFieldWithDefault(msg, 2, "")
4103
+ };
4104
+
4105
+ if (includeInstance) {
4106
+ obj.$jspbMessageInstance = msg;
4107
+ }
4108
+ return obj;
4109
+ };
4110
+ }
4111
+
4112
+
4113
+ /**
4114
+ * Deserializes binary data (in protobuf wire format).
4115
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
4116
+ * @return {!proto.cashback.CashbackUserRequest}
4117
+ */
4118
+ proto.cashback.CashbackUserRequest.deserializeBinary = function(bytes) {
4119
+ var reader = new jspb.BinaryReader(bytes);
4120
+ var msg = new proto.cashback.CashbackUserRequest;
4121
+ return proto.cashback.CashbackUserRequest.deserializeBinaryFromReader(msg, reader);
4122
+ };
4123
+
4124
+
4125
+ /**
4126
+ * Deserializes binary data (in protobuf wire format) from the
4127
+ * given reader into the given message object.
4128
+ * @param {!proto.cashback.CashbackUserRequest} msg The message object to deserialize into.
4129
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
4130
+ * @return {!proto.cashback.CashbackUserRequest}
4131
+ */
4132
+ proto.cashback.CashbackUserRequest.deserializeBinaryFromReader = function(msg, reader) {
4133
+ while (reader.nextField()) {
4134
+ if (reader.isEndGroup()) {
4135
+ break;
4136
+ }
4137
+ var field = reader.getFieldNumber();
4138
+ switch (field) {
4139
+ case 1:
4140
+ var value = /** @type {number} */ (reader.readInt32());
4141
+ msg.setUserId(value);
4142
+ break;
4143
+ case 2:
4144
+ var value = /** @type {string} */ (reader.readString());
4145
+ msg.setCashbackType(value);
4146
+ break;
4147
+ default:
4148
+ reader.skipField();
4149
+ break;
4150
+ }
4151
+ }
4152
+ return msg;
4153
+ };
4154
+
4155
+
4156
+ /**
4157
+ * Serializes the message to binary data (in protobuf wire format).
4158
+ * @return {!Uint8Array}
4159
+ */
4160
+ proto.cashback.CashbackUserRequest.prototype.serializeBinary = function() {
4161
+ var writer = new jspb.BinaryWriter();
4162
+ proto.cashback.CashbackUserRequest.serializeBinaryToWriter(this, writer);
4163
+ return writer.getResultBuffer();
4164
+ };
4165
+
4166
+
4167
+ /**
4168
+ * Serializes the given message to binary data (in protobuf wire
4169
+ * format), writing to the given BinaryWriter.
4170
+ * @param {!proto.cashback.CashbackUserRequest} message
4171
+ * @param {!jspb.BinaryWriter} writer
4172
+ * @suppress {unusedLocalVariables} f is only used for nested messages
4173
+ */
4174
+ proto.cashback.CashbackUserRequest.serializeBinaryToWriter = function(message, writer) {
4175
+ var f = undefined;
4176
+ f = message.getUserId();
4177
+ if (f !== 0) {
4178
+ writer.writeInt32(
4179
+ 1,
4180
+ f
4181
+ );
4182
+ }
4183
+ f = /** @type {string} */ (jspb.Message.getField(message, 2));
4184
+ if (f != null) {
4185
+ writer.writeString(
4186
+ 2,
4187
+ f
4188
+ );
4189
+ }
4190
+ };
4191
+
4192
+
4193
+ /**
4194
+ * optional int32 user_id = 1;
4195
+ * @return {number}
4196
+ */
4197
+ proto.cashback.CashbackUserRequest.prototype.getUserId = function() {
4198
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
4199
+ };
4200
+
4201
+
4202
+ /**
4203
+ * @param {number} value
4204
+ * @return {!proto.cashback.CashbackUserRequest} returns this
4205
+ */
4206
+ proto.cashback.CashbackUserRequest.prototype.setUserId = function(value) {
4207
+ return jspb.Message.setProto3IntField(this, 1, value);
4208
+ };
4209
+
4210
+
4211
+ /**
4212
+ * optional string cashback_type = 2;
4213
+ * @return {string}
4214
+ */
4215
+ proto.cashback.CashbackUserRequest.prototype.getCashbackType = function() {
4216
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
4217
+ };
4218
+
4219
+
4220
+ /**
4221
+ * @param {string} value
4222
+ * @return {!proto.cashback.CashbackUserRequest} returns this
4223
+ */
4224
+ proto.cashback.CashbackUserRequest.prototype.setCashbackType = function(value) {
4225
+ return jspb.Message.setField(this, 2, value);
4226
+ };
4227
+
4228
+
4229
+ /**
4230
+ * Clears the field making it undefined.
4231
+ * @return {!proto.cashback.CashbackUserRequest} returns this
4232
+ */
4233
+ proto.cashback.CashbackUserRequest.prototype.clearCashbackType = function() {
4234
+ return jspb.Message.setField(this, 2, undefined);
4235
+ };
4236
+
4237
+
4238
+ /**
4239
+ * Returns whether this field is set.
4240
+ * @return {boolean}
4241
+ */
4242
+ proto.cashback.CashbackUserRequest.prototype.hasCashbackType = function() {
4243
+ return jspb.Message.getField(this, 2) != null;
4244
+ };
4245
+
4246
+
4047
4247
  goog.object.extend(exports, proto.cashback);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.294",
3
+ "version": "1.0.295",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {