@bufbuild/protobuf 2.2.3 → 2.2.5

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/clone.js +1 -1
  2. package/dist/cjs/codegenv1/boot.js +1 -1
  3. package/dist/cjs/codegenv1/embed.js +1 -1
  4. package/dist/cjs/codegenv1/enum.js +1 -1
  5. package/dist/cjs/codegenv1/extension.js +1 -1
  6. package/dist/cjs/codegenv1/file.js +1 -1
  7. package/dist/cjs/codegenv1/index.js +1 -1
  8. package/dist/cjs/codegenv1/message.js +1 -1
  9. package/dist/cjs/codegenv1/restore-json-names.js +1 -1
  10. package/dist/cjs/codegenv1/scalar.js +1 -1
  11. package/dist/cjs/codegenv1/service.js +1 -1
  12. package/dist/cjs/codegenv1/symbols.js +1 -1
  13. package/dist/cjs/codegenv1/types.js +1 -1
  14. package/dist/cjs/create.js +1 -1
  15. package/dist/cjs/descriptors.js +1 -1
  16. package/dist/cjs/equals.js +1 -1
  17. package/dist/cjs/extensions.js +3 -3
  18. package/dist/cjs/fields.js +1 -1
  19. package/dist/cjs/from-binary.js +1 -1
  20. package/dist/cjs/from-json.js +2 -2
  21. package/dist/cjs/index.js +1 -1
  22. package/dist/cjs/is-message.js +1 -1
  23. package/dist/cjs/json-value.js +1 -1
  24. package/dist/cjs/proto-int64.js +1 -1
  25. package/dist/cjs/reflect/error.js +1 -1
  26. package/dist/cjs/reflect/guard.js +1 -1
  27. package/dist/cjs/reflect/index.js +1 -1
  28. package/dist/cjs/reflect/names.js +1 -1
  29. package/dist/cjs/reflect/nested-types.js +1 -1
  30. package/dist/cjs/reflect/reflect-check.js +23 -23
  31. package/dist/cjs/reflect/reflect-types.js +1 -1
  32. package/dist/cjs/reflect/reflect.js +1 -1
  33. package/dist/cjs/reflect/scalar.js +1 -1
  34. package/dist/cjs/reflect/unsafe.js +1 -1
  35. package/dist/cjs/registry.js +5 -2
  36. package/dist/cjs/to-binary.js +63 -55
  37. package/dist/cjs/to-json.js +1 -1
  38. package/dist/cjs/types.js +1 -1
  39. package/dist/cjs/wire/base64-encoding.js +1 -1
  40. package/dist/cjs/wire/binary-encoding.js +1 -1
  41. package/dist/cjs/wire/index.js +1 -1
  42. package/dist/cjs/wire/size-delimited.js +1 -1
  43. package/dist/cjs/wire/text-encoding.js +1 -1
  44. package/dist/cjs/wire/text-format.js +1 -1
  45. package/dist/cjs/wkt/any.js +1 -1
  46. package/dist/cjs/wkt/gen/google/protobuf/any_pb.js +1 -1
  47. package/dist/cjs/wkt/gen/google/protobuf/api_pb.d.ts +2 -2
  48. package/dist/cjs/wkt/gen/google/protobuf/api_pb.js +1 -1
  49. package/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +1 -1
  50. package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.d.ts +96 -9
  51. package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.js +27 -8
  52. package/dist/cjs/wkt/gen/google/protobuf/duration_pb.js +1 -1
  53. package/dist/cjs/wkt/gen/google/protobuf/empty_pb.js +1 -1
  54. package/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.js +1 -1
  55. package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.js +1 -1
  56. package/dist/cjs/wkt/gen/google/protobuf/struct_pb.js +1 -1
  57. package/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.js +1 -1
  58. package/dist/cjs/wkt/gen/google/protobuf/type_pb.js +1 -1
  59. package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.d.ts +54 -0
  60. package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.js +1 -1
  61. package/dist/cjs/wkt/index.js +1 -1
  62. package/dist/cjs/wkt/timestamp.js +4 -3
  63. package/dist/cjs/wkt/wrappers.js +1 -1
  64. package/dist/esm/clone.js +1 -1
  65. package/dist/esm/codegenv1/boot.js +1 -1
  66. package/dist/esm/codegenv1/embed.js +1 -1
  67. package/dist/esm/codegenv1/enum.js +1 -1
  68. package/dist/esm/codegenv1/extension.js +1 -1
  69. package/dist/esm/codegenv1/file.js +1 -1
  70. package/dist/esm/codegenv1/index.js +1 -1
  71. package/dist/esm/codegenv1/message.js +1 -1
  72. package/dist/esm/codegenv1/restore-json-names.js +1 -1
  73. package/dist/esm/codegenv1/scalar.js +1 -1
  74. package/dist/esm/codegenv1/service.js +1 -1
  75. package/dist/esm/codegenv1/symbols.js +1 -1
  76. package/dist/esm/codegenv1/types.js +1 -1
  77. package/dist/esm/create.js +1 -1
  78. package/dist/esm/descriptors.js +1 -1
  79. package/dist/esm/equals.js +1 -1
  80. package/dist/esm/extensions.js +3 -3
  81. package/dist/esm/fields.js +1 -1
  82. package/dist/esm/from-binary.js +1 -1
  83. package/dist/esm/from-json.js +2 -2
  84. package/dist/esm/index.js +1 -1
  85. package/dist/esm/is-message.js +1 -1
  86. package/dist/esm/json-value.js +1 -1
  87. package/dist/esm/proto-int64.js +1 -1
  88. package/dist/esm/reflect/error.js +1 -1
  89. package/dist/esm/reflect/guard.js +1 -1
  90. package/dist/esm/reflect/index.js +1 -1
  91. package/dist/esm/reflect/names.js +1 -1
  92. package/dist/esm/reflect/nested-types.js +1 -1
  93. package/dist/esm/reflect/reflect-check.js +23 -23
  94. package/dist/esm/reflect/reflect-types.js +1 -1
  95. package/dist/esm/reflect/reflect.js +1 -1
  96. package/dist/esm/reflect/scalar.js +1 -1
  97. package/dist/esm/reflect/unsafe.js +1 -1
  98. package/dist/esm/registry.js +5 -2
  99. package/dist/esm/to-binary.js +63 -55
  100. package/dist/esm/to-json.js +1 -1
  101. package/dist/esm/types.js +1 -1
  102. package/dist/esm/wire/base64-encoding.js +1 -1
  103. package/dist/esm/wire/binary-encoding.js +1 -1
  104. package/dist/esm/wire/index.js +1 -1
  105. package/dist/esm/wire/size-delimited.js +1 -1
  106. package/dist/esm/wire/text-encoding.js +1 -1
  107. package/dist/esm/wire/text-format.js +1 -1
  108. package/dist/esm/wkt/any.js +1 -1
  109. package/dist/esm/wkt/gen/google/protobuf/any_pb.js +1 -1
  110. package/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts +2 -2
  111. package/dist/esm/wkt/gen/google/protobuf/api_pb.js +1 -1
  112. package/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +1 -1
  113. package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts +96 -9
  114. package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +26 -7
  115. package/dist/esm/wkt/gen/google/protobuf/duration_pb.js +1 -1
  116. package/dist/esm/wkt/gen/google/protobuf/empty_pb.js +1 -1
  117. package/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +1 -1
  118. package/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +1 -1
  119. package/dist/esm/wkt/gen/google/protobuf/struct_pb.js +1 -1
  120. package/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +1 -1
  121. package/dist/esm/wkt/gen/google/protobuf/type_pb.js +1 -1
  122. package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts +54 -0
  123. package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +1 -1
  124. package/dist/esm/wkt/index.js +1 -1
  125. package/dist/esm/wkt/timestamp.js +4 -3
  126. package/dist/esm/wkt/wrappers.js +1 -1
  127. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2024 Buf Technologies, Inc.
2
+ // Copyright 2021-2025 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2024 Buf Technologies, Inc.
2
+ // Copyright 2021-2025 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2024 Buf Technologies, Inc.
2
+ // Copyright 2021-2025 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -9,6 +9,9 @@ export declare const file_google_protobuf_wrappers: GenFile;
9
9
  *
10
10
  * The JSON representation for `DoubleValue` is JSON number.
11
11
  *
12
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
13
+ * has no plan to be removed.
14
+ *
12
15
  * @generated from message google.protobuf.DoubleValue
13
16
  */
14
17
  export type DoubleValue = Message<"google.protobuf.DoubleValue"> & {
@@ -24,6 +27,9 @@ export type DoubleValue = Message<"google.protobuf.DoubleValue"> & {
24
27
  *
25
28
  * The JSON representation for `DoubleValue` is JSON number.
26
29
  *
30
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
31
+ * has no plan to be removed.
32
+ *
27
33
  * @generated from message google.protobuf.DoubleValue
28
34
  */
29
35
  export type DoubleValueJson = number | "NaN" | "Infinity" | "-Infinity";
@@ -37,6 +43,9 @@ export declare const DoubleValueSchema: GenMessage<DoubleValue, DoubleValueJson>
37
43
  *
38
44
  * The JSON representation for `FloatValue` is JSON number.
39
45
  *
46
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
47
+ * has no plan to be removed.
48
+ *
40
49
  * @generated from message google.protobuf.FloatValue
41
50
  */
42
51
  export type FloatValue = Message<"google.protobuf.FloatValue"> & {
@@ -52,6 +61,9 @@ export type FloatValue = Message<"google.protobuf.FloatValue"> & {
52
61
  *
53
62
  * The JSON representation for `FloatValue` is JSON number.
54
63
  *
64
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
65
+ * has no plan to be removed.
66
+ *
55
67
  * @generated from message google.protobuf.FloatValue
56
68
  */
57
69
  export type FloatValueJson = number | "NaN" | "Infinity" | "-Infinity";
@@ -65,6 +77,9 @@ export declare const FloatValueSchema: GenMessage<FloatValue, FloatValueJson>;
65
77
  *
66
78
  * The JSON representation for `Int64Value` is JSON string.
67
79
  *
80
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
81
+ * has no plan to be removed.
82
+ *
68
83
  * @generated from message google.protobuf.Int64Value
69
84
  */
70
85
  export type Int64Value = Message<"google.protobuf.Int64Value"> & {
@@ -80,6 +95,9 @@ export type Int64Value = Message<"google.protobuf.Int64Value"> & {
80
95
  *
81
96
  * The JSON representation for `Int64Value` is JSON string.
82
97
  *
98
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
99
+ * has no plan to be removed.
100
+ *
83
101
  * @generated from message google.protobuf.Int64Value
84
102
  */
85
103
  export type Int64ValueJson = string;
@@ -93,6 +111,9 @@ export declare const Int64ValueSchema: GenMessage<Int64Value, Int64ValueJson>;
93
111
  *
94
112
  * The JSON representation for `UInt64Value` is JSON string.
95
113
  *
114
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
115
+ * has no plan to be removed.
116
+ *
96
117
  * @generated from message google.protobuf.UInt64Value
97
118
  */
98
119
  export type UInt64Value = Message<"google.protobuf.UInt64Value"> & {
@@ -108,6 +129,9 @@ export type UInt64Value = Message<"google.protobuf.UInt64Value"> & {
108
129
  *
109
130
  * The JSON representation for `UInt64Value` is JSON string.
110
131
  *
132
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
133
+ * has no plan to be removed.
134
+ *
111
135
  * @generated from message google.protobuf.UInt64Value
112
136
  */
113
137
  export type UInt64ValueJson = string;
@@ -121,6 +145,9 @@ export declare const UInt64ValueSchema: GenMessage<UInt64Value, UInt64ValueJson>
121
145
  *
122
146
  * The JSON representation for `Int32Value` is JSON number.
123
147
  *
148
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
149
+ * has no plan to be removed.
150
+ *
124
151
  * @generated from message google.protobuf.Int32Value
125
152
  */
126
153
  export type Int32Value = Message<"google.protobuf.Int32Value"> & {
@@ -136,6 +163,9 @@ export type Int32Value = Message<"google.protobuf.Int32Value"> & {
136
163
  *
137
164
  * The JSON representation for `Int32Value` is JSON number.
138
165
  *
166
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
167
+ * has no plan to be removed.
168
+ *
139
169
  * @generated from message google.protobuf.Int32Value
140
170
  */
141
171
  export type Int32ValueJson = number;
@@ -149,6 +179,9 @@ export declare const Int32ValueSchema: GenMessage<Int32Value, Int32ValueJson>;
149
179
  *
150
180
  * The JSON representation for `UInt32Value` is JSON number.
151
181
  *
182
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
183
+ * has no plan to be removed.
184
+ *
152
185
  * @generated from message google.protobuf.UInt32Value
153
186
  */
154
187
  export type UInt32Value = Message<"google.protobuf.UInt32Value"> & {
@@ -164,6 +197,9 @@ export type UInt32Value = Message<"google.protobuf.UInt32Value"> & {
164
197
  *
165
198
  * The JSON representation for `UInt32Value` is JSON number.
166
199
  *
200
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
201
+ * has no plan to be removed.
202
+ *
167
203
  * @generated from message google.protobuf.UInt32Value
168
204
  */
169
205
  export type UInt32ValueJson = number;
@@ -177,6 +213,9 @@ export declare const UInt32ValueSchema: GenMessage<UInt32Value, UInt32ValueJson>
177
213
  *
178
214
  * The JSON representation for `BoolValue` is JSON `true` and `false`.
179
215
  *
216
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
217
+ * has no plan to be removed.
218
+ *
180
219
  * @generated from message google.protobuf.BoolValue
181
220
  */
182
221
  export type BoolValue = Message<"google.protobuf.BoolValue"> & {
@@ -192,6 +231,9 @@ export type BoolValue = Message<"google.protobuf.BoolValue"> & {
192
231
  *
193
232
  * The JSON representation for `BoolValue` is JSON `true` and `false`.
194
233
  *
234
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
235
+ * has no plan to be removed.
236
+ *
195
237
  * @generated from message google.protobuf.BoolValue
196
238
  */
197
239
  export type BoolValueJson = boolean;
@@ -205,6 +247,9 @@ export declare const BoolValueSchema: GenMessage<BoolValue, BoolValueJson>;
205
247
  *
206
248
  * The JSON representation for `StringValue` is JSON string.
207
249
  *
250
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
251
+ * has no plan to be removed.
252
+ *
208
253
  * @generated from message google.protobuf.StringValue
209
254
  */
210
255
  export type StringValue = Message<"google.protobuf.StringValue"> & {
@@ -220,6 +265,9 @@ export type StringValue = Message<"google.protobuf.StringValue"> & {
220
265
  *
221
266
  * The JSON representation for `StringValue` is JSON string.
222
267
  *
268
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
269
+ * has no plan to be removed.
270
+ *
223
271
  * @generated from message google.protobuf.StringValue
224
272
  */
225
273
  export type StringValueJson = string;
@@ -233,6 +281,9 @@ export declare const StringValueSchema: GenMessage<StringValue, StringValueJson>
233
281
  *
234
282
  * The JSON representation for `BytesValue` is JSON string.
235
283
  *
284
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
285
+ * has no plan to be removed.
286
+ *
236
287
  * @generated from message google.protobuf.BytesValue
237
288
  */
238
289
  export type BytesValue = Message<"google.protobuf.BytesValue"> & {
@@ -248,6 +299,9 @@ export type BytesValue = Message<"google.protobuf.BytesValue"> & {
248
299
  *
249
300
  * The JSON representation for `BytesValue` is JSON string.
250
301
  *
302
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
303
+ * has no plan to be removed.
304
+ *
251
305
  * @generated from message google.protobuf.BytesValue
252
306
  */
253
307
  export type BytesValueJson = string;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2024 Buf Technologies, Inc.
2
+ // Copyright 2021-2025 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2024 Buf Technologies, Inc.
2
+ // Copyright 2021-2025 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2024 Buf Technologies, Inc.
2
+ // Copyright 2021-2025 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -43,9 +43,10 @@ function timestampDate(timestamp) {
43
43
  * Create a google.protobuf.Timestamp message from a Unix timestamp in milliseconds.
44
44
  */
45
45
  function timestampFromMs(timestampMs) {
46
+ const seconds = Math.floor(timestampMs / 1000);
46
47
  return (0, create_js_1.create)(timestamp_pb_js_1.TimestampSchema, {
47
- seconds: proto_int64_js_1.protoInt64.parse(Math.floor(timestampMs / 1000)),
48
- nanos: (timestampMs % 1000) * 1000000,
48
+ seconds: proto_int64_js_1.protoInt64.parse(seconds),
49
+ nanos: (timestampMs - seconds * 1000) * 1000000,
49
50
  });
50
51
  }
51
52
  /**
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021-2024 Buf Technologies, Inc.
2
+ // Copyright 2021-2025 Buf Technologies, Inc.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
package/dist/esm/clone.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ export function getExtension(message, extension) {
38
38
  const [container, field, get] = createExtensionContainer(extension);
39
39
  for (const uf of ufs) {
40
40
  readField(container, new BinaryReader(uf.data), field, uf.wireType, {
41
- readUnknownFields: false,
41
+ readUnknownFields: true,
42
42
  });
43
43
  }
44
44
  return get();
@@ -55,7 +55,7 @@ export function setExtension(message, extension, value) {
55
55
  const ufs = ((_a = message.$unknown) !== null && _a !== void 0 ? _a : []).filter((uf) => uf.no !== extension.number);
56
56
  const [container, field] = createExtensionContainer(extension, value);
57
57
  const writer = new BinaryWriter();
58
- writeField(writer, { writeUnknownFields: false }, container, field);
58
+ writeField(writer, { writeUnknownFields: true }, container, field);
59
59
  const reader = new BinaryReader(writer.finish());
60
60
  while (reader.pos < reader.len) {
61
61
  const [no, wireType] = reader.tag();
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -503,7 +503,7 @@ function timestampFromJson(timestamp, json) {
503
503
  if (typeof json !== "string") {
504
504
  throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: ${formatVal(json)}`);
505
505
  }
506
- 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]))$/);
506
+ const matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);
507
507
  if (!matches) {
508
508
  throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`);
509
509
  }
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -129,33 +129,33 @@ function checkScalarValue(value, scalar) {
129
129
  case ScalarType.SFIXED64:
130
130
  case ScalarType.SINT64:
131
131
  // signed
132
- if (typeof value != "string" &&
133
- typeof value !== "bigint" &&
134
- typeof value !== "number") {
135
- return false;
136
- }
137
- try {
138
- protoInt64.parse(value);
132
+ if (typeof value == "bigint" ||
133
+ typeof value == "number" ||
134
+ (typeof value == "string" && value.length > 0)) {
135
+ try {
136
+ protoInt64.parse(value);
137
+ return true;
138
+ }
139
+ catch (e) {
140
+ return `${value} out of range`;
141
+ }
139
142
  }
140
- catch (e) {
141
- return `${value} out of range`;
142
- }
143
- return true;
143
+ return false;
144
144
  case ScalarType.FIXED64:
145
145
  case ScalarType.UINT64:
146
146
  // unsigned
147
- if (typeof value != "string" &&
148
- typeof value !== "bigint" &&
149
- typeof value !== "number") {
150
- return false;
151
- }
152
- try {
153
- protoInt64.uParse(value);
147
+ if (typeof value == "bigint" ||
148
+ typeof value == "number" ||
149
+ (typeof value == "string" && value.length > 0)) {
150
+ try {
151
+ protoInt64.uParse(value);
152
+ return true;
153
+ }
154
+ catch (e) {
155
+ return `${value} out of range`;
156
+ }
154
157
  }
155
- catch (e) {
156
- return `${value} out of range`;
157
- }
158
- return true;
158
+ return false;
159
159
  }
160
160
  }
161
161
  function reasonSingular(field, val, details) {
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Buf Technologies, Inc.
1
+ // Copyright 2021-2025 Buf Technologies, Inc.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -224,7 +224,7 @@ const DELIMITED = 2;
224
224
  const OPEN = 1;
225
225
  // prettier-ignore
226
226
  // bootstrap-inject defaults: EDITION_PROTO2 to EDITION_2023: export const minimumEdition: SupportedEdition = $minimumEdition, maximumEdition: SupportedEdition = $maximumEdition;
227
- // generated from protoc v28.3
227
+ // generated from protoc v30.0
228
228
  export const minimumEdition = 998, maximumEdition = 1000;
229
229
  const featureDefaults = {
230
230
  // EDITION_PROTO2
@@ -235,6 +235,7 @@ const featureDefaults = {
235
235
  utf8Validation: 3, // NONE,
236
236
  messageEncoding: 1, // LENGTH_PREFIXED,
237
237
  jsonFormat: 2, // LEGACY_BEST_EFFORT,
238
+ enforceNamingStyle: 2, // STYLE_LEGACY,
238
239
  },
239
240
  // EDITION_PROTO3
240
241
  999: {
@@ -244,6 +245,7 @@ const featureDefaults = {
244
245
  utf8Validation: 2, // VERIFY,
245
246
  messageEncoding: 1, // LENGTH_PREFIXED,
246
247
  jsonFormat: 1, // ALLOW,
248
+ enforceNamingStyle: 2, // STYLE_LEGACY,
247
249
  },
248
250
  // EDITION_2023
249
251
  1000: {
@@ -253,6 +255,7 @@ const featureDefaults = {
253
255
  utf8Validation: 2, // VERIFY,
254
256
  messageEncoding: 1, // LENGTH_PREFIXED,
255
257
  jsonFormat: 1, // ALLOW,
258
+ enforceNamingStyle: 2, // STYLE_LEGACY,
256
259
  },
257
260
  };
258
261
  /**