@aptre/protobuf-es-lite 0.2.10 → 0.2.12

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 (79) hide show
  1. package/bin/protoc-gen-es-lite +2 -2
  2. package/dist/assert.js +4 -11
  3. package/dist/binary-encoding.js +69 -42
  4. package/dist/binary.js +87 -105
  5. package/dist/codegen-info.d.ts +0 -1
  6. package/dist/codegen-info.js +12 -16
  7. package/dist/create-descriptor-set.js +114 -118
  8. package/dist/descriptor-set.js +1 -2
  9. package/dist/enum.js +2 -7
  10. package/dist/feature-set.d.ts +1 -1
  11. package/dist/feature-set.js +18 -22
  12. package/dist/field-wrapper.js +12 -17
  13. package/dist/field.js +35 -34
  14. package/dist/google/index.js +9 -41
  15. package/dist/google/protobuf/any.pb.d.ts +2 -2
  16. package/dist/google/protobuf/any.pb.js +3 -6
  17. package/dist/google/protobuf/api.pb.d.ts +2 -2
  18. package/dist/google/protobuf/api.pb.js +56 -21
  19. package/dist/google/protobuf/compiler/plugin.pb.d.ts +2 -2
  20. package/dist/google/protobuf/compiler/plugin.pb.js +15 -18
  21. package/dist/google/protobuf/descriptor.pb.d.ts +19 -19
  22. package/dist/google/protobuf/descriptor.pb.js +831 -223
  23. package/dist/google/protobuf/duration.pb.d.ts +2 -2
  24. package/dist/google/protobuf/duration.pb.js +3 -6
  25. package/dist/google/protobuf/empty.pb.d.ts +2 -2
  26. package/dist/google/protobuf/empty.pb.js +3 -6
  27. package/dist/google/protobuf/source_context.pb.d.ts +2 -2
  28. package/dist/google/protobuf/source_context.pb.js +3 -6
  29. package/dist/google/protobuf/struct.pb.d.ts +3 -3
  30. package/dist/google/protobuf/struct.pb.js +31 -18
  31. package/dist/google/protobuf/timestamp.pb.d.ts +2 -2
  32. package/dist/google/protobuf/timestamp.pb.js +3 -6
  33. package/dist/google/protobuf/type.pb.d.ts +5 -5
  34. package/dist/google/protobuf/type.pb.js +74 -36
  35. package/dist/google/protobuf/wrappers.pb.d.ts +2 -2
  36. package/dist/google/protobuf/wrappers.pb.js +11 -14
  37. package/dist/index.js +12 -60
  38. package/dist/is-message.js +9 -16
  39. package/dist/json.d.ts +0 -9
  40. package/dist/json.js +72 -102
  41. package/dist/message.d.ts +3 -3
  42. package/dist/message.js +50 -57
  43. package/dist/names.js +12 -23
  44. package/dist/partial.js +15 -24
  45. package/dist/proto-base64.js +1 -4
  46. package/dist/proto-double.js +1 -4
  47. package/dist/proto-int64.js +9 -12
  48. package/dist/protoc-gen-es-lite/protoc-gen-es-lite-plugin.js +4 -7
  49. package/dist/protoc-gen-es-lite/typescript.js +27 -36
  50. package/dist/protoplugin/create-es-plugin.js +14 -18
  51. package/dist/protoplugin/ecmascript/file-preamble.js +5 -9
  52. package/dist/protoplugin/ecmascript/generated-file.js +16 -20
  53. package/dist/protoplugin/ecmascript/import-path.js +13 -20
  54. package/dist/protoplugin/ecmascript/import-symbol.js +1 -5
  55. package/dist/protoplugin/ecmascript/index.js +2 -7
  56. package/dist/protoplugin/ecmascript/jsdoc.js +1 -5
  57. package/dist/protoplugin/ecmascript/opaque-printables.js +1 -2
  58. package/dist/protoplugin/ecmascript/parameter.js +10 -14
  59. package/dist/protoplugin/ecmascript/reify-wkt.js +12 -16
  60. package/dist/protoplugin/ecmascript/runtime-imports.js +5 -9
  61. package/dist/protoplugin/ecmascript/schema.js +16 -20
  62. package/dist/protoplugin/ecmascript/target.js +1 -2
  63. package/dist/protoplugin/ecmascript/transpile.js +15 -42
  64. package/dist/protoplugin/error.js +4 -10
  65. package/dist/protoplugin/index.js +2 -7
  66. package/dist/protoplugin/plugin.js +1 -2
  67. package/dist/protoplugin/run-node.js +6 -10
  68. package/dist/scalar.js +9 -15
  69. package/dist/service-type.js +4 -7
  70. package/dist/text-format.js +25 -30
  71. package/dist/unknown.js +7 -12
  72. package/dist/util.d.ts +1 -1
  73. package/dist/util.js +49 -55
  74. package/dist/varint.js +7 -17
  75. package/example/example.pb.ts +24 -18
  76. package/package.json +10 -7
  77. package/tsconfig.base.json +3 -3
  78. package/dist/type-registry.d.ts +0 -43
  79. package/dist/type-registry.js +0 -15
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "../../";
2
- import { Message } from "../../";
1
+ import type { MessageType } from "../../index.js";
2
+ import { Message } from "../../index.js";
3
3
  export declare const protobufPackage = "google.protobuf";
4
4
  /**
5
5
  * A Duration represents a signed, fixed-length span of time represented
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // Protocol Buffers - Google's data interchange format
3
2
  // Copyright 2008 Google Inc. All rights reserved.
4
3
  // https://developers.google.com/protocol-buffers/
@@ -28,11 +27,9 @@
28
27
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
28
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
29
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.Duration = exports.protobufPackage = void 0;
33
- const __1 = require("../../");
34
- exports.protobufPackage = "google.protobuf";
35
- exports.Duration = (0, __1.createMessageType)({
30
+ import { createMessageType } from "../../index.js";
31
+ export const protobufPackage = "google.protobuf";
32
+ export const Duration = createMessageType({
36
33
  typeName: "google.protobuf.Duration",
37
34
  fields: [
38
35
  { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "../../";
2
- import { Message } from "../../";
1
+ import type { MessageType } from "../../index.js";
2
+ import { Message } from "../../index.js";
3
3
  export declare const protobufPackage = "google.protobuf";
4
4
  /**
5
5
  * A generic empty message that you can re-use to avoid defining duplicated
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // Protocol Buffers - Google's data interchange format
3
2
  // Copyright 2008 Google Inc. All rights reserved.
4
3
  // https://developers.google.com/protocol-buffers/
@@ -28,11 +27,9 @@
28
27
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
28
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
29
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.Empty = exports.protobufPackage = void 0;
33
- const __1 = require("../../");
34
- exports.protobufPackage = "google.protobuf";
35
- exports.Empty = (0, __1.createMessageType)({
30
+ import { createMessageType } from "../../index.js";
31
+ export const protobufPackage = "google.protobuf";
32
+ export const Empty = createMessageType({
36
33
  typeName: "google.protobuf.Empty",
37
34
  fields: [],
38
35
  packedByDefault: true,
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "../../";
2
- import { Message } from "../../";
1
+ import type { MessageType } from "../../index.js";
2
+ import { Message } from "../../index.js";
3
3
  export declare const protobufPackage = "google.protobuf";
4
4
  /**
5
5
  * `SourceContext` represents information about the source of a
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // Protocol Buffers - Google's data interchange format
3
2
  // Copyright 2008 Google Inc. All rights reserved.
4
3
  // https://developers.google.com/protocol-buffers/
@@ -28,11 +27,9 @@
28
27
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
28
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
29
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.SourceContext = exports.protobufPackage = void 0;
33
- const __1 = require("../../");
34
- exports.protobufPackage = "google.protobuf";
35
- exports.SourceContext = (0, __1.createMessageType)({
30
+ import { createMessageType } from "../../index.js";
31
+ export const protobufPackage = "google.protobuf";
32
+ export const SourceContext = createMessageType({
36
33
  typeName: "google.protobuf.SourceContext",
37
34
  fields: [
38
35
  { no: 1, name: "file_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "../../";
2
- import { Message } from "../../";
1
+ import type { MessageType } from "../../index.js";
2
+ import { Message } from "../../index.js";
3
3
  export declare const protobufPackage = "google.protobuf";
4
4
  /**
5
5
  * `NullValue` is a singleton enumeration to represent the null value for the
@@ -19,7 +19,7 @@ export declare enum NullValue {
19
19
  */
20
20
  NULL_VALUE = 0
21
21
  }
22
- export declare const NullValue_Enum: import("../../enum").EnumType;
22
+ export declare const NullValue_Enum: import("../../enum.js").EnumType;
23
23
  /**
24
24
  * `ListValue` is a wrapper around a repeated field of values.
25
25
  *
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // Protocol Buffers - Google's data interchange format
3
2
  // Copyright 2008 Google Inc. All rights reserved.
4
3
  // https://developers.google.com/protocol-buffers/
@@ -28,10 +27,8 @@
28
27
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
28
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
29
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.Struct = exports.Value = exports.ListValue = exports.NullValue_Enum = exports.NullValue = exports.protobufPackage = void 0;
33
- const __1 = require("../../");
34
- exports.protobufPackage = "google.protobuf";
30
+ import { createEnumType, createMessageType } from "../../index.js";
31
+ export const protobufPackage = "google.protobuf";
35
32
  /**
36
33
  * `NullValue` is a singleton enumeration to represent the null value for the
37
34
  * `Value` type union.
@@ -41,7 +38,7 @@ exports.protobufPackage = "google.protobuf";
41
38
  *
42
39
  * @generated from enum google.protobuf.NullValue
43
40
  */
44
- var NullValue;
41
+ export var NullValue;
45
42
  (function (NullValue) {
46
43
  /**
47
44
  * Null value.
@@ -50,34 +47,50 @@ var NullValue;
50
47
  * @generated from enum value: NULL_VALUE = 0;
51
48
  */
52
49
  NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
53
- })(NullValue || (exports.NullValue = NullValue = {}));
50
+ })(NullValue || (NullValue = {}));
54
51
  // NullValue_Enum is the enum type for NullValue.
55
- exports.NullValue_Enum = (0, __1.createEnumType)("google.protobuf.NullValue", [
52
+ export const NullValue_Enum = createEnumType("google.protobuf.NullValue", [
56
53
  { no: 0, name: "NULL_VALUE" },
57
54
  ]);
58
- exports.ListValue = (0, __1.createMessageType)({
55
+ export const ListValue = createMessageType({
59
56
  typeName: "google.protobuf.ListValue",
60
57
  fields: [
61
- { no: 1, name: "values", kind: "message", T: () => exports.Value, repeated: true },
58
+ { no: 1, name: "values", kind: "message", T: () => Value, repeated: true },
62
59
  ],
63
60
  packedByDefault: true,
64
61
  });
65
- exports.Value = (0, __1.createMessageType)({
62
+ export const Value = createMessageType({
66
63
  typeName: "google.protobuf.Value",
67
64
  fields: [
68
- { no: 1, name: "null_value", kind: "enum", T: exports.NullValue_Enum },
69
- { no: 2, name: "number_value", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ },
70
- { no: 3, name: "string_value", kind: "scalar", T: 9 /* ScalarType.STRING */ },
65
+ { no: 1, name: "null_value", kind: "enum", T: NullValue_Enum },
66
+ {
67
+ no: 2,
68
+ name: "number_value",
69
+ kind: "scalar",
70
+ T: 1 /* ScalarType.DOUBLE */,
71
+ },
72
+ {
73
+ no: 3,
74
+ name: "string_value",
75
+ kind: "scalar",
76
+ T: 9 /* ScalarType.STRING */,
77
+ },
71
78
  { no: 4, name: "bool_value", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
72
- { no: 5, name: "struct_value", kind: "message", T: () => exports.Struct },
73
- { no: 6, name: "list_value", kind: "message", T: () => exports.ListValue },
79
+ { no: 5, name: "struct_value", kind: "message", T: () => Struct },
80
+ { no: 6, name: "list_value", kind: "message", T: () => ListValue },
74
81
  ],
75
82
  packedByDefault: true,
76
83
  });
77
- exports.Struct = (0, __1.createMessageType)({
84
+ export const Struct = createMessageType({
78
85
  typeName: "google.protobuf.Struct",
79
86
  fields: [
80
- { no: 1, name: "fields", kind: "map", K: 9 /* ScalarType.STRING */, V: { kind: "message", T: () => exports.Value } },
87
+ {
88
+ no: 1,
89
+ name: "fields",
90
+ kind: "map",
91
+ K: 9 /* ScalarType.STRING */,
92
+ V: { kind: "message", T: () => Value },
93
+ },
81
94
  ],
82
95
  packedByDefault: true,
83
96
  });
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "../../";
2
- import { Message } from "../../";
1
+ import type { MessageType } from "../../index.js";
2
+ import { Message } from "../../index.js";
3
3
  export declare const protobufPackage = "google.protobuf";
4
4
  /**
5
5
  * A Timestamp represents a point in time independent of any time zone or local
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // Protocol Buffers - Google's data interchange format
3
2
  // Copyright 2008 Google Inc. All rights reserved.
4
3
  // https://developers.google.com/protocol-buffers/
@@ -28,11 +27,9 @@
28
27
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
28
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
29
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.Timestamp = exports.protobufPackage = void 0;
33
- const __1 = require("../../");
34
- exports.protobufPackage = "google.protobuf";
35
- exports.Timestamp = (0, __1.createMessageType)({
30
+ import { createMessageType } from "../../index.js";
31
+ export const protobufPackage = "google.protobuf";
32
+ export const Timestamp = createMessageType({
36
33
  typeName: "google.protobuf.Timestamp",
37
34
  fields: [
38
35
  { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "../../";
2
- import { Message } from "../../";
1
+ import type { MessageType } from "../../index.js";
2
+ import { Message } from "../../index.js";
3
3
  import { Any } from "./any.pb.js";
4
4
  import { SourceContext } from "./source_context.pb.js";
5
5
  export declare const protobufPackage = "google.protobuf";
@@ -32,7 +32,7 @@ export declare enum Syntax {
32
32
  */
33
33
  EDITIONS = 2
34
34
  }
35
- export declare const Syntax_Enum: import("../../enum").EnumType;
35
+ export declare const Syntax_Enum: import("../../enum.js").EnumType;
36
36
  /**
37
37
  * Basic field types.
38
38
  *
@@ -174,7 +174,7 @@ export declare enum Field_Kind {
174
174
  */
175
175
  TYPE_SINT64 = 18
176
176
  }
177
- export declare const Field_Kind_Enum: import("../../enum").EnumType;
177
+ export declare const Field_Kind_Enum: import("../../enum.js").EnumType;
178
178
  /**
179
179
  * Whether a field is optional, required, or repeated.
180
180
  *
@@ -211,7 +211,7 @@ export declare enum Field_Cardinality {
211
211
  */
212
212
  REPEATED = 3
213
213
  }
214
- export declare const Field_Cardinality_Enum: import("../../enum").EnumType;
214
+ export declare const Field_Cardinality_Enum: import("../../enum.js").EnumType;
215
215
  /**
216
216
  * A protocol buffer option, which can be attached to a message, field,
217
217
  * enumeration, etc.
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // Protocol Buffers - Google's data interchange format
3
2
  // Copyright 2008 Google Inc. All rights reserved.
4
3
  // https://developers.google.com/protocol-buffers/
@@ -28,19 +27,17 @@
28
27
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
28
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
29
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.Enum = exports.EnumValue = exports.Type = exports.Field = exports.Option = exports.Field_Cardinality_Enum = exports.Field_Cardinality = exports.Field_Kind_Enum = exports.Field_Kind = exports.Syntax_Enum = exports.Syntax = exports.protobufPackage = void 0;
33
- const __1 = require("../../");
34
- const any_pb_js_1 = require("./any.pb.js");
35
- const source_context_pb_js_1 = require("./source_context.pb.js");
36
- exports.protobufPackage = "google.protobuf";
30
+ import { createEnumType, createMessageType } from "../../index.js";
31
+ import { Any } from "./any.pb.js";
32
+ import { SourceContext } from "./source_context.pb.js";
33
+ export const protobufPackage = "google.protobuf";
37
34
  /**
38
35
  * The syntax in which a protocol buffer element is defined.
39
36
  *
40
37
  *
41
38
  * @generated from enum google.protobuf.Syntax
42
39
  */
43
- var Syntax;
40
+ export var Syntax;
44
41
  (function (Syntax) {
45
42
  /**
46
43
  * Syntax `proto2`.
@@ -63,9 +60,9 @@ var Syntax;
63
60
  * @generated from enum value: SYNTAX_EDITIONS = 2;
64
61
  */
65
62
  Syntax[Syntax["EDITIONS"] = 2] = "EDITIONS";
66
- })(Syntax || (exports.Syntax = Syntax = {}));
63
+ })(Syntax || (Syntax = {}));
67
64
  // Syntax_Enum is the enum type for Syntax.
68
- exports.Syntax_Enum = (0, __1.createEnumType)("google.protobuf.Syntax", [
65
+ export const Syntax_Enum = createEnumType("google.protobuf.Syntax", [
69
66
  { no: 0, name: "SYNTAX_PROTO2" },
70
67
  { no: 1, name: "SYNTAX_PROTO3" },
71
68
  { no: 2, name: "SYNTAX_EDITIONS" },
@@ -76,7 +73,7 @@ exports.Syntax_Enum = (0, __1.createEnumType)("google.protobuf.Syntax", [
76
73
  *
77
74
  * @generated from enum google.protobuf.Field.Kind
78
75
  */
79
- var Field_Kind;
76
+ export var Field_Kind;
80
77
  (function (Field_Kind) {
81
78
  /**
82
79
  * Field type unknown.
@@ -211,9 +208,9 @@ var Field_Kind;
211
208
  * @generated from enum value: TYPE_SINT64 = 18;
212
209
  */
213
210
  Field_Kind[Field_Kind["TYPE_SINT64"] = 18] = "TYPE_SINT64";
214
- })(Field_Kind || (exports.Field_Kind = Field_Kind = {}));
211
+ })(Field_Kind || (Field_Kind = {}));
215
212
  // Field_Kind_Enum is the enum type for Field_Kind.
216
- exports.Field_Kind_Enum = (0, __1.createEnumType)("google.protobuf.Field.Kind", [
213
+ export const Field_Kind_Enum = createEnumType("google.protobuf.Field.Kind", [
217
214
  { no: 0, name: "TYPE_UNKNOWN" },
218
215
  { no: 1, name: "TYPE_DOUBLE" },
219
216
  { no: 2, name: "TYPE_FLOAT" },
@@ -240,7 +237,7 @@ exports.Field_Kind_Enum = (0, __1.createEnumType)("google.protobuf.Field.Kind",
240
237
  *
241
238
  * @generated from enum google.protobuf.Field.Cardinality
242
239
  */
243
- var Field_Cardinality;
240
+ export var Field_Cardinality;
244
241
  (function (Field_Cardinality) {
245
242
  /**
246
243
  * For fields with unknown cardinality.
@@ -270,68 +267,109 @@ var Field_Cardinality;
270
267
  * @generated from enum value: CARDINALITY_REPEATED = 3;
271
268
  */
272
269
  Field_Cardinality[Field_Cardinality["REPEATED"] = 3] = "REPEATED";
273
- })(Field_Cardinality || (exports.Field_Cardinality = Field_Cardinality = {}));
270
+ })(Field_Cardinality || (Field_Cardinality = {}));
274
271
  // Field_Cardinality_Enum is the enum type for Field_Cardinality.
275
- exports.Field_Cardinality_Enum = (0, __1.createEnumType)("google.protobuf.Field.Cardinality", [
272
+ export const Field_Cardinality_Enum = createEnumType("google.protobuf.Field.Cardinality", [
276
273
  { no: 0, name: "CARDINALITY_UNKNOWN" },
277
274
  { no: 1, name: "CARDINALITY_OPTIONAL" },
278
275
  { no: 2, name: "CARDINALITY_REQUIRED" },
279
276
  { no: 3, name: "CARDINALITY_REPEATED" },
280
277
  ]);
281
- exports.Option = (0, __1.createMessageType)({
278
+ export const Option = createMessageType({
282
279
  typeName: "google.protobuf.Option",
283
280
  fields: [
284
281
  { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
285
- { no: 2, name: "value", kind: "message", T: () => any_pb_js_1.Any },
282
+ { no: 2, name: "value", kind: "message", T: () => Any },
286
283
  ],
287
284
  packedByDefault: true,
288
285
  });
289
- exports.Field = (0, __1.createMessageType)({
286
+ export const Field = createMessageType({
290
287
  typeName: "google.protobuf.Field",
291
288
  fields: [
292
- { no: 1, name: "kind", kind: "enum", T: exports.Field_Kind_Enum },
293
- { no: 2, name: "cardinality", kind: "enum", T: exports.Field_Cardinality_Enum },
289
+ { no: 1, name: "kind", kind: "enum", T: Field_Kind_Enum },
290
+ { no: 2, name: "cardinality", kind: "enum", T: Field_Cardinality_Enum },
294
291
  { no: 3, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
295
292
  { no: 4, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
296
293
  { no: 6, name: "type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
297
294
  { no: 7, name: "oneof_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
298
295
  { no: 8, name: "packed", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
299
- { no: 9, name: "options", kind: "message", T: () => exports.Option, repeated: true },
296
+ {
297
+ no: 9,
298
+ name: "options",
299
+ kind: "message",
300
+ T: () => Option,
301
+ repeated: true,
302
+ },
300
303
  { no: 10, name: "json_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
301
- { no: 11, name: "default_value", kind: "scalar", T: 9 /* ScalarType.STRING */ },
304
+ {
305
+ no: 11,
306
+ name: "default_value",
307
+ kind: "scalar",
308
+ T: 9 /* ScalarType.STRING */,
309
+ },
302
310
  ],
303
311
  packedByDefault: true,
304
312
  });
305
- exports.Type = (0, __1.createMessageType)({
313
+ export const Type = createMessageType({
306
314
  typeName: "google.protobuf.Type",
307
315
  fields: [
308
316
  { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
309
- { no: 2, name: "fields", kind: "message", T: () => exports.Field, repeated: true },
310
- { no: 3, name: "oneofs", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
311
- { no: 4, name: "options", kind: "message", T: () => exports.Option, repeated: true },
312
- { no: 5, name: "source_context", kind: "message", T: () => source_context_pb_js_1.SourceContext },
313
- { no: 6, name: "syntax", kind: "enum", T: exports.Syntax_Enum },
317
+ { no: 2, name: "fields", kind: "message", T: () => Field, repeated: true },
318
+ {
319
+ no: 3,
320
+ name: "oneofs",
321
+ kind: "scalar",
322
+ T: 9 /* ScalarType.STRING */,
323
+ repeated: true,
324
+ },
325
+ {
326
+ no: 4,
327
+ name: "options",
328
+ kind: "message",
329
+ T: () => Option,
330
+ repeated: true,
331
+ },
332
+ { no: 5, name: "source_context", kind: "message", T: () => SourceContext },
333
+ { no: 6, name: "syntax", kind: "enum", T: Syntax_Enum },
314
334
  { no: 7, name: "edition", kind: "scalar", T: 9 /* ScalarType.STRING */ },
315
335
  ],
316
336
  packedByDefault: true,
317
337
  });
318
- exports.EnumValue = (0, __1.createMessageType)({
338
+ export const EnumValue = createMessageType({
319
339
  typeName: "google.protobuf.EnumValue",
320
340
  fields: [
321
341
  { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
322
342
  { no: 2, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
323
- { no: 3, name: "options", kind: "message", T: () => exports.Option, repeated: true },
343
+ {
344
+ no: 3,
345
+ name: "options",
346
+ kind: "message",
347
+ T: () => Option,
348
+ repeated: true,
349
+ },
324
350
  ],
325
351
  packedByDefault: true,
326
352
  });
327
- exports.Enum = (0, __1.createMessageType)({
353
+ export const Enum = createMessageType({
328
354
  typeName: "google.protobuf.Enum",
329
355
  fields: [
330
356
  { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
331
- { no: 2, name: "enumvalue", kind: "message", T: () => exports.EnumValue, repeated: true },
332
- { no: 3, name: "options", kind: "message", T: () => exports.Option, repeated: true },
333
- { no: 4, name: "source_context", kind: "message", T: () => source_context_pb_js_1.SourceContext },
334
- { no: 5, name: "syntax", kind: "enum", T: exports.Syntax_Enum },
357
+ {
358
+ no: 2,
359
+ name: "enumvalue",
360
+ kind: "message",
361
+ T: () => EnumValue,
362
+ repeated: true,
363
+ },
364
+ {
365
+ no: 3,
366
+ name: "options",
367
+ kind: "message",
368
+ T: () => Option,
369
+ repeated: true,
370
+ },
371
+ { no: 4, name: "source_context", kind: "message", T: () => SourceContext },
372
+ { no: 5, name: "syntax", kind: "enum", T: Syntax_Enum },
335
373
  { no: 6, name: "edition", kind: "scalar", T: 9 /* ScalarType.STRING */ },
336
374
  ],
337
375
  packedByDefault: true,
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "../../";
2
- import { Message } from "../../";
1
+ import type { MessageType } from "../../index.js";
2
+ import { Message } from "../../index.js";
3
3
  export declare const protobufPackage = "google.protobuf";
4
4
  /**
5
5
  * Wrapper message for `double`.
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // Protocol Buffers - Google's data interchange format
3
2
  // Copyright 2008 Google Inc. All rights reserved.
4
3
  // https://developers.google.com/protocol-buffers/
@@ -38,67 +37,65 @@
38
37
  // the ability to detect presence on individual elements.
39
38
  // These wrappers have no meaningful use within a map or a oneof since
40
39
  // individual entries of a map or fields of a oneof can already detect presence.
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.BytesValue = exports.StringValue = exports.BoolValue = exports.UInt32Value = exports.Int32Value = exports.UInt64Value = exports.Int64Value = exports.FloatValue = exports.DoubleValue = exports.protobufPackage = void 0;
43
- const __1 = require("../../");
44
- exports.protobufPackage = "google.protobuf";
45
- exports.DoubleValue = (0, __1.createMessageType)({
40
+ import { createMessageType } from "../../index.js";
41
+ export const protobufPackage = "google.protobuf";
42
+ export const DoubleValue = createMessageType({
46
43
  typeName: "google.protobuf.DoubleValue",
47
44
  fields: [
48
45
  { no: 1, name: "value", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ },
49
46
  ],
50
47
  packedByDefault: true,
51
48
  });
52
- exports.FloatValue = (0, __1.createMessageType)({
49
+ export const FloatValue = createMessageType({
53
50
  typeName: "google.protobuf.FloatValue",
54
51
  fields: [
55
52
  { no: 1, name: "value", kind: "scalar", T: 2 /* ScalarType.FLOAT */ },
56
53
  ],
57
54
  packedByDefault: true,
58
55
  });
59
- exports.Int64Value = (0, __1.createMessageType)({
56
+ export const Int64Value = createMessageType({
60
57
  typeName: "google.protobuf.Int64Value",
61
58
  fields: [
62
59
  { no: 1, name: "value", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
63
60
  ],
64
61
  packedByDefault: true,
65
62
  });
66
- exports.UInt64Value = (0, __1.createMessageType)({
63
+ export const UInt64Value = createMessageType({
67
64
  typeName: "google.protobuf.UInt64Value",
68
65
  fields: [
69
66
  { no: 1, name: "value", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
70
67
  ],
71
68
  packedByDefault: true,
72
69
  });
73
- exports.Int32Value = (0, __1.createMessageType)({
70
+ export const Int32Value = createMessageType({
74
71
  typeName: "google.protobuf.Int32Value",
75
72
  fields: [
76
73
  { no: 1, name: "value", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
77
74
  ],
78
75
  packedByDefault: true,
79
76
  });
80
- exports.UInt32Value = (0, __1.createMessageType)({
77
+ export const UInt32Value = createMessageType({
81
78
  typeName: "google.protobuf.UInt32Value",
82
79
  fields: [
83
80
  { no: 1, name: "value", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
84
81
  ],
85
82
  packedByDefault: true,
86
83
  });
87
- exports.BoolValue = (0, __1.createMessageType)({
84
+ export const BoolValue = createMessageType({
88
85
  typeName: "google.protobuf.BoolValue",
89
86
  fields: [
90
87
  { no: 1, name: "value", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
91
88
  ],
92
89
  packedByDefault: true,
93
90
  });
94
- exports.StringValue = (0, __1.createMessageType)({
91
+ export const StringValue = createMessageType({
95
92
  typeName: "google.protobuf.StringValue",
96
93
  fields: [
97
94
  { no: 1, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ },
98
95
  ],
99
96
  packedByDefault: true,
100
97
  });
101
- exports.BytesValue = (0, __1.createMessageType)({
98
+ export const BytesValue = createMessageType({
102
99
  typeName: "google.protobuf.BytesValue",
103
100
  fields: [
104
101
  { no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
package/dist/index.js CHANGED
@@ -1,60 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Struct = exports.ListValue = exports.NullValue = exports.Value = exports.BytesValue = exports.StringValue = exports.BoolValue = exports.UInt32Value = exports.Int32Value = exports.UInt64Value = exports.Int64Value = exports.FloatValue = exports.DoubleValue = exports.Empty = exports.Any = exports.Duration = exports.Timestamp = exports.protoDouble = exports.protoBase64 = exports.protoInt64 = exports.uInt64ToString = exports.int64ToString = exports.int64FromString = exports.safeIdentifier = exports.safeObjectProperty = exports.protoCamelCase = exports.camelToSnakeCase = exports.findEnumSharedPrefix = exports.localOneofName = exports.localFieldName = exports.localName = exports.normalizeEnumValue = exports.createEnumType = exports.isScalarZeroValue = exports.scalarZeroValue = exports.scalarEquals = exports.fieldJsonName = exports.FieldList = exports.newFieldList = exports.isCompleteField = exports.isCompleteMessage = exports.MethodIdempotency = exports.MethodKind = exports.createMessageType = exports.compareMessages = void 0;
4
- var message_js_1 = require("./message.js");
5
- Object.defineProperty(exports, "compareMessages", { enumerable: true, get: function () { return message_js_1.compareMessages; } });
6
- Object.defineProperty(exports, "createMessageType", { enumerable: true, get: function () { return message_js_1.createMessageType; } });
7
- var service_type_js_1 = require("./service-type.js");
8
- Object.defineProperty(exports, "MethodKind", { enumerable: true, get: function () { return service_type_js_1.MethodKind; } });
9
- Object.defineProperty(exports, "MethodIdempotency", { enumerable: true, get: function () { return service_type_js_1.MethodIdempotency; } });
10
- var is_message_js_1 = require("./is-message.js");
11
- Object.defineProperty(exports, "isCompleteMessage", { enumerable: true, get: function () { return is_message_js_1.isCompleteMessage; } });
12
- Object.defineProperty(exports, "isCompleteField", { enumerable: true, get: function () { return is_message_js_1.isCompleteField; } });
13
- var field_js_1 = require("./field.js");
14
- Object.defineProperty(exports, "newFieldList", { enumerable: true, get: function () { return field_js_1.newFieldList; } });
15
- Object.defineProperty(exports, "FieldList", { enumerable: true, get: function () { return field_js_1.FieldList; } });
16
- Object.defineProperty(exports, "fieldJsonName", { enumerable: true, get: function () { return field_js_1.fieldJsonName; } });
17
- var scalar_js_1 = require("./scalar.js");
18
- Object.defineProperty(exports, "scalarEquals", { enumerable: true, get: function () { return scalar_js_1.scalarEquals; } });
19
- Object.defineProperty(exports, "scalarZeroValue", { enumerable: true, get: function () { return scalar_js_1.scalarZeroValue; } });
20
- Object.defineProperty(exports, "isScalarZeroValue", { enumerable: true, get: function () { return scalar_js_1.isScalarZeroValue; } });
21
- var enum_js_1 = require("./enum.js");
22
- Object.defineProperty(exports, "createEnumType", { enumerable: true, get: function () { return enum_js_1.createEnumType; } });
23
- Object.defineProperty(exports, "normalizeEnumValue", { enumerable: true, get: function () { return enum_js_1.normalizeEnumValue; } });
24
- var names_js_1 = require("./names.js");
25
- Object.defineProperty(exports, "localName", { enumerable: true, get: function () { return names_js_1.localName; } });
26
- Object.defineProperty(exports, "localFieldName", { enumerable: true, get: function () { return names_js_1.localFieldName; } });
27
- Object.defineProperty(exports, "localOneofName", { enumerable: true, get: function () { return names_js_1.localOneofName; } });
28
- Object.defineProperty(exports, "findEnumSharedPrefix", { enumerable: true, get: function () { return names_js_1.findEnumSharedPrefix; } });
29
- Object.defineProperty(exports, "camelToSnakeCase", { enumerable: true, get: function () { return names_js_1.camelToSnakeCase; } });
30
- Object.defineProperty(exports, "protoCamelCase", { enumerable: true, get: function () { return names_js_1.protoCamelCase; } });
31
- Object.defineProperty(exports, "safeObjectProperty", { enumerable: true, get: function () { return names_js_1.safeObjectProperty; } });
32
- Object.defineProperty(exports, "safeIdentifier", { enumerable: true, get: function () { return names_js_1.safeIdentifier; } });
33
- var varint_js_1 = require("./varint.js");
34
- Object.defineProperty(exports, "int64FromString", { enumerable: true, get: function () { return varint_js_1.int64FromString; } });
35
- Object.defineProperty(exports, "int64ToString", { enumerable: true, get: function () { return varint_js_1.int64ToString; } });
36
- Object.defineProperty(exports, "uInt64ToString", { enumerable: true, get: function () { return varint_js_1.uInt64ToString; } });
37
- var proto_int64_js_1 = require("./proto-int64.js");
38
- Object.defineProperty(exports, "protoInt64", { enumerable: true, get: function () { return proto_int64_js_1.protoInt64; } });
39
- var proto_base64_js_1 = require("./proto-base64.js");
40
- Object.defineProperty(exports, "protoBase64", { enumerable: true, get: function () { return proto_base64_js_1.protoBase64; } });
41
- var proto_double_js_1 = require("./proto-double.js");
42
- Object.defineProperty(exports, "protoDouble", { enumerable: true, get: function () { return proto_double_js_1.protoDouble; } });
43
- var index_js_1 = require("./google/index.js");
44
- Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return index_js_1.Timestamp; } });
45
- Object.defineProperty(exports, "Duration", { enumerable: true, get: function () { return index_js_1.Duration; } });
46
- Object.defineProperty(exports, "Any", { enumerable: true, get: function () { return index_js_1.Any; } });
47
- Object.defineProperty(exports, "Empty", { enumerable: true, get: function () { return index_js_1.Empty; } });
48
- Object.defineProperty(exports, "DoubleValue", { enumerable: true, get: function () { return index_js_1.DoubleValue; } });
49
- Object.defineProperty(exports, "FloatValue", { enumerable: true, get: function () { return index_js_1.FloatValue; } });
50
- Object.defineProperty(exports, "Int64Value", { enumerable: true, get: function () { return index_js_1.Int64Value; } });
51
- Object.defineProperty(exports, "UInt64Value", { enumerable: true, get: function () { return index_js_1.UInt64Value; } });
52
- Object.defineProperty(exports, "Int32Value", { enumerable: true, get: function () { return index_js_1.Int32Value; } });
53
- Object.defineProperty(exports, "UInt32Value", { enumerable: true, get: function () { return index_js_1.UInt32Value; } });
54
- Object.defineProperty(exports, "BoolValue", { enumerable: true, get: function () { return index_js_1.BoolValue; } });
55
- Object.defineProperty(exports, "StringValue", { enumerable: true, get: function () { return index_js_1.StringValue; } });
56
- Object.defineProperty(exports, "BytesValue", { enumerable: true, get: function () { return index_js_1.BytesValue; } });
57
- Object.defineProperty(exports, "Value", { enumerable: true, get: function () { return index_js_1.Value; } });
58
- Object.defineProperty(exports, "NullValue", { enumerable: true, get: function () { return index_js_1.NullValue; } });
59
- Object.defineProperty(exports, "ListValue", { enumerable: true, get: function () { return index_js_1.ListValue; } });
60
- Object.defineProperty(exports, "Struct", { enumerable: true, get: function () { return index_js_1.Struct; } });
1
+ export { compareMessages, createMessageType, } from "./message.js";
2
+ export { MethodKind, MethodIdempotency, } from "./service-type.js";
3
+ export { isCompleteMessage, isCompleteField } from "./is-message.js";
4
+ export { newFieldList, FieldList, fieldJsonName, } from "./field.js";
5
+ export { scalarEquals, scalarZeroValue, isScalarZeroValue } from "./scalar.js";
6
+ export { createEnumType, normalizeEnumValue } from "./enum.js";
7
+ export { localName, localFieldName, localOneofName, findEnumSharedPrefix, camelToSnakeCase, protoCamelCase, safeObjectProperty, safeIdentifier, } from "./names.js";
8
+ export { int64FromString, int64ToString, uInt64ToString } from "./varint.js";
9
+ export { protoInt64 } from "./proto-int64.js";
10
+ export { protoBase64 } from "./proto-base64.js";
11
+ export { protoDouble } from "./proto-double.js";
12
+ export { Timestamp, Duration, Any, Empty, DoubleValue, FloatValue, Int64Value, UInt64Value, Int32Value, UInt32Value, BoolValue, StringValue, BytesValue, Value, NullValue, ListValue, Struct, } from "./google/index.js";