protobuf-platform 1.0.171 → 1.0.173

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.
@@ -11,6 +11,7 @@ service Config {
11
11
  rpc getConfig(ConfigRequest) returns (ConfigDataResponse);
12
12
  //Global settings
13
13
  rpc addError(ErrorRequest) returns (ErrorStatusResponse);
14
+ rpc changeGlobalData(GlobalDataRequest) returns (ConfigStatusResponse);
14
15
  }
15
16
 
16
17
  message PingRequest { string ping = 1; }
@@ -48,4 +49,10 @@ message ErrorRequest {
48
49
  }
49
50
  message ErrorStatusResponse {
50
51
  string status = 1;
52
+ }
53
+ //Global
54
+ message GlobalDataRequest {
55
+ string key = 1;
56
+ repeated string string_values = 2;
57
+ repeated int32 integer_values = 3;
51
58
  }
@@ -59,6 +59,17 @@ function deserialize_config_ErrorStatusResponse(buffer_arg) {
59
59
  return config_pb.ErrorStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
60
60
  }
61
61
 
62
+ function serialize_config_GlobalDataRequest(arg) {
63
+ if (!(arg instanceof config_pb.GlobalDataRequest)) {
64
+ throw new Error('Expected argument of type config.GlobalDataRequest');
65
+ }
66
+ return Buffer.from(arg.serializeBinary());
67
+ }
68
+
69
+ function deserialize_config_GlobalDataRequest(buffer_arg) {
70
+ return config_pb.GlobalDataRequest.deserializeBinary(new Uint8Array(buffer_arg));
71
+ }
72
+
62
73
  function serialize_config_PingRequest(arg) {
63
74
  if (!(arg instanceof config_pb.PingRequest)) {
64
75
  throw new Error('Expected argument of type config.PingRequest');
@@ -163,6 +174,17 @@ addError: {
163
174
  responseSerialize: serialize_config_ErrorStatusResponse,
164
175
  responseDeserialize: deserialize_config_ErrorStatusResponse,
165
176
  },
177
+ changeGlobalData: {
178
+ path: '/config.Config/changeGlobalData',
179
+ requestStream: false,
180
+ responseStream: false,
181
+ requestType: config_pb.GlobalDataRequest,
182
+ responseType: config_pb.ConfigStatusResponse,
183
+ requestSerialize: serialize_config_GlobalDataRequest,
184
+ requestDeserialize: deserialize_config_GlobalDataRequest,
185
+ responseSerialize: serialize_config_ConfigStatusResponse,
186
+ responseDeserialize: deserialize_config_ConfigStatusResponse,
187
+ },
166
188
  };
167
189
 
168
190
  exports.ConfigClient = grpc.makeGenericClientConstructor(ConfigService);
@@ -26,6 +26,7 @@ goog.exportSymbol('proto.config.ConfigRequest', null, global);
26
26
  goog.exportSymbol('proto.config.ConfigStatusResponse', null, global);
27
27
  goog.exportSymbol('proto.config.ErrorRequest', null, global);
28
28
  goog.exportSymbol('proto.config.ErrorStatusResponse', null, global);
29
+ goog.exportSymbol('proto.config.GlobalDataRequest', null, global);
29
30
  goog.exportSymbol('proto.config.PingRequest', null, global);
30
31
  goog.exportSymbol('proto.config.PongResponse', null, global);
31
32
  goog.exportSymbol('proto.config.SettingsRequest', null, global);
@@ -219,6 +220,27 @@ if (goog.DEBUG && !COMPILED) {
219
220
  */
220
221
  proto.config.ErrorStatusResponse.displayName = 'proto.config.ErrorStatusResponse';
221
222
  }
223
+ /**
224
+ * Generated by JsPbCodeGenerator.
225
+ * @param {Array=} opt_data Optional initial data array, typically from a
226
+ * server response, or constructed directly in Javascript. The array is used
227
+ * in place and becomes part of the constructed object. It is not cloned.
228
+ * If no data is provided, the constructed object will be empty, but still
229
+ * valid.
230
+ * @extends {jspb.Message}
231
+ * @constructor
232
+ */
233
+ proto.config.GlobalDataRequest = function(opt_data) {
234
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.config.GlobalDataRequest.repeatedFields_, null);
235
+ };
236
+ goog.inherits(proto.config.GlobalDataRequest, jspb.Message);
237
+ if (goog.DEBUG && !COMPILED) {
238
+ /**
239
+ * @public
240
+ * @override
241
+ */
242
+ proto.config.GlobalDataRequest.displayName = 'proto.config.GlobalDataRequest';
243
+ }
222
244
 
223
245
 
224
246
 
@@ -1797,4 +1819,241 @@ proto.config.ErrorStatusResponse.prototype.setStatus = function(value) {
1797
1819
  };
1798
1820
 
1799
1821
 
1822
+
1823
+ /**
1824
+ * List of repeated fields within this message type.
1825
+ * @private {!Array<number>}
1826
+ * @const
1827
+ */
1828
+ proto.config.GlobalDataRequest.repeatedFields_ = [2,3];
1829
+
1830
+
1831
+
1832
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1833
+ /**
1834
+ * Creates an object representation of this proto.
1835
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1836
+ * Optional fields that are not set will be set to undefined.
1837
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1838
+ * For the list of reserved names please see:
1839
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1840
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1841
+ * JSPB instance for transitional soy proto support:
1842
+ * http://goto/soy-param-migration
1843
+ * @return {!Object}
1844
+ */
1845
+ proto.config.GlobalDataRequest.prototype.toObject = function(opt_includeInstance) {
1846
+ return proto.config.GlobalDataRequest.toObject(opt_includeInstance, this);
1847
+ };
1848
+
1849
+
1850
+ /**
1851
+ * Static version of the {@see toObject} method.
1852
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1853
+ * the JSPB instance for transitional soy proto support:
1854
+ * http://goto/soy-param-migration
1855
+ * @param {!proto.config.GlobalDataRequest} msg The msg instance to transform.
1856
+ * @return {!Object}
1857
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1858
+ */
1859
+ proto.config.GlobalDataRequest.toObject = function(includeInstance, msg) {
1860
+ var f, obj = {
1861
+ key: jspb.Message.getFieldWithDefault(msg, 1, ""),
1862
+ stringValuesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f,
1863
+ integerValuesList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f
1864
+ };
1865
+
1866
+ if (includeInstance) {
1867
+ obj.$jspbMessageInstance = msg;
1868
+ }
1869
+ return obj;
1870
+ };
1871
+ }
1872
+
1873
+
1874
+ /**
1875
+ * Deserializes binary data (in protobuf wire format).
1876
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1877
+ * @return {!proto.config.GlobalDataRequest}
1878
+ */
1879
+ proto.config.GlobalDataRequest.deserializeBinary = function(bytes) {
1880
+ var reader = new jspb.BinaryReader(bytes);
1881
+ var msg = new proto.config.GlobalDataRequest;
1882
+ return proto.config.GlobalDataRequest.deserializeBinaryFromReader(msg, reader);
1883
+ };
1884
+
1885
+
1886
+ /**
1887
+ * Deserializes binary data (in protobuf wire format) from the
1888
+ * given reader into the given message object.
1889
+ * @param {!proto.config.GlobalDataRequest} msg The message object to deserialize into.
1890
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1891
+ * @return {!proto.config.GlobalDataRequest}
1892
+ */
1893
+ proto.config.GlobalDataRequest.deserializeBinaryFromReader = function(msg, reader) {
1894
+ while (reader.nextField()) {
1895
+ if (reader.isEndGroup()) {
1896
+ break;
1897
+ }
1898
+ var field = reader.getFieldNumber();
1899
+ switch (field) {
1900
+ case 1:
1901
+ var value = /** @type {string} */ (reader.readString());
1902
+ msg.setKey(value);
1903
+ break;
1904
+ case 2:
1905
+ var value = /** @type {string} */ (reader.readString());
1906
+ msg.addStringValues(value);
1907
+ break;
1908
+ case 3:
1909
+ var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedInt32() : [reader.readInt32()]);
1910
+ for (var i = 0; i < values.length; i++) {
1911
+ msg.addIntegerValues(values[i]);
1912
+ }
1913
+ break;
1914
+ default:
1915
+ reader.skipField();
1916
+ break;
1917
+ }
1918
+ }
1919
+ return msg;
1920
+ };
1921
+
1922
+
1923
+ /**
1924
+ * Serializes the message to binary data (in protobuf wire format).
1925
+ * @return {!Uint8Array}
1926
+ */
1927
+ proto.config.GlobalDataRequest.prototype.serializeBinary = function() {
1928
+ var writer = new jspb.BinaryWriter();
1929
+ proto.config.GlobalDataRequest.serializeBinaryToWriter(this, writer);
1930
+ return writer.getResultBuffer();
1931
+ };
1932
+
1933
+
1934
+ /**
1935
+ * Serializes the given message to binary data (in protobuf wire
1936
+ * format), writing to the given BinaryWriter.
1937
+ * @param {!proto.config.GlobalDataRequest} message
1938
+ * @param {!jspb.BinaryWriter} writer
1939
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1940
+ */
1941
+ proto.config.GlobalDataRequest.serializeBinaryToWriter = function(message, writer) {
1942
+ var f = undefined;
1943
+ f = message.getKey();
1944
+ if (f.length > 0) {
1945
+ writer.writeString(
1946
+ 1,
1947
+ f
1948
+ );
1949
+ }
1950
+ f = message.getStringValuesList();
1951
+ if (f.length > 0) {
1952
+ writer.writeRepeatedString(
1953
+ 2,
1954
+ f
1955
+ );
1956
+ }
1957
+ f = message.getIntegerValuesList();
1958
+ if (f.length > 0) {
1959
+ writer.writePackedInt32(
1960
+ 3,
1961
+ f
1962
+ );
1963
+ }
1964
+ };
1965
+
1966
+
1967
+ /**
1968
+ * optional string key = 1;
1969
+ * @return {string}
1970
+ */
1971
+ proto.config.GlobalDataRequest.prototype.getKey = function() {
1972
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1973
+ };
1974
+
1975
+
1976
+ /**
1977
+ * @param {string} value
1978
+ * @return {!proto.config.GlobalDataRequest} returns this
1979
+ */
1980
+ proto.config.GlobalDataRequest.prototype.setKey = function(value) {
1981
+ return jspb.Message.setProto3StringField(this, 1, value);
1982
+ };
1983
+
1984
+
1985
+ /**
1986
+ * repeated string string_values = 2;
1987
+ * @return {!Array<string>}
1988
+ */
1989
+ proto.config.GlobalDataRequest.prototype.getStringValuesList = function() {
1990
+ return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 2));
1991
+ };
1992
+
1993
+
1994
+ /**
1995
+ * @param {!Array<string>} value
1996
+ * @return {!proto.config.GlobalDataRequest} returns this
1997
+ */
1998
+ proto.config.GlobalDataRequest.prototype.setStringValuesList = function(value) {
1999
+ return jspb.Message.setField(this, 2, value || []);
2000
+ };
2001
+
2002
+
2003
+ /**
2004
+ * @param {string} value
2005
+ * @param {number=} opt_index
2006
+ * @return {!proto.config.GlobalDataRequest} returns this
2007
+ */
2008
+ proto.config.GlobalDataRequest.prototype.addStringValues = function(value, opt_index) {
2009
+ return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
2010
+ };
2011
+
2012
+
2013
+ /**
2014
+ * Clears the list making it empty but non-null.
2015
+ * @return {!proto.config.GlobalDataRequest} returns this
2016
+ */
2017
+ proto.config.GlobalDataRequest.prototype.clearStringValuesList = function() {
2018
+ return this.setStringValuesList([]);
2019
+ };
2020
+
2021
+
2022
+ /**
2023
+ * repeated int32 integer_values = 3;
2024
+ * @return {!Array<number>}
2025
+ */
2026
+ proto.config.GlobalDataRequest.prototype.getIntegerValuesList = function() {
2027
+ return /** @type {!Array<number>} */ (jspb.Message.getRepeatedField(this, 3));
2028
+ };
2029
+
2030
+
2031
+ /**
2032
+ * @param {!Array<number>} value
2033
+ * @return {!proto.config.GlobalDataRequest} returns this
2034
+ */
2035
+ proto.config.GlobalDataRequest.prototype.setIntegerValuesList = function(value) {
2036
+ return jspb.Message.setField(this, 3, value || []);
2037
+ };
2038
+
2039
+
2040
+ /**
2041
+ * @param {number} value
2042
+ * @param {number=} opt_index
2043
+ * @return {!proto.config.GlobalDataRequest} returns this
2044
+ */
2045
+ proto.config.GlobalDataRequest.prototype.addIntegerValues = function(value, opt_index) {
2046
+ return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
2047
+ };
2048
+
2049
+
2050
+ /**
2051
+ * Clears the list making it empty but non-null.
2052
+ * @return {!proto.config.GlobalDataRequest} returns this
2053
+ */
2054
+ proto.config.GlobalDataRequest.prototype.clearIntegerValuesList = function() {
2055
+ return this.setIntegerValuesList([]);
2056
+ };
2057
+
2058
+
1800
2059
  goog.object.extend(exports, proto.config);
@@ -4,6 +4,19 @@ package loyalty;
4
4
 
5
5
  service Loyalty {
6
6
  rpc checkConnection(PingRequest) returns (PongResponse);
7
+ rpc getMediaResource(GetFileRequest) returns (stream File);
8
+ //Loyalty Levels
9
+ rpc createSingleLevel(stream LevelRequest) returns (LevelResponse);
10
+ rpc readSingleLevel(GetLevelRequest) returns (LevelResponse);
11
+ rpc updateSingleLevel(stream LevelRequest) returns (LevelResponse);
12
+ rpc deleteSingleLevel(GetLevelRequest) returns (LevelStatusResponse);
13
+ rpc readListLevels(PaginationRequest) returns (LevelItemsResponse);
14
+ //Loyalty Points
15
+ rpc createSinglePoint(PointRequest) returns (PointResponse);
16
+ rpc readSinglePoint(GetPointRequest) returns (PointResponse);
17
+ rpc updateSinglePoint(PointRequest) returns (PointResponse);
18
+ rpc deleteSinglePoint(GetPointRequest) returns (PointStatusResponse);
19
+ rpc readListPoints(PaginationRequest) returns (PointItemsResponse);
7
20
  }
8
21
 
9
22
  message PingRequest { string ping = 1; }
@@ -14,3 +27,81 @@ message LoyaltySearchRequest {
14
27
  optional int32 user_id = 2;
15
28
  optional string loyalty_title = 3;
16
29
  }
30
+ //Media
31
+ message File { bytes media = 1; }
32
+ message GetFileRequest { string file_name = 1; string instance_type = 2; }
33
+ //Level CRUD
34
+ message LevelItem {
35
+ optional int32 id = 1;
36
+ optional int32 level_number = 2;
37
+ optional string title = 3;
38
+ optional string description = 4;
39
+ optional int32 is_active = 5;
40
+ optional string image = 6;
41
+ optional int32 value_to_complete = 7;
42
+ }
43
+ //Level CRUD | Requests
44
+ message LevelRequest {
45
+ oneof request {
46
+ LevelItemRequest level_data = 1;
47
+ File file = 2;
48
+ }
49
+ }
50
+ message LevelItemRequest {
51
+ optional int32 id = 1;
52
+ optional int32 level_number = 2;
53
+ optional string title = 3;
54
+ optional string description = 4;
55
+ optional int32 is_active = 5;
56
+ optional int32 value_to_complete = 6;
57
+ optional string file_name = 7;
58
+ optional string file_type = 8;
59
+ }
60
+ message GetLevelRequest {
61
+ int32 id = 1;
62
+ }
63
+ //Level CRUD | Responses
64
+ message LevelResponse {
65
+ LevelItem data = 1;
66
+ }
67
+ message LevelItemsResponse {
68
+ repeated LevelItem items = 1;
69
+ optional int32 total_pages = 2;
70
+ optional int32 total_items = 3;
71
+ }
72
+ message LevelStatusResponse {
73
+ string status = 1;
74
+ }
75
+
76
+
77
+ //Point CRUD
78
+ message PointItem {
79
+ optional int32 id = 1;
80
+ optional string title = 2;
81
+ optional string description = 3;
82
+ optional int32 is_active = 4;
83
+ optional int32 reward_amount = 5;
84
+ }
85
+ //Point CRUD | Requests
86
+ message PointRequest {
87
+ optional int32 id = 1;
88
+ optional string title = 2;
89
+ optional string description = 3;
90
+ optional int32 is_active = 4;
91
+ optional int32 reward_amount = 5;
92
+ }
93
+ message GetPointRequest {
94
+ int32 id = 1;
95
+ }
96
+ //Point CRUD | Responses
97
+ message PointResponse {
98
+ PointItem data = 1;
99
+ }
100
+ message PointItemsResponse {
101
+ repeated PointItem items = 1;
102
+ optional int32 total_pages = 2;
103
+ optional int32 total_items = 3;
104
+ }
105
+ message PointStatusResponse {
106
+ string status = 1;
107
+ }