@bufbuild/protobuf 0.0.5 → 0.0.8

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.
Files changed (78) hide show
  1. package/dist/cjs/binary-encoding.js +2 -2
  2. package/dist/cjs/descriptor-registry.js +18 -60
  3. package/dist/cjs/descriptor-set.js +15 -37
  4. package/dist/cjs/google/protobuf/any_pb.js +11 -8
  5. package/dist/cjs/google/protobuf/api_pb.js +19 -18
  6. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +23 -22
  7. package/dist/cjs/google/protobuf/descriptor_pb.js +149 -148
  8. package/dist/cjs/google/protobuf/duration_pb.js +14 -12
  9. package/dist/cjs/google/protobuf/empty_pb.js +7 -6
  10. package/dist/cjs/google/protobuf/field_mask_pb.js +8 -7
  11. package/dist/cjs/google/protobuf/source_context_pb.js +7 -6
  12. package/dist/cjs/google/protobuf/struct_pb.js +26 -22
  13. package/dist/cjs/google/protobuf/timestamp_pb.js +12 -10
  14. package/dist/cjs/google/protobuf/type_pb.js +37 -33
  15. package/dist/cjs/google/protobuf/wrappers_pb.js +69 -66
  16. package/dist/cjs/index.js +40 -4
  17. package/dist/cjs/message.js +2 -1
  18. package/dist/cjs/private/binary-format-common.js +4 -3
  19. package/dist/cjs/private/binary-format-proto2.js +3 -6
  20. package/dist/cjs/private/binary-format-proto3.js +2 -5
  21. package/dist/cjs/private/enum.js +1 -1
  22. package/dist/cjs/private/json-format-common.js +6 -5
  23. package/dist/cjs/private/message-type.js +2 -1
  24. package/dist/cjs/proto-int64.js +1 -1
  25. package/dist/cjs/proto2.js +6 -8
  26. package/dist/cjs/proto3.js +9 -12
  27. package/dist/esm/binary-encoding.js +2 -2
  28. package/dist/esm/descriptor-registry.js +18 -60
  29. package/dist/esm/descriptor-set.js +15 -37
  30. package/dist/esm/google/protobuf/any_pb.js +6 -3
  31. package/dist/esm/google/protobuf/api_pb.js +2 -1
  32. package/dist/esm/google/protobuf/compiler/plugin_pb.js +2 -1
  33. package/dist/esm/google/protobuf/descriptor_pb.js +2 -1
  34. package/dist/esm/google/protobuf/duration_pb.js +4 -2
  35. package/dist/esm/google/protobuf/empty_pb.js +2 -1
  36. package/dist/esm/google/protobuf/field_mask_pb.js +2 -1
  37. package/dist/esm/google/protobuf/source_context_pb.js +2 -1
  38. package/dist/esm/google/protobuf/struct_pb.js +6 -2
  39. package/dist/esm/google/protobuf/timestamp_pb.js +3 -1
  40. package/dist/esm/google/protobuf/type_pb.js +5 -1
  41. package/dist/esm/google/protobuf/wrappers_pb.js +4 -1
  42. package/dist/esm/index.js +25 -4
  43. package/dist/esm/message.js +2 -1
  44. package/dist/esm/private/binary-format-common.js +4 -3
  45. package/dist/esm/private/binary-format-proto2.js +3 -6
  46. package/dist/esm/private/binary-format-proto3.js +2 -5
  47. package/dist/esm/private/enum.js +1 -1
  48. package/dist/esm/private/json-format-common.js +6 -5
  49. package/dist/esm/private/message-type.js +2 -1
  50. package/dist/esm/proto-int64.js +1 -1
  51. package/dist/esm/proto2.js +6 -8
  52. package/dist/esm/proto3.js +9 -12
  53. package/dist/protobuf.cjs +2 -0
  54. package/dist/protobuf.cjs.map +1 -0
  55. package/dist/protobuf.esm.js +2 -0
  56. package/dist/protobuf.esm.js.map +1 -0
  57. package/dist/protobuf.modern.js +2 -0
  58. package/dist/protobuf.modern.js.map +1 -0
  59. package/dist/types/google/protobuf/any_pb.d.ts +6 -2
  60. package/dist/types/google/protobuf/api_pb.d.ts +5 -2
  61. package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +5 -2
  62. package/dist/types/google/protobuf/descriptor_pb.d.ts +5 -2
  63. package/dist/types/google/protobuf/duration_pb.d.ts +5 -2
  64. package/dist/types/google/protobuf/empty_pb.d.ts +5 -2
  65. package/dist/types/google/protobuf/field_mask_pb.d.ts +5 -2
  66. package/dist/types/google/protobuf/source_context_pb.d.ts +5 -2
  67. package/dist/types/google/protobuf/struct_pb.d.ts +5 -2
  68. package/dist/types/google/protobuf/timestamp_pb.d.ts +5 -2
  69. package/dist/types/google/protobuf/type_pb.d.ts +5 -2
  70. package/dist/types/google/protobuf/wrappers_pb.d.ts +5 -2
  71. package/dist/types/index.d.ts +31 -2
  72. package/package.json +3 -2
  73. package/dist/cjs/index-runtime.js +0 -42
  74. package/dist/cjs/index-wkt.js +0 -42
  75. package/dist/esm/index-runtime.js +0 -25
  76. package/dist/esm/index-wkt.js +0 -26
  77. package/dist/types/index-runtime.d.ts +0 -19
  78. package/dist/types/index-wkt.d.ts +0 -12
@@ -14,7 +14,9 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.Duration = void 0;
17
- const index_runtime_js_1 = require("../../index-runtime.js");
17
+ const message_js_1 = require("../../message.js");
18
+ const proto_int64_js_1 = require("../../proto-int64.js");
19
+ const proto3_js_1 = require("../../proto3.js");
18
20
  /**
19
21
  * A Duration represents a signed, fixed-length span of time represented
20
22
  * as a count of seconds and fractions of seconds at nanosecond
@@ -79,7 +81,7 @@ const index_runtime_js_1 = require("../../index-runtime.js");
79
81
  *
80
82
  * @generated from message google.protobuf.Duration
81
83
  */
82
- class Duration extends index_runtime_js_1.Message {
84
+ class Duration extends message_js_1.Message {
83
85
  constructor(data) {
84
86
  super();
85
87
  /**
@@ -89,7 +91,7 @@ class Duration extends index_runtime_js_1.Message {
89
91
  *
90
92
  * @generated from field: int64 seconds = 1;
91
93
  */
92
- this.seconds = index_runtime_js_1.protoInt64.zero;
94
+ this.seconds = proto_int64_js_1.protoInt64.zero;
93
95
  /**
94
96
  * Signed fractions of a second at nanosecond resolution of the span
95
97
  * of time. Durations less than one second are represented with a 0
@@ -101,25 +103,25 @@ class Duration extends index_runtime_js_1.Message {
101
103
  * @generated from field: int32 nanos = 2;
102
104
  */
103
105
  this.nanos = 0;
104
- index_runtime_js_1.proto3.util.initPartial(data, this);
106
+ proto3_js_1.proto3.util.initPartial(data, this);
105
107
  }
106
108
  fromJson(json, options) {
107
109
  if (typeof json !== "string") {
108
- throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
110
+ throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3_js_1.proto3.json.debug(json)}`);
109
111
  }
110
112
  const match = json.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);
111
113
  if (match === null) {
112
- throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
114
+ throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3_js_1.proto3.json.debug(json)}`);
113
115
  }
114
116
  const longSeconds = Number(match[1]);
115
117
  if (longSeconds > 315576000000 || longSeconds < -315576000000) {
116
- throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
118
+ throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3_js_1.proto3.json.debug(json)}`);
117
119
  }
118
- this.seconds = index_runtime_js_1.protoInt64.parse(longSeconds);
120
+ this.seconds = proto_int64_js_1.protoInt64.parse(longSeconds);
119
121
  if (typeof match[2] == "string") {
120
122
  const nanosStr = match[2] + "0".repeat(9 - match[2].length);
121
123
  this.nanos = parseInt(nanosStr);
122
- if (longSeconds < 0n) {
124
+ if (longSeconds < proto_int64_js_1.protoInt64.zero) {
123
125
  this.nanos = -this.nanos;
124
126
  }
125
127
  }
@@ -153,13 +155,13 @@ class Duration extends index_runtime_js_1.Message {
153
155
  return new Duration().fromJsonString(jsonString, options);
154
156
  }
155
157
  static equals(a, b) {
156
- return index_runtime_js_1.proto3.util.equals(Duration, a, b);
158
+ return proto3_js_1.proto3.util.equals(Duration, a, b);
157
159
  }
158
160
  }
159
161
  exports.Duration = Duration;
160
- Duration.runtime = index_runtime_js_1.proto3;
162
+ Duration.runtime = proto3_js_1.proto3;
161
163
  Duration.typeName = "google.protobuf.Duration";
162
- Duration.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
164
+ Duration.fields = proto3_js_1.proto3.util.newFieldList(() => [
163
165
  { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
164
166
  { no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
165
167
  ]);
@@ -14,7 +14,8 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.Empty = void 0;
17
- const index_runtime_js_1 = require("../../index-runtime.js");
17
+ const message_js_1 = require("../../message.js");
18
+ const proto3_js_1 = require("../../proto3.js");
18
19
  /**
19
20
  * A generic empty message that you can re-use to avoid defining duplicated
20
21
  * empty messages in your APIs. A typical example is to use it as the request
@@ -28,10 +29,10 @@ const index_runtime_js_1 = require("../../index-runtime.js");
28
29
  *
29
30
  * @generated from message google.protobuf.Empty
30
31
  */
31
- class Empty extends index_runtime_js_1.Message {
32
+ class Empty extends message_js_1.Message {
32
33
  constructor(data) {
33
34
  super();
34
- index_runtime_js_1.proto3.util.initPartial(data, this);
35
+ proto3_js_1.proto3.util.initPartial(data, this);
35
36
  }
36
37
  static fromBinary(bytes, options) {
37
38
  return new Empty().fromBinary(bytes, options);
@@ -43,10 +44,10 @@ class Empty extends index_runtime_js_1.Message {
43
44
  return new Empty().fromJsonString(jsonString, options);
44
45
  }
45
46
  static equals(a, b) {
46
- return index_runtime_js_1.proto3.util.equals(Empty, a, b);
47
+ return proto3_js_1.proto3.util.equals(Empty, a, b);
47
48
  }
48
49
  }
49
50
  exports.Empty = Empty;
50
- Empty.runtime = index_runtime_js_1.proto3;
51
+ Empty.runtime = proto3_js_1.proto3;
51
52
  Empty.typeName = "google.protobuf.Empty";
52
- Empty.fields = index_runtime_js_1.proto3.util.newFieldList(() => []);
53
+ Empty.fields = proto3_js_1.proto3.util.newFieldList(() => []);
@@ -14,7 +14,8 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.FieldMask = void 0;
17
- const index_runtime_js_1 = require("../../index-runtime.js");
17
+ const message_js_1 = require("../../message.js");
18
+ const proto3_js_1 = require("../../proto3.js");
18
19
  /**
19
20
  * `FieldMask` represents a set of symbolic field paths, for example:
20
21
  *
@@ -218,7 +219,7 @@ const index_runtime_js_1 = require("../../index-runtime.js");
218
219
  *
219
220
  * @generated from message google.protobuf.FieldMask
220
221
  */
221
- class FieldMask extends index_runtime_js_1.Message {
222
+ class FieldMask extends message_js_1.Message {
222
223
  constructor(data) {
223
224
  super();
224
225
  /**
@@ -227,7 +228,7 @@ class FieldMask extends index_runtime_js_1.Message {
227
228
  * @generated from field: repeated string paths = 1;
228
229
  */
229
230
  this.paths = [];
230
- index_runtime_js_1.proto3.util.initPartial(data, this);
231
+ proto3_js_1.proto3.util.initPartial(data, this);
231
232
  }
232
233
  toJson(options) {
233
234
  // Converts snake_case to protoCamelCase according to the convention
@@ -274,7 +275,7 @@ class FieldMask extends index_runtime_js_1.Message {
274
275
  }
275
276
  fromJson(json, options) {
276
277
  if (typeof json !== "string") {
277
- throw new Error("cannot decode google.protobuf.FieldMask from JSON: " + index_runtime_js_1.proto3.json.debug(json));
278
+ throw new Error("cannot decode google.protobuf.FieldMask from JSON: " + proto3_js_1.proto3.json.debug(json));
278
279
  }
279
280
  if (json === "") {
280
281
  return this;
@@ -299,12 +300,12 @@ class FieldMask extends index_runtime_js_1.Message {
299
300
  return new FieldMask().fromJsonString(jsonString, options);
300
301
  }
301
302
  static equals(a, b) {
302
- return index_runtime_js_1.proto3.util.equals(FieldMask, a, b);
303
+ return proto3_js_1.proto3.util.equals(FieldMask, a, b);
303
304
  }
304
305
  }
305
306
  exports.FieldMask = FieldMask;
306
- FieldMask.runtime = index_runtime_js_1.proto3;
307
+ FieldMask.runtime = proto3_js_1.proto3;
307
308
  FieldMask.typeName = "google.protobuf.FieldMask";
308
- FieldMask.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
309
+ FieldMask.fields = proto3_js_1.proto3.util.newFieldList(() => [
309
310
  { no: 1, name: "paths", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
310
311
  ]);
@@ -14,14 +14,15 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.SourceContext = void 0;
17
- const index_runtime_js_1 = require("../../index-runtime.js");
17
+ const message_js_1 = require("../../message.js");
18
+ const proto3_js_1 = require("../../proto3.js");
18
19
  /**
19
20
  * `SourceContext` represents information about the source of a
20
21
  * protobuf element, like the file in which it is defined.
21
22
  *
22
23
  * @generated from message google.protobuf.SourceContext
23
24
  */
24
- class SourceContext extends index_runtime_js_1.Message {
25
+ class SourceContext extends message_js_1.Message {
25
26
  constructor(data) {
26
27
  super();
27
28
  /**
@@ -31,7 +32,7 @@ class SourceContext extends index_runtime_js_1.Message {
31
32
  * @generated from field: string file_name = 1;
32
33
  */
33
34
  this.fileName = "";
34
- index_runtime_js_1.proto3.util.initPartial(data, this);
35
+ proto3_js_1.proto3.util.initPartial(data, this);
35
36
  }
36
37
  static fromBinary(bytes, options) {
37
38
  return new SourceContext().fromBinary(bytes, options);
@@ -43,12 +44,12 @@ class SourceContext extends index_runtime_js_1.Message {
43
44
  return new SourceContext().fromJsonString(jsonString, options);
44
45
  }
45
46
  static equals(a, b) {
46
- return index_runtime_js_1.proto3.util.equals(SourceContext, a, b);
47
+ return proto3_js_1.proto3.util.equals(SourceContext, a, b);
47
48
  }
48
49
  }
49
50
  exports.SourceContext = SourceContext;
50
- SourceContext.runtime = index_runtime_js_1.proto3;
51
+ SourceContext.runtime = proto3_js_1.proto3;
51
52
  SourceContext.typeName = "google.protobuf.SourceContext";
52
- SourceContext.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
53
+ SourceContext.fields = proto3_js_1.proto3.util.newFieldList(() => [
53
54
  { no: 1, name: "file_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
54
55
  ]);
@@ -14,7 +14,11 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.ListValue = exports.Value = exports.Struct = exports.NullValue = void 0;
17
- const index_runtime_js_1 = require("../../index-runtime.js");
17
+ // @generated by protoc-gen-es v0.0.8 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
18
+ // @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)
19
+ /* eslint-disable */
20
+ const proto3_js_1 = require("../../proto3.js");
21
+ const message_js_1 = require("../../message.js");
18
22
  /**
19
23
  * `NullValue` is a singleton enumeration to represent the null value for the
20
24
  * `Value` type union.
@@ -33,7 +37,7 @@ var NullValue;
33
37
  NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
34
38
  })(NullValue = exports.NullValue || (exports.NullValue = {}));
35
39
  // Retrieve enum metadata with: proto3.getEnumType(NullValue)
36
- index_runtime_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue", [
40
+ proto3_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue", [
37
41
  { no: 0, name: "NULL_VALUE" },
38
42
  ]);
39
43
  /**
@@ -48,7 +52,7 @@ index_runtime_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue
48
52
  *
49
53
  * @generated from message google.protobuf.Struct
50
54
  */
51
- class Struct extends index_runtime_js_1.Message {
55
+ class Struct extends message_js_1.Message {
52
56
  constructor(data) {
53
57
  super();
54
58
  /**
@@ -57,7 +61,7 @@ class Struct extends index_runtime_js_1.Message {
57
61
  * @generated from field: map<string, google.protobuf.Value> fields = 1;
58
62
  */
59
63
  this.fields = {};
60
- index_runtime_js_1.proto3.util.initPartial(data, this);
64
+ proto3_js_1.proto3.util.initPartial(data, this);
61
65
  }
62
66
  toJson(options) {
63
67
  const json = {};
@@ -68,7 +72,7 @@ class Struct extends index_runtime_js_1.Message {
68
72
  }
69
73
  fromJson(json, options) {
70
74
  if (typeof json != "object" || json == null || Array.isArray(json)) {
71
- throw new Error("cannot decode google.protobuf.Struct from JSON " + index_runtime_js_1.proto3.json.debug(json));
75
+ throw new Error("cannot decode google.protobuf.Struct from JSON " + proto3_js_1.proto3.json.debug(json));
72
76
  }
73
77
  for (const [k, v] of Object.entries(json)) {
74
78
  this.fields[k] = Value.fromJson(v);
@@ -85,13 +89,13 @@ class Struct extends index_runtime_js_1.Message {
85
89
  return new Struct().fromJsonString(jsonString, options);
86
90
  }
87
91
  static equals(a, b) {
88
- return index_runtime_js_1.proto3.util.equals(Struct, a, b);
92
+ return proto3_js_1.proto3.util.equals(Struct, a, b);
89
93
  }
90
94
  }
91
95
  exports.Struct = Struct;
92
- Struct.runtime = index_runtime_js_1.proto3;
96
+ Struct.runtime = proto3_js_1.proto3;
93
97
  Struct.typeName = "google.protobuf.Struct";
94
- Struct.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
98
+ Struct.fields = proto3_js_1.proto3.util.newFieldList(() => [
95
99
  { no: 1, name: "fields", kind: "map", K: 9 /* ScalarType.STRING */, V: { kind: "message", T: Value } },
96
100
  ]);
97
101
  /**
@@ -104,7 +108,7 @@ Struct.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
104
108
  *
105
109
  * @generated from message google.protobuf.Value
106
110
  */
107
- class Value extends index_runtime_js_1.Message {
111
+ class Value extends message_js_1.Message {
108
112
  constructor(data) {
109
113
  super();
110
114
  /**
@@ -113,7 +117,7 @@ class Value extends index_runtime_js_1.Message {
113
117
  * @generated from oneof google.protobuf.Value.kind
114
118
  */
115
119
  this.kind = { case: undefined };
116
- index_runtime_js_1.proto3.util.initPartial(data, this);
120
+ proto3_js_1.proto3.util.initPartial(data, this);
117
121
  }
118
122
  toJson(options) {
119
123
  switch (this.kind.case) {
@@ -125,7 +129,7 @@ class Value extends index_runtime_js_1.Message {
125
129
  return this.kind.value;
126
130
  case "structValue":
127
131
  case "listValue":
128
- return this.kind.value.toJson({ ...options, emitDefaultValues: true });
132
+ return this.kind.value.toJson(Object.assign(Object.assign({}, options), { emitDefaultValues: true }));
129
133
  }
130
134
  throw new Error("google.protobuf.Value must have a value");
131
135
  }
@@ -152,7 +156,7 @@ class Value extends index_runtime_js_1.Message {
152
156
  }
153
157
  break;
154
158
  default:
155
- throw new Error("cannot decode google.protobuf.Value from JSON " + index_runtime_js_1.proto3.json.debug(json));
159
+ throw new Error("cannot decode google.protobuf.Value from JSON " + proto3_js_1.proto3.json.debug(json));
156
160
  }
157
161
  return this;
158
162
  }
@@ -166,14 +170,14 @@ class Value extends index_runtime_js_1.Message {
166
170
  return new Value().fromJsonString(jsonString, options);
167
171
  }
168
172
  static equals(a, b) {
169
- return index_runtime_js_1.proto3.util.equals(Value, a, b);
173
+ return proto3_js_1.proto3.util.equals(Value, a, b);
170
174
  }
171
175
  }
172
176
  exports.Value = Value;
173
- Value.runtime = index_runtime_js_1.proto3;
177
+ Value.runtime = proto3_js_1.proto3;
174
178
  Value.typeName = "google.protobuf.Value";
175
- Value.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
176
- { no: 1, name: "null_value", kind: "enum", T: index_runtime_js_1.proto3.getEnumType(NullValue), oneof: "kind" },
179
+ Value.fields = proto3_js_1.proto3.util.newFieldList(() => [
180
+ { no: 1, name: "null_value", kind: "enum", T: proto3_js_1.proto3.getEnumType(NullValue), oneof: "kind" },
177
181
  { no: 2, name: "number_value", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, oneof: "kind" },
178
182
  { no: 3, name: "string_value", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "kind" },
179
183
  { no: 4, name: "bool_value", kind: "scalar", T: 8 /* ScalarType.BOOL */, oneof: "kind" },
@@ -187,7 +191,7 @@ Value.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
187
191
  *
188
192
  * @generated from message google.protobuf.ListValue
189
193
  */
190
- class ListValue extends index_runtime_js_1.Message {
194
+ class ListValue extends message_js_1.Message {
191
195
  constructor(data) {
192
196
  super();
193
197
  /**
@@ -196,14 +200,14 @@ class ListValue extends index_runtime_js_1.Message {
196
200
  * @generated from field: repeated google.protobuf.Value values = 1;
197
201
  */
198
202
  this.values = [];
199
- index_runtime_js_1.proto3.util.initPartial(data, this);
203
+ proto3_js_1.proto3.util.initPartial(data, this);
200
204
  }
201
205
  toJson(options) {
202
206
  return this.values.map(v => v.toJson());
203
207
  }
204
208
  fromJson(json, options) {
205
209
  if (!Array.isArray(json)) {
206
- throw new Error("cannot decode google.protobuf.ListValue from JSON " + index_runtime_js_1.proto3.json.debug(json));
210
+ throw new Error("cannot decode google.protobuf.ListValue from JSON " + proto3_js_1.proto3.json.debug(json));
207
211
  }
208
212
  for (let e of json) {
209
213
  this.values.push(Value.fromJson(e));
@@ -220,12 +224,12 @@ class ListValue extends index_runtime_js_1.Message {
220
224
  return new ListValue().fromJsonString(jsonString, options);
221
225
  }
222
226
  static equals(a, b) {
223
- return index_runtime_js_1.proto3.util.equals(ListValue, a, b);
227
+ return proto3_js_1.proto3.util.equals(ListValue, a, b);
224
228
  }
225
229
  }
226
230
  exports.ListValue = ListValue;
227
- ListValue.runtime = index_runtime_js_1.proto3;
231
+ ListValue.runtime = proto3_js_1.proto3;
228
232
  ListValue.typeName = "google.protobuf.ListValue";
229
- ListValue.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
233
+ ListValue.fields = proto3_js_1.proto3.util.newFieldList(() => [
230
234
  { no: 1, name: "values", kind: "message", T: Value, repeated: true },
231
235
  ]);
@@ -14,7 +14,9 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.Timestamp = void 0;
17
- const index_runtime_js_1 = require("../../index-runtime.js");
17
+ const message_js_1 = require("../../message.js");
18
+ const proto_int64_js_1 = require("../../proto-int64.js");
19
+ const proto3_js_1 = require("../../proto3.js");
18
20
  /**
19
21
  * A Timestamp represents a point in time independent of any time zone or local
20
22
  * calendar, encoded as a count of seconds and fractions of seconds at
@@ -112,7 +114,7 @@ const index_runtime_js_1 = require("../../index-runtime.js");
112
114
  *
113
115
  * @generated from message google.protobuf.Timestamp
114
116
  */
115
- class Timestamp extends index_runtime_js_1.Message {
117
+ class Timestamp extends message_js_1.Message {
116
118
  constructor(data) {
117
119
  super();
118
120
  /**
@@ -122,7 +124,7 @@ class Timestamp extends index_runtime_js_1.Message {
122
124
  *
123
125
  * @generated from field: int64 seconds = 1;
124
126
  */
125
- this.seconds = index_runtime_js_1.protoInt64.zero;
127
+ this.seconds = proto_int64_js_1.protoInt64.zero;
126
128
  /**
127
129
  * Non-negative fractions of a second at nanosecond resolution. Negative
128
130
  * second values with fractions must still have non-negative nanos values
@@ -132,11 +134,11 @@ class Timestamp extends index_runtime_js_1.Message {
132
134
  * @generated from field: int32 nanos = 2;
133
135
  */
134
136
  this.nanos = 0;
135
- index_runtime_js_1.proto3.util.initPartial(data, this);
137
+ proto3_js_1.proto3.util.initPartial(data, this);
136
138
  }
137
139
  fromJson(json, options) {
138
140
  if (typeof json !== "string") {
139
- throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
141
+ throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${proto3_js_1.proto3.json.debug(json)}`);
140
142
  }
141
143
  const matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);
142
144
  if (!matches) {
@@ -149,7 +151,7 @@ class Timestamp extends index_runtime_js_1.Message {
149
151
  if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z")) {
150
152
  throw new Error(`cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);
151
153
  }
152
- this.seconds = index_runtime_js_1.protoInt64.parse(ms / 1000);
154
+ this.seconds = proto_int64_js_1.protoInt64.parse(ms / 1000);
153
155
  this.nanos = 0;
154
156
  if (matches[7]) {
155
157
  this.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000);
@@ -188,7 +190,7 @@ class Timestamp extends index_runtime_js_1.Message {
188
190
  static fromDate(date) {
189
191
  const ms = date.getTime();
190
192
  return new Timestamp({
191
- seconds: index_runtime_js_1.protoInt64.parse(Math.floor(ms / 1000)),
193
+ seconds: proto_int64_js_1.protoInt64.parse(Math.floor(ms / 1000)),
192
194
  nanos: (ms % 1000) * 1000000,
193
195
  });
194
196
  }
@@ -202,13 +204,13 @@ class Timestamp extends index_runtime_js_1.Message {
202
204
  return new Timestamp().fromJsonString(jsonString, options);
203
205
  }
204
206
  static equals(a, b) {
205
- return index_runtime_js_1.proto3.util.equals(Timestamp, a, b);
207
+ return proto3_js_1.proto3.util.equals(Timestamp, a, b);
206
208
  }
207
209
  }
208
210
  exports.Timestamp = Timestamp;
209
- Timestamp.runtime = index_runtime_js_1.proto3;
211
+ Timestamp.runtime = proto3_js_1.proto3;
210
212
  Timestamp.typeName = "google.protobuf.Timestamp";
211
- Timestamp.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
213
+ Timestamp.fields = proto3_js_1.proto3.util.newFieldList(() => [
212
214
  { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
213
215
  { no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
214
216
  ]);