@bufbuild/protobuf 0.0.1 → 0.0.2-alpha.1

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 (108) hide show
  1. package/README.md +1 -21
  2. package/dist/cjs/binary-encoding.js +21 -8
  3. package/dist/cjs/binary-format.js +13 -0
  4. package/dist/cjs/descriptor-registry.js +13 -0
  5. package/dist/cjs/descriptor-set.js +13 -0
  6. package/dist/cjs/enum.js +13 -0
  7. package/dist/cjs/field-list.js +13 -0
  8. package/dist/cjs/field.js +13 -0
  9. package/dist/cjs/google/protobuf/any_pb.js +1 -1
  10. package/dist/cjs/google/protobuf/api_pb.js +1 -1
  11. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +1 -1
  12. package/dist/cjs/google/protobuf/descriptor_pb.js +1 -1
  13. package/dist/cjs/google/protobuf/duration_pb.js +1 -1
  14. package/dist/cjs/google/protobuf/empty_pb.js +1 -1
  15. package/dist/cjs/google/protobuf/field_mask_pb.js +1 -1
  16. package/dist/cjs/google/protobuf/source_context_pb.js +1 -1
  17. package/dist/cjs/google/protobuf/struct_pb.js +1 -1
  18. package/dist/cjs/google/protobuf/timestamp_pb.js +1 -1
  19. package/dist/cjs/google/protobuf/type_pb.js +1 -1
  20. package/dist/cjs/google/protobuf/wrappers_pb.js +1 -1
  21. package/dist/cjs/{private/goog-varint.js → google/varint.js} +0 -0
  22. package/dist/cjs/index.js +18 -1
  23. package/dist/cjs/json-format.js +13 -0
  24. package/dist/cjs/message-type.js +13 -0
  25. package/dist/cjs/message.js +18 -6
  26. package/dist/cjs/private/assert.js +13 -0
  27. package/dist/cjs/private/base64.js +14 -1
  28. package/dist/cjs/private/binary-format-common.js +13 -0
  29. package/dist/cjs/private/binary-format-proto2.js +13 -0
  30. package/dist/cjs/private/binary-format-proto3.js +13 -0
  31. package/dist/cjs/private/enum.js +13 -0
  32. package/dist/cjs/private/field-list.js +13 -0
  33. package/dist/cjs/private/field-wrapper.js +13 -0
  34. package/dist/cjs/private/field.js +13 -0
  35. package/dist/cjs/private/json-format-common.js +13 -0
  36. package/dist/cjs/private/json-format-proto2.js +13 -0
  37. package/dist/cjs/private/json-format-proto3.js +13 -0
  38. package/dist/cjs/private/message-type.js +13 -0
  39. package/dist/cjs/private/names.js +13 -0
  40. package/dist/cjs/private/options-map.js +13 -0
  41. package/dist/cjs/private/proto-runtime.js +13 -0
  42. package/dist/cjs/private/scalars.js +13 -0
  43. package/dist/cjs/private/util-common.js +16 -3
  44. package/dist/cjs/private/util.js +13 -0
  45. package/dist/cjs/proto-int64.js +19 -6
  46. package/dist/cjs/proto2.js +13 -0
  47. package/dist/cjs/proto3.js +13 -0
  48. package/dist/cjs/service-type.js +13 -0
  49. package/dist/cjs/type-registry.js +13 -0
  50. package/dist/esm/binary-encoding.js +14 -1
  51. package/dist/esm/binary-format.js +13 -0
  52. package/dist/esm/descriptor-registry.js +13 -0
  53. package/dist/esm/descriptor-set.js +13 -0
  54. package/dist/esm/enum.js +13 -0
  55. package/dist/esm/field-list.js +13 -0
  56. package/dist/esm/field.js +13 -0
  57. package/dist/esm/google/protobuf/any_pb.js +1 -1
  58. package/dist/esm/google/protobuf/api_pb.js +1 -1
  59. package/dist/esm/google/protobuf/compiler/plugin_pb.js +1 -1
  60. package/dist/esm/google/protobuf/descriptor_pb.js +1 -1
  61. package/dist/esm/google/protobuf/duration_pb.js +1 -1
  62. package/dist/esm/google/protobuf/empty_pb.js +1 -1
  63. package/dist/esm/google/protobuf/field_mask_pb.js +1 -1
  64. package/dist/esm/google/protobuf/source_context_pb.js +1 -1
  65. package/dist/esm/google/protobuf/struct_pb.js +1 -1
  66. package/dist/esm/google/protobuf/timestamp_pb.js +1 -1
  67. package/dist/esm/google/protobuf/type_pb.js +1 -1
  68. package/dist/esm/google/protobuf/wrappers_pb.js +1 -1
  69. package/dist/esm/{private/goog-varint.js → google/varint.js} +0 -0
  70. package/dist/esm/index.js +13 -0
  71. package/dist/esm/json-format.js +13 -0
  72. package/dist/esm/message-type.js +13 -0
  73. package/dist/esm/message.js +18 -6
  74. package/dist/esm/private/assert.js +13 -0
  75. package/dist/esm/private/base64.js +13 -0
  76. package/dist/esm/private/binary-format-common.js +13 -0
  77. package/dist/esm/private/binary-format-proto2.js +13 -0
  78. package/dist/esm/private/binary-format-proto3.js +13 -0
  79. package/dist/esm/private/enum.js +13 -0
  80. package/dist/esm/private/field-list.js +13 -0
  81. package/dist/esm/private/field-wrapper.js +13 -0
  82. package/dist/esm/private/field.js +13 -0
  83. package/dist/esm/private/json-format-common.js +13 -0
  84. package/dist/esm/private/json-format-proto2.js +13 -0
  85. package/dist/esm/private/json-format-proto3.js +13 -0
  86. package/dist/esm/private/message-type.js +13 -0
  87. package/dist/esm/private/names.js +13 -0
  88. package/dist/esm/private/options-map.js +13 -0
  89. package/dist/esm/private/proto-runtime.js +13 -0
  90. package/dist/esm/private/scalars.js +13 -0
  91. package/dist/esm/private/util-common.js +16 -3
  92. package/dist/esm/private/util.js +13 -0
  93. package/dist/esm/proto-int64.js +14 -1
  94. package/dist/esm/proto2.js +13 -0
  95. package/dist/esm/proto3.js +13 -0
  96. package/dist/esm/service-type.js +13 -0
  97. package/dist/esm/type-registry.js +13 -0
  98. package/dist/types/{private/goog-varint.d.ts → google/varint.d.ts} +0 -0
  99. package/dist/types/index.d.ts +1 -1
  100. package/dist/types/json-format.d.ts +1 -1
  101. package/dist/types/message-type.d.ts +2 -2
  102. package/dist/types/message.d.ts +13 -12
  103. package/dist/types/private/field-wrapper.d.ts +3 -3
  104. package/dist/types/private/message-type.d.ts +2 -2
  105. package/dist/types/private/proto-runtime.d.ts +2 -2
  106. package/dist/types/private/util.d.ts +3 -3
  107. package/dist/types/service-type.d.ts +7 -7
  108. package/package.json +2 -2
package/README.md CHANGED
@@ -3,24 +3,4 @@
3
3
  A complete implementation of protocol buffers in TypeScript,
4
4
  suitable for web browsers and Node.js.
5
5
 
6
- ### Features
7
- - small code size
8
- - no dependencies
9
- - implements all proto3 features, including the canonical JSON format
10
- - implements all proto2 features, except for extensions and the text format
11
- - passes the protocol buffers conformance tests
12
- - provides all well-known types with their specialized JSON representation
13
- - uses and algebraic data type to represent `oneof` groups
14
- - unboxes fields using google/protobuf/wrappers.proto to optional primitives
15
- - represents 64-bit integers with BigInt, and falls back to `string` if unavailable
16
- - uses standard TypeScript enums for protocol buffer `enum`
17
- - provides `equals()` and `clone()` on each message for convenience
18
- - fields are plain properties, and support the object spread operator
19
- - messages can be constructed from partial plain objects
20
- - can dynamically create types at run time, for example from a set of `google.protobuf.FileDescriptorProto`
21
- - provides field information to traverse types programmatically
22
-
23
-
24
- ### Copyright
25
-
26
- The [code to encode and decode varint](./src/private/goog-varint.ts) is Copyright 2008 Google Inc., licensed under BSD-3-Clause.
6
+ Learn more at [github.com/bufbuild/protobuf-es](github.com/bufbuild/protobuf-es).
@@ -1,7 +1,20 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.BinaryReader = exports.BinaryWriter = exports.WireType = void 0;
4
- const goog_varint_js_1 = require("./private/goog-varint.js");
17
+ const varint_js_1 = require("./google/varint.js");
5
18
  const assert_js_1 = require("./private/assert.js");
6
19
  const proto_int64_js_1 = require("./proto-int64.js");
7
20
  /* eslint-disable prefer-const,no-case-declarations,@typescript-eslint/restrict-plus-operands */
@@ -143,7 +156,7 @@ class BinaryWriter {
143
156
  */
144
157
  int32(value) {
145
158
  (0, assert_js_1.assertInt32)(value);
146
- (0, goog_varint_js_1.varint32write)(value, this.buf);
159
+ (0, varint_js_1.varint32write)(value, this.buf);
147
160
  return this;
148
161
  }
149
162
  /**
@@ -210,7 +223,7 @@ class BinaryWriter {
210
223
  (0, assert_js_1.assertInt32)(value);
211
224
  // zigzag encode
212
225
  value = ((value << 1) ^ (value >> 31)) >>> 0;
213
- (0, goog_varint_js_1.varint32write)(value, this.buf);
226
+ (0, varint_js_1.varint32write)(value, this.buf);
214
227
  return this;
215
228
  }
216
229
  /**
@@ -236,7 +249,7 @@ class BinaryWriter {
236
249
  */
237
250
  int64(value) {
238
251
  let tc = proto_int64_js_1.protoInt64.enc(value);
239
- (0, goog_varint_js_1.varint64write)(tc.lo, tc.hi, this.buf);
252
+ (0, varint_js_1.varint64write)(tc.lo, tc.hi, this.buf);
240
253
  return this;
241
254
  }
242
255
  /**
@@ -246,7 +259,7 @@ class BinaryWriter {
246
259
  let tc = proto_int64_js_1.protoInt64.enc(value),
247
260
  // zigzag encode
248
261
  sign = tc.hi >> 31, lo = (tc.lo << 1) ^ sign, hi = ((tc.hi << 1) | (tc.lo >>> 31)) ^ sign;
249
- (0, goog_varint_js_1.varint64write)(lo, hi, this.buf);
262
+ (0, varint_js_1.varint64write)(lo, hi, this.buf);
250
263
  return this;
251
264
  }
252
265
  /**
@@ -254,18 +267,18 @@ class BinaryWriter {
254
267
  */
255
268
  uint64(value) {
256
269
  let tc = proto_int64_js_1.protoInt64.uEnc(value);
257
- (0, goog_varint_js_1.varint64write)(tc.lo, tc.hi, this.buf);
270
+ (0, varint_js_1.varint64write)(tc.lo, tc.hi, this.buf);
258
271
  return this;
259
272
  }
260
273
  }
261
274
  exports.BinaryWriter = BinaryWriter;
262
275
  class BinaryReader {
263
276
  constructor(buf, textDecoder) {
264
- this.varint64 = goog_varint_js_1.varint64read; // dirty cast for `this`
277
+ this.varint64 = varint_js_1.varint64read; // dirty cast for `this`
265
278
  /**
266
279
  * Read a `uint32` field, an unsigned 32 bit varint.
267
280
  */
268
- this.uint32 = goog_varint_js_1.varint32read; // dirty cast for `this` and access to protected `buf`
281
+ this.uint32 = varint_js_1.varint32read; // dirty cast for `this` and access to protected `buf`
269
282
  this.buf = buf;
270
283
  this.len = buf.length;
271
284
  this.pos = 0;
@@ -1,2 +1,15 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.DescriptorRegistry = void 0;
4
17
  const assert_js_1 = require("./private/assert.js");
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.DescriptorSet = void 0;
4
17
  const descriptor_pb_js_1 = require("./google/protobuf/descriptor_pb.js");
package/dist/cjs/enum.js CHANGED
@@ -1,2 +1,15 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,15 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/cjs/field.js CHANGED
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.ScalarType = void 0;
4
17
  /**
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/any.proto (package google.protobuf, syntax proto3)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/api.proto (package google.protobuf, syntax proto3)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/compiler/plugin.proto (package google.protobuf.compiler, syntax proto2)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/descriptor.proto (package google.protobuf, syntax proto2)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/duration.proto (package google.protobuf, syntax proto3)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/empty.proto (package google.protobuf, syntax proto3)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/field_mask.proto (package google.protobuf, syntax proto3)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/source_context.proto (package google.protobuf, syntax proto3)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/timestamp.proto (package google.protobuf, syntax proto3)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
- // @generated by protoc-gen-es v0.0.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
+ // @generated by protoc-gen-es v0.0.2-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
4
  // @generated from file google/protobuf/wrappers.proto (package google.protobuf, syntax proto3)
5
5
  //
6
6
  // Protocol Buffers - Google's data interchange format
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,24 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
16
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
5
22
  }) : (function(o, m, k, k2) {
6
23
  if (k2 === undefined) k2 = k;
7
24
  o[k2] = m[k];
@@ -1,2 +1,15 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,15 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,26 +1,38 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.Message = void 0;
4
17
  /**
5
- * Every message - generated or created at runtime - is an instance of this
6
- * class.
18
+ * Message is the base class of every message, generated, or created at
19
+ * runtime.
7
20
  *
8
- * It is unsafe to extend this class. If you want to create a message at run
9
- * time, use proto3.makeMessageType().
21
+ * It is _not_ safe to extend this class. If you want to create a message at
22
+ * run time, use proto3.makeMessageType().
10
23
  */
11
24
  class Message {
12
- // TODO find better name to prevent field name conflicts?
13
25
  /**
14
26
  * Compare with a message of the same type.
15
27
  */
16
28
  equals(other) {
17
29
  return this.getType().runtime.util.equals(this.getType(), this, other);
18
30
  }
19
- // TODO find better name to prevent field name conflicts?
20
31
  /**
21
32
  * Create a deep copy.
22
33
  */
23
34
  clone() {
35
+ // return this.getType().runtime.util.clone(this);
24
36
  return this.getType().runtime.util.clone(this);
25
37
  }
26
38
  /**
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.assertFloat32 = exports.assertUInt32 = exports.assertInt32 = exports.assert = void 0;
4
17
  /**
@@ -1,7 +1,20 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unnecessary-condition, prefer-const */
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
3
15
  Object.defineProperty(exports, "__esModule", { value: true });
4
16
  exports.base64encode = exports.base64decode = void 0;
17
+ /* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unnecessary-condition, prefer-const */
5
18
  // lookup table from base64 character to byte
6
19
  let encTable = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
7
20
  // lookup table from base64 character *code* to byte because lookup by number is fast
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.writePacked = exports.writeScalar = exports.writeMessageField = exports.writeMapEntry = exports.makeBinaryFormatCommon = void 0;
4
17
  const binary_encoding_js_1 = require("../binary-encoding.js");
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.makeBinaryFormatProto2 = void 0;
4
17
  const field_js_1 = require("../field.js");
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.makeBinaryFormatProto3 = void 0;
4
17
  const field_js_1 = require("../field.js");
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.makeEnumType = exports.setEnumType = exports.getEnumType = void 0;
4
17
  const assert_js_1 = require("./assert.js");
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.InternalFieldList = void 0;
4
17
  class InternalFieldList {
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.unwrapField = exports.wrapField = void 0;
4
17
  /**
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.InternalOneofInfo = void 0;
4
17
  const names_js_1 = require("./names.js");
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // Copyright 2021-2022 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.makeJsonFormatCommon = void 0;
4
17
  const field_wrapper_js_1 = require("./field-wrapper.js");