@replit/protocol 0.3.35 → 0.3.36

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/main/index.d.ts CHANGED
@@ -1268,7 +1268,7 @@ export namespace replit {
1268
1268
  ack?: (string|null);
1269
1269
 
1270
1270
  /** RiverMessage payload */
1271
- payload?: (Uint8Array|null);
1271
+ payload?: (google.protobuf.Value|google.protobuf.IValue|null);
1272
1272
  }
1273
1273
 
1274
1274
  /** Represents a RiverMessage. */
@@ -1284,7 +1284,7 @@ export namespace replit {
1284
1284
  public id: string;
1285
1285
 
1286
1286
  /** RiverMessage replyTo. */
1287
- public replyTo: string;
1287
+ public replyTo?: (string|null);
1288
1288
 
1289
1289
  /** RiverMessage from. */
1290
1290
  public from: string;
@@ -1299,10 +1299,16 @@ export namespace replit {
1299
1299
  public procedureName: string;
1300
1300
 
1301
1301
  /** RiverMessage ack. */
1302
- public ack: string;
1302
+ public ack?: (string|null);
1303
1303
 
1304
1304
  /** RiverMessage payload. */
1305
- public payload: Uint8Array;
1305
+ public payload?: (google.protobuf.Value|null);
1306
+
1307
+ /** RiverMessage _replyTo. */
1308
+ public _replyTo?: "replyTo";
1309
+
1310
+ /** RiverMessage _ack. */
1311
+ public _ack?: "ack";
1306
1312
 
1307
1313
  /**
1308
1314
  * Creates a new RiverMessage instance using the specified properties.
package/main/index.js CHANGED
@@ -6828,7 +6828,7 @@
6828
6828
  * @property {string|null} [serviceName] RiverMessage serviceName
6829
6829
  * @property {string|null} [procedureName] RiverMessage procedureName
6830
6830
  * @property {string|null} [ack] RiverMessage ack
6831
- * @property {Uint8Array|null} [payload] RiverMessage payload
6831
+ * @property {google.protobuf.Value|google.protobuf.IValue|null} [payload] RiverMessage payload
6832
6832
  */
6833
6833
 
6834
6834
  /**
@@ -6855,11 +6855,11 @@
6855
6855
 
6856
6856
  /**
6857
6857
  * RiverMessage replyTo.
6858
- * @member {string} replyTo
6858
+ * @member {string|null|undefined} replyTo
6859
6859
  * @memberof replit.goval.api.RiverMessage
6860
6860
  * @instance
6861
6861
  */
6862
- RiverMessage.prototype.replyTo = "";
6862
+ RiverMessage.prototype.replyTo = null;
6863
6863
 
6864
6864
  /**
6865
6865
  * RiverMessage from.
@@ -6895,19 +6895,44 @@
6895
6895
 
6896
6896
  /**
6897
6897
  * RiverMessage ack.
6898
- * @member {string} ack
6898
+ * @member {string|null|undefined} ack
6899
6899
  * @memberof replit.goval.api.RiverMessage
6900
6900
  * @instance
6901
6901
  */
6902
- RiverMessage.prototype.ack = "";
6902
+ RiverMessage.prototype.ack = null;
6903
6903
 
6904
6904
  /**
6905
6905
  * RiverMessage payload.
6906
- * @member {Uint8Array} payload
6906
+ * @member {google.protobuf.Value|null|undefined} payload
6907
6907
  * @memberof replit.goval.api.RiverMessage
6908
6908
  * @instance
6909
6909
  */
6910
- RiverMessage.prototype.payload = $util.newBuffer([]);
6910
+ RiverMessage.prototype.payload = null;
6911
+
6912
+ // OneOf field names bound to virtual getters and setters
6913
+ var $oneOfFields;
6914
+
6915
+ /**
6916
+ * RiverMessage _replyTo.
6917
+ * @member {"replyTo"|undefined} _replyTo
6918
+ * @memberof replit.goval.api.RiverMessage
6919
+ * @instance
6920
+ */
6921
+ Object.defineProperty(RiverMessage.prototype, "_replyTo", {
6922
+ get: $util.oneOfGetter($oneOfFields = ["replyTo"]),
6923
+ set: $util.oneOfSetter($oneOfFields)
6924
+ });
6925
+
6926
+ /**
6927
+ * RiverMessage _ack.
6928
+ * @member {"ack"|undefined} _ack
6929
+ * @memberof replit.goval.api.RiverMessage
6930
+ * @instance
6931
+ */
6932
+ Object.defineProperty(RiverMessage.prototype, "_ack", {
6933
+ get: $util.oneOfGetter($oneOfFields = ["ack"]),
6934
+ set: $util.oneOfSetter($oneOfFields)
6935
+ });
6911
6936
 
6912
6937
  /**
6913
6938
  * Creates a new RiverMessage instance using the specified properties.
@@ -6948,7 +6973,7 @@
6948
6973
  if (message.ack != null && Object.hasOwnProperty.call(message, "ack"))
6949
6974
  writer.uint32(/* id 7, wireType 2 =*/58).string(message.ack);
6950
6975
  if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
6951
- writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.payload);
6976
+ $root.google.protobuf.Value.encode(message.payload, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
6952
6977
  return writer;
6953
6978
  };
6954
6979
 
@@ -7012,7 +7037,7 @@
7012
7037
  break;
7013
7038
  }
7014
7039
  case 10: {
7015
- message.payload = reader.bytes();
7040
+ message.payload = $root.google.protobuf.Value.decode(reader, reader.uint32());
7016
7041
  break;
7017
7042
  }
7018
7043
  default:
@@ -7050,12 +7075,15 @@
7050
7075
  RiverMessage.verify = function verify(message) {
7051
7076
  if (typeof message !== "object" || message === null)
7052
7077
  return "object expected";
7078
+ var properties = {};
7053
7079
  if (message.id != null && message.hasOwnProperty("id"))
7054
7080
  if (!$util.isString(message.id))
7055
7081
  return "id: string expected";
7056
- if (message.replyTo != null && message.hasOwnProperty("replyTo"))
7082
+ if (message.replyTo != null && message.hasOwnProperty("replyTo")) {
7083
+ properties._replyTo = 1;
7057
7084
  if (!$util.isString(message.replyTo))
7058
7085
  return "replyTo: string expected";
7086
+ }
7059
7087
  if (message.from != null && message.hasOwnProperty("from"))
7060
7088
  if (!$util.isString(message.from))
7061
7089
  return "from: string expected";
@@ -7068,12 +7096,16 @@
7068
7096
  if (message.procedureName != null && message.hasOwnProperty("procedureName"))
7069
7097
  if (!$util.isString(message.procedureName))
7070
7098
  return "procedureName: string expected";
7071
- if (message.ack != null && message.hasOwnProperty("ack"))
7099
+ if (message.ack != null && message.hasOwnProperty("ack")) {
7100
+ properties._ack = 1;
7072
7101
  if (!$util.isString(message.ack))
7073
7102
  return "ack: string expected";
7074
- if (message.payload != null && message.hasOwnProperty("payload"))
7075
- if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload)))
7076
- return "payload: buffer expected";
7103
+ }
7104
+ if (message.payload != null && message.hasOwnProperty("payload")) {
7105
+ var error = $root.google.protobuf.Value.verify(message.payload);
7106
+ if (error)
7107
+ return "payload." + error;
7108
+ }
7077
7109
  return null;
7078
7110
  };
7079
7111
 
@@ -7103,11 +7135,11 @@
7103
7135
  message.procedureName = String(object.procedureName);
7104
7136
  if (object.ack != null)
7105
7137
  message.ack = String(object.ack);
7106
- if (object.payload != null)
7107
- if (typeof object.payload === "string")
7108
- $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0);
7109
- else if (object.payload.length >= 0)
7110
- message.payload = object.payload;
7138
+ if (object.payload != null) {
7139
+ if (typeof object.payload !== "object")
7140
+ throw TypeError(".replit.goval.api.RiverMessage.payload: object expected");
7141
+ message.payload = $root.google.protobuf.Value.fromObject(object.payload);
7142
+ }
7111
7143
  return message;
7112
7144
  };
7113
7145
 
@@ -7126,24 +7158,19 @@
7126
7158
  var object = {};
7127
7159
  if (options.defaults) {
7128
7160
  object.id = "";
7129
- object.replyTo = "";
7130
7161
  object.from = "";
7131
7162
  object.to = "";
7132
7163
  object.serviceName = "";
7133
7164
  object.procedureName = "";
7134
- object.ack = "";
7135
- if (options.bytes === String)
7136
- object.payload = "";
7137
- else {
7138
- object.payload = [];
7139
- if (options.bytes !== Array)
7140
- object.payload = $util.newBuffer(object.payload);
7141
- }
7165
+ object.payload = null;
7142
7166
  }
7143
7167
  if (message.id != null && message.hasOwnProperty("id"))
7144
7168
  object.id = message.id;
7145
- if (message.replyTo != null && message.hasOwnProperty("replyTo"))
7169
+ if (message.replyTo != null && message.hasOwnProperty("replyTo")) {
7146
7170
  object.replyTo = message.replyTo;
7171
+ if (options.oneofs)
7172
+ object._replyTo = "replyTo";
7173
+ }
7147
7174
  if (message.from != null && message.hasOwnProperty("from"))
7148
7175
  object.from = message.from;
7149
7176
  if (message.to != null && message.hasOwnProperty("to"))
@@ -7152,10 +7179,13 @@
7152
7179
  object.serviceName = message.serviceName;
7153
7180
  if (message.procedureName != null && message.hasOwnProperty("procedureName"))
7154
7181
  object.procedureName = message.procedureName;
7155
- if (message.ack != null && message.hasOwnProperty("ack"))
7182
+ if (message.ack != null && message.hasOwnProperty("ack")) {
7156
7183
  object.ack = message.ack;
7184
+ if (options.oneofs)
7185
+ object._ack = "ack";
7186
+ }
7157
7187
  if (message.payload != null && message.hasOwnProperty("payload"))
7158
- object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload;
7188
+ object.payload = $root.google.protobuf.Value.toObject(message.payload, options);
7159
7189
  return object;
7160
7190
  };
7161
7191
 
@@ -3088,7 +3088,7 @@ declare type replit$goval$api$IRiverMessage = {|
3088
3088
  /**
3089
3089
  * RiverMessage payload
3090
3090
  */
3091
- payload?: Uint8Array | null,
3091
+ payload?: google$protobuf$Value | google$protobuf$IValue | null,
3092
3092
  |};
3093
3093
 
3094
3094
  /**
@@ -3109,7 +3109,7 @@ declare class replit$goval$api$RiverMessage {
3109
3109
  /**
3110
3110
  * RiverMessage replyTo.
3111
3111
  */
3112
- replyTo: string;
3112
+ replyTo?: string | null;
3113
3113
 
3114
3114
  /**
3115
3115
  * RiverMessage from.
@@ -3134,12 +3134,22 @@ declare class replit$goval$api$RiverMessage {
3134
3134
  /**
3135
3135
  * RiverMessage ack.
3136
3136
  */
3137
- ack: string;
3137
+ ack?: string | null;
3138
3138
 
3139
3139
  /**
3140
3140
  * RiverMessage payload.
3141
3141
  */
3142
- payload: Uint8Array;
3142
+ payload?: google$protobuf$Value | null;
3143
+
3144
+ /**
3145
+ * RiverMessage _replyTo.
3146
+ */
3147
+ _replyTo?: "replyTo";
3148
+
3149
+ /**
3150
+ * RiverMessage _ack.
3151
+ */
3152
+ _ack?: "ack";
3143
3153
 
3144
3154
  /**
3145
3155
  * Creates a new RiverMessage instance using the specified properties.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replit/protocol",
3
- "version": "0.3.35",
3
+ "version": "0.3.36",
4
4
  "description": "JavaScript bindings for the Replit protocol",
5
5
  "main": "main/index.js",
6
6
  "repository": "https://github.com/replit/protocol",