@replit/protocol 0.4.26 → 0.4.27

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.
@@ -4,6 +4,7 @@ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
4
  import type { IBinaryReader } from "@protobuf-ts/runtime";
5
5
  import type { PartialMessage } from "@protobuf-ts/runtime";
6
6
  import { MessageType } from "@protobuf-ts/runtime";
7
+ import { Duration } from "../../google/protobuf/duration.js";
7
8
  import { Pid2Binary } from "../repl/repl.js";
8
9
  import { BuildInfo } from "../repl/repl.js";
9
10
  import { Feature } from "../features/features.js";
@@ -193,6 +194,12 @@ export interface ReplToken {
193
194
  * @generated from protobuf field: string resource_tier = 25
194
195
  */
195
196
  resourceTier: string;
197
+ /**
198
+ * Idle timeout override for this repl.
199
+ *
200
+ * @generated from protobuf field: optional google.protobuf.Duration idle_timeout = 26
201
+ */
202
+ idleTimeout?: Duration;
196
203
  }
197
204
  /**
198
205
  * Metadata for the classroom. This is deprecated and should be removed
@@ -2,6 +2,7 @@ import { WireType } from "@protobuf-ts/runtime";
2
2
  import { UnknownFieldHandler } from "@protobuf-ts/runtime";
3
3
  import { reflectionMergePartial } from "@protobuf-ts/runtime";
4
4
  import { MessageType } from "@protobuf-ts/runtime";
5
+ import { Duration } from "../../google/protobuf/duration.js";
5
6
  import { Pid2Binary } from "../repl/repl.js";
6
7
  import { BuildInfo } from "../repl/repl.js";
7
8
  import { Feature } from "../features/features.js";
@@ -67,7 +68,8 @@ class ReplToken$Type extends MessageType {
67
68
  { no: 21, name: "replexec", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
68
69
  { no: 22, name: "external_secrets", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ReplToken_ExternalSecret },
69
70
  { no: 23, name: "before", kind: "message", T: () => Timestamp },
70
- { no: 25, name: "resource_tier", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
71
+ { no: 25, name: "resource_tier", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
72
+ { no: 26, name: "idle_timeout", kind: "message", T: () => Duration }
71
73
  ]);
72
74
  }
73
75
  create(value) {
@@ -164,6 +166,9 @@ class ReplToken$Type extends MessageType {
164
166
  case /* string resource_tier */ 25:
165
167
  message.resourceTier = reader.string();
166
168
  break;
169
+ case /* optional google.protobuf.Duration idle_timeout */ 26:
170
+ message.idleTimeout = Duration.internalBinaryRead(reader, reader.uint32(), options, message.idleTimeout);
171
+ break;
167
172
  default:
168
173
  let u = options.readUnknownField;
169
174
  if (u === "throw")
@@ -239,6 +244,9 @@ class ReplToken$Type extends MessageType {
239
244
  /* string resource_tier = 25; */
240
245
  if (message.resourceTier !== "")
241
246
  writer.tag(25, WireType.LengthDelimited).string(message.resourceTier);
247
+ /* optional google.protobuf.Duration idle_timeout = 26; */
248
+ if (message.idleTimeout)
249
+ Duration.internalBinaryWrite(message.idleTimeout, writer.tag(26, WireType.LengthDelimited).fork(), options).join();
242
250
  let u = options.writeUnknownFields;
243
251
  if (u !== false)
244
252
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -0,0 +1,112 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import type { JsonValue } from "@protobuf-ts/runtime";
7
+ import type { JsonReadOptions } from "@protobuf-ts/runtime";
8
+ import type { JsonWriteOptions } from "@protobuf-ts/runtime";
9
+ import { MessageType } from "@protobuf-ts/runtime";
10
+ /**
11
+ * A Duration represents a signed, fixed-length span of time represented
12
+ * as a count of seconds and fractions of seconds at nanosecond
13
+ * resolution. It is independent of any calendar and concepts like "day"
14
+ * or "month". It is related to Timestamp in that the difference between
15
+ * two Timestamp values is a Duration and it can be added or subtracted
16
+ * from a Timestamp. Range is approximately +-10,000 years.
17
+ *
18
+ * # Examples
19
+ *
20
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
21
+ *
22
+ * Timestamp start = ...;
23
+ * Timestamp end = ...;
24
+ * Duration duration = ...;
25
+ *
26
+ * duration.seconds = end.seconds - start.seconds;
27
+ * duration.nanos = end.nanos - start.nanos;
28
+ *
29
+ * if (duration.seconds < 0 && duration.nanos > 0) {
30
+ * duration.seconds += 1;
31
+ * duration.nanos -= 1000000000;
32
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
33
+ * duration.seconds -= 1;
34
+ * duration.nanos += 1000000000;
35
+ * }
36
+ *
37
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
38
+ *
39
+ * Timestamp start = ...;
40
+ * Duration duration = ...;
41
+ * Timestamp end = ...;
42
+ *
43
+ * end.seconds = start.seconds + duration.seconds;
44
+ * end.nanos = start.nanos + duration.nanos;
45
+ *
46
+ * if (end.nanos < 0) {
47
+ * end.seconds -= 1;
48
+ * end.nanos += 1000000000;
49
+ * } else if (end.nanos >= 1000000000) {
50
+ * end.seconds += 1;
51
+ * end.nanos -= 1000000000;
52
+ * }
53
+ *
54
+ * Example 3: Compute Duration from datetime.timedelta in Python.
55
+ *
56
+ * td = datetime.timedelta(days=3, minutes=10)
57
+ * duration = Duration()
58
+ * duration.FromTimedelta(td)
59
+ *
60
+ * # JSON Mapping
61
+ *
62
+ * In JSON format, the Duration type is encoded as a string rather than an
63
+ * object, where the string ends in the suffix "s" (indicating seconds) and
64
+ * is preceded by the number of seconds, with nanoseconds expressed as
65
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
66
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
67
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
68
+ * microsecond should be expressed in JSON format as "3.000001s".
69
+ *
70
+ *
71
+ * @generated from protobuf message google.protobuf.Duration
72
+ */
73
+ export interface Duration {
74
+ /**
75
+ * Signed seconds of the span of time. Must be from -315,576,000,000
76
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
77
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
78
+ *
79
+ * @generated from protobuf field: int64 seconds = 1
80
+ */
81
+ seconds: bigint;
82
+ /**
83
+ * Signed fractions of a second at nanosecond resolution of the span
84
+ * of time. Durations less than one second are represented with a 0
85
+ * `seconds` field and a positive or negative `nanos` field. For durations
86
+ * of one second or more, a non-zero value for the `nanos` field must be
87
+ * of the same sign as the `seconds` field. Must be from -999,999,999
88
+ * to +999,999,999 inclusive.
89
+ *
90
+ * @generated from protobuf field: int32 nanos = 2
91
+ */
92
+ nanos: number;
93
+ }
94
+ declare class Duration$Type extends MessageType<Duration> {
95
+ constructor();
96
+ /**
97
+ * Encode `Duration` to JSON string like "3.000001s".
98
+ */
99
+ internalJsonWrite(message: Duration, options: JsonWriteOptions): JsonValue;
100
+ /**
101
+ * Decode `Duration` from JSON string like "3.000001s"
102
+ */
103
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Duration): Duration;
104
+ create(value?: PartialMessage<Duration>): Duration;
105
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Duration): Duration;
106
+ internalBinaryWrite(message: Duration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
107
+ }
108
+ /**
109
+ * @generated MessageType for protobuf message google.protobuf.Duration
110
+ */
111
+ export declare const Duration: Duration$Type;
112
+ export {};
@@ -0,0 +1,104 @@
1
+ import { WireType } from "@protobuf-ts/runtime";
2
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
3
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
4
+ import { typeofJsonValue } from "@protobuf-ts/runtime";
5
+ import { PbLong } from "@protobuf-ts/runtime";
6
+ import { MessageType } from "@protobuf-ts/runtime";
7
+ // @generated message type with reflection information, may provide speed optimized methods
8
+ class Duration$Type extends MessageType {
9
+ constructor() {
10
+ super("google.protobuf.Duration", [
11
+ { no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
12
+ { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
13
+ ]);
14
+ }
15
+ /**
16
+ * Encode `Duration` to JSON string like "3.000001s".
17
+ */
18
+ internalJsonWrite(message, options) {
19
+ let s = PbLong.from(message.seconds).toNumber();
20
+ if (s > 315576000000 || s < -315576000000)
21
+ throw new Error("Duration value out of range.");
22
+ let text = message.seconds.toString();
23
+ if (s === 0 && message.nanos < 0)
24
+ text = "-" + text;
25
+ if (message.nanos !== 0) {
26
+ let nanosStr = Math.abs(message.nanos).toString();
27
+ nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr;
28
+ if (nanosStr.substring(3) === "000000")
29
+ nanosStr = nanosStr.substring(0, 3);
30
+ else if (nanosStr.substring(6) === "000")
31
+ nanosStr = nanosStr.substring(0, 6);
32
+ text += "." + nanosStr;
33
+ }
34
+ return text + "s";
35
+ }
36
+ /**
37
+ * Decode `Duration` from JSON string like "3.000001s"
38
+ */
39
+ internalJsonRead(json, options, target) {
40
+ if (typeof json !== "string")
41
+ throw new Error("Unable to parse Duration from JSON " + typeofJsonValue(json) + ". Expected string.");
42
+ let match = json.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);
43
+ if (match === null)
44
+ throw new Error("Unable to parse Duration from JSON string. Invalid format.");
45
+ if (!target)
46
+ target = this.create();
47
+ let [, sign, secs, nanos] = match;
48
+ let longSeconds = PbLong.from(sign + secs);
49
+ if (longSeconds.toNumber() > 315576000000 || longSeconds.toNumber() < -315576000000)
50
+ throw new Error("Unable to parse Duration from JSON string. Value out of range.");
51
+ target.seconds = longSeconds.toBigInt();
52
+ if (typeof nanos == "string") {
53
+ let nanosStr = sign + nanos + "0".repeat(9 - nanos.length);
54
+ target.nanos = parseInt(nanosStr);
55
+ }
56
+ return target;
57
+ }
58
+ create(value) {
59
+ const message = globalThis.Object.create((this.messagePrototype));
60
+ message.seconds = 0n;
61
+ message.nanos = 0;
62
+ if (value !== undefined)
63
+ reflectionMergePartial(this, message, value);
64
+ return message;
65
+ }
66
+ internalBinaryRead(reader, length, options, target) {
67
+ let message = target ?? this.create(), end = reader.pos + length;
68
+ while (reader.pos < end) {
69
+ let [fieldNo, wireType] = reader.tag();
70
+ switch (fieldNo) {
71
+ case /* int64 seconds */ 1:
72
+ message.seconds = reader.int64().toBigInt();
73
+ break;
74
+ case /* int32 nanos */ 2:
75
+ message.nanos = reader.int32();
76
+ break;
77
+ default:
78
+ let u = options.readUnknownField;
79
+ if (u === "throw")
80
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
81
+ let d = reader.skip(wireType);
82
+ if (u !== false)
83
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
84
+ }
85
+ }
86
+ return message;
87
+ }
88
+ internalBinaryWrite(message, writer, options) {
89
+ /* int64 seconds = 1; */
90
+ if (message.seconds !== 0n)
91
+ writer.tag(1, WireType.Varint).int64(message.seconds);
92
+ /* int32 nanos = 2; */
93
+ if (message.nanos !== 0)
94
+ writer.tag(2, WireType.Varint).int32(message.nanos);
95
+ let u = options.writeUnknownFields;
96
+ if (u !== false)
97
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
98
+ return writer;
99
+ }
100
+ }
101
+ /**
102
+ * @generated MessageType for protobuf message google.protobuf.Duration
103
+ */
104
+ export const Duration = new Duration$Type();
@@ -30807,6 +30807,9 @@ export namespace replit {
30807
30807
 
30808
30808
  /** ReplToken resourceTier */
30809
30809
  resourceTier?: (string|null);
30810
+
30811
+ /** ReplToken idleTimeout */
30812
+ idleTimeout?: (google.protobuf.Duration|google.protobuf.IDuration|null);
30810
30813
  }
30811
30814
 
30812
30815
  /** Represents a ReplToken. */
@@ -30881,6 +30884,9 @@ export namespace replit {
30881
30884
  /** ReplToken resourceTier. */
30882
30885
  public resourceTier: string;
30883
30886
 
30887
+ /** ReplToken idleTimeout. */
30888
+ public idleTimeout?: (google.protobuf.Duration|null);
30889
+
30884
30890
  /** ReplToken metadata. */
30885
30891
  public metadata?: ("repl"|"id"|"classroom");
30886
30892
 
@@ -38852,6 +38858,109 @@ export namespace google {
38852
38858
  public static getTypeUrl(typeUrlPrefix?: string): string;
38853
38859
  }
38854
38860
 
38861
+ /** Properties of a Duration. */
38862
+ interface IDuration {
38863
+
38864
+ /** Duration seconds */
38865
+ seconds?: (number|null);
38866
+
38867
+ /** Duration nanos */
38868
+ nanos?: (number|null);
38869
+ }
38870
+
38871
+ /** Represents a Duration. */
38872
+ class Duration {
38873
+
38874
+ /**
38875
+ * Constructs a new Duration.
38876
+ * @param [properties] Properties to set
38877
+ */
38878
+ private constructor(properties?: google.protobuf.IDuration);
38879
+
38880
+ /** Duration seconds. */
38881
+ public seconds: number;
38882
+
38883
+ /** Duration nanos. */
38884
+ public nanos: number;
38885
+
38886
+ /**
38887
+ * Creates a new Duration instance using the specified properties.
38888
+ * @param [properties] Properties to set
38889
+ * @returns Duration instance
38890
+ */
38891
+ public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration;
38892
+
38893
+ /**
38894
+ * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
38895
+ * @param message Duration message or plain object to encode
38896
+ * @param [writer] Writer to encode to
38897
+ * @returns Writer
38898
+ */
38899
+ public static encode(message: google.protobuf.Duration, writer?: $protobuf.Writer): $protobuf.Writer;
38900
+
38901
+ /**
38902
+ * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
38903
+ * @param message Duration message or plain object to encode
38904
+ * @param [writer] Writer to encode to
38905
+ * @returns Writer
38906
+ */
38907
+ public static encodeDelimited(message: google.protobuf.Duration, writer?: $protobuf.Writer): $protobuf.Writer;
38908
+
38909
+ /**
38910
+ * Decodes a Duration message from the specified reader or buffer.
38911
+ * @param reader Reader or buffer to decode from
38912
+ * @param [length] Message length if known beforehand
38913
+ * @returns Duration
38914
+ * @throws {Error} If the payload is not a reader or valid buffer
38915
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
38916
+ */
38917
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration;
38918
+
38919
+ /**
38920
+ * Decodes a Duration message from the specified reader or buffer, length delimited.
38921
+ * @param reader Reader or buffer to decode from
38922
+ * @returns Duration
38923
+ * @throws {Error} If the payload is not a reader or valid buffer
38924
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
38925
+ */
38926
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration;
38927
+
38928
+ /**
38929
+ * Verifies a Duration message.
38930
+ * @param message Plain object to verify
38931
+ * @returns `null` if valid, otherwise the reason why it is not
38932
+ */
38933
+ public static verify(message: { [k: string]: any }): (string|null);
38934
+
38935
+ /**
38936
+ * Creates a Duration message from a plain object. Also converts values to their respective internal types.
38937
+ * @param object Plain object
38938
+ * @returns Duration
38939
+ */
38940
+ public static fromObject(object: { [k: string]: any }): google.protobuf.Duration;
38941
+
38942
+ /**
38943
+ * Creates a plain object from a Duration message. Also converts values to other types if specified.
38944
+ * @param message Duration
38945
+ * @param [options] Conversion options
38946
+ * @returns Plain object
38947
+ */
38948
+ public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any };
38949
+
38950
+ /**
38951
+ * Converts this Duration to JSON.
38952
+ * @returns JSON object
38953
+ */
38954
+ public toJSON(): { [k: string]: any };
38955
+
38956
+ /**
38957
+ * Gets the default type url for Duration
38958
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
38959
+ * @returns The default type url
38960
+ */
38961
+ public static getTypeUrl(typeUrlPrefix?: string): string;
38962
+ }
38963
+
38855
38964
  /** Properties of a FieldMask. */
38856
38965
  interface IFieldMask {
38857
38966
 
package/iotester/index.js CHANGED
@@ -78476,6 +78476,7 @@
78476
78476
  * @property {Array.<replit.goval.api.token.ReplToken.ExternalSecret|replit.goval.api.token.ReplToken.IExternalSecret>|null} [externalSecrets] ReplToken externalSecrets
78477
78477
  * @property {google.protobuf.Timestamp|google.protobuf.ITimestamp|null} [before] ReplToken before
78478
78478
  * @property {string|null} [resourceTier] ReplToken resourceTier
78479
+ * @property {google.protobuf.Duration|google.protobuf.IDuration|null} [idleTimeout] ReplToken idleTimeout
78479
78480
  */
78480
78481
 
78481
78482
  /**
@@ -78663,6 +78664,14 @@
78663
78664
  */
78664
78665
  ReplToken.prototype.resourceTier = "";
78665
78666
 
78667
+ /**
78668
+ * ReplToken idleTimeout.
78669
+ * @member {google.protobuf.Duration|null|undefined} idleTimeout
78670
+ * @memberof replit.goval.api.token.ReplToken
78671
+ * @instance
78672
+ */
78673
+ ReplToken.prototype.idleTimeout = null;
78674
+
78666
78675
  // OneOf field names bound to virtual getters and setters
78667
78676
  var $oneOfFields;
78668
78677
 
@@ -78677,6 +78686,12 @@
78677
78686
  set: $util.oneOfSetter($oneOfFields)
78678
78687
  });
78679
78688
 
78689
+ // Virtual OneOf for proto3 optional field
78690
+ Object.defineProperty(ReplToken.prototype, "_idleTimeout", {
78691
+ get: $util.oneOfGetter($oneOfFields = ["idleTimeout"]),
78692
+ set: $util.oneOfSetter($oneOfFields)
78693
+ });
78694
+
78680
78695
  /**
78681
78696
  * Creates a new ReplToken instance using the specified properties.
78682
78697
  * @function create
@@ -78746,6 +78761,8 @@
78746
78761
  $root.google.protobuf.Timestamp.encode(message.before, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim();
78747
78762
  if (message.resourceTier != null && Object.hasOwnProperty.call(message, "resourceTier"))
78748
78763
  writer.uint32(/* id 25, wireType 2 =*/202).string(message.resourceTier);
78764
+ if (message.idleTimeout != null && Object.hasOwnProperty.call(message, "idleTimeout"))
78765
+ $root.google.protobuf.Duration.encode(message.idleTimeout, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim();
78749
78766
  return writer;
78750
78767
  };
78751
78768
 
@@ -78872,6 +78889,10 @@
78872
78889
  message.resourceTier = reader.string();
78873
78890
  break;
78874
78891
  }
78892
+ case 26: {
78893
+ message.idleTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32());
78894
+ break;
78895
+ }
78875
78896
  default:
78876
78897
  reader.skipType(tag & 7);
78877
78898
  break;
@@ -79036,6 +79057,14 @@
79036
79057
  if (message.resourceTier != null && message.hasOwnProperty("resourceTier"))
79037
79058
  if (!$util.isString(message.resourceTier))
79038
79059
  return "resourceTier: string expected";
79060
+ if (message.idleTimeout != null && message.hasOwnProperty("idleTimeout")) {
79061
+ properties._idleTimeout = 1;
79062
+ {
79063
+ var error = $root.google.protobuf.Duration.verify(message.idleTimeout);
79064
+ if (error)
79065
+ return "idleTimeout." + error;
79066
+ }
79067
+ }
79039
79068
  return null;
79040
79069
  };
79041
79070
 
@@ -79191,6 +79220,11 @@
79191
79220
  }
79192
79221
  if (object.resourceTier != null)
79193
79222
  message.resourceTier = String(object.resourceTier);
79223
+ if (object.idleTimeout != null) {
79224
+ if (typeof object.idleTimeout !== "object")
79225
+ throw TypeError(".replit.goval.api.token.ReplToken.idleTimeout: object expected");
79226
+ message.idleTimeout = $root.google.protobuf.Duration.fromObject(object.idleTimeout);
79227
+ }
79194
79228
  return message;
79195
79229
  };
79196
79230
 
@@ -79289,6 +79323,11 @@
79289
79323
  object.before = $root.google.protobuf.Timestamp.toObject(message.before, options);
79290
79324
  if (message.resourceTier != null && message.hasOwnProperty("resourceTier"))
79291
79325
  object.resourceTier = message.resourceTier;
79326
+ if (message.idleTimeout != null && message.hasOwnProperty("idleTimeout")) {
79327
+ object.idleTimeout = $root.google.protobuf.Duration.toObject(message.idleTimeout, options);
79328
+ if (options.oneofs)
79329
+ object._idleTimeout = "idleTimeout";
79330
+ }
79292
79331
  return object;
79293
79332
  };
79294
79333
 
@@ -97395,6 +97434,252 @@
97395
97434
  return Empty;
97396
97435
  })();
97397
97436
 
97437
+ protobuf.Duration = (function() {
97438
+
97439
+ /**
97440
+ * Properties of a Duration.
97441
+ * @memberof google.protobuf
97442
+ * @interface IDuration
97443
+ * @property {number|null} [seconds] Duration seconds
97444
+ * @property {number|null} [nanos] Duration nanos
97445
+ */
97446
+
97447
+ /**
97448
+ * Constructs a new Duration.
97449
+ * @memberof google.protobuf
97450
+ * @classdesc Represents a Duration.
97451
+ * @constructor
97452
+ * @param {google.protobuf.IDuration=} [properties] Properties to set
97453
+ */
97454
+ function Duration(properties) {
97455
+ if (properties)
97456
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
97457
+ if (properties[keys[i]] != null)
97458
+ this[keys[i]] = properties[keys[i]];
97459
+ }
97460
+
97461
+ /**
97462
+ * Duration seconds.
97463
+ * @member {number} seconds
97464
+ * @memberof google.protobuf.Duration
97465
+ * @instance
97466
+ */
97467
+ Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
97468
+
97469
+ /**
97470
+ * Duration nanos.
97471
+ * @member {number} nanos
97472
+ * @memberof google.protobuf.Duration
97473
+ * @instance
97474
+ */
97475
+ Duration.prototype.nanos = 0;
97476
+
97477
+ /**
97478
+ * Creates a new Duration instance using the specified properties.
97479
+ * @function create
97480
+ * @memberof google.protobuf.Duration
97481
+ * @static
97482
+ * @param {google.protobuf.IDuration=} [properties] Properties to set
97483
+ * @returns {google.protobuf.Duration} Duration instance
97484
+ */
97485
+ Duration.create = function create(properties) {
97486
+ return Duration.fromObject(properties);
97487
+ };
97488
+
97489
+ /**
97490
+ * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
97491
+ * @function encode
97492
+ * @memberof google.protobuf.Duration
97493
+ * @static
97494
+ * @param {google.protobuf.Duration} message Duration message or plain object to encode
97495
+ * @param {$protobuf.Writer} [writer] Writer to encode to
97496
+ * @returns {$protobuf.Writer} Writer
97497
+ */
97498
+ Duration.encode = function encode(message, writer) {
97499
+ if (!writer)
97500
+ writer = $Writer.create();
97501
+ if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
97502
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
97503
+ if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
97504
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
97505
+ return writer;
97506
+ };
97507
+
97508
+ /**
97509
+ * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
97510
+ * @function encodeDelimited
97511
+ * @memberof google.protobuf.Duration
97512
+ * @static
97513
+ * @param {google.protobuf.Duration} message Duration message or plain object to encode
97514
+ * @param {$protobuf.Writer} [writer] Writer to encode to
97515
+ * @returns {$protobuf.Writer} Writer
97516
+ */
97517
+ Duration.encodeDelimited = function encodeDelimited(message, writer) {
97518
+ return this.encode(message, writer).ldelim();
97519
+ };
97520
+
97521
+ /**
97522
+ * Decodes a Duration message from the specified reader or buffer.
97523
+ * @function decode
97524
+ * @memberof google.protobuf.Duration
97525
+ * @static
97526
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
97527
+ * @param {number} [length] Message length if known beforehand
97528
+ * @returns {google.protobuf.Duration} Duration
97529
+ * @throws {Error} If the payload is not a reader or valid buffer
97530
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
97531
+ */
97532
+ Duration.decode = function decode(reader, length, error) {
97533
+ if (!(reader instanceof $Reader))
97534
+ reader = $Reader.create(reader);
97535
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration();
97536
+ while (reader.pos < end) {
97537
+ var tag = reader.uint32();
97538
+ if (tag === error)
97539
+ break;
97540
+ switch (tag >>> 3) {
97541
+ case 1: {
97542
+ message.seconds = reader.int64();
97543
+ break;
97544
+ }
97545
+ case 2: {
97546
+ message.nanos = reader.int32();
97547
+ break;
97548
+ }
97549
+ default:
97550
+ reader.skipType(tag & 7);
97551
+ break;
97552
+ }
97553
+ }
97554
+ return message;
97555
+ };
97556
+
97557
+ /**
97558
+ * Decodes a Duration message from the specified reader or buffer, length delimited.
97559
+ * @function decodeDelimited
97560
+ * @memberof google.protobuf.Duration
97561
+ * @static
97562
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
97563
+ * @returns {google.protobuf.Duration} Duration
97564
+ * @throws {Error} If the payload is not a reader or valid buffer
97565
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
97566
+ */
97567
+ Duration.decodeDelimited = function decodeDelimited(reader) {
97568
+ if (!(reader instanceof $Reader))
97569
+ reader = new $Reader(reader);
97570
+ return this.decode(reader, reader.uint32());
97571
+ };
97572
+
97573
+ /**
97574
+ * Verifies a Duration message.
97575
+ * @function verify
97576
+ * @memberof google.protobuf.Duration
97577
+ * @static
97578
+ * @param {Object.<string,*>} message Plain object to verify
97579
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
97580
+ */
97581
+ Duration.verify = function verify(message) {
97582
+ if (typeof message !== "object" || message === null)
97583
+ return "object expected";
97584
+ if (message.seconds != null && message.hasOwnProperty("seconds"))
97585
+ if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
97586
+ return "seconds: integer|Long expected";
97587
+ if (message.nanos != null && message.hasOwnProperty("nanos"))
97588
+ if (!$util.isInteger(message.nanos))
97589
+ return "nanos: integer expected";
97590
+ return null;
97591
+ };
97592
+
97593
+ /**
97594
+ * Creates a Duration message from a plain object. Also converts values to their respective internal types.
97595
+ * @function fromObject
97596
+ * @memberof google.protobuf.Duration
97597
+ * @static
97598
+ * @param {Object.<string,*>} object Plain object
97599
+ * @returns {google.protobuf.Duration} Duration
97600
+ */
97601
+ Duration.fromObject = function fromObject(object) {
97602
+ if (object instanceof $root.google.protobuf.Duration)
97603
+ return object;
97604
+ var message = new $root.google.protobuf.Duration();
97605
+ if (object.seconds != null)
97606
+ if ($util.Long)
97607
+ (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
97608
+ else if (typeof object.seconds === "string")
97609
+ message.seconds = parseInt(object.seconds, 10);
97610
+ else if (typeof object.seconds === "number")
97611
+ message.seconds = object.seconds;
97612
+ else if (typeof object.seconds === "object")
97613
+ message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
97614
+ if (object.nanos != null)
97615
+ message.nanos = object.nanos | 0;
97616
+ return message;
97617
+ };
97618
+
97619
+ /**
97620
+ * Creates a plain object from a Duration message. Also converts values to other types if specified.
97621
+ * @function toObject
97622
+ * @memberof google.protobuf.Duration
97623
+ * @static
97624
+ * @param {google.protobuf.Duration} message Duration
97625
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
97626
+ * @returns {Object.<string,*>} Plain object
97627
+ */
97628
+ Duration.toObject = function toObject(message, options) {
97629
+ if (options && options.json) {
97630
+ return `${message.seconds || 0}.${message.nanos || 0}s`.replace(/(0+(?=s$))/, '');
97631
+ }
97632
+
97633
+ if (!options)
97634
+ options = {};
97635
+ var object = {};
97636
+ if (options.defaults) {
97637
+ if ($util.Long) {
97638
+ var long = new $util.Long(0, 0, false);
97639
+ object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
97640
+ } else
97641
+ object.seconds = options.longs === String ? "0" : 0;
97642
+ object.nanos = 0;
97643
+ }
97644
+ if (message.seconds != null && message.hasOwnProperty("seconds"))
97645
+ if (typeof message.seconds === "number")
97646
+ object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
97647
+ else
97648
+ object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;
97649
+ if (message.nanos != null && message.hasOwnProperty("nanos"))
97650
+ object.nanos = message.nanos;
97651
+ return object;
97652
+ };
97653
+
97654
+ /**
97655
+ * Converts this Duration to JSON.
97656
+ * @function toJSON
97657
+ * @memberof google.protobuf.Duration
97658
+ * @instance
97659
+ * @returns {Object.<string,*>} JSON object
97660
+ */
97661
+ Duration.prototype.toJSON = function toJSON() {
97662
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
97663
+ };
97664
+
97665
+ /**
97666
+ * Gets the default type url for Duration
97667
+ * @function getTypeUrl
97668
+ * @memberof google.protobuf.Duration
97669
+ * @static
97670
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
97671
+ * @returns {string} The default type url
97672
+ */
97673
+ Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
97674
+ if (typeUrlPrefix === undefined) {
97675
+ typeUrlPrefix = "type.googleapis.com";
97676
+ }
97677
+ return typeUrlPrefix + "/google.protobuf.Duration";
97678
+ };
97679
+
97680
+ return Duration;
97681
+ })();
97682
+
97398
97683
  protobuf.FieldMask = (function() {
97399
97684
 
97400
97685
  /**
package/main/index.d.ts CHANGED
@@ -30807,6 +30807,9 @@ export namespace replit {
30807
30807
 
30808
30808
  /** ReplToken resourceTier */
30809
30809
  resourceTier?: (string|null);
30810
+
30811
+ /** ReplToken idleTimeout */
30812
+ idleTimeout?: (google.protobuf.Duration|google.protobuf.IDuration|null);
30810
30813
  }
30811
30814
 
30812
30815
  /** Represents a ReplToken. */
@@ -30881,6 +30884,9 @@ export namespace replit {
30881
30884
  /** ReplToken resourceTier. */
30882
30885
  public resourceTier: string;
30883
30886
 
30887
+ /** ReplToken idleTimeout. */
30888
+ public idleTimeout?: (google.protobuf.Duration|null);
30889
+
30884
30890
  /** ReplToken metadata. */
30885
30891
  public metadata?: ("repl"|"id"|"classroom");
30886
30892
 
@@ -38852,6 +38858,109 @@ export namespace google {
38852
38858
  public static getTypeUrl(typeUrlPrefix?: string): string;
38853
38859
  }
38854
38860
 
38861
+ /** Properties of a Duration. */
38862
+ interface IDuration {
38863
+
38864
+ /** Duration seconds */
38865
+ seconds?: (number|null);
38866
+
38867
+ /** Duration nanos */
38868
+ nanos?: (number|null);
38869
+ }
38870
+
38871
+ /** Represents a Duration. */
38872
+ class Duration {
38873
+
38874
+ /**
38875
+ * Constructs a new Duration.
38876
+ * @param [properties] Properties to set
38877
+ */
38878
+ private constructor(properties?: google.protobuf.IDuration);
38879
+
38880
+ /** Duration seconds. */
38881
+ public seconds: number;
38882
+
38883
+ /** Duration nanos. */
38884
+ public nanos: number;
38885
+
38886
+ /**
38887
+ * Creates a new Duration instance using the specified properties.
38888
+ * @param [properties] Properties to set
38889
+ * @returns Duration instance
38890
+ */
38891
+ public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration;
38892
+
38893
+ /**
38894
+ * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
38895
+ * @param message Duration message or plain object to encode
38896
+ * @param [writer] Writer to encode to
38897
+ * @returns Writer
38898
+ */
38899
+ public static encode(message: google.protobuf.Duration, writer?: $protobuf.Writer): $protobuf.Writer;
38900
+
38901
+ /**
38902
+ * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
38903
+ * @param message Duration message or plain object to encode
38904
+ * @param [writer] Writer to encode to
38905
+ * @returns Writer
38906
+ */
38907
+ public static encodeDelimited(message: google.protobuf.Duration, writer?: $protobuf.Writer): $protobuf.Writer;
38908
+
38909
+ /**
38910
+ * Decodes a Duration message from the specified reader or buffer.
38911
+ * @param reader Reader or buffer to decode from
38912
+ * @param [length] Message length if known beforehand
38913
+ * @returns Duration
38914
+ * @throws {Error} If the payload is not a reader or valid buffer
38915
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
38916
+ */
38917
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration;
38918
+
38919
+ /**
38920
+ * Decodes a Duration message from the specified reader or buffer, length delimited.
38921
+ * @param reader Reader or buffer to decode from
38922
+ * @returns Duration
38923
+ * @throws {Error} If the payload is not a reader or valid buffer
38924
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
38925
+ */
38926
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration;
38927
+
38928
+ /**
38929
+ * Verifies a Duration message.
38930
+ * @param message Plain object to verify
38931
+ * @returns `null` if valid, otherwise the reason why it is not
38932
+ */
38933
+ public static verify(message: { [k: string]: any }): (string|null);
38934
+
38935
+ /**
38936
+ * Creates a Duration message from a plain object. Also converts values to their respective internal types.
38937
+ * @param object Plain object
38938
+ * @returns Duration
38939
+ */
38940
+ public static fromObject(object: { [k: string]: any }): google.protobuf.Duration;
38941
+
38942
+ /**
38943
+ * Creates a plain object from a Duration message. Also converts values to other types if specified.
38944
+ * @param message Duration
38945
+ * @param [options] Conversion options
38946
+ * @returns Plain object
38947
+ */
38948
+ public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any };
38949
+
38950
+ /**
38951
+ * Converts this Duration to JSON.
38952
+ * @returns JSON object
38953
+ */
38954
+ public toJSON(): { [k: string]: any };
38955
+
38956
+ /**
38957
+ * Gets the default type url for Duration
38958
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
38959
+ * @returns The default type url
38960
+ */
38961
+ public static getTypeUrl(typeUrlPrefix?: string): string;
38962
+ }
38963
+
38855
38964
  /** Properties of a FieldMask. */
38856
38965
  interface IFieldMask {
38857
38966
 
package/main/index.js CHANGED
@@ -78476,6 +78476,7 @@
78476
78476
  * @property {Array.<replit.goval.api.token.ReplToken.ExternalSecret|replit.goval.api.token.ReplToken.IExternalSecret>|null} [externalSecrets] ReplToken externalSecrets
78477
78477
  * @property {google.protobuf.Timestamp|google.protobuf.ITimestamp|null} [before] ReplToken before
78478
78478
  * @property {string|null} [resourceTier] ReplToken resourceTier
78479
+ * @property {google.protobuf.Duration|google.protobuf.IDuration|null} [idleTimeout] ReplToken idleTimeout
78479
78480
  */
78480
78481
 
78481
78482
  /**
@@ -78663,6 +78664,14 @@
78663
78664
  */
78664
78665
  ReplToken.prototype.resourceTier = "";
78665
78666
 
78667
+ /**
78668
+ * ReplToken idleTimeout.
78669
+ * @member {google.protobuf.Duration|null|undefined} idleTimeout
78670
+ * @memberof replit.goval.api.token.ReplToken
78671
+ * @instance
78672
+ */
78673
+ ReplToken.prototype.idleTimeout = null;
78674
+
78666
78675
  // OneOf field names bound to virtual getters and setters
78667
78676
  var $oneOfFields;
78668
78677
 
@@ -78677,6 +78686,12 @@
78677
78686
  set: $util.oneOfSetter($oneOfFields)
78678
78687
  });
78679
78688
 
78689
+ // Virtual OneOf for proto3 optional field
78690
+ Object.defineProperty(ReplToken.prototype, "_idleTimeout", {
78691
+ get: $util.oneOfGetter($oneOfFields = ["idleTimeout"]),
78692
+ set: $util.oneOfSetter($oneOfFields)
78693
+ });
78694
+
78680
78695
  /**
78681
78696
  * Creates a new ReplToken instance using the specified properties.
78682
78697
  * @function create
@@ -78746,6 +78761,8 @@
78746
78761
  $root.google.protobuf.Timestamp.encode(message.before, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim();
78747
78762
  if (message.resourceTier != null && Object.hasOwnProperty.call(message, "resourceTier"))
78748
78763
  writer.uint32(/* id 25, wireType 2 =*/202).string(message.resourceTier);
78764
+ if (message.idleTimeout != null && Object.hasOwnProperty.call(message, "idleTimeout"))
78765
+ $root.google.protobuf.Duration.encode(message.idleTimeout, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim();
78749
78766
  return writer;
78750
78767
  };
78751
78768
 
@@ -78872,6 +78889,10 @@
78872
78889
  message.resourceTier = reader.string();
78873
78890
  break;
78874
78891
  }
78892
+ case 26: {
78893
+ message.idleTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32());
78894
+ break;
78895
+ }
78875
78896
  default:
78876
78897
  reader.skipType(tag & 7);
78877
78898
  break;
@@ -79036,6 +79057,14 @@
79036
79057
  if (message.resourceTier != null && message.hasOwnProperty("resourceTier"))
79037
79058
  if (!$util.isString(message.resourceTier))
79038
79059
  return "resourceTier: string expected";
79060
+ if (message.idleTimeout != null && message.hasOwnProperty("idleTimeout")) {
79061
+ properties._idleTimeout = 1;
79062
+ {
79063
+ var error = $root.google.protobuf.Duration.verify(message.idleTimeout);
79064
+ if (error)
79065
+ return "idleTimeout." + error;
79066
+ }
79067
+ }
79039
79068
  return null;
79040
79069
  };
79041
79070
 
@@ -79191,6 +79220,11 @@
79191
79220
  }
79192
79221
  if (object.resourceTier != null)
79193
79222
  message.resourceTier = String(object.resourceTier);
79223
+ if (object.idleTimeout != null) {
79224
+ if (typeof object.idleTimeout !== "object")
79225
+ throw TypeError(".replit.goval.api.token.ReplToken.idleTimeout: object expected");
79226
+ message.idleTimeout = $root.google.protobuf.Duration.fromObject(object.idleTimeout);
79227
+ }
79194
79228
  return message;
79195
79229
  };
79196
79230
 
@@ -79289,6 +79323,11 @@
79289
79323
  object.before = $root.google.protobuf.Timestamp.toObject(message.before, options);
79290
79324
  if (message.resourceTier != null && message.hasOwnProperty("resourceTier"))
79291
79325
  object.resourceTier = message.resourceTier;
79326
+ if (message.idleTimeout != null && message.hasOwnProperty("idleTimeout")) {
79327
+ object.idleTimeout = $root.google.protobuf.Duration.toObject(message.idleTimeout, options);
79328
+ if (options.oneofs)
79329
+ object._idleTimeout = "idleTimeout";
79330
+ }
79292
79331
  return object;
79293
79332
  };
79294
79333
 
@@ -97395,6 +97434,252 @@
97395
97434
  return Empty;
97396
97435
  })();
97397
97436
 
97437
+ protobuf.Duration = (function() {
97438
+
97439
+ /**
97440
+ * Properties of a Duration.
97441
+ * @memberof google.protobuf
97442
+ * @interface IDuration
97443
+ * @property {number|null} [seconds] Duration seconds
97444
+ * @property {number|null} [nanos] Duration nanos
97445
+ */
97446
+
97447
+ /**
97448
+ * Constructs a new Duration.
97449
+ * @memberof google.protobuf
97450
+ * @classdesc Represents a Duration.
97451
+ * @constructor
97452
+ * @param {google.protobuf.IDuration=} [properties] Properties to set
97453
+ */
97454
+ function Duration(properties) {
97455
+ if (properties)
97456
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
97457
+ if (properties[keys[i]] != null)
97458
+ this[keys[i]] = properties[keys[i]];
97459
+ }
97460
+
97461
+ /**
97462
+ * Duration seconds.
97463
+ * @member {number} seconds
97464
+ * @memberof google.protobuf.Duration
97465
+ * @instance
97466
+ */
97467
+ Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
97468
+
97469
+ /**
97470
+ * Duration nanos.
97471
+ * @member {number} nanos
97472
+ * @memberof google.protobuf.Duration
97473
+ * @instance
97474
+ */
97475
+ Duration.prototype.nanos = 0;
97476
+
97477
+ /**
97478
+ * Creates a new Duration instance using the specified properties.
97479
+ * @function create
97480
+ * @memberof google.protobuf.Duration
97481
+ * @static
97482
+ * @param {google.protobuf.IDuration=} [properties] Properties to set
97483
+ * @returns {google.protobuf.Duration} Duration instance
97484
+ */
97485
+ Duration.create = function create(properties) {
97486
+ return Duration.fromObject(properties);
97487
+ };
97488
+
97489
+ /**
97490
+ * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
97491
+ * @function encode
97492
+ * @memberof google.protobuf.Duration
97493
+ * @static
97494
+ * @param {google.protobuf.Duration} message Duration message or plain object to encode
97495
+ * @param {$protobuf.Writer} [writer] Writer to encode to
97496
+ * @returns {$protobuf.Writer} Writer
97497
+ */
97498
+ Duration.encode = function encode(message, writer) {
97499
+ if (!writer)
97500
+ writer = $Writer.create();
97501
+ if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
97502
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
97503
+ if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
97504
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
97505
+ return writer;
97506
+ };
97507
+
97508
+ /**
97509
+ * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
97510
+ * @function encodeDelimited
97511
+ * @memberof google.protobuf.Duration
97512
+ * @static
97513
+ * @param {google.protobuf.Duration} message Duration message or plain object to encode
97514
+ * @param {$protobuf.Writer} [writer] Writer to encode to
97515
+ * @returns {$protobuf.Writer} Writer
97516
+ */
97517
+ Duration.encodeDelimited = function encodeDelimited(message, writer) {
97518
+ return this.encode(message, writer).ldelim();
97519
+ };
97520
+
97521
+ /**
97522
+ * Decodes a Duration message from the specified reader or buffer.
97523
+ * @function decode
97524
+ * @memberof google.protobuf.Duration
97525
+ * @static
97526
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
97527
+ * @param {number} [length] Message length if known beforehand
97528
+ * @returns {google.protobuf.Duration} Duration
97529
+ * @throws {Error} If the payload is not a reader or valid buffer
97530
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
97531
+ */
97532
+ Duration.decode = function decode(reader, length, error) {
97533
+ if (!(reader instanceof $Reader))
97534
+ reader = $Reader.create(reader);
97535
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration();
97536
+ while (reader.pos < end) {
97537
+ var tag = reader.uint32();
97538
+ if (tag === error)
97539
+ break;
97540
+ switch (tag >>> 3) {
97541
+ case 1: {
97542
+ message.seconds = reader.int64();
97543
+ break;
97544
+ }
97545
+ case 2: {
97546
+ message.nanos = reader.int32();
97547
+ break;
97548
+ }
97549
+ default:
97550
+ reader.skipType(tag & 7);
97551
+ break;
97552
+ }
97553
+ }
97554
+ return message;
97555
+ };
97556
+
97557
+ /**
97558
+ * Decodes a Duration message from the specified reader or buffer, length delimited.
97559
+ * @function decodeDelimited
97560
+ * @memberof google.protobuf.Duration
97561
+ * @static
97562
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
97563
+ * @returns {google.protobuf.Duration} Duration
97564
+ * @throws {Error} If the payload is not a reader or valid buffer
97565
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
97566
+ */
97567
+ Duration.decodeDelimited = function decodeDelimited(reader) {
97568
+ if (!(reader instanceof $Reader))
97569
+ reader = new $Reader(reader);
97570
+ return this.decode(reader, reader.uint32());
97571
+ };
97572
+
97573
+ /**
97574
+ * Verifies a Duration message.
97575
+ * @function verify
97576
+ * @memberof google.protobuf.Duration
97577
+ * @static
97578
+ * @param {Object.<string,*>} message Plain object to verify
97579
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
97580
+ */
97581
+ Duration.verify = function verify(message) {
97582
+ if (typeof message !== "object" || message === null)
97583
+ return "object expected";
97584
+ if (message.seconds != null && message.hasOwnProperty("seconds"))
97585
+ if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
97586
+ return "seconds: integer|Long expected";
97587
+ if (message.nanos != null && message.hasOwnProperty("nanos"))
97588
+ if (!$util.isInteger(message.nanos))
97589
+ return "nanos: integer expected";
97590
+ return null;
97591
+ };
97592
+
97593
+ /**
97594
+ * Creates a Duration message from a plain object. Also converts values to their respective internal types.
97595
+ * @function fromObject
97596
+ * @memberof google.protobuf.Duration
97597
+ * @static
97598
+ * @param {Object.<string,*>} object Plain object
97599
+ * @returns {google.protobuf.Duration} Duration
97600
+ */
97601
+ Duration.fromObject = function fromObject(object) {
97602
+ if (object instanceof $root.google.protobuf.Duration)
97603
+ return object;
97604
+ var message = new $root.google.protobuf.Duration();
97605
+ if (object.seconds != null)
97606
+ if ($util.Long)
97607
+ (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
97608
+ else if (typeof object.seconds === "string")
97609
+ message.seconds = parseInt(object.seconds, 10);
97610
+ else if (typeof object.seconds === "number")
97611
+ message.seconds = object.seconds;
97612
+ else if (typeof object.seconds === "object")
97613
+ message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
97614
+ if (object.nanos != null)
97615
+ message.nanos = object.nanos | 0;
97616
+ return message;
97617
+ };
97618
+
97619
+ /**
97620
+ * Creates a plain object from a Duration message. Also converts values to other types if specified.
97621
+ * @function toObject
97622
+ * @memberof google.protobuf.Duration
97623
+ * @static
97624
+ * @param {google.protobuf.Duration} message Duration
97625
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
97626
+ * @returns {Object.<string,*>} Plain object
97627
+ */
97628
+ Duration.toObject = function toObject(message, options) {
97629
+ if (options && options.json) {
97630
+ return `${message.seconds || 0}.${message.nanos || 0}s`.replace(/(0+(?=s$))/, '');
97631
+ }
97632
+
97633
+ if (!options)
97634
+ options = {};
97635
+ var object = {};
97636
+ if (options.defaults) {
97637
+ if ($util.Long) {
97638
+ var long = new $util.Long(0, 0, false);
97639
+ object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
97640
+ } else
97641
+ object.seconds = options.longs === String ? "0" : 0;
97642
+ object.nanos = 0;
97643
+ }
97644
+ if (message.seconds != null && message.hasOwnProperty("seconds"))
97645
+ if (typeof message.seconds === "number")
97646
+ object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
97647
+ else
97648
+ object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;
97649
+ if (message.nanos != null && message.hasOwnProperty("nanos"))
97650
+ object.nanos = message.nanos;
97651
+ return object;
97652
+ };
97653
+
97654
+ /**
97655
+ * Converts this Duration to JSON.
97656
+ * @function toJSON
97657
+ * @memberof google.protobuf.Duration
97658
+ * @instance
97659
+ * @returns {Object.<string,*>} JSON object
97660
+ */
97661
+ Duration.prototype.toJSON = function toJSON() {
97662
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
97663
+ };
97664
+
97665
+ /**
97666
+ * Gets the default type url for Duration
97667
+ * @function getTypeUrl
97668
+ * @memberof google.protobuf.Duration
97669
+ * @static
97670
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
97671
+ * @returns {string} The default type url
97672
+ */
97673
+ Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
97674
+ if (typeUrlPrefix === undefined) {
97675
+ typeUrlPrefix = "type.googleapis.com";
97676
+ }
97677
+ return typeUrlPrefix + "/google.protobuf.Duration";
97678
+ };
97679
+
97680
+ return Duration;
97681
+ })();
97682
+
97398
97683
  protobuf.FieldMask = (function() {
97399
97684
 
97400
97685
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replit/protocol",
3
- "version": "0.4.26",
3
+ "version": "0.4.27",
4
4
  "description": "JavaScript bindings for the Replit protocol",
5
5
  "main": "main/index.js",
6
6
  "types": "main/index.d.ts",