@bufbuild/protobuf 0.0.2-alpha.3 → 0.0.3

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 (50) hide show
  1. package/README.md +5 -2
  2. package/dist/cjs/google/protobuf/any_pb.js +6 -6
  3. package/dist/cjs/google/protobuf/api_pb.js +18 -18
  4. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +22 -22
  5. package/dist/cjs/google/protobuf/descriptor_pb.js +148 -148
  6. package/dist/cjs/google/protobuf/duration_pb.js +11 -11
  7. package/dist/cjs/google/protobuf/empty_pb.js +6 -6
  8. package/dist/cjs/google/protobuf/field_mask_pb.js +7 -7
  9. package/dist/cjs/google/protobuf/source_context_pb.js +6 -6
  10. package/dist/cjs/google/protobuf/struct_pb.js +21 -21
  11. package/dist/cjs/google/protobuf/timestamp_pb.js +10 -10
  12. package/dist/cjs/google/protobuf/type_pb.js +33 -33
  13. package/dist/cjs/google/protobuf/wrappers_pb.js +66 -66
  14. package/dist/cjs/index-runtime.js +42 -0
  15. package/dist/cjs/index-wkt.js +42 -0
  16. package/dist/cjs/index.js +4 -40
  17. package/dist/cjs/private/util-common.js +1 -1
  18. package/dist/esm/google/protobuf/any_pb.js +1 -1
  19. package/dist/esm/google/protobuf/api_pb.js +1 -1
  20. package/dist/esm/google/protobuf/compiler/plugin_pb.js +1 -1
  21. package/dist/esm/google/protobuf/descriptor_pb.js +1 -1
  22. package/dist/esm/google/protobuf/duration_pb.js +1 -1
  23. package/dist/esm/google/protobuf/empty_pb.js +1 -1
  24. package/dist/esm/google/protobuf/field_mask_pb.js +1 -1
  25. package/dist/esm/google/protobuf/source_context_pb.js +1 -1
  26. package/dist/esm/google/protobuf/struct_pb.js +1 -1
  27. package/dist/esm/google/protobuf/timestamp_pb.js +1 -1
  28. package/dist/esm/google/protobuf/type_pb.js +1 -1
  29. package/dist/esm/google/protobuf/wrappers_pb.js +1 -1
  30. package/dist/esm/index-runtime.js +25 -0
  31. package/dist/esm/index-wkt.js +26 -0
  32. package/dist/esm/index.js +4 -25
  33. package/dist/esm/private/util-common.js +1 -1
  34. package/dist/types/google/protobuf/any_pb.d.ts +2 -2
  35. package/dist/types/google/protobuf/api_pb.d.ts +2 -2
  36. package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +2 -2
  37. package/dist/types/google/protobuf/descriptor_pb.d.ts +2 -2
  38. package/dist/types/google/protobuf/duration_pb.d.ts +2 -2
  39. package/dist/types/google/protobuf/empty_pb.d.ts +2 -2
  40. package/dist/types/google/protobuf/field_mask_pb.d.ts +2 -2
  41. package/dist/types/google/protobuf/source_context_pb.d.ts +2 -2
  42. package/dist/types/google/protobuf/struct_pb.d.ts +2 -2
  43. package/dist/types/google/protobuf/timestamp_pb.d.ts +2 -2
  44. package/dist/types/google/protobuf/type_pb.d.ts +2 -2
  45. package/dist/types/google/protobuf/wrappers_pb.d.ts +2 -2
  46. package/dist/types/index-runtime.d.ts +19 -0
  47. package/dist/types/index-wkt.d.ts +12 -0
  48. package/dist/types/index.d.ts +2 -31
  49. package/dist/types/message.d.ts +1 -3
  50. package/package.json +2 -2
@@ -14,7 +14,7 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.Duration = void 0;
17
- const index_js_1 = require("../../index.js");
17
+ const index_runtime_js_1 = require("../../index-runtime.js");
18
18
  /**
19
19
  * A Duration represents a signed, fixed-length span of time represented
20
20
  * as a count of seconds and fractions of seconds at nanosecond
@@ -79,7 +79,7 @@ const index_js_1 = require("../../index.js");
79
79
  *
80
80
  * @generated from message google.protobuf.Duration
81
81
  */
82
- class Duration extends index_js_1.Message {
82
+ class Duration extends index_runtime_js_1.Message {
83
83
  constructor(data) {
84
84
  super();
85
85
  /**
@@ -89,7 +89,7 @@ class Duration extends index_js_1.Message {
89
89
  *
90
90
  * @generated from field: int64 seconds = 1;
91
91
  */
92
- this.seconds = index_js_1.protoInt64.zero;
92
+ this.seconds = index_runtime_js_1.protoInt64.zero;
93
93
  /**
94
94
  * Signed fractions of a second at nanosecond resolution of the span
95
95
  * of time. Durations less than one second are represented with a 0
@@ -101,21 +101,21 @@ class Duration extends index_js_1.Message {
101
101
  * @generated from field: int32 nanos = 2;
102
102
  */
103
103
  this.nanos = 0;
104
- index_js_1.proto3.util.initPartial(data, this);
104
+ index_runtime_js_1.proto3.util.initPartial(data, this);
105
105
  }
106
106
  fromJson(json, options) {
107
107
  if (typeof json !== "string") {
108
- throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_js_1.proto3.json.debug(json)}`);
108
+ throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
109
109
  }
110
110
  const match = json.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);
111
111
  if (match === null) {
112
- throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_js_1.proto3.json.debug(json)}`);
112
+ throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
113
113
  }
114
114
  const longSeconds = Number(match[1]);
115
115
  if (longSeconds > 315576000000 || longSeconds < -315576000000) {
116
- throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_js_1.proto3.json.debug(json)}`);
116
+ throw new Error(`cannot decode google.protobuf.Duration from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
117
117
  }
118
- this.seconds = index_js_1.protoInt64.parse(longSeconds);
118
+ this.seconds = index_runtime_js_1.protoInt64.parse(longSeconds);
119
119
  if (typeof match[2] == "string") {
120
120
  const nanosStr = match[2] + "0".repeat(9 - match[2].length);
121
121
  this.nanos = parseInt(nanosStr);
@@ -153,13 +153,13 @@ class Duration extends index_js_1.Message {
153
153
  return new Duration().fromJsonString(jsonString, options);
154
154
  }
155
155
  static equals(a, b) {
156
- return index_js_1.proto3.util.equals(Duration, a, b);
156
+ return index_runtime_js_1.proto3.util.equals(Duration, a, b);
157
157
  }
158
158
  }
159
159
  exports.Duration = Duration;
160
- Duration.runtime = index_js_1.proto3;
160
+ Duration.runtime = index_runtime_js_1.proto3;
161
161
  Duration.typeName = "google.protobuf.Duration";
162
- Duration.fields = index_js_1.proto3.util.newFieldList(() => [
162
+ Duration.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
163
163
  { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
164
164
  { no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
165
165
  ]);
@@ -14,7 +14,7 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.Empty = void 0;
17
- const index_js_1 = require("../../index.js");
17
+ const index_runtime_js_1 = require("../../index-runtime.js");
18
18
  /**
19
19
  * A generic empty message that you can re-use to avoid defining duplicated
20
20
  * empty messages in your APIs. A typical example is to use it as the request
@@ -28,10 +28,10 @@ const index_js_1 = require("../../index.js");
28
28
  *
29
29
  * @generated from message google.protobuf.Empty
30
30
  */
31
- class Empty extends index_js_1.Message {
31
+ class Empty extends index_runtime_js_1.Message {
32
32
  constructor(data) {
33
33
  super();
34
- index_js_1.proto3.util.initPartial(data, this);
34
+ index_runtime_js_1.proto3.util.initPartial(data, this);
35
35
  }
36
36
  static fromBinary(bytes, options) {
37
37
  return new Empty().fromBinary(bytes, options);
@@ -43,10 +43,10 @@ class Empty extends index_js_1.Message {
43
43
  return new Empty().fromJsonString(jsonString, options);
44
44
  }
45
45
  static equals(a, b) {
46
- return index_js_1.proto3.util.equals(Empty, a, b);
46
+ return index_runtime_js_1.proto3.util.equals(Empty, a, b);
47
47
  }
48
48
  }
49
49
  exports.Empty = Empty;
50
- Empty.runtime = index_js_1.proto3;
50
+ Empty.runtime = index_runtime_js_1.proto3;
51
51
  Empty.typeName = "google.protobuf.Empty";
52
- Empty.fields = index_js_1.proto3.util.newFieldList(() => []);
52
+ Empty.fields = index_runtime_js_1.proto3.util.newFieldList(() => []);
@@ -14,7 +14,7 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.FieldMask = void 0;
17
- const index_js_1 = require("../../index.js");
17
+ const index_runtime_js_1 = require("../../index-runtime.js");
18
18
  /**
19
19
  * `FieldMask` represents a set of symbolic field paths, for example:
20
20
  *
@@ -218,7 +218,7 @@ const index_js_1 = require("../../index.js");
218
218
  *
219
219
  * @generated from message google.protobuf.FieldMask
220
220
  */
221
- class FieldMask extends index_js_1.Message {
221
+ class FieldMask extends index_runtime_js_1.Message {
222
222
  constructor(data) {
223
223
  super();
224
224
  /**
@@ -227,7 +227,7 @@ class FieldMask extends index_js_1.Message {
227
227
  * @generated from field: repeated string paths = 1;
228
228
  */
229
229
  this.paths = [];
230
- index_js_1.proto3.util.initPartial(data, this);
230
+ index_runtime_js_1.proto3.util.initPartial(data, this);
231
231
  }
232
232
  toJson(options) {
233
233
  // Converts snake_case to protoCamelCase according to the convention
@@ -274,7 +274,7 @@ class FieldMask extends index_js_1.Message {
274
274
  }
275
275
  fromJson(json, options) {
276
276
  if (typeof json !== "string") {
277
- throw new Error("cannot decode google.protobuf.FieldMask from JSON: " + index_js_1.proto3.json.debug(json));
277
+ throw new Error("cannot decode google.protobuf.FieldMask from JSON: " + index_runtime_js_1.proto3.json.debug(json));
278
278
  }
279
279
  if (json === "") {
280
280
  return this;
@@ -299,12 +299,12 @@ class FieldMask extends index_js_1.Message {
299
299
  return new FieldMask().fromJsonString(jsonString, options);
300
300
  }
301
301
  static equals(a, b) {
302
- return index_js_1.proto3.util.equals(FieldMask, a, b);
302
+ return index_runtime_js_1.proto3.util.equals(FieldMask, a, b);
303
303
  }
304
304
  }
305
305
  exports.FieldMask = FieldMask;
306
- FieldMask.runtime = index_js_1.proto3;
306
+ FieldMask.runtime = index_runtime_js_1.proto3;
307
307
  FieldMask.typeName = "google.protobuf.FieldMask";
308
- FieldMask.fields = index_js_1.proto3.util.newFieldList(() => [
308
+ FieldMask.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
309
309
  { no: 1, name: "paths", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
310
310
  ]);
@@ -14,14 +14,14 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.SourceContext = void 0;
17
- const index_js_1 = require("../../index.js");
17
+ const index_runtime_js_1 = require("../../index-runtime.js");
18
18
  /**
19
19
  * `SourceContext` represents information about the source of a
20
20
  * protobuf element, like the file in which it is defined.
21
21
  *
22
22
  * @generated from message google.protobuf.SourceContext
23
23
  */
24
- class SourceContext extends index_js_1.Message {
24
+ class SourceContext extends index_runtime_js_1.Message {
25
25
  constructor(data) {
26
26
  super();
27
27
  /**
@@ -31,7 +31,7 @@ class SourceContext extends index_js_1.Message {
31
31
  * @generated from field: string file_name = 1;
32
32
  */
33
33
  this.fileName = "";
34
- index_js_1.proto3.util.initPartial(data, this);
34
+ index_runtime_js_1.proto3.util.initPartial(data, this);
35
35
  }
36
36
  static fromBinary(bytes, options) {
37
37
  return new SourceContext().fromBinary(bytes, options);
@@ -43,12 +43,12 @@ class SourceContext extends index_js_1.Message {
43
43
  return new SourceContext().fromJsonString(jsonString, options);
44
44
  }
45
45
  static equals(a, b) {
46
- return index_js_1.proto3.util.equals(SourceContext, a, b);
46
+ return index_runtime_js_1.proto3.util.equals(SourceContext, a, b);
47
47
  }
48
48
  }
49
49
  exports.SourceContext = SourceContext;
50
- SourceContext.runtime = index_js_1.proto3;
50
+ SourceContext.runtime = index_runtime_js_1.proto3;
51
51
  SourceContext.typeName = "google.protobuf.SourceContext";
52
- SourceContext.fields = index_js_1.proto3.util.newFieldList(() => [
52
+ SourceContext.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
53
53
  { no: 1, name: "file_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
54
54
  ]);
@@ -14,7 +14,7 @@
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_js_1 = require("../../index.js");
17
+ const index_runtime_js_1 = require("../../index-runtime.js");
18
18
  /**
19
19
  * `NullValue` is a singleton enumeration to represent the null value for the
20
20
  * `Value` type union.
@@ -33,7 +33,7 @@ var NullValue;
33
33
  NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
34
34
  })(NullValue = exports.NullValue || (exports.NullValue = {}));
35
35
  // Retrieve enum metadata with: proto3.getEnumType(NullValue)
36
- index_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue", [
36
+ index_runtime_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue", [
37
37
  { no: 0, name: "NULL_VALUE" },
38
38
  ]);
39
39
  /**
@@ -48,7 +48,7 @@ index_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue", [
48
48
  *
49
49
  * @generated from message google.protobuf.Struct
50
50
  */
51
- class Struct extends index_js_1.Message {
51
+ class Struct extends index_runtime_js_1.Message {
52
52
  constructor(data) {
53
53
  super();
54
54
  /**
@@ -57,7 +57,7 @@ class Struct extends index_js_1.Message {
57
57
  * @generated from field: map<string, google.protobuf.Value> fields = 1;
58
58
  */
59
59
  this.fields = {};
60
- index_js_1.proto3.util.initPartial(data, this);
60
+ index_runtime_js_1.proto3.util.initPartial(data, this);
61
61
  }
62
62
  toJson(options) {
63
63
  const json = {};
@@ -68,7 +68,7 @@ class Struct extends index_js_1.Message {
68
68
  }
69
69
  fromJson(json, options) {
70
70
  if (typeof json != "object" || json == null || Array.isArray(json)) {
71
- throw new Error("cannot decode google.protobuf.Struct from JSON " + index_js_1.proto3.json.debug(json));
71
+ throw new Error("cannot decode google.protobuf.Struct from JSON " + index_runtime_js_1.proto3.json.debug(json));
72
72
  }
73
73
  for (const [k, v] of Object.entries(json)) {
74
74
  this.fields[k] = Value.fromJson(v);
@@ -85,13 +85,13 @@ class Struct extends index_js_1.Message {
85
85
  return new Struct().fromJsonString(jsonString, options);
86
86
  }
87
87
  static equals(a, b) {
88
- return index_js_1.proto3.util.equals(Struct, a, b);
88
+ return index_runtime_js_1.proto3.util.equals(Struct, a, b);
89
89
  }
90
90
  }
91
91
  exports.Struct = Struct;
92
- Struct.runtime = index_js_1.proto3;
92
+ Struct.runtime = index_runtime_js_1.proto3;
93
93
  Struct.typeName = "google.protobuf.Struct";
94
- Struct.fields = index_js_1.proto3.util.newFieldList(() => [
94
+ Struct.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
95
95
  { no: 1, name: "fields", kind: "map", K: 9 /* ScalarType.STRING */, V: { kind: "message", T: Value } },
96
96
  ]);
97
97
  /**
@@ -104,7 +104,7 @@ Struct.fields = index_js_1.proto3.util.newFieldList(() => [
104
104
  *
105
105
  * @generated from message google.protobuf.Value
106
106
  */
107
- class Value extends index_js_1.Message {
107
+ class Value extends index_runtime_js_1.Message {
108
108
  constructor(data) {
109
109
  super();
110
110
  /**
@@ -113,7 +113,7 @@ class Value extends index_js_1.Message {
113
113
  * @generated from oneof google.protobuf.Value.kind
114
114
  */
115
115
  this.kind = { case: undefined };
116
- index_js_1.proto3.util.initPartial(data, this);
116
+ index_runtime_js_1.proto3.util.initPartial(data, this);
117
117
  }
118
118
  toJson(options) {
119
119
  switch (this.kind.case) {
@@ -152,7 +152,7 @@ class Value extends index_js_1.Message {
152
152
  }
153
153
  break;
154
154
  default:
155
- throw new Error("cannot decode google.protobuf.Value from JSON " + index_js_1.proto3.json.debug(json));
155
+ throw new Error("cannot decode google.protobuf.Value from JSON " + index_runtime_js_1.proto3.json.debug(json));
156
156
  }
157
157
  return this;
158
158
  }
@@ -166,14 +166,14 @@ class Value extends index_js_1.Message {
166
166
  return new Value().fromJsonString(jsonString, options);
167
167
  }
168
168
  static equals(a, b) {
169
- return index_js_1.proto3.util.equals(Value, a, b);
169
+ return index_runtime_js_1.proto3.util.equals(Value, a, b);
170
170
  }
171
171
  }
172
172
  exports.Value = Value;
173
- Value.runtime = index_js_1.proto3;
173
+ Value.runtime = index_runtime_js_1.proto3;
174
174
  Value.typeName = "google.protobuf.Value";
175
- Value.fields = index_js_1.proto3.util.newFieldList(() => [
176
- { no: 1, name: "null_value", kind: "enum", T: index_js_1.proto3.getEnumType(NullValue), oneof: "kind" },
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" },
177
177
  { no: 2, name: "number_value", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, oneof: "kind" },
178
178
  { no: 3, name: "string_value", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "kind" },
179
179
  { no: 4, name: "bool_value", kind: "scalar", T: 8 /* ScalarType.BOOL */, oneof: "kind" },
@@ -187,7 +187,7 @@ Value.fields = index_js_1.proto3.util.newFieldList(() => [
187
187
  *
188
188
  * @generated from message google.protobuf.ListValue
189
189
  */
190
- class ListValue extends index_js_1.Message {
190
+ class ListValue extends index_runtime_js_1.Message {
191
191
  constructor(data) {
192
192
  super();
193
193
  /**
@@ -196,14 +196,14 @@ class ListValue extends index_js_1.Message {
196
196
  * @generated from field: repeated google.protobuf.Value values = 1;
197
197
  */
198
198
  this.values = [];
199
- index_js_1.proto3.util.initPartial(data, this);
199
+ index_runtime_js_1.proto3.util.initPartial(data, this);
200
200
  }
201
201
  toJson(options) {
202
202
  return this.values.map(v => v.toJson());
203
203
  }
204
204
  fromJson(json, options) {
205
205
  if (!Array.isArray(json)) {
206
- throw new Error("cannot decode google.protobuf.ListValue from JSON " + index_js_1.proto3.json.debug(json));
206
+ throw new Error("cannot decode google.protobuf.ListValue from JSON " + index_runtime_js_1.proto3.json.debug(json));
207
207
  }
208
208
  for (let e of json) {
209
209
  this.values.push(Value.fromJson(e));
@@ -220,12 +220,12 @@ class ListValue extends index_js_1.Message {
220
220
  return new ListValue().fromJsonString(jsonString, options);
221
221
  }
222
222
  static equals(a, b) {
223
- return index_js_1.proto3.util.equals(ListValue, a, b);
223
+ return index_runtime_js_1.proto3.util.equals(ListValue, a, b);
224
224
  }
225
225
  }
226
226
  exports.ListValue = ListValue;
227
- ListValue.runtime = index_js_1.proto3;
227
+ ListValue.runtime = index_runtime_js_1.proto3;
228
228
  ListValue.typeName = "google.protobuf.ListValue";
229
- ListValue.fields = index_js_1.proto3.util.newFieldList(() => [
229
+ ListValue.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
230
230
  { no: 1, name: "values", kind: "message", T: Value, repeated: true },
231
231
  ]);
@@ -14,7 +14,7 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.Timestamp = void 0;
17
- const index_js_1 = require("../../index.js");
17
+ const index_runtime_js_1 = require("../../index-runtime.js");
18
18
  /**
19
19
  * A Timestamp represents a point in time independent of any time zone or local
20
20
  * calendar, encoded as a count of seconds and fractions of seconds at
@@ -112,7 +112,7 @@ const index_js_1 = require("../../index.js");
112
112
  *
113
113
  * @generated from message google.protobuf.Timestamp
114
114
  */
115
- class Timestamp extends index_js_1.Message {
115
+ class Timestamp extends index_runtime_js_1.Message {
116
116
  constructor(data) {
117
117
  super();
118
118
  /**
@@ -122,7 +122,7 @@ class Timestamp extends index_js_1.Message {
122
122
  *
123
123
  * @generated from field: int64 seconds = 1;
124
124
  */
125
- this.seconds = index_js_1.protoInt64.zero;
125
+ this.seconds = index_runtime_js_1.protoInt64.zero;
126
126
  /**
127
127
  * Non-negative fractions of a second at nanosecond resolution. Negative
128
128
  * second values with fractions must still have non-negative nanos values
@@ -132,11 +132,11 @@ class Timestamp extends index_js_1.Message {
132
132
  * @generated from field: int32 nanos = 2;
133
133
  */
134
134
  this.nanos = 0;
135
- index_js_1.proto3.util.initPartial(data, this);
135
+ index_runtime_js_1.proto3.util.initPartial(data, this);
136
136
  }
137
137
  fromJson(json, options) {
138
138
  if (typeof json !== "string") {
139
- throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${index_js_1.proto3.json.debug(json)}`);
139
+ throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${index_runtime_js_1.proto3.json.debug(json)}`);
140
140
  }
141
141
  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
142
  if (!matches) {
@@ -149,7 +149,7 @@ class Timestamp extends index_js_1.Message {
149
149
  if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z")) {
150
150
  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
151
  }
152
- this.seconds = index_js_1.protoInt64.parse(ms / 1000);
152
+ this.seconds = index_runtime_js_1.protoInt64.parse(ms / 1000);
153
153
  this.nanos = 0;
154
154
  if (matches[7]) {
155
155
  this.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000);
@@ -188,7 +188,7 @@ class Timestamp extends index_js_1.Message {
188
188
  static fromDate(date) {
189
189
  const ms = date.getTime();
190
190
  return new Timestamp({
191
- seconds: index_js_1.protoInt64.parse(Math.floor(ms / 1000)),
191
+ seconds: index_runtime_js_1.protoInt64.parse(Math.floor(ms / 1000)),
192
192
  nanos: (ms % 1000) * 1000000,
193
193
  });
194
194
  }
@@ -202,13 +202,13 @@ class Timestamp extends index_js_1.Message {
202
202
  return new Timestamp().fromJsonString(jsonString, options);
203
203
  }
204
204
  static equals(a, b) {
205
- return index_js_1.proto3.util.equals(Timestamp, a, b);
205
+ return index_runtime_js_1.proto3.util.equals(Timestamp, a, b);
206
206
  }
207
207
  }
208
208
  exports.Timestamp = Timestamp;
209
- Timestamp.runtime = index_js_1.proto3;
209
+ Timestamp.runtime = index_runtime_js_1.proto3;
210
210
  Timestamp.typeName = "google.protobuf.Timestamp";
211
- Timestamp.fields = index_js_1.proto3.util.newFieldList(() => [
211
+ Timestamp.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
212
212
  { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
213
213
  { no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
214
214
  ]);
@@ -14,7 +14,7 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.Option = exports.EnumValue = exports.Enum = exports.Field_Cardinality = exports.Field_Kind = exports.Field = exports.Type = exports.Syntax = void 0;
17
- const index_js_1 = require("../../index.js");
17
+ const index_runtime_js_1 = require("../../index-runtime.js");
18
18
  const source_context_pb_js_1 = require("./source_context_pb.js");
19
19
  const any_pb_js_1 = require("./any_pb.js");
20
20
  /**
@@ -38,7 +38,7 @@ var Syntax;
38
38
  Syntax[Syntax["PROTO3"] = 1] = "PROTO3";
39
39
  })(Syntax = exports.Syntax || (exports.Syntax = {}));
40
40
  // Retrieve enum metadata with: proto3.getEnumType(Syntax)
41
- index_js_1.proto3.util.setEnumType(Syntax, "google.protobuf.Syntax", [
41
+ index_runtime_js_1.proto3.util.setEnumType(Syntax, "google.protobuf.Syntax", [
42
42
  { no: 0, name: "SYNTAX_PROTO2" },
43
43
  { no: 1, name: "SYNTAX_PROTO3" },
44
44
  ]);
@@ -47,7 +47,7 @@ index_js_1.proto3.util.setEnumType(Syntax, "google.protobuf.Syntax", [
47
47
  *
48
48
  * @generated from message google.protobuf.Type
49
49
  */
50
- class Type extends index_js_1.Message {
50
+ class Type extends index_runtime_js_1.Message {
51
51
  constructor(data) {
52
52
  super();
53
53
  /**
@@ -80,7 +80,7 @@ class Type extends index_js_1.Message {
80
80
  * @generated from field: google.protobuf.Syntax syntax = 6;
81
81
  */
82
82
  this.syntax = Syntax.PROTO2;
83
- index_js_1.proto3.util.initPartial(data, this);
83
+ index_runtime_js_1.proto3.util.initPartial(data, this);
84
84
  }
85
85
  static fromBinary(bytes, options) {
86
86
  return new Type().fromBinary(bytes, options);
@@ -92,26 +92,26 @@ class Type extends index_js_1.Message {
92
92
  return new Type().fromJsonString(jsonString, options);
93
93
  }
94
94
  static equals(a, b) {
95
- return index_js_1.proto3.util.equals(Type, a, b);
95
+ return index_runtime_js_1.proto3.util.equals(Type, a, b);
96
96
  }
97
97
  }
98
98
  exports.Type = Type;
99
- Type.runtime = index_js_1.proto3;
99
+ Type.runtime = index_runtime_js_1.proto3;
100
100
  Type.typeName = "google.protobuf.Type";
101
- Type.fields = index_js_1.proto3.util.newFieldList(() => [
101
+ Type.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
102
102
  { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
103
103
  { no: 2, name: "fields", kind: "message", T: Field, repeated: true },
104
104
  { no: 3, name: "oneofs", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
105
105
  { no: 4, name: "options", kind: "message", T: Option, repeated: true },
106
106
  { no: 5, name: "source_context", kind: "message", T: source_context_pb_js_1.SourceContext },
107
- { no: 6, name: "syntax", kind: "enum", T: index_js_1.proto3.getEnumType(Syntax) },
107
+ { no: 6, name: "syntax", kind: "enum", T: index_runtime_js_1.proto3.getEnumType(Syntax) },
108
108
  ]);
109
109
  /**
110
110
  * A single field of a message type.
111
111
  *
112
112
  * @generated from message google.protobuf.Field
113
113
  */
114
- class Field extends index_js_1.Message {
114
+ class Field extends index_runtime_js_1.Message {
115
115
  constructor(data) {
116
116
  super();
117
117
  /**
@@ -176,7 +176,7 @@ class Field extends index_js_1.Message {
176
176
  * @generated from field: string default_value = 11;
177
177
  */
178
178
  this.defaultValue = "";
179
- index_js_1.proto3.util.initPartial(data, this);
179
+ index_runtime_js_1.proto3.util.initPartial(data, this);
180
180
  }
181
181
  static fromBinary(bytes, options) {
182
182
  return new Field().fromBinary(bytes, options);
@@ -188,15 +188,15 @@ class Field extends index_js_1.Message {
188
188
  return new Field().fromJsonString(jsonString, options);
189
189
  }
190
190
  static equals(a, b) {
191
- return index_js_1.proto3.util.equals(Field, a, b);
191
+ return index_runtime_js_1.proto3.util.equals(Field, a, b);
192
192
  }
193
193
  }
194
194
  exports.Field = Field;
195
- Field.runtime = index_js_1.proto3;
195
+ Field.runtime = index_runtime_js_1.proto3;
196
196
  Field.typeName = "google.protobuf.Field";
197
- Field.fields = index_js_1.proto3.util.newFieldList(() => [
198
- { no: 1, name: "kind", kind: "enum", T: index_js_1.proto3.getEnumType(Field_Kind) },
199
- { no: 2, name: "cardinality", kind: "enum", T: index_js_1.proto3.getEnumType(Field_Cardinality) },
197
+ Field.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
198
+ { no: 1, name: "kind", kind: "enum", T: index_runtime_js_1.proto3.getEnumType(Field_Kind) },
199
+ { no: 2, name: "cardinality", kind: "enum", T: index_runtime_js_1.proto3.getEnumType(Field_Cardinality) },
200
200
  { no: 3, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
201
201
  { no: 4, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
202
202
  { no: 6, name: "type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
@@ -329,7 +329,7 @@ var Field_Kind;
329
329
  Field_Kind[Field_Kind["TYPE_SINT64"] = 18] = "TYPE_SINT64";
330
330
  })(Field_Kind = exports.Field_Kind || (exports.Field_Kind = {}));
331
331
  // Retrieve enum metadata with: proto3.getEnumType(Field_Kind)
332
- index_js_1.proto3.util.setEnumType(Field_Kind, "google.protobuf.Field.Kind", [
332
+ index_runtime_js_1.proto3.util.setEnumType(Field_Kind, "google.protobuf.Field.Kind", [
333
333
  { no: 0, name: "TYPE_UNKNOWN" },
334
334
  { no: 1, name: "TYPE_DOUBLE" },
335
335
  { no: 2, name: "TYPE_FLOAT" },
@@ -383,7 +383,7 @@ var Field_Cardinality;
383
383
  Field_Cardinality[Field_Cardinality["REPEATED"] = 3] = "REPEATED";
384
384
  })(Field_Cardinality = exports.Field_Cardinality || (exports.Field_Cardinality = {}));
385
385
  // Retrieve enum metadata with: proto3.getEnumType(Field_Cardinality)
386
- index_js_1.proto3.util.setEnumType(Field_Cardinality, "google.protobuf.Field.Cardinality", [
386
+ index_runtime_js_1.proto3.util.setEnumType(Field_Cardinality, "google.protobuf.Field.Cardinality", [
387
387
  { no: 0, name: "CARDINALITY_UNKNOWN" },
388
388
  { no: 1, name: "CARDINALITY_OPTIONAL" },
389
389
  { no: 2, name: "CARDINALITY_REQUIRED" },
@@ -394,7 +394,7 @@ index_js_1.proto3.util.setEnumType(Field_Cardinality, "google.protobuf.Field.Car
394
394
  *
395
395
  * @generated from message google.protobuf.Enum
396
396
  */
397
- class Enum extends index_js_1.Message {
397
+ class Enum extends index_runtime_js_1.Message {
398
398
  constructor(data) {
399
399
  super();
400
400
  /**
@@ -421,7 +421,7 @@ class Enum extends index_js_1.Message {
421
421
  * @generated from field: google.protobuf.Syntax syntax = 5;
422
422
  */
423
423
  this.syntax = Syntax.PROTO2;
424
- index_js_1.proto3.util.initPartial(data, this);
424
+ index_runtime_js_1.proto3.util.initPartial(data, this);
425
425
  }
426
426
  static fromBinary(bytes, options) {
427
427
  return new Enum().fromBinary(bytes, options);
@@ -433,25 +433,25 @@ class Enum extends index_js_1.Message {
433
433
  return new Enum().fromJsonString(jsonString, options);
434
434
  }
435
435
  static equals(a, b) {
436
- return index_js_1.proto3.util.equals(Enum, a, b);
436
+ return index_runtime_js_1.proto3.util.equals(Enum, a, b);
437
437
  }
438
438
  }
439
439
  exports.Enum = Enum;
440
- Enum.runtime = index_js_1.proto3;
440
+ Enum.runtime = index_runtime_js_1.proto3;
441
441
  Enum.typeName = "google.protobuf.Enum";
442
- Enum.fields = index_js_1.proto3.util.newFieldList(() => [
442
+ Enum.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
443
443
  { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
444
444
  { no: 2, name: "enumvalue", kind: "message", T: EnumValue, repeated: true },
445
445
  { no: 3, name: "options", kind: "message", T: Option, repeated: true },
446
446
  { no: 4, name: "source_context", kind: "message", T: source_context_pb_js_1.SourceContext },
447
- { no: 5, name: "syntax", kind: "enum", T: index_js_1.proto3.getEnumType(Syntax) },
447
+ { no: 5, name: "syntax", kind: "enum", T: index_runtime_js_1.proto3.getEnumType(Syntax) },
448
448
  ]);
449
449
  /**
450
450
  * Enum value definition.
451
451
  *
452
452
  * @generated from message google.protobuf.EnumValue
453
453
  */
454
- class EnumValue extends index_js_1.Message {
454
+ class EnumValue extends index_runtime_js_1.Message {
455
455
  constructor(data) {
456
456
  super();
457
457
  /**
@@ -472,7 +472,7 @@ class EnumValue extends index_js_1.Message {
472
472
  * @generated from field: repeated google.protobuf.Option options = 3;
473
473
  */
474
474
  this.options = [];
475
- index_js_1.proto3.util.initPartial(data, this);
475
+ index_runtime_js_1.proto3.util.initPartial(data, this);
476
476
  }
477
477
  static fromBinary(bytes, options) {
478
478
  return new EnumValue().fromBinary(bytes, options);
@@ -484,13 +484,13 @@ class EnumValue extends index_js_1.Message {
484
484
  return new EnumValue().fromJsonString(jsonString, options);
485
485
  }
486
486
  static equals(a, b) {
487
- return index_js_1.proto3.util.equals(EnumValue, a, b);
487
+ return index_runtime_js_1.proto3.util.equals(EnumValue, a, b);
488
488
  }
489
489
  }
490
490
  exports.EnumValue = EnumValue;
491
- EnumValue.runtime = index_js_1.proto3;
491
+ EnumValue.runtime = index_runtime_js_1.proto3;
492
492
  EnumValue.typeName = "google.protobuf.EnumValue";
493
- EnumValue.fields = index_js_1.proto3.util.newFieldList(() => [
493
+ EnumValue.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
494
494
  { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
495
495
  { no: 2, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
496
496
  { no: 3, name: "options", kind: "message", T: Option, repeated: true },
@@ -501,7 +501,7 @@ EnumValue.fields = index_js_1.proto3.util.newFieldList(() => [
501
501
  *
502
502
  * @generated from message google.protobuf.Option
503
503
  */
504
- class Option extends index_js_1.Message {
504
+ class Option extends index_runtime_js_1.Message {
505
505
  constructor(data) {
506
506
  super();
507
507
  /**
@@ -513,7 +513,7 @@ class Option extends index_js_1.Message {
513
513
  * @generated from field: string name = 1;
514
514
  */
515
515
  this.name = "";
516
- index_js_1.proto3.util.initPartial(data, this);
516
+ index_runtime_js_1.proto3.util.initPartial(data, this);
517
517
  }
518
518
  static fromBinary(bytes, options) {
519
519
  return new Option().fromBinary(bytes, options);
@@ -525,13 +525,13 @@ class Option extends index_js_1.Message {
525
525
  return new Option().fromJsonString(jsonString, options);
526
526
  }
527
527
  static equals(a, b) {
528
- return index_js_1.proto3.util.equals(Option, a, b);
528
+ return index_runtime_js_1.proto3.util.equals(Option, a, b);
529
529
  }
530
530
  }
531
531
  exports.Option = Option;
532
- Option.runtime = index_js_1.proto3;
532
+ Option.runtime = index_runtime_js_1.proto3;
533
533
  Option.typeName = "google.protobuf.Option";
534
- Option.fields = index_js_1.proto3.util.newFieldList(() => [
534
+ Option.fields = index_runtime_js_1.proto3.util.newFieldList(() => [
535
535
  { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
536
536
  { no: 2, name: "value", kind: "message", T: any_pb_js_1.Any },
537
537
  ]);