@bufbuild/protobuf 1.7.2 → 1.9.0

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 (127) hide show
  1. package/dist/cjs/binary-encoding.d.ts +2 -2
  2. package/dist/cjs/codegen-info.d.ts +6 -1
  3. package/dist/cjs/codegen-info.js +4 -3
  4. package/dist/cjs/create-descriptor-set.js +45 -33
  5. package/dist/cjs/create-registry-from-desc.js +60 -110
  6. package/dist/cjs/descriptor-set.d.ts +13 -9
  7. package/dist/cjs/field.d.ts +25 -51
  8. package/dist/cjs/field.js +0 -66
  9. package/dist/cjs/google/protobuf/compiler/plugin_pb.d.ts +18 -0
  10. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +2 -0
  11. package/dist/cjs/google/protobuf/descriptor_pb.d.ts +33 -33
  12. package/dist/cjs/google/protobuf/descriptor_pb.js +23 -10
  13. package/dist/cjs/google/protobuf/struct_pb.js +1 -1
  14. package/dist/cjs/google/protobuf/type_pb.js +1 -1
  15. package/dist/cjs/google/protobuf/wrappers_pb.js +19 -19
  16. package/dist/cjs/index.d.ts +4 -2
  17. package/dist/cjs/index.js +6 -4
  18. package/dist/cjs/is-message.d.ts +22 -0
  19. package/dist/cjs/is-message.js +52 -0
  20. package/dist/cjs/json-format.d.ts +1 -2
  21. package/dist/cjs/message.d.ts +1 -0
  22. package/dist/cjs/message.js +1 -0
  23. package/dist/cjs/private/binary-format.d.ts +7 -0
  24. package/dist/cjs/private/{binary-format-common.js → binary-format.js} +150 -53
  25. package/dist/cjs/private/extensions.js +1 -1
  26. package/dist/cjs/private/feature-set.js +1 -1
  27. package/dist/cjs/private/field-normalize.d.ts +9 -0
  28. package/dist/cjs/private/field-normalize.js +69 -0
  29. package/dist/cjs/private/field-wrapper.d.ts +1 -1
  30. package/dist/cjs/private/field-wrapper.js +12 -12
  31. package/dist/cjs/private/field.d.ts +1 -0
  32. package/dist/cjs/private/field.js +1 -0
  33. package/dist/cjs/private/json-format.d.ts +2 -0
  34. package/dist/cjs/private/{json-format-common.js → json-format.js} +261 -170
  35. package/dist/cjs/private/names.js +3 -3
  36. package/dist/cjs/private/proto-runtime.d.ts +1 -1
  37. package/dist/cjs/private/proto-runtime.js +8 -4
  38. package/dist/cjs/private/reflect.d.ts +9 -0
  39. package/dist/cjs/private/reflect.js +79 -0
  40. package/dist/cjs/private/reify-wkt.js +11 -11
  41. package/dist/cjs/private/scalars.d.ts +9 -18
  42. package/dist/cjs/private/scalars.js +36 -80
  43. package/dist/cjs/private/text-format.d.ts +1 -1
  44. package/dist/cjs/private/text-format.js +17 -17
  45. package/dist/cjs/private/util-common.js +20 -14
  46. package/dist/cjs/proto-delimited.js +2 -3
  47. package/dist/cjs/proto2.js +29 -68
  48. package/dist/cjs/proto3.js +30 -77
  49. package/dist/cjs/scalar.d.ts +53 -0
  50. package/dist/cjs/scalar.js +81 -0
  51. package/dist/cjs/to-plain-message.js +3 -4
  52. package/dist/esm/binary-encoding.d.ts +2 -2
  53. package/dist/esm/codegen-info.d.ts +6 -1
  54. package/dist/esm/codegen-info.js +6 -5
  55. package/dist/esm/create-descriptor-set.js +22 -10
  56. package/dist/esm/create-registry-from-desc.js +62 -111
  57. package/dist/esm/descriptor-set.d.ts +13 -9
  58. package/dist/esm/descriptor-set.js +1 -1
  59. package/dist/esm/field.d.ts +25 -51
  60. package/dist/esm/field.js +1 -65
  61. package/dist/esm/google/protobuf/compiler/plugin_pb.d.ts +18 -0
  62. package/dist/esm/google/protobuf/compiler/plugin_pb.js +2 -0
  63. package/dist/esm/google/protobuf/descriptor_pb.d.ts +33 -33
  64. package/dist/esm/google/protobuf/descriptor_pb.js +23 -10
  65. package/dist/esm/google/protobuf/struct_pb.js +1 -1
  66. package/dist/esm/google/protobuf/type_pb.js +1 -1
  67. package/dist/esm/google/protobuf/wrappers_pb.js +1 -1
  68. package/dist/esm/index.d.ts +4 -2
  69. package/dist/esm/index.js +2 -1
  70. package/dist/esm/is-message.d.ts +22 -0
  71. package/dist/esm/is-message.js +48 -0
  72. package/dist/esm/json-format.d.ts +1 -2
  73. package/dist/esm/json-format.js +1 -1
  74. package/dist/esm/message.d.ts +1 -0
  75. package/dist/esm/message.js +1 -0
  76. package/dist/esm/private/binary-format.d.ts +7 -0
  77. package/dist/esm/private/{binary-format-common.js → binary-format.js} +126 -25
  78. package/dist/esm/private/extensions.js +2 -2
  79. package/dist/esm/private/feature-set.js +1 -1
  80. package/dist/esm/private/field-normalize.d.ts +9 -0
  81. package/dist/esm/private/field-normalize.js +65 -0
  82. package/dist/esm/private/field-wrapper.d.ts +1 -1
  83. package/dist/esm/private/field-wrapper.js +3 -2
  84. package/dist/esm/private/field.d.ts +1 -0
  85. package/dist/esm/private/field.js +1 -0
  86. package/dist/esm/private/json-format.d.ts +2 -0
  87. package/dist/esm/private/{json-format-common.js → json-format.js} +228 -136
  88. package/dist/esm/private/names.js +3 -3
  89. package/dist/esm/private/proto-runtime.d.ts +1 -1
  90. package/dist/esm/private/proto-runtime.js +8 -4
  91. package/dist/esm/private/reflect.d.ts +9 -0
  92. package/dist/esm/private/reflect.js +74 -0
  93. package/dist/esm/private/reify-wkt.js +1 -1
  94. package/dist/esm/private/scalars.d.ts +9 -18
  95. package/dist/esm/private/scalars.js +15 -59
  96. package/dist/esm/private/text-format.d.ts +1 -1
  97. package/dist/esm/private/text-format.js +1 -1
  98. package/dist/esm/private/util-common.js +13 -6
  99. package/dist/esm/proto-delimited.js +2 -3
  100. package/dist/esm/proto2.js +29 -68
  101. package/dist/esm/proto3.js +31 -78
  102. package/dist/esm/scalar.d.ts +53 -0
  103. package/dist/esm/scalar.js +78 -0
  104. package/dist/esm/to-plain-message.js +3 -2
  105. package/package.json +4 -10
  106. package/dist/cjs/private/binary-format-common.d.ts +0 -13
  107. package/dist/cjs/private/binary-format-proto2.d.ts +0 -2
  108. package/dist/cjs/private/binary-format-proto2.js +0 -91
  109. package/dist/cjs/private/binary-format-proto3.d.ts +0 -2
  110. package/dist/cjs/private/binary-format-proto3.js +0 -83
  111. package/dist/cjs/private/json-format-common.d.ts +0 -9
  112. package/dist/cjs/private/json-format-proto2.d.ts +0 -2
  113. package/dist/cjs/private/json-format-proto2.js +0 -103
  114. package/dist/cjs/private/json-format-proto3.d.ts +0 -2
  115. package/dist/cjs/private/json-format-proto3.js +0 -94
  116. package/dist/esm/private/binary-format-common.d.ts +0 -13
  117. package/dist/esm/private/binary-format-proto2.d.ts +0 -2
  118. package/dist/esm/private/binary-format-proto2.js +0 -87
  119. package/dist/esm/private/binary-format-proto3.d.ts +0 -2
  120. package/dist/esm/private/binary-format-proto3.js +0 -79
  121. package/dist/esm/private/json-format-common.d.ts +0 -9
  122. package/dist/esm/private/json-format-proto2.d.ts +0 -2
  123. package/dist/esm/private/json-format-proto2.js +0 -99
  124. package/dist/esm/private/json-format-proto3.d.ts +0 -2
  125. package/dist/esm/private/json-format-proto3.js +0 -90
  126. package/dist/proxy/index.d.ts +0 -1
  127. package/dist/proxy/index.js +0 -1
@@ -1,5 +1,6 @@
1
1
  import type { EnumType } from "./enum.js";
2
2
  import type { MessageType } from "./message-type.js";
3
+ import type { LongType, ScalarType } from "./scalar.js";
3
4
  /**
4
5
  * FieldInfo describes a field of a protobuf message for runtime reflection. We
5
6
  * distinguish between the following kinds of fields:
@@ -16,6 +17,7 @@ import type { MessageType } from "./message-type.js";
16
17
  * - "localName": The name of the field as used in generated code.
17
18
  * - "jsonName": The name for JSON serialization / deserialization.
18
19
  * - "opt": Whether the field is optional.
20
+ * - "req": Whether the field is required (a legacy proto2 feature).
19
21
  * - "repeated": Whether the field is repeated.
20
22
  * - "packed": Whether the repeated field is packed.
21
23
  *
@@ -46,6 +48,7 @@ export interface OneofInfo {
46
48
  readonly repeated: false;
47
49
  readonly packed: false;
48
50
  readonly opt: false;
51
+ readonly req: false;
49
52
  readonly default: undefined;
50
53
  readonly delimited?: undefined;
51
54
  readonly fields: readonly FieldInfo[];
@@ -117,6 +120,10 @@ interface fiScalar extends fiShared {
117
120
  * Is the field optional?
118
121
  */
119
122
  readonly opt: boolean;
123
+ /**
124
+ * Is the field required? A legacy proto2 feature.
125
+ */
126
+ readonly req: boolean;
120
127
  /**
121
128
  * Only proto2: An explicit default value.
122
129
  */
@@ -143,6 +150,10 @@ interface fiMessage extends fiShared {
143
150
  * Is this repeated field packed? Never true for messages.
144
151
  */
145
152
  readonly packed: false;
153
+ /**
154
+ * Is the field required? A legacy proto2 feature.
155
+ */
156
+ readonly req: boolean;
146
157
  /**
147
158
  * An explicit default value (only proto2). Never set for messages.
148
159
  */
@@ -175,6 +186,10 @@ interface fiEnum extends fiShared {
175
186
  * Is the field optional?
176
187
  */
177
188
  readonly opt: boolean;
189
+ /**
190
+ * Is the field required? A legacy proto2 feature.
191
+ */
192
+ readonly req: boolean;
178
193
  /**
179
194
  * Only proto2: An explicit default value.
180
195
  */
@@ -230,32 +245,37 @@ interface fiMap extends fiShared {
230
245
  */
231
246
  readonly delimited?: undefined;
232
247
  }
233
- type fiRules<T> = Omit<T, "oneof" | "repeat" | "repeated" | "packed" | "opt"> & ({
248
+ type fiRules<T> = Omit<T, "oneof" | "repeat" | "repeated" | "packed" | "opt" | "req"> & ({
234
249
  readonly repeated: false;
235
250
  readonly packed: false;
236
251
  readonly opt: false;
252
+ readonly req: boolean;
237
253
  readonly oneof: undefined;
238
254
  } | {
239
255
  readonly repeated: false;
240
256
  readonly packed: false;
241
257
  readonly opt: true;
258
+ readonly req: false;
242
259
  readonly oneof: undefined;
243
260
  } | {
244
261
  readonly repeated: boolean;
245
262
  readonly packed: boolean;
246
263
  readonly opt: false;
264
+ readonly req: boolean;
247
265
  readonly oneof: undefined;
248
266
  } | {
249
267
  readonly repeated: false;
250
268
  readonly packed: false;
251
269
  readonly opt: false;
270
+ readonly req: false;
252
271
  readonly oneof: OneofInfo;
253
272
  });
254
- type fiPartialRules<T extends fiScalar | fiMap | fiEnum | fiMessage> = Omit<T, "jsonName" | "localName" | "oneof" | "repeat" | "repeated" | "packed" | "opt" | "default" | "L" | "delimited"> & ({
273
+ type fiPartialRules<T extends fiScalar | fiMap | fiEnum | fiMessage> = Omit<T, "jsonName" | "localName" | "oneof" | "repeat" | "repeated" | "packed" | "opt" | "req" | "default" | "L" | "delimited"> & ({
255
274
  readonly jsonName?: string;
256
275
  readonly repeated?: false;
257
276
  readonly packed?: false;
258
277
  readonly opt?: false;
278
+ readonly req?: boolean;
259
279
  readonly oneof?: undefined;
260
280
  default?: T["default"];
261
281
  L?: LongType;
@@ -265,6 +285,7 @@ type fiPartialRules<T extends fiScalar | fiMap | fiEnum | fiMessage> = Omit<T, "
265
285
  readonly repeated?: false;
266
286
  readonly packed?: false;
267
287
  readonly opt: true;
288
+ readonly req?: false;
268
289
  readonly oneof?: undefined;
269
290
  default?: T["default"];
270
291
  L?: LongType;
@@ -274,6 +295,7 @@ type fiPartialRules<T extends fiScalar | fiMap | fiEnum | fiMessage> = Omit<T, "
274
295
  readonly repeated?: boolean;
275
296
  readonly packed?: boolean;
276
297
  readonly opt?: false;
298
+ readonly req?: boolean;
277
299
  readonly oneof?: undefined;
278
300
  default?: T["default"];
279
301
  L?: LongType;
@@ -283,58 +305,10 @@ type fiPartialRules<T extends fiScalar | fiMap | fiEnum | fiMessage> = Omit<T, "
283
305
  readonly repeated?: false;
284
306
  readonly packed?: false;
285
307
  readonly opt?: false;
308
+ readonly req?: false;
286
309
  readonly oneof: string;
287
310
  default?: T["default"];
288
311
  L?: LongType;
289
312
  delimited?: boolean;
290
313
  });
291
- /**
292
- * Scalar value types. This is a subset of field types declared by protobuf
293
- * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE
294
- * are omitted, but the numerical values are identical.
295
- */
296
- export declare enum ScalarType {
297
- DOUBLE = 1,
298
- FLOAT = 2,
299
- INT64 = 3,
300
- UINT64 = 4,
301
- INT32 = 5,
302
- FIXED64 = 6,
303
- FIXED32 = 7,
304
- BOOL = 8,
305
- STRING = 9,
306
- BYTES = 12,
307
- UINT32 = 13,
308
- SFIXED32 = 15,
309
- SFIXED64 = 16,
310
- SINT32 = 17,// Uses ZigZag encoding.
311
- SINT64 = 18
312
- }
313
- /**
314
- * JavaScript representation of fields with 64 bit integral types (int64, uint64,
315
- * sint64, fixed64, sfixed64).
316
- *
317
- * This is a subset of google.protobuf.FieldOptions.JSType, which defines JS_NORMAL,
318
- * JS_STRING, and JS_NUMBER. Protobuf-ES uses BigInt by default, but will use
319
- * String if `[jstype = JS_STRING]` is specified.
320
- *
321
- * ```protobuf
322
- * uint64 field_a = 1; // BigInt
323
- * uint64 field_b = 2 [jstype = JS_NORMAL]; // BigInt
324
- * uint64 field_b = 2 [jstype = JS_NUMBER]; // BigInt
325
- * uint64 field_b = 2 [jstype = JS_STRING]; // String
326
- * ```
327
- */
328
- export declare enum LongType {
329
- /**
330
- * Use JavaScript BigInt.
331
- */
332
- BIGINT = 0,
333
- /**
334
- * Use JavaScript String.
335
- *
336
- * Field option `[jstype = JS_STRING]`.
337
- */
338
- STRING = 1
339
- }
340
314
  export {};
package/dist/cjs/field.js CHANGED
@@ -13,69 +13,3 @@
13
13
  // See the License for the specific language governing permissions and
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.LongType = exports.ScalarType = void 0;
17
- /**
18
- * Scalar value types. This is a subset of field types declared by protobuf
19
- * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE
20
- * are omitted, but the numerical values are identical.
21
- */
22
- var ScalarType;
23
- (function (ScalarType) {
24
- // 0 is reserved for errors.
25
- // Order is weird for historical reasons.
26
- ScalarType[ScalarType["DOUBLE"] = 1] = "DOUBLE";
27
- ScalarType[ScalarType["FLOAT"] = 2] = "FLOAT";
28
- // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
29
- // negative values are likely.
30
- ScalarType[ScalarType["INT64"] = 3] = "INT64";
31
- ScalarType[ScalarType["UINT64"] = 4] = "UINT64";
32
- // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
33
- // negative values are likely.
34
- ScalarType[ScalarType["INT32"] = 5] = "INT32";
35
- ScalarType[ScalarType["FIXED64"] = 6] = "FIXED64";
36
- ScalarType[ScalarType["FIXED32"] = 7] = "FIXED32";
37
- ScalarType[ScalarType["BOOL"] = 8] = "BOOL";
38
- ScalarType[ScalarType["STRING"] = 9] = "STRING";
39
- // Tag-delimited aggregate.
40
- // Group type is deprecated and not supported in proto3. However, Proto3
41
- // implementations should still be able to parse the group wire format and
42
- // treat group fields as unknown fields.
43
- // TYPE_GROUP = 10,
44
- // TYPE_MESSAGE = 11, // Length-delimited aggregate.
45
- // New in version 2.
46
- ScalarType[ScalarType["BYTES"] = 12] = "BYTES";
47
- ScalarType[ScalarType["UINT32"] = 13] = "UINT32";
48
- // TYPE_ENUM = 14,
49
- ScalarType[ScalarType["SFIXED32"] = 15] = "SFIXED32";
50
- ScalarType[ScalarType["SFIXED64"] = 16] = "SFIXED64";
51
- ScalarType[ScalarType["SINT32"] = 17] = "SINT32";
52
- ScalarType[ScalarType["SINT64"] = 18] = "SINT64";
53
- })(ScalarType || (exports.ScalarType = ScalarType = {}));
54
- /**
55
- * JavaScript representation of fields with 64 bit integral types (int64, uint64,
56
- * sint64, fixed64, sfixed64).
57
- *
58
- * This is a subset of google.protobuf.FieldOptions.JSType, which defines JS_NORMAL,
59
- * JS_STRING, and JS_NUMBER. Protobuf-ES uses BigInt by default, but will use
60
- * String if `[jstype = JS_STRING]` is specified.
61
- *
62
- * ```protobuf
63
- * uint64 field_a = 1; // BigInt
64
- * uint64 field_b = 2 [jstype = JS_NORMAL]; // BigInt
65
- * uint64 field_b = 2 [jstype = JS_NUMBER]; // BigInt
66
- * uint64 field_b = 2 [jstype = JS_STRING]; // String
67
- * ```
68
- */
69
- var LongType;
70
- (function (LongType) {
71
- /**
72
- * Use JavaScript BigInt.
73
- */
74
- LongType[LongType["BIGINT"] = 0] = "BIGINT";
75
- /**
76
- * Use JavaScript String.
77
- *
78
- * Field option `[jstype = JS_STRING]`.
79
- */
80
- LongType[LongType["STRING"] = 1] = "STRING";
81
- })(LongType || (exports.LongType = LongType = {}));
@@ -132,6 +132,24 @@ export declare class CodeGeneratorResponse extends Message<CodeGeneratorResponse
132
132
  * @generated from field: optional uint64 supported_features = 2;
133
133
  */
134
134
  supportedFeatures?: bigint;
135
+ /**
136
+ * The minimum edition this plugin supports. This will be treated as an
137
+ * Edition enum, but we want to allow unknown values. It should be specified
138
+ * according the edition enum value, *not* the edition number. Only takes
139
+ * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
140
+ *
141
+ * @generated from field: optional int32 minimum_edition = 3;
142
+ */
143
+ minimumEdition?: number;
144
+ /**
145
+ * The maximum edition this plugin supports. This will be treated as an
146
+ * Edition enum, but we want to allow unknown values. It should be specified
147
+ * according the edition enum value, *not* the edition number. Only takes
148
+ * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
149
+ *
150
+ * @generated from field: optional int32 maximum_edition = 4;
151
+ */
152
+ maximumEdition?: number;
135
153
  /**
136
154
  * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
137
155
  */
@@ -155,6 +155,8 @@ CodeGeneratorResponse.typeName = "google.protobuf.compiler.CodeGeneratorResponse
155
155
  CodeGeneratorResponse.fields = proto2_js_1.proto2.util.newFieldList(() => [
156
156
  { no: 1, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
157
157
  { no: 2, name: "supported_features", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true },
158
+ { no: 3, name: "minimum_edition", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
159
+ { no: 4, name: "maximum_edition", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
158
160
  { no: 15, name: "file", kind: "message", T: CodeGeneratorResponse_File, repeated: true },
159
161
  ]);
160
162
  /**
@@ -37,6 +37,10 @@ export declare enum Edition {
37
37
  * @generated from enum value: EDITION_2023 = 1000;
38
38
  */
39
39
  EDITION_2023 = 1000,
40
+ /**
41
+ * @generated from enum value: EDITION_2024 = 1001;
42
+ */
43
+ EDITION_2024 = 1001,
40
44
  /**
41
45
  * Placeholder editions for testing feature resolution. These should not be
42
46
  * used or relyed on outside of tests.
@@ -59,7 +63,15 @@ export declare enum Edition {
59
63
  /**
60
64
  * @generated from enum value: EDITION_99999_TEST_ONLY = 99999;
61
65
  */
62
- EDITION_99999_TEST_ONLY = 99999
66
+ EDITION_99999_TEST_ONLY = 99999,
67
+ /**
68
+ * Placeholder for specifying unbounded edition support. This should only
69
+ * ever be used by plugins that can expect to never require any changes to
70
+ * support a new edition.
71
+ *
72
+ * @generated from enum value: EDITION_MAX = 2147483647;
73
+ */
74
+ EDITION_MAX = 2147483647
63
75
  }
64
76
  /**
65
77
  * The protocol compiler can output a FileDescriptorSet containing the .proto
@@ -471,12 +483,12 @@ export declare class FieldDescriptorProto extends Message<FieldDescriptorProto>
471
483
  * If true, this is a proto3 "optional". When a proto3 field is optional, it
472
484
  * tracks presence regardless of field type.
473
485
  *
474
- * When proto3_optional is true, this field must be belong to a oneof to
475
- * signal to old proto3 clients that presence is tracked for this field. This
476
- * oneof is known as a "synthetic" oneof, and this field must be its sole
477
- * member (each proto3 optional field gets its own synthetic oneof). Synthetic
478
- * oneofs exist in the descriptor only, and do not generate any API. Synthetic
479
- * oneofs must be ordered after all "real" oneofs.
486
+ * When proto3_optional is true, this field must belong to a oneof to signal
487
+ * to old proto3 clients that presence is tracked for this field. This oneof
488
+ * is known as a "synthetic" oneof, and this field must be its sole member
489
+ * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs
490
+ * exist in the descriptor only, and do not generate any API. Synthetic oneofs
491
+ * must be ordered after all "real" oneofs.
480
492
  *
481
493
  * For message fields, proto3_optional doesn't create any semantic change,
482
494
  * since non-repeated message fields always track presence. However it still
@@ -911,10 +923,6 @@ export declare class FileOptions extends Message<FileOptions> {
911
923
  * @generated from field: optional bool py_generic_services = 18 [default = false];
912
924
  */
913
925
  pyGenericServices?: boolean;
914
- /**
915
- * @generated from field: optional bool php_generic_services = 42 [default = false];
916
- */
917
- phpGenericServices?: boolean;
918
926
  /**
919
927
  * Is this file deprecated?
920
928
  * Depending on the target platform, this can emit Deprecated annotations
@@ -1078,10 +1086,6 @@ export declare class MessageOptions extends Message<MessageOptions> {
1078
1086
  */
1079
1087
  deprecated?: boolean;
1080
1088
  /**
1081
- * NOTE: Do not set the option in .proto files. Always use the maps syntax
1082
- * instead. The option should only be implicitly set by the proto compiler
1083
- * parser.
1084
- *
1085
1089
  * Whether the message is an automatically generated map entry type for the
1086
1090
  * maps field.
1087
1091
  *
@@ -1100,6 +1104,10 @@ export declare class MessageOptions extends Message<MessageOptions> {
1100
1104
  * The reflection APIs in such implementations still need to work as
1101
1105
  * if the field is a repeated message field.
1102
1106
  *
1107
+ * NOTE: Do not set the option in .proto files. Always use the maps syntax
1108
+ * instead. The option should only be implicitly set by the proto compiler
1109
+ * parser.
1110
+ *
1103
1111
  * @generated from field: optional bool map_entry = 7;
1104
1112
  */
1105
1113
  mapEntry?: boolean;
@@ -1201,19 +1209,11 @@ export declare class FieldOptions extends Message<FieldOptions> {
1201
1209
  * call from multiple threads concurrently, while non-const methods continue
1202
1210
  * to require exclusive access.
1203
1211
  *
1204
- * Note that implementations may choose not to check required fields within
1205
- * a lazy sub-message. That is, calling IsInitialized() on the outer message
1206
- * may return true even if the inner message has missing required fields.
1207
- * This is necessary because otherwise the inner message would have to be
1208
- * parsed in order to perform the check, defeating the purpose of lazy
1209
- * parsing. An implementation which chooses not to check required fields
1210
- * must be consistent about it. That is, for any particular sub-message, the
1211
- * implementation must either *always* check its required fields, or *never*
1212
- * check its required fields, regardless of whether or not the message has
1213
- * been parsed.
1214
- *
1215
- * As of May 2022, lazy verifies the contents of the byte stream during
1216
- * parsing. An invalid byte stream will cause the overall parsing to fail.
1212
+ * Note that lazy message fields are still eagerly verified to check
1213
+ * ill-formed wireformat or missing required fields. Calling IsInitialized()
1214
+ * on the outer message would fail if the inner message has missing required
1215
+ * fields. Failed verification would result in parsing failure (except when
1216
+ * uninitialized messages are acceptable).
1217
1217
  *
1218
1218
  * @generated from field: optional bool lazy = 5 [default = false];
1219
1219
  */
@@ -1827,13 +1827,13 @@ export declare enum FeatureSet_Utf8Validation {
1827
1827
  */
1828
1828
  UTF8_VALIDATION_UNKNOWN = 0,
1829
1829
  /**
1830
- * @generated from enum value: NONE = 1;
1830
+ * @generated from enum value: VERIFY = 2;
1831
1831
  */
1832
- NONE = 1,
1832
+ VERIFY = 2,
1833
1833
  /**
1834
- * @generated from enum value: VERIFY = 2;
1834
+ * @generated from enum value: NONE = 3;
1835
1835
  */
1836
- VERIFY = 2
1836
+ NONE = 3
1837
1837
  }
1838
1838
  /**
1839
1839
  * @generated from enum google.protobuf.FeatureSet.MessageEncoding
@@ -2004,7 +2004,7 @@ export declare class SourceCodeInfo_Location extends Message<SourceCodeInfo_Loca
2004
2004
  * location.
2005
2005
  *
2006
2006
  * Each element is a field number or an index. They form a path from
2007
- * the root FileDescriptorProto to the place where the definition occurs.
2007
+ * the root FileDescriptorProto to the place where the definition appears.
2008
2008
  * For example, this path:
2009
2009
  * [ 4, 3, 2, 7, 1 ]
2010
2010
  * refers to:
@@ -21,7 +21,7 @@ exports.GeneratedCodeInfo_Annotation_Semantic = exports.GeneratedCodeInfo_Annota
21
21
  // The messages in this file describe the definitions found in .proto files.
22
22
  // A valid .proto file can be translated directly to a FileDescriptorProto
23
23
  // without any other information (e.g. without reading its imports).
24
- // @generated by protoc-gen-es v1.7.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
24
+ // @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
25
25
  // @generated from file google/protobuf/descriptor.proto (package google.protobuf, syntax proto2)
26
26
  /* eslint-disable */
27
27
  const proto2_js_1 = require("../../proto2.js");
@@ -60,6 +60,10 @@ var Edition;
60
60
  * @generated from enum value: EDITION_2023 = 1000;
61
61
  */
62
62
  Edition[Edition["EDITION_2023"] = 1000] = "EDITION_2023";
63
+ /**
64
+ * @generated from enum value: EDITION_2024 = 1001;
65
+ */
66
+ Edition[Edition["EDITION_2024"] = 1001] = "EDITION_2024";
63
67
  /**
64
68
  * Placeholder editions for testing feature resolution. These should not be
65
69
  * used or relyed on outside of tests.
@@ -83,6 +87,14 @@ var Edition;
83
87
  * @generated from enum value: EDITION_99999_TEST_ONLY = 99999;
84
88
  */
85
89
  Edition[Edition["EDITION_99999_TEST_ONLY"] = 99999] = "EDITION_99999_TEST_ONLY";
90
+ /**
91
+ * Placeholder for specifying unbounded edition support. This should only
92
+ * ever be used by plugins that can expect to never require any changes to
93
+ * support a new edition.
94
+ *
95
+ * @generated from enum value: EDITION_MAX = 2147483647;
96
+ */
97
+ Edition[Edition["EDITION_MAX"] = 2147483647] = "EDITION_MAX";
86
98
  })(Edition || (exports.Edition = Edition = {}));
87
99
  // Retrieve enum metadata with: proto2.getEnumType(Edition)
88
100
  proto2_js_1.proto2.util.setEnumType(Edition, "google.protobuf.Edition", [
@@ -90,11 +102,13 @@ proto2_js_1.proto2.util.setEnumType(Edition, "google.protobuf.Edition", [
90
102
  { no: 998, name: "EDITION_PROTO2" },
91
103
  { no: 999, name: "EDITION_PROTO3" },
92
104
  { no: 1000, name: "EDITION_2023" },
105
+ { no: 1001, name: "EDITION_2024" },
93
106
  { no: 1, name: "EDITION_1_TEST_ONLY" },
94
107
  { no: 2, name: "EDITION_2_TEST_ONLY" },
95
108
  { no: 99997, name: "EDITION_99997_TEST_ONLY" },
96
109
  { no: 99998, name: "EDITION_99998_TEST_ONLY" },
97
110
  { no: 99999, name: "EDITION_99999_TEST_ONLY" },
111
+ { no: 2147483647, name: "EDITION_MAX" },
98
112
  ]);
99
113
  /**
100
114
  * The protocol compiler can output a FileDescriptorSet containing the .proto
@@ -890,7 +904,6 @@ FileOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [
890
904
  { no: 16, name: "cc_generic_services", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
891
905
  { no: 17, name: "java_generic_services", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
892
906
  { no: 18, name: "py_generic_services", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
893
- { no: 42, name: "php_generic_services", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
894
907
  { no: 23, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
895
908
  { no: 31, name: "cc_enable_arenas", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: true },
896
909
  { no: 36, name: "objc_class_prefix", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
@@ -1497,8 +1510,8 @@ exports.UninterpretedOption_NamePart = UninterpretedOption_NamePart;
1497
1510
  UninterpretedOption_NamePart.runtime = proto2_js_1.proto2;
1498
1511
  UninterpretedOption_NamePart.typeName = "google.protobuf.UninterpretedOption.NamePart";
1499
1512
  UninterpretedOption_NamePart.fields = proto2_js_1.proto2.util.newFieldList(() => [
1500
- { no: 1, name: "name_part", kind: "scalar", T: 9 /* ScalarType.STRING */ },
1501
- { no: 2, name: "is_extension", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
1513
+ { no: 1, name: "name_part", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true },
1514
+ { no: 2, name: "is_extension", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true },
1502
1515
  ]);
1503
1516
  /**
1504
1517
  * TODO Enums in C++ gencode (and potentially other languages) are
@@ -1625,20 +1638,20 @@ var FeatureSet_Utf8Validation;
1625
1638
  * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0;
1626
1639
  */
1627
1640
  FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["UTF8_VALIDATION_UNKNOWN"] = 0] = "UTF8_VALIDATION_UNKNOWN";
1628
- /**
1629
- * @generated from enum value: NONE = 1;
1630
- */
1631
- FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["NONE"] = 1] = "NONE";
1632
1641
  /**
1633
1642
  * @generated from enum value: VERIFY = 2;
1634
1643
  */
1635
1644
  FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["VERIFY"] = 2] = "VERIFY";
1645
+ /**
1646
+ * @generated from enum value: NONE = 3;
1647
+ */
1648
+ FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["NONE"] = 3] = "NONE";
1636
1649
  })(FeatureSet_Utf8Validation || (exports.FeatureSet_Utf8Validation = FeatureSet_Utf8Validation = {}));
1637
1650
  // Retrieve enum metadata with: proto2.getEnumType(FeatureSet_Utf8Validation)
1638
1651
  proto2_js_1.proto2.util.setEnumType(FeatureSet_Utf8Validation, "google.protobuf.FeatureSet.Utf8Validation", [
1639
1652
  { no: 0, name: "UTF8_VALIDATION_UNKNOWN" },
1640
- { no: 1, name: "NONE" },
1641
1653
  { no: 2, name: "VERIFY" },
1654
+ { no: 3, name: "NONE" },
1642
1655
  ]);
1643
1656
  /**
1644
1657
  * @generated from enum google.protobuf.FeatureSet.MessageEncoding
@@ -1848,7 +1861,7 @@ class SourceCodeInfo_Location extends message_js_1.Message {
1848
1861
  * location.
1849
1862
  *
1850
1863
  * Each element is a field number or an index. They form a path from
1851
- * the root FileDescriptorProto to the place where the definition occurs.
1864
+ * the root FileDescriptorProto to the place where the definition appears.
1852
1865
  * For example, this path:
1853
1866
  * [ 4, 3, 2, 7, 1 ]
1854
1867
  * refers to:
@@ -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
- // @generated by protoc-gen-es v1.7.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
17
+ // @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
18
18
  // @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)
19
19
  /* eslint-disable */
20
20
  const proto3_js_1 = require("../../proto3.js");
@@ -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
- // @generated by protoc-gen-es v1.7.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
17
+ // @generated by protoc-gen-es v1.9.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
18
18
  // @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
19
19
  /* eslint-disable */
20
20
  const proto3_js_1 = require("../../proto3.js");
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.BytesValue = exports.StringValue = exports.BoolValue = exports.UInt32Value = exports.Int32Value = exports.UInt64Value = exports.Int64Value = exports.FloatValue = exports.DoubleValue = void 0;
17
17
  const message_js_1 = require("../../message.js");
18
18
  const proto3_js_1 = require("../../proto3.js");
19
- const field_js_1 = require("../../field.js");
19
+ const scalar_js_1 = require("../../scalar.js");
20
20
  const proto_int64_js_1 = require("../../proto-int64.js");
21
21
  /**
22
22
  * Wrapper message for `double`.
@@ -37,11 +37,11 @@ class DoubleValue extends message_js_1.Message {
37
37
  proto3_js_1.proto3.util.initPartial(data, this);
38
38
  }
39
39
  toJson(options) {
40
- return proto3_js_1.proto3.json.writeScalar(field_js_1.ScalarType.DOUBLE, this.value, true);
40
+ return proto3_js_1.proto3.json.writeScalar(scalar_js_1.ScalarType.DOUBLE, this.value, true);
41
41
  }
42
42
  fromJson(json, options) {
43
43
  try {
44
- this.value = proto3_js_1.proto3.json.readScalar(field_js_1.ScalarType.DOUBLE, json);
44
+ this.value = proto3_js_1.proto3.json.readScalar(scalar_js_1.ScalarType.DOUBLE, json);
45
45
  }
46
46
  catch (e) {
47
47
  let m = `cannot decode message google.protobuf.DoubleValue from JSON"`;
@@ -98,11 +98,11 @@ class FloatValue extends message_js_1.Message {
98
98
  proto3_js_1.proto3.util.initPartial(data, this);
99
99
  }
100
100
  toJson(options) {
101
- return proto3_js_1.proto3.json.writeScalar(field_js_1.ScalarType.FLOAT, this.value, true);
101
+ return proto3_js_1.proto3.json.writeScalar(scalar_js_1.ScalarType.FLOAT, this.value, true);
102
102
  }
103
103
  fromJson(json, options) {
104
104
  try {
105
- this.value = proto3_js_1.proto3.json.readScalar(field_js_1.ScalarType.FLOAT, json);
105
+ this.value = proto3_js_1.proto3.json.readScalar(scalar_js_1.ScalarType.FLOAT, json);
106
106
  }
107
107
  catch (e) {
108
108
  let m = `cannot decode message google.protobuf.FloatValue from JSON"`;
@@ -159,11 +159,11 @@ class Int64Value extends message_js_1.Message {
159
159
  proto3_js_1.proto3.util.initPartial(data, this);
160
160
  }
161
161
  toJson(options) {
162
- return proto3_js_1.proto3.json.writeScalar(field_js_1.ScalarType.INT64, this.value, true);
162
+ return proto3_js_1.proto3.json.writeScalar(scalar_js_1.ScalarType.INT64, this.value, true);
163
163
  }
164
164
  fromJson(json, options) {
165
165
  try {
166
- this.value = proto3_js_1.proto3.json.readScalar(field_js_1.ScalarType.INT64, json);
166
+ this.value = proto3_js_1.proto3.json.readScalar(scalar_js_1.ScalarType.INT64, json);
167
167
  }
168
168
  catch (e) {
169
169
  let m = `cannot decode message google.protobuf.Int64Value from JSON"`;
@@ -220,11 +220,11 @@ class UInt64Value extends message_js_1.Message {
220
220
  proto3_js_1.proto3.util.initPartial(data, this);
221
221
  }
222
222
  toJson(options) {
223
- return proto3_js_1.proto3.json.writeScalar(field_js_1.ScalarType.UINT64, this.value, true);
223
+ return proto3_js_1.proto3.json.writeScalar(scalar_js_1.ScalarType.UINT64, this.value, true);
224
224
  }
225
225
  fromJson(json, options) {
226
226
  try {
227
- this.value = proto3_js_1.proto3.json.readScalar(field_js_1.ScalarType.UINT64, json);
227
+ this.value = proto3_js_1.proto3.json.readScalar(scalar_js_1.ScalarType.UINT64, json);
228
228
  }
229
229
  catch (e) {
230
230
  let m = `cannot decode message google.protobuf.UInt64Value from JSON"`;
@@ -281,11 +281,11 @@ class Int32Value extends message_js_1.Message {
281
281
  proto3_js_1.proto3.util.initPartial(data, this);
282
282
  }
283
283
  toJson(options) {
284
- return proto3_js_1.proto3.json.writeScalar(field_js_1.ScalarType.INT32, this.value, true);
284
+ return proto3_js_1.proto3.json.writeScalar(scalar_js_1.ScalarType.INT32, this.value, true);
285
285
  }
286
286
  fromJson(json, options) {
287
287
  try {
288
- this.value = proto3_js_1.proto3.json.readScalar(field_js_1.ScalarType.INT32, json);
288
+ this.value = proto3_js_1.proto3.json.readScalar(scalar_js_1.ScalarType.INT32, json);
289
289
  }
290
290
  catch (e) {
291
291
  let m = `cannot decode message google.protobuf.Int32Value from JSON"`;
@@ -342,11 +342,11 @@ class UInt32Value extends message_js_1.Message {
342
342
  proto3_js_1.proto3.util.initPartial(data, this);
343
343
  }
344
344
  toJson(options) {
345
- return proto3_js_1.proto3.json.writeScalar(field_js_1.ScalarType.UINT32, this.value, true);
345
+ return proto3_js_1.proto3.json.writeScalar(scalar_js_1.ScalarType.UINT32, this.value, true);
346
346
  }
347
347
  fromJson(json, options) {
348
348
  try {
349
- this.value = proto3_js_1.proto3.json.readScalar(field_js_1.ScalarType.UINT32, json);
349
+ this.value = proto3_js_1.proto3.json.readScalar(scalar_js_1.ScalarType.UINT32, json);
350
350
  }
351
351
  catch (e) {
352
352
  let m = `cannot decode message google.protobuf.UInt32Value from JSON"`;
@@ -403,11 +403,11 @@ class BoolValue extends message_js_1.Message {
403
403
  proto3_js_1.proto3.util.initPartial(data, this);
404
404
  }
405
405
  toJson(options) {
406
- return proto3_js_1.proto3.json.writeScalar(field_js_1.ScalarType.BOOL, this.value, true);
406
+ return proto3_js_1.proto3.json.writeScalar(scalar_js_1.ScalarType.BOOL, this.value, true);
407
407
  }
408
408
  fromJson(json, options) {
409
409
  try {
410
- this.value = proto3_js_1.proto3.json.readScalar(field_js_1.ScalarType.BOOL, json);
410
+ this.value = proto3_js_1.proto3.json.readScalar(scalar_js_1.ScalarType.BOOL, json);
411
411
  }
412
412
  catch (e) {
413
413
  let m = `cannot decode message google.protobuf.BoolValue from JSON"`;
@@ -464,11 +464,11 @@ class StringValue extends message_js_1.Message {
464
464
  proto3_js_1.proto3.util.initPartial(data, this);
465
465
  }
466
466
  toJson(options) {
467
- return proto3_js_1.proto3.json.writeScalar(field_js_1.ScalarType.STRING, this.value, true);
467
+ return proto3_js_1.proto3.json.writeScalar(scalar_js_1.ScalarType.STRING, this.value, true);
468
468
  }
469
469
  fromJson(json, options) {
470
470
  try {
471
- this.value = proto3_js_1.proto3.json.readScalar(field_js_1.ScalarType.STRING, json);
471
+ this.value = proto3_js_1.proto3.json.readScalar(scalar_js_1.ScalarType.STRING, json);
472
472
  }
473
473
  catch (e) {
474
474
  let m = `cannot decode message google.protobuf.StringValue from JSON"`;
@@ -525,11 +525,11 @@ class BytesValue extends message_js_1.Message {
525
525
  proto3_js_1.proto3.util.initPartial(data, this);
526
526
  }
527
527
  toJson(options) {
528
- return proto3_js_1.proto3.json.writeScalar(field_js_1.ScalarType.BYTES, this.value, true);
528
+ return proto3_js_1.proto3.json.writeScalar(scalar_js_1.ScalarType.BYTES, this.value, true);
529
529
  }
530
530
  fromJson(json, options) {
531
531
  try {
532
- this.value = proto3_js_1.proto3.json.readScalar(field_js_1.ScalarType.BYTES, json);
532
+ this.value = proto3_js_1.proto3.json.readScalar(scalar_js_1.ScalarType.BYTES, json);
533
533
  }
534
534
  catch (e) {
535
535
  let m = `cannot decode message google.protobuf.BytesValue from JSON"`;