@bufbuild/protobuf 0.0.1-alpha.1 → 0.0.2-alpha.2

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 (138) hide show
  1. package/dist/cjs/binary-encoding.js +414 -409
  2. package/dist/cjs/binary-format.js +13 -0
  3. package/dist/cjs/descriptor-registry.js +420 -449
  4. package/dist/cjs/descriptor-set.js +429 -513
  5. package/dist/cjs/enum.js +13 -0
  6. package/dist/cjs/field-list.js +13 -0
  7. package/dist/cjs/field.js +43 -30
  8. package/dist/cjs/google/protobuf/any_pb.js +122 -140
  9. package/dist/cjs/google/protobuf/api_pb.js +177 -224
  10. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +125 -227
  11. package/dist/cjs/google/protobuf/descriptor_pb.js +1029 -1888
  12. package/dist/cjs/google/protobuf/duration_pb.js +72 -88
  13. package/dist/cjs/google/protobuf/empty_pb.js +17 -17
  14. package/dist/cjs/google/protobuf/field_mask_pb.js +77 -94
  15. package/dist/cjs/google/protobuf/source_context_pb.js +25 -25
  16. package/dist/cjs/google/protobuf/struct_pb.js +144 -181
  17. package/dist/cjs/google/protobuf/timestamp_pb.js +86 -123
  18. package/dist/cjs/google/protobuf/type_pb.js +406 -462
  19. package/dist/cjs/google/protobuf/wrappers_pb.js +407 -470
  20. package/dist/cjs/google/varint.js +166 -171
  21. package/dist/cjs/index.js +41 -122
  22. package/dist/cjs/json-format.js +13 -0
  23. package/dist/cjs/message-type.js +13 -0
  24. package/dist/cjs/message.js +89 -85
  25. package/dist/cjs/private/assert.js +33 -26
  26. package/dist/cjs/private/base64.js +93 -79
  27. package/dist/cjs/private/binary-format-common.js +208 -208
  28. package/dist/cjs/private/binary-format-proto2.js +88 -109
  29. package/dist/cjs/private/binary-format-proto3.js +70 -90
  30. package/dist/cjs/private/enum.js +77 -44
  31. package/dist/cjs/private/field-list.js +64 -50
  32. package/dist/cjs/private/field-wrapper.js +21 -10
  33. package/dist/cjs/private/field.js +35 -25
  34. package/dist/cjs/private/json-format-common.js +427 -440
  35. package/dist/cjs/private/json-format-proto2.js +91 -89
  36. package/dist/cjs/private/json-format-proto3.js +82 -93
  37. package/dist/cjs/private/message-type.js +39 -27
  38. package/dist/cjs/private/names.js +71 -62
  39. package/dist/cjs/private/options-map.js +13 -0
  40. package/dist/cjs/private/proto-runtime.js +25 -16
  41. package/dist/cjs/private/scalars.js +113 -103
  42. package/dist/cjs/private/util-common.js +193 -210
  43. package/dist/cjs/private/util.js +13 -0
  44. package/dist/cjs/proto-int64.js +123 -111
  45. package/dist/cjs/proto2.js +63 -63
  46. package/dist/cjs/proto3.js +74 -74
  47. package/dist/cjs/service-type.js +27 -17
  48. package/dist/cjs/type-registry.js +46 -31
  49. package/dist/esm/binary-encoding.js +414 -414
  50. package/dist/esm/binary-format.js +13 -0
  51. package/dist/esm/descriptor-registry.js +422 -458
  52. package/dist/esm/descriptor-set.js +430 -478
  53. package/dist/esm/enum.js +13 -0
  54. package/dist/esm/field-list.js +13 -0
  55. package/dist/esm/field.js +42 -29
  56. package/dist/esm/google/protobuf/any_pb.js +122 -140
  57. package/dist/esm/google/protobuf/api_pb.js +177 -197
  58. package/dist/esm/google/protobuf/compiler/plugin_pb.js +123 -216
  59. package/dist/esm/google/protobuf/descriptor_pb.js +1013 -1804
  60. package/dist/esm/google/protobuf/duration_pb.js +72 -88
  61. package/dist/esm/google/protobuf/empty_pb.js +17 -17
  62. package/dist/esm/google/protobuf/field_mask_pb.js +77 -94
  63. package/dist/esm/google/protobuf/source_context_pb.js +25 -25
  64. package/dist/esm/google/protobuf/struct_pb.js +143 -180
  65. package/dist/esm/google/protobuf/timestamp_pb.js +86 -123
  66. package/dist/esm/google/protobuf/type_pb.js +401 -421
  67. package/dist/esm/google/protobuf/wrappers_pb.js +406 -397
  68. package/dist/esm/google/varint.js +165 -164
  69. package/dist/esm/index.js +14 -1
  70. package/dist/esm/json-format.js +13 -0
  71. package/dist/esm/message-type.js +13 -0
  72. package/dist/esm/message.js +89 -85
  73. package/dist/esm/private/assert.js +32 -21
  74. package/dist/esm/private/base64.js +92 -78
  75. package/dist/esm/private/binary-format-common.js +209 -207
  76. package/dist/esm/private/binary-format-proto2.js +89 -81
  77. package/dist/esm/private/binary-format-proto3.js +71 -67
  78. package/dist/esm/private/enum.js +75 -43
  79. package/dist/esm/private/field-list.js +64 -50
  80. package/dist/esm/private/field-wrapper.js +21 -10
  81. package/dist/esm/private/field.js +35 -22
  82. package/dist/esm/private/json-format-common.js +427 -435
  83. package/dist/esm/private/json-format-proto2.js +89 -81
  84. package/dist/esm/private/json-format-proto3.js +79 -80
  85. package/dist/esm/private/message-type.js +40 -28
  86. package/dist/esm/private/names.js +70 -57
  87. package/dist/esm/private/options-map.js +13 -0
  88. package/dist/esm/private/proto-runtime.js +26 -12
  89. package/dist/esm/private/scalars.js +112 -99
  90. package/dist/esm/private/util-common.js +193 -192
  91. package/dist/esm/private/util.js +13 -0
  92. package/dist/esm/proto-int64.js +123 -111
  93. package/dist/esm/proto2.js +63 -57
  94. package/dist/esm/proto3.js +74 -68
  95. package/dist/esm/service-type.js +25 -12
  96. package/dist/esm/type-registry.js +46 -31
  97. package/dist/types/binary-encoding.d.ts +398 -398
  98. package/dist/types/binary-format.d.ts +69 -91
  99. package/dist/types/descriptor-registry.d.ts +23 -29
  100. package/dist/types/descriptor-set.d.ts +107 -128
  101. package/dist/types/enum.d.ts +21 -21
  102. package/dist/types/field-list.d.ts +21 -21
  103. package/dist/types/field.d.ts +191 -231
  104. package/dist/types/google/protobuf/any_pb.d.ts +56 -77
  105. package/dist/types/google/protobuf/api_pb.d.ts +144 -187
  106. package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +195 -257
  107. package/dist/types/google/protobuf/descriptor_pb.d.ts +1360 -1737
  108. package/dist/types/google/protobuf/duration_pb.d.ts +30 -50
  109. package/dist/types/google/protobuf/empty_pb.d.ts +9 -28
  110. package/dist/types/google/protobuf/field_mask_pb.d.ts +17 -37
  111. package/dist/types/google/protobuf/source_context_pb.d.ts +16 -35
  112. package/dist/types/google/protobuf/struct_pb.d.ts +64 -115
  113. package/dist/types/google/protobuf/timestamp_pb.d.ts +31 -51
  114. package/dist/types/google/protobuf/type_pb.d.ts +355 -422
  115. package/dist/types/google/protobuf/wrappers_pb.d.ts +181 -297
  116. package/dist/types/google/varint.d.ts +6 -13
  117. package/dist/types/index.d.ts +4 -27
  118. package/dist/types/json-format.d.ts +70 -89
  119. package/dist/types/message-type.d.ts +37 -45
  120. package/dist/types/message.d.ts +62 -87
  121. package/dist/types/private/assert.d.ts +1 -4
  122. package/dist/types/private/binary-format-common.d.ts +6 -32
  123. package/dist/types/private/enum.d.ts +13 -11
  124. package/dist/types/private/field-list.d.ts +14 -21
  125. package/dist/types/private/field-wrapper.d.ts +4 -10
  126. package/dist/types/private/field.d.ts +12 -12
  127. package/dist/types/private/json-format-common.d.ts +5 -27
  128. package/dist/types/private/message-type.d.ts +12 -7
  129. package/dist/types/private/names.d.ts +1 -4
  130. package/dist/types/private/options-map.d.ts +1 -1
  131. package/dist/types/private/proto-runtime.d.ts +34 -42
  132. package/dist/types/private/scalars.d.ts +5 -12
  133. package/dist/types/private/util-common.d.ts +1 -4
  134. package/dist/types/private/util.d.ts +29 -41
  135. package/dist/types/proto-int64.d.ts +42 -42
  136. package/dist/types/service-type.d.ts +36 -56
  137. package/dist/types/type-registry.d.ts +13 -15
  138. package/package.json +2 -3
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- // @generated by protoc-gen-es v0.0.1-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
2
+ // @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
3
3
  // @generated from file google/protobuf/duration.proto (package google.protobuf, syntax proto3)
4
4
  //
5
5
  // Protocol Buffers - Google's data interchange format
@@ -97,101 +97,85 @@ import { Message, proto3, protoInt64 } from "../../index.js";
97
97
  * @generated from message google.protobuf.Duration
98
98
  */
99
99
  export class Duration extends Message {
100
- constructor(data) {
101
- super();
102
- /**
103
- * Signed seconds of the span of time. Must be from -315,576,000,000
104
- * to +315,576,000,000 inclusive. Note: these bounds are computed from:
105
- * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
106
- *
107
- * @generated from field: int64 seconds = 1;
108
- */
109
- this.seconds = protoInt64.zero;
110
- /**
111
- * Signed fractions of a second at nanosecond resolution of the span
112
- * of time. Durations less than one second are represented with a 0
113
- * `seconds` field and a positive or negative `nanos` field. For durations
114
- * of one second or more, a non-zero value for the `nanos` field must be
115
- * of the same sign as the `seconds` field. Must be from -999,999,999
116
- * to +999,999,999 inclusive.
117
- *
118
- * @generated from field: int32 nanos = 2;
119
- */
120
- this.nanos = 0;
121
- proto3.util.initPartial(data, this);
122
- }
123
- fromJson(json, options) {
124
- if (typeof json !== "string") {
125
- throw new Error(
126
- `cannot decode google.protobuf.Duration from JSON: ${proto3.json.debug(
127
- json
128
- )}`
129
- );
100
+ constructor(data) {
101
+ super();
102
+ /**
103
+ * Signed seconds of the span of time. Must be from -315,576,000,000
104
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
105
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
106
+ *
107
+ * @generated from field: int64 seconds = 1;
108
+ */
109
+ this.seconds = protoInt64.zero;
110
+ /**
111
+ * Signed fractions of a second at nanosecond resolution of the span
112
+ * of time. Durations less than one second are represented with a 0
113
+ * `seconds` field and a positive or negative `nanos` field. For durations
114
+ * of one second or more, a non-zero value for the `nanos` field must be
115
+ * of the same sign as the `seconds` field. Must be from -999,999,999
116
+ * to +999,999,999 inclusive.
117
+ *
118
+ * @generated from field: int32 nanos = 2;
119
+ */
120
+ this.nanos = 0;
121
+ proto3.util.initPartial(data, this);
130
122
  }
131
- const match = json.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);
132
- if (match === null) {
133
- throw new Error(
134
- `cannot decode google.protobuf.Duration from JSON: ${proto3.json.debug(
135
- json
136
- )}`
137
- );
123
+ fromJson(json, options) {
124
+ if (typeof json !== "string") {
125
+ throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3.json.debug(json)}`);
126
+ }
127
+ const match = json.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);
128
+ if (match === null) {
129
+ throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3.json.debug(json)}`);
130
+ }
131
+ const longSeconds = Number(match[1]);
132
+ if (longSeconds > 315576000000 || longSeconds < -315576000000) {
133
+ throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3.json.debug(json)}`);
134
+ }
135
+ this.seconds = protoInt64.parse(longSeconds);
136
+ if (typeof match[2] == "string") {
137
+ const nanosStr = match[2] + "0".repeat(9 - match[2].length);
138
+ this.nanos = parseInt(nanosStr);
139
+ if (longSeconds < 0n) {
140
+ this.nanos = -this.nanos;
141
+ }
142
+ }
143
+ return this;
138
144
  }
139
- const longSeconds = Number(match[1]);
140
- if (longSeconds > 315576000000 || longSeconds < -315576000000) {
141
- throw new Error(
142
- `cannot decode google.protobuf.Duration from JSON: ${proto3.json.debug(
143
- json
144
- )}`
145
- );
145
+ toJson(options) {
146
+ if (Number(this.seconds) > 315576000000 || Number(this.seconds) < -315576000000) {
147
+ throw new Error(`cannot encode google.protobuf.Duration to JSON: value out of range`);
148
+ }
149
+ let text = this.seconds.toString();
150
+ if (this.nanos !== 0) {
151
+ let nanosStr = Math.abs(this.nanos).toString();
152
+ nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr;
153
+ if (nanosStr.substring(3) === "000000") {
154
+ nanosStr = nanosStr.substring(0, 3);
155
+ }
156
+ else if (nanosStr.substring(6) === "000") {
157
+ nanosStr = nanosStr.substring(0, 6);
158
+ }
159
+ text += "." + nanosStr;
160
+ }
161
+ return text + "s";
146
162
  }
147
- this.seconds = protoInt64.parse(longSeconds);
148
- if (typeof match[2] == "string") {
149
- const nanosStr = match[2] + "0".repeat(9 - match[2].length);
150
- this.nanos = parseInt(nanosStr);
151
- if (longSeconds < 0n) {
152
- this.nanos = -this.nanos;
153
- }
163
+ static fromBinary(bytes, options) {
164
+ return new Duration().fromBinary(bytes, options);
154
165
  }
155
- return this;
156
- }
157
- toJson(options) {
158
- if (
159
- Number(this.seconds) > 315576000000 ||
160
- Number(this.seconds) < -315576000000
161
- ) {
162
- throw new Error(
163
- `cannot encode google.protobuf.Duration to JSON: value out of range`
164
- );
166
+ static fromJson(jsonValue, options) {
167
+ return new Duration().fromJson(jsonValue, options);
165
168
  }
166
- let text = this.seconds.toString();
167
- if (this.nanos !== 0) {
168
- let nanosStr = Math.abs(this.nanos).toString();
169
- nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr;
170
- if (nanosStr.substring(3) === "000000") {
171
- nanosStr = nanosStr.substring(0, 3);
172
- } else if (nanosStr.substring(6) === "000") {
173
- nanosStr = nanosStr.substring(0, 6);
174
- }
175
- text += "." + nanosStr;
169
+ static fromJsonString(jsonString, options) {
170
+ return new Duration().fromJsonString(jsonString, options);
171
+ }
172
+ static equals(a, b) {
173
+ return proto3.util.equals(Duration, a, b);
176
174
  }
177
- return text + "s";
178
- }
179
- static fromBinary(bytes, options) {
180
- return new Duration().fromBinary(bytes, options);
181
- }
182
- static fromJson(jsonValue, options) {
183
- return new Duration().fromJson(jsonValue, options);
184
- }
185
- static fromJsonString(jsonString, options) {
186
- return new Duration().fromJsonString(jsonString, options);
187
- }
188
- static equals(a, b) {
189
- return proto3.util.equals(Duration, a, b);
190
- }
191
175
  }
192
176
  Duration.runtime = proto3;
193
177
  Duration.typeName = "google.protobuf.Duration";
194
178
  Duration.fields = proto3.util.newFieldList(() => [
195
- { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
196
- { no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
179
+ { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
180
+ { no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
197
181
  ]);
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- // @generated by protoc-gen-es v0.0.1-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
2
+ // @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
3
3
  // @generated from file google/protobuf/empty.proto (package google.protobuf, syntax proto3)
4
4
  //
5
5
  // Protocol Buffers - Google's data interchange format
@@ -46,22 +46,22 @@ import { Message, proto3 } from "../../index.js";
46
46
  * @generated from message google.protobuf.Empty
47
47
  */
48
48
  export class Empty extends Message {
49
- constructor(data) {
50
- super();
51
- proto3.util.initPartial(data, this);
52
- }
53
- static fromBinary(bytes, options) {
54
- return new Empty().fromBinary(bytes, options);
55
- }
56
- static fromJson(jsonValue, options) {
57
- return new Empty().fromJson(jsonValue, options);
58
- }
59
- static fromJsonString(jsonString, options) {
60
- return new Empty().fromJsonString(jsonString, options);
61
- }
62
- static equals(a, b) {
63
- return proto3.util.equals(Empty, a, b);
64
- }
49
+ constructor(data) {
50
+ super();
51
+ proto3.util.initPartial(data, this);
52
+ }
53
+ static fromBinary(bytes, options) {
54
+ return new Empty().fromBinary(bytes, options);
55
+ }
56
+ static fromJson(jsonValue, options) {
57
+ return new Empty().fromJson(jsonValue, options);
58
+ }
59
+ static fromJsonString(jsonString, options) {
60
+ return new Empty().fromJsonString(jsonString, options);
61
+ }
62
+ static equals(a, b) {
63
+ return proto3.util.equals(Empty, a, b);
64
+ }
65
65
  }
66
66
  Empty.runtime = proto3;
67
67
  Empty.typeName = "google.protobuf.Empty";
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- // @generated by protoc-gen-es v0.0.1-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
2
+ // @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
3
3
  // @generated from file google/protobuf/field_mask.proto (package google.protobuf, syntax proto3)
4
4
  //
5
5
  // Protocol Buffers - Google's data interchange format
@@ -236,108 +236,91 @@ import { Message, proto3 } from "../../index.js";
236
236
  * @generated from message google.protobuf.FieldMask
237
237
  */
238
238
  export class FieldMask extends Message {
239
- constructor(data) {
240
- super();
241
- /**
242
- * The set of field mask paths.
243
- *
244
- * @generated from field: repeated string paths = 1;
245
- */
246
- this.paths = [];
247
- proto3.util.initPartial(data, this);
248
- }
249
- toJson(options) {
250
- // Converts snake_case to protoCamelCase according to the convention
251
- // used by protoc to convert a field name to a JSON name.
252
- function protoCamelCase(snakeCase) {
253
- let capNext = false;
254
- const b = [];
255
- for (let i = 0; i < snakeCase.length; i++) {
256
- let c = snakeCase.charAt(i);
257
- switch (c) {
258
- case "_":
259
- capNext = true;
260
- break;
261
- case "0":
262
- case "1":
263
- case "2":
264
- case "3":
265
- case "4":
266
- case "5":
267
- case "6":
268
- case "7":
269
- case "8":
270
- case "9":
271
- b.push(c);
272
- capNext = false;
273
- break;
274
- default:
275
- if (capNext) {
276
- capNext = false;
277
- c = c.toUpperCase();
239
+ constructor(data) {
240
+ super();
241
+ /**
242
+ * The set of field mask paths.
243
+ *
244
+ * @generated from field: repeated string paths = 1;
245
+ */
246
+ this.paths = [];
247
+ proto3.util.initPartial(data, this);
248
+ }
249
+ toJson(options) {
250
+ // Converts snake_case to protoCamelCase according to the convention
251
+ // used by protoc to convert a field name to a JSON name.
252
+ function protoCamelCase(snakeCase) {
253
+ let capNext = false;
254
+ const b = [];
255
+ for (let i = 0; i < snakeCase.length; i++) {
256
+ let c = snakeCase.charAt(i);
257
+ switch (c) {
258
+ case '_':
259
+ capNext = true;
260
+ break;
261
+ case '0':
262
+ case '1':
263
+ case '2':
264
+ case '3':
265
+ case '4':
266
+ case '5':
267
+ case '6':
268
+ case '7':
269
+ case '8':
270
+ case '9':
271
+ b.push(c);
272
+ capNext = false;
273
+ break;
274
+ default:
275
+ if (capNext) {
276
+ capNext = false;
277
+ c = c.toUpperCase();
278
+ }
279
+ b.push(c);
280
+ break;
281
+ }
278
282
  }
279
- b.push(c);
280
- break;
283
+ return b.join('');
281
284
  }
282
- }
283
- return b.join("");
285
+ return this.paths.map(p => {
286
+ if (p.match(/_[0-9]?_/g) || p.match(/[A-Z]/g)) {
287
+ throw new Error("cannot decode google.protobuf.FieldMask from JSON: lowerCamelCase of path name \"" + p + "\" is irreversible");
288
+ }
289
+ return protoCamelCase(p);
290
+ }).join(",");
284
291
  }
285
- return this.paths
286
- .map((p) => {
287
- if (p.match(/_[0-9]?_/g) || p.match(/[A-Z]/g)) {
288
- throw new Error(
289
- 'cannot decode google.protobuf.FieldMask from JSON: lowerCamelCase of path name "' +
290
- p +
291
- '" is irreversible'
292
- );
292
+ fromJson(json, options) {
293
+ if (typeof json !== "string") {
294
+ throw new Error("cannot decode google.protobuf.FieldMask from JSON: " + proto3.json.debug(json));
293
295
  }
294
- return protoCamelCase(p);
295
- })
296
- .join(",");
297
- }
298
- fromJson(json, options) {
299
- if (typeof json !== "string") {
300
- throw new Error(
301
- "cannot decode google.protobuf.FieldMask from JSON: " +
302
- proto3.json.debug(json)
303
- );
296
+ if (json === "") {
297
+ return this;
298
+ }
299
+ function camelToSnake(str) {
300
+ if (str.includes("_")) {
301
+ throw new Error("cannot decode google.protobuf.FieldMask from JSON: path names must be lowerCamelCase");
302
+ }
303
+ const sc = str.replace(/[A-Z]/g, letter => "_" + letter.toLowerCase());
304
+ return (sc[0] === "_") ? sc.substring(1) : sc;
305
+ }
306
+ this.paths = json.split(",").map(camelToSnake);
307
+ return this;
308
+ }
309
+ static fromBinary(bytes, options) {
310
+ return new FieldMask().fromBinary(bytes, options);
311
+ }
312
+ static fromJson(jsonValue, options) {
313
+ return new FieldMask().fromJson(jsonValue, options);
304
314
  }
305
- if (json === "") {
306
- return this;
315
+ static fromJsonString(jsonString, options) {
316
+ return new FieldMask().fromJsonString(jsonString, options);
307
317
  }
308
- function camelToSnake(str) {
309
- if (str.includes("_")) {
310
- throw new Error(
311
- "cannot decode google.protobuf.FieldMask from JSON: path names must be lowerCamelCase"
312
- );
313
- }
314
- const sc = str.replace(/[A-Z]/g, (letter) => "_" + letter.toLowerCase());
315
- return sc[0] === "_" ? sc.substring(1) : sc;
318
+ static equals(a, b) {
319
+ return proto3.util.equals(FieldMask, a, b);
316
320
  }
317
- this.paths = json.split(",").map(camelToSnake);
318
- return this;
319
- }
320
- static fromBinary(bytes, options) {
321
- return new FieldMask().fromBinary(bytes, options);
322
- }
323
- static fromJson(jsonValue, options) {
324
- return new FieldMask().fromJson(jsonValue, options);
325
- }
326
- static fromJsonString(jsonString, options) {
327
- return new FieldMask().fromJsonString(jsonString, options);
328
- }
329
- static equals(a, b) {
330
- return proto3.util.equals(FieldMask, a, b);
331
- }
332
321
  }
333
322
  FieldMask.runtime = proto3;
334
323
  FieldMask.typeName = "google.protobuf.FieldMask";
335
324
  FieldMask.fields = proto3.util.newFieldList(() => [
336
- {
337
- no: 1,
338
- name: "paths",
339
- kind: "scalar",
340
- T: 9 /* ScalarType.STRING */,
341
- repeated: true,
342
- },
325
+ { no: 1, name: "paths", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
343
326
  ]);
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- // @generated by protoc-gen-es v0.0.1-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
2
+ // @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
3
3
  // @generated from file google/protobuf/source_context.proto (package google.protobuf, syntax proto3)
4
4
  //
5
5
  // Protocol Buffers - Google's data interchange format
@@ -39,32 +39,32 @@ import { Message, proto3 } from "../../index.js";
39
39
  * @generated from message google.protobuf.SourceContext
40
40
  */
41
41
  export class SourceContext extends Message {
42
- constructor(data) {
43
- super();
44
- /**
45
- * The path-qualified name of the .proto file that contained the associated
46
- * protobuf element. For example: `"google/protobuf/source_context.proto"`.
47
- *
48
- * @generated from field: string file_name = 1;
49
- */
50
- this.fileName = "";
51
- proto3.util.initPartial(data, this);
52
- }
53
- static fromBinary(bytes, options) {
54
- return new SourceContext().fromBinary(bytes, options);
55
- }
56
- static fromJson(jsonValue, options) {
57
- return new SourceContext().fromJson(jsonValue, options);
58
- }
59
- static fromJsonString(jsonString, options) {
60
- return new SourceContext().fromJsonString(jsonString, options);
61
- }
62
- static equals(a, b) {
63
- return proto3.util.equals(SourceContext, a, b);
64
- }
42
+ constructor(data) {
43
+ super();
44
+ /**
45
+ * The path-qualified name of the .proto file that contained the associated
46
+ * protobuf element. For example: `"google/protobuf/source_context.proto"`.
47
+ *
48
+ * @generated from field: string file_name = 1;
49
+ */
50
+ this.fileName = "";
51
+ proto3.util.initPartial(data, this);
52
+ }
53
+ static fromBinary(bytes, options) {
54
+ return new SourceContext().fromBinary(bytes, options);
55
+ }
56
+ static fromJson(jsonValue, options) {
57
+ return new SourceContext().fromJson(jsonValue, options);
58
+ }
59
+ static fromJsonString(jsonString, options) {
60
+ return new SourceContext().fromJsonString(jsonString, options);
61
+ }
62
+ static equals(a, b) {
63
+ return proto3.util.equals(SourceContext, a, b);
64
+ }
65
65
  }
66
66
  SourceContext.runtime = proto3;
67
67
  SourceContext.typeName = "google.protobuf.SourceContext";
68
68
  SourceContext.fields = proto3.util.newFieldList(() => [
69
- { no: 1, name: "file_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
69
+ { no: 1, name: "file_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
70
70
  ]);