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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/dist/cjs/binary-encoding.js +414 -409
  2. package/dist/cjs/binary-format.js +13 -0
  3. package/dist/cjs/descriptor-registry.js +420 -449
  4. package/dist/cjs/descriptor-set.js +429 -513
  5. package/dist/cjs/enum.js +13 -0
  6. package/dist/cjs/field-list.js +13 -0
  7. package/dist/cjs/field.js +43 -30
  8. package/dist/cjs/google/protobuf/any_pb.js +122 -140
  9. package/dist/cjs/google/protobuf/api_pb.js +177 -224
  10. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +125 -227
  11. package/dist/cjs/google/protobuf/descriptor_pb.js +1029 -1888
  12. package/dist/cjs/google/protobuf/duration_pb.js +72 -88
  13. package/dist/cjs/google/protobuf/empty_pb.js +17 -17
  14. package/dist/cjs/google/protobuf/field_mask_pb.js +77 -94
  15. package/dist/cjs/google/protobuf/source_context_pb.js +25 -25
  16. package/dist/cjs/google/protobuf/struct_pb.js +144 -181
  17. package/dist/cjs/google/protobuf/timestamp_pb.js +86 -123
  18. package/dist/cjs/google/protobuf/type_pb.js +406 -462
  19. package/dist/cjs/google/protobuf/wrappers_pb.js +407 -470
  20. package/dist/cjs/google/varint.js +166 -171
  21. package/dist/cjs/index.js +41 -122
  22. package/dist/cjs/json-format.js +13 -0
  23. package/dist/cjs/message-type.js +13 -0
  24. package/dist/cjs/message.js +89 -85
  25. package/dist/cjs/private/assert.js +33 -26
  26. package/dist/cjs/private/base64.js +93 -79
  27. package/dist/cjs/private/binary-format-common.js +208 -208
  28. package/dist/cjs/private/binary-format-proto2.js +88 -109
  29. package/dist/cjs/private/binary-format-proto3.js +70 -90
  30. package/dist/cjs/private/enum.js +77 -44
  31. package/dist/cjs/private/field-list.js +64 -50
  32. package/dist/cjs/private/field-wrapper.js +21 -10
  33. package/dist/cjs/private/field.js +35 -25
  34. package/dist/cjs/private/json-format-common.js +427 -440
  35. package/dist/cjs/private/json-format-proto2.js +91 -89
  36. package/dist/cjs/private/json-format-proto3.js +82 -93
  37. package/dist/cjs/private/message-type.js +39 -27
  38. package/dist/cjs/private/names.js +71 -62
  39. package/dist/cjs/private/options-map.js +13 -0
  40. package/dist/cjs/private/proto-runtime.js +25 -16
  41. package/dist/cjs/private/scalars.js +113 -103
  42. package/dist/cjs/private/util-common.js +193 -210
  43. package/dist/cjs/private/util.js +13 -0
  44. package/dist/cjs/proto-int64.js +123 -111
  45. package/dist/cjs/proto2.js +63 -63
  46. package/dist/cjs/proto3.js +74 -74
  47. package/dist/cjs/service-type.js +27 -17
  48. package/dist/cjs/type-registry.js +46 -31
  49. package/dist/esm/binary-encoding.js +414 -414
  50. package/dist/esm/binary-format.js +13 -0
  51. package/dist/esm/descriptor-registry.js +422 -458
  52. package/dist/esm/descriptor-set.js +430 -478
  53. package/dist/esm/enum.js +13 -0
  54. package/dist/esm/field-list.js +13 -0
  55. package/dist/esm/field.js +42 -29
  56. package/dist/esm/google/protobuf/any_pb.js +122 -140
  57. package/dist/esm/google/protobuf/api_pb.js +177 -197
  58. package/dist/esm/google/protobuf/compiler/plugin_pb.js +123 -216
  59. package/dist/esm/google/protobuf/descriptor_pb.js +1013 -1804
  60. package/dist/esm/google/protobuf/duration_pb.js +72 -88
  61. package/dist/esm/google/protobuf/empty_pb.js +17 -17
  62. package/dist/esm/google/protobuf/field_mask_pb.js +77 -94
  63. package/dist/esm/google/protobuf/source_context_pb.js +25 -25
  64. package/dist/esm/google/protobuf/struct_pb.js +143 -180
  65. package/dist/esm/google/protobuf/timestamp_pb.js +86 -123
  66. package/dist/esm/google/protobuf/type_pb.js +401 -421
  67. package/dist/esm/google/protobuf/wrappers_pb.js +406 -397
  68. package/dist/esm/google/varint.js +165 -164
  69. package/dist/esm/index.js +14 -1
  70. package/dist/esm/json-format.js +13 -0
  71. package/dist/esm/message-type.js +13 -0
  72. package/dist/esm/message.js +89 -85
  73. package/dist/esm/private/assert.js +32 -21
  74. package/dist/esm/private/base64.js +92 -78
  75. package/dist/esm/private/binary-format-common.js +209 -207
  76. package/dist/esm/private/binary-format-proto2.js +89 -81
  77. package/dist/esm/private/binary-format-proto3.js +71 -67
  78. package/dist/esm/private/enum.js +75 -43
  79. package/dist/esm/private/field-list.js +64 -50
  80. package/dist/esm/private/field-wrapper.js +21 -10
  81. package/dist/esm/private/field.js +35 -22
  82. package/dist/esm/private/json-format-common.js +427 -435
  83. package/dist/esm/private/json-format-proto2.js +89 -81
  84. package/dist/esm/private/json-format-proto3.js +79 -80
  85. package/dist/esm/private/message-type.js +40 -28
  86. package/dist/esm/private/names.js +70 -57
  87. package/dist/esm/private/options-map.js +13 -0
  88. package/dist/esm/private/proto-runtime.js +26 -12
  89. package/dist/esm/private/scalars.js +112 -99
  90. package/dist/esm/private/util-common.js +193 -192
  91. package/dist/esm/private/util.js +13 -0
  92. package/dist/esm/proto-int64.js +123 -111
  93. package/dist/esm/proto2.js +63 -57
  94. package/dist/esm/proto3.js +74 -68
  95. package/dist/esm/service-type.js +25 -12
  96. package/dist/esm/type-registry.js +46 -31
  97. package/dist/types/binary-encoding.d.ts +398 -398
  98. package/dist/types/binary-format.d.ts +69 -91
  99. package/dist/types/descriptor-registry.d.ts +23 -29
  100. package/dist/types/descriptor-set.d.ts +107 -128
  101. package/dist/types/enum.d.ts +21 -21
  102. package/dist/types/field-list.d.ts +21 -21
  103. package/dist/types/field.d.ts +191 -231
  104. package/dist/types/google/protobuf/any_pb.d.ts +56 -77
  105. package/dist/types/google/protobuf/api_pb.d.ts +144 -187
  106. package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +195 -257
  107. package/dist/types/google/protobuf/descriptor_pb.d.ts +1360 -1737
  108. package/dist/types/google/protobuf/duration_pb.d.ts +30 -50
  109. package/dist/types/google/protobuf/empty_pb.d.ts +9 -28
  110. package/dist/types/google/protobuf/field_mask_pb.d.ts +17 -37
  111. package/dist/types/google/protobuf/source_context_pb.d.ts +16 -35
  112. package/dist/types/google/protobuf/struct_pb.d.ts +64 -115
  113. package/dist/types/google/protobuf/timestamp_pb.d.ts +31 -51
  114. package/dist/types/google/protobuf/type_pb.d.ts +355 -422
  115. package/dist/types/google/protobuf/wrappers_pb.d.ts +181 -297
  116. package/dist/types/google/varint.d.ts +6 -13
  117. package/dist/types/index.d.ts +4 -27
  118. package/dist/types/json-format.d.ts +70 -89
  119. package/dist/types/message-type.d.ts +37 -45
  120. package/dist/types/message.d.ts +62 -87
  121. package/dist/types/private/assert.d.ts +1 -4
  122. package/dist/types/private/binary-format-common.d.ts +6 -32
  123. package/dist/types/private/enum.d.ts +13 -11
  124. package/dist/types/private/field-list.d.ts +14 -21
  125. package/dist/types/private/field-wrapper.d.ts +4 -10
  126. package/dist/types/private/field.d.ts +12 -12
  127. package/dist/types/private/json-format-common.d.ts +5 -27
  128. package/dist/types/private/message-type.d.ts +12 -7
  129. package/dist/types/private/names.d.ts +1 -4
  130. package/dist/types/private/options-map.d.ts +1 -1
  131. package/dist/types/private/proto-runtime.d.ts +34 -42
  132. package/dist/types/private/scalars.d.ts +5 -12
  133. package/dist/types/private/util-common.d.ts +1 -4
  134. package/dist/types/private/util.d.ts +29 -41
  135. package/dist/types/proto-int64.d.ts +42 -42
  136. package/dist/types/service-type.d.ts +36 -56
  137. package/dist/types/type-registry.d.ts +13 -15
  138. package/package.json +2 -3
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- // @generated by protoc-gen-es v0.0.1-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
2
+ // @generated by protoc-gen-es v0.0.2-alpha.2 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
3
3
  // @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
4
4
  //
5
5
  // Protocol Buffers - Google's data interchange format
@@ -41,23 +41,23 @@ import { Any } from "./any_pb.js";
41
41
  */
42
42
  export var Syntax;
43
43
  (function (Syntax) {
44
- /**
45
- * Syntax `proto2`.
46
- *
47
- * @generated from enum value: SYNTAX_PROTO2 = 0;
48
- */
49
- Syntax[(Syntax["PROTO2"] = 0)] = "PROTO2";
50
- /**
51
- * Syntax `proto3`.
52
- *
53
- * @generated from enum value: SYNTAX_PROTO3 = 1;
54
- */
55
- Syntax[(Syntax["PROTO3"] = 1)] = "PROTO3";
44
+ /**
45
+ * Syntax `proto2`.
46
+ *
47
+ * @generated from enum value: SYNTAX_PROTO2 = 0;
48
+ */
49
+ Syntax[Syntax["PROTO2"] = 0] = "PROTO2";
50
+ /**
51
+ * Syntax `proto3`.
52
+ *
53
+ * @generated from enum value: SYNTAX_PROTO3 = 1;
54
+ */
55
+ Syntax[Syntax["PROTO3"] = 1] = "PROTO3";
56
56
  })(Syntax || (Syntax = {}));
57
57
  // Retrieve enum metadata with: proto3.getEnumType(Syntax)
58
58
  proto3.util.setEnumType(Syntax, "google.protobuf.Syntax", [
59
- { no: 0, name: "SYNTAX_PROTO2" },
60
- { no: 1, name: "SYNTAX_PROTO3" },
59
+ { no: 0, name: "SYNTAX_PROTO2" },
60
+ { no: 1, name: "SYNTAX_PROTO3" },
61
61
  ]);
62
62
  /**
63
63
  * A protocol buffer message type.
@@ -65,321 +65,305 @@ proto3.util.setEnumType(Syntax, "google.protobuf.Syntax", [
65
65
  * @generated from message google.protobuf.Type
66
66
  */
67
67
  export class Type extends Message {
68
- constructor(data) {
69
- super();
68
+ constructor(data) {
69
+ super();
70
+ /**
71
+ * The fully qualified message name.
72
+ *
73
+ * @generated from field: string name = 1;
74
+ */
75
+ this.name = "";
76
+ /**
77
+ * The list of fields.
78
+ *
79
+ * @generated from field: repeated google.protobuf.Field fields = 2;
80
+ */
81
+ this.fields = [];
82
+ /**
83
+ * The list of types appearing in `oneof` definitions in this type.
84
+ *
85
+ * @generated from field: repeated string oneofs = 3;
86
+ */
87
+ this.oneofs = [];
88
+ /**
89
+ * The protocol buffer options.
90
+ *
91
+ * @generated from field: repeated google.protobuf.Option options = 4;
92
+ */
93
+ this.options = [];
94
+ /**
95
+ * The source syntax.
96
+ *
97
+ * @generated from field: google.protobuf.Syntax syntax = 6;
98
+ */
99
+ this.syntax = Syntax.PROTO2;
100
+ proto3.util.initPartial(data, this);
101
+ }
102
+ static fromBinary(bytes, options) {
103
+ return new Type().fromBinary(bytes, options);
104
+ }
105
+ static fromJson(jsonValue, options) {
106
+ return new Type().fromJson(jsonValue, options);
107
+ }
108
+ static fromJsonString(jsonString, options) {
109
+ return new Type().fromJsonString(jsonString, options);
110
+ }
111
+ static equals(a, b) {
112
+ return proto3.util.equals(Type, a, b);
113
+ }
114
+ }
115
+ Type.runtime = proto3;
116
+ Type.typeName = "google.protobuf.Type";
117
+ Type.fields = proto3.util.newFieldList(() => [
118
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
119
+ { no: 2, name: "fields", kind: "message", T: Field, repeated: true },
120
+ { no: 3, name: "oneofs", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
121
+ { no: 4, name: "options", kind: "message", T: Option, repeated: true },
122
+ { no: 5, name: "source_context", kind: "message", T: SourceContext },
123
+ { no: 6, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
124
+ ]);
125
+ /**
126
+ * A single field of a message type.
127
+ *
128
+ * @generated from message google.protobuf.Field
129
+ */
130
+ export class Field extends Message {
131
+ constructor(data) {
132
+ super();
133
+ /**
134
+ * The field type.
135
+ *
136
+ * @generated from field: google.protobuf.Field.Kind kind = 1;
137
+ */
138
+ this.kind = Field_Kind.TYPE_UNKNOWN;
139
+ /**
140
+ * The field cardinality.
141
+ *
142
+ * @generated from field: google.protobuf.Field.Cardinality cardinality = 2;
143
+ */
144
+ this.cardinality = Field_Cardinality.UNKNOWN;
145
+ /**
146
+ * The field number.
147
+ *
148
+ * @generated from field: int32 number = 3;
149
+ */
150
+ this.number = 0;
151
+ /**
152
+ * The field name.
153
+ *
154
+ * @generated from field: string name = 4;
155
+ */
156
+ this.name = "";
157
+ /**
158
+ * The field type URL, without the scheme, for message or enumeration
159
+ * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
160
+ *
161
+ * @generated from field: string type_url = 6;
162
+ */
163
+ this.typeUrl = "";
164
+ /**
165
+ * The index of the field type in `Type.oneofs`, for message or enumeration
166
+ * types. The first type has index 1; zero means the type is not in the list.
167
+ *
168
+ * @generated from field: int32 oneof_index = 7;
169
+ */
170
+ this.oneofIndex = 0;
171
+ /**
172
+ * Whether to use alternative packed wire representation.
173
+ *
174
+ * @generated from field: bool packed = 8;
175
+ */
176
+ this.packed = false;
177
+ /**
178
+ * The protocol buffer options.
179
+ *
180
+ * @generated from field: repeated google.protobuf.Option options = 9;
181
+ */
182
+ this.options = [];
183
+ /**
184
+ * The field JSON name.
185
+ *
186
+ * @generated from field: string json_name = 10;
187
+ */
188
+ this.jsonName = "";
189
+ /**
190
+ * The string value of the default value of this field. Proto2 syntax only.
191
+ *
192
+ * @generated from field: string default_value = 11;
193
+ */
194
+ this.defaultValue = "";
195
+ proto3.util.initPartial(data, this);
196
+ }
197
+ static fromBinary(bytes, options) {
198
+ return new Field().fromBinary(bytes, options);
199
+ }
200
+ static fromJson(jsonValue, options) {
201
+ return new Field().fromJson(jsonValue, options);
202
+ }
203
+ static fromJsonString(jsonString, options) {
204
+ return new Field().fromJsonString(jsonString, options);
205
+ }
206
+ static equals(a, b) {
207
+ return proto3.util.equals(Field, a, b);
208
+ }
209
+ }
210
+ Field.runtime = proto3;
211
+ Field.typeName = "google.protobuf.Field";
212
+ Field.fields = proto3.util.newFieldList(() => [
213
+ { no: 1, name: "kind", kind: "enum", T: proto3.getEnumType(Field_Kind) },
214
+ { no: 2, name: "cardinality", kind: "enum", T: proto3.getEnumType(Field_Cardinality) },
215
+ { no: 3, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
216
+ { no: 4, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
217
+ { no: 6, name: "type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
218
+ { no: 7, name: "oneof_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
219
+ { no: 8, name: "packed", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
220
+ { no: 9, name: "options", kind: "message", T: Option, repeated: true },
221
+ { no: 10, name: "json_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
222
+ { no: 11, name: "default_value", kind: "scalar", T: 9 /* ScalarType.STRING */ },
223
+ ]);
224
+ /**
225
+ * Basic field types.
226
+ *
227
+ * @generated from enum google.protobuf.Field.Kind
228
+ */
229
+ export var Field_Kind;
230
+ (function (Field_Kind) {
70
231
  /**
71
- * The fully qualified message name.
232
+ * Field type unknown.
72
233
  *
73
- * @generated from field: string name = 1;
234
+ * @generated from enum value: TYPE_UNKNOWN = 0;
74
235
  */
75
- this.name = "";
236
+ Field_Kind[Field_Kind["TYPE_UNKNOWN"] = 0] = "TYPE_UNKNOWN";
76
237
  /**
77
- * The list of fields.
238
+ * Field type double.
78
239
  *
79
- * @generated from field: repeated google.protobuf.Field fields = 2;
240
+ * @generated from enum value: TYPE_DOUBLE = 1;
80
241
  */
81
- this.fields = [];
242
+ Field_Kind[Field_Kind["TYPE_DOUBLE"] = 1] = "TYPE_DOUBLE";
82
243
  /**
83
- * The list of types appearing in `oneof` definitions in this type.
244
+ * Field type float.
84
245
  *
85
- * @generated from field: repeated string oneofs = 3;
246
+ * @generated from enum value: TYPE_FLOAT = 2;
86
247
  */
87
- this.oneofs = [];
248
+ Field_Kind[Field_Kind["TYPE_FLOAT"] = 2] = "TYPE_FLOAT";
88
249
  /**
89
- * The protocol buffer options.
250
+ * Field type int64.
90
251
  *
91
- * @generated from field: repeated google.protobuf.Option options = 4;
252
+ * @generated from enum value: TYPE_INT64 = 3;
92
253
  */
93
- this.options = [];
254
+ Field_Kind[Field_Kind["TYPE_INT64"] = 3] = "TYPE_INT64";
94
255
  /**
95
- * The source syntax.
256
+ * Field type uint64.
96
257
  *
97
- * @generated from field: google.protobuf.Syntax syntax = 6;
258
+ * @generated from enum value: TYPE_UINT64 = 4;
98
259
  */
99
- this.syntax = Syntax.PROTO2;
100
- proto3.util.initPartial(data, this);
101
- }
102
- static fromBinary(bytes, options) {
103
- return new Type().fromBinary(bytes, options);
104
- }
105
- static fromJson(jsonValue, options) {
106
- return new Type().fromJson(jsonValue, options);
107
- }
108
- static fromJsonString(jsonString, options) {
109
- return new Type().fromJsonString(jsonString, options);
110
- }
111
- static equals(a, b) {
112
- return proto3.util.equals(Type, a, b);
113
- }
114
- }
115
- Type.runtime = proto3;
116
- Type.typeName = "google.protobuf.Type";
117
- Type.fields = proto3.util.newFieldList(() => [
118
- { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
119
- { no: 2, name: "fields", kind: "message", T: Field, repeated: true },
120
- {
121
- no: 3,
122
- name: "oneofs",
123
- kind: "scalar",
124
- T: 9 /* ScalarType.STRING */,
125
- repeated: true,
126
- },
127
- { no: 4, name: "options", kind: "message", T: Option, repeated: true },
128
- { no: 5, name: "source_context", kind: "message", T: SourceContext },
129
- { no: 6, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
130
- ]);
131
- /**
132
- * A single field of a message type.
133
- *
134
- * @generated from message google.protobuf.Field
135
- */
136
- export class Field extends Message {
137
- constructor(data) {
138
- super();
260
+ Field_Kind[Field_Kind["TYPE_UINT64"] = 4] = "TYPE_UINT64";
139
261
  /**
140
- * The field type.
262
+ * Field type int32.
141
263
  *
142
- * @generated from field: google.protobuf.Field.Kind kind = 1;
264
+ * @generated from enum value: TYPE_INT32 = 5;
143
265
  */
144
- this.kind = Field_Kind.TYPE_UNKNOWN;
266
+ Field_Kind[Field_Kind["TYPE_INT32"] = 5] = "TYPE_INT32";
145
267
  /**
146
- * The field cardinality.
268
+ * Field type fixed64.
147
269
  *
148
- * @generated from field: google.protobuf.Field.Cardinality cardinality = 2;
270
+ * @generated from enum value: TYPE_FIXED64 = 6;
149
271
  */
150
- this.cardinality = Field_Cardinality.UNKNOWN;
272
+ Field_Kind[Field_Kind["TYPE_FIXED64"] = 6] = "TYPE_FIXED64";
151
273
  /**
152
- * The field number.
274
+ * Field type fixed32.
153
275
  *
154
- * @generated from field: int32 number = 3;
276
+ * @generated from enum value: TYPE_FIXED32 = 7;
155
277
  */
156
- this.number = 0;
278
+ Field_Kind[Field_Kind["TYPE_FIXED32"] = 7] = "TYPE_FIXED32";
157
279
  /**
158
- * The field name.
280
+ * Field type bool.
159
281
  *
160
- * @generated from field: string name = 4;
282
+ * @generated from enum value: TYPE_BOOL = 8;
161
283
  */
162
- this.name = "";
284
+ Field_Kind[Field_Kind["TYPE_BOOL"] = 8] = "TYPE_BOOL";
163
285
  /**
164
- * The field type URL, without the scheme, for message or enumeration
165
- * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
286
+ * Field type string.
166
287
  *
167
- * @generated from field: string type_url = 6;
288
+ * @generated from enum value: TYPE_STRING = 9;
168
289
  */
169
- this.typeUrl = "";
290
+ Field_Kind[Field_Kind["TYPE_STRING"] = 9] = "TYPE_STRING";
170
291
  /**
171
- * The index of the field type in `Type.oneofs`, for message or enumeration
172
- * types. The first type has index 1; zero means the type is not in the list.
292
+ * Field type group. Proto2 syntax only, and deprecated.
173
293
  *
174
- * @generated from field: int32 oneof_index = 7;
294
+ * @generated from enum value: TYPE_GROUP = 10;
175
295
  */
176
- this.oneofIndex = 0;
296
+ Field_Kind[Field_Kind["TYPE_GROUP"] = 10] = "TYPE_GROUP";
177
297
  /**
178
- * Whether to use alternative packed wire representation.
298
+ * Field type message.
179
299
  *
180
- * @generated from field: bool packed = 8;
300
+ * @generated from enum value: TYPE_MESSAGE = 11;
181
301
  */
182
- this.packed = false;
302
+ Field_Kind[Field_Kind["TYPE_MESSAGE"] = 11] = "TYPE_MESSAGE";
183
303
  /**
184
- * The protocol buffer options.
304
+ * Field type bytes.
185
305
  *
186
- * @generated from field: repeated google.protobuf.Option options = 9;
306
+ * @generated from enum value: TYPE_BYTES = 12;
187
307
  */
188
- this.options = [];
308
+ Field_Kind[Field_Kind["TYPE_BYTES"] = 12] = "TYPE_BYTES";
189
309
  /**
190
- * The field JSON name.
310
+ * Field type uint32.
191
311
  *
192
- * @generated from field: string json_name = 10;
312
+ * @generated from enum value: TYPE_UINT32 = 13;
193
313
  */
194
- this.jsonName = "";
314
+ Field_Kind[Field_Kind["TYPE_UINT32"] = 13] = "TYPE_UINT32";
195
315
  /**
196
- * The string value of the default value of this field. Proto2 syntax only.
316
+ * Field type enum.
197
317
  *
198
- * @generated from field: string default_value = 11;
318
+ * @generated from enum value: TYPE_ENUM = 14;
199
319
  */
200
- this.defaultValue = "";
201
- proto3.util.initPartial(data, this);
202
- }
203
- static fromBinary(bytes, options) {
204
- return new Field().fromBinary(bytes, options);
205
- }
206
- static fromJson(jsonValue, options) {
207
- return new Field().fromJson(jsonValue, options);
208
- }
209
- static fromJsonString(jsonString, options) {
210
- return new Field().fromJsonString(jsonString, options);
211
- }
212
- static equals(a, b) {
213
- return proto3.util.equals(Field, a, b);
214
- }
215
- }
216
- Field.runtime = proto3;
217
- Field.typeName = "google.protobuf.Field";
218
- Field.fields = proto3.util.newFieldList(() => [
219
- { no: 1, name: "kind", kind: "enum", T: proto3.getEnumType(Field_Kind) },
220
- {
221
- no: 2,
222
- name: "cardinality",
223
- kind: "enum",
224
- T: proto3.getEnumType(Field_Cardinality),
225
- },
226
- { no: 3, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
227
- { no: 4, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
228
- { no: 6, name: "type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
229
- { no: 7, name: "oneof_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
230
- { no: 8, name: "packed", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
231
- { no: 9, name: "options", kind: "message", T: Option, repeated: true },
232
- { no: 10, name: "json_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
233
- {
234
- no: 11,
235
- name: "default_value",
236
- kind: "scalar",
237
- T: 9 /* ScalarType.STRING */,
238
- },
239
- ]);
240
- /**
241
- * Basic field types.
242
- *
243
- * @generated from enum google.protobuf.Field.Kind
244
- */
245
- export var Field_Kind;
246
- (function (Field_Kind) {
247
- /**
248
- * Field type unknown.
249
- *
250
- * @generated from enum value: TYPE_UNKNOWN = 0;
251
- */
252
- Field_Kind[(Field_Kind["TYPE_UNKNOWN"] = 0)] = "TYPE_UNKNOWN";
253
- /**
254
- * Field type double.
255
- *
256
- * @generated from enum value: TYPE_DOUBLE = 1;
257
- */
258
- Field_Kind[(Field_Kind["TYPE_DOUBLE"] = 1)] = "TYPE_DOUBLE";
259
- /**
260
- * Field type float.
261
- *
262
- * @generated from enum value: TYPE_FLOAT = 2;
263
- */
264
- Field_Kind[(Field_Kind["TYPE_FLOAT"] = 2)] = "TYPE_FLOAT";
265
- /**
266
- * Field type int64.
267
- *
268
- * @generated from enum value: TYPE_INT64 = 3;
269
- */
270
- Field_Kind[(Field_Kind["TYPE_INT64"] = 3)] = "TYPE_INT64";
271
- /**
272
- * Field type uint64.
273
- *
274
- * @generated from enum value: TYPE_UINT64 = 4;
275
- */
276
- Field_Kind[(Field_Kind["TYPE_UINT64"] = 4)] = "TYPE_UINT64";
277
- /**
278
- * Field type int32.
279
- *
280
- * @generated from enum value: TYPE_INT32 = 5;
281
- */
282
- Field_Kind[(Field_Kind["TYPE_INT32"] = 5)] = "TYPE_INT32";
283
- /**
284
- * Field type fixed64.
285
- *
286
- * @generated from enum value: TYPE_FIXED64 = 6;
287
- */
288
- Field_Kind[(Field_Kind["TYPE_FIXED64"] = 6)] = "TYPE_FIXED64";
289
- /**
290
- * Field type fixed32.
291
- *
292
- * @generated from enum value: TYPE_FIXED32 = 7;
293
- */
294
- Field_Kind[(Field_Kind["TYPE_FIXED32"] = 7)] = "TYPE_FIXED32";
295
- /**
296
- * Field type bool.
297
- *
298
- * @generated from enum value: TYPE_BOOL = 8;
299
- */
300
- Field_Kind[(Field_Kind["TYPE_BOOL"] = 8)] = "TYPE_BOOL";
301
- /**
302
- * Field type string.
303
- *
304
- * @generated from enum value: TYPE_STRING = 9;
305
- */
306
- Field_Kind[(Field_Kind["TYPE_STRING"] = 9)] = "TYPE_STRING";
307
- /**
308
- * Field type group. Proto2 syntax only, and deprecated.
309
- *
310
- * @generated from enum value: TYPE_GROUP = 10;
311
- */
312
- Field_Kind[(Field_Kind["TYPE_GROUP"] = 10)] = "TYPE_GROUP";
313
- /**
314
- * Field type message.
315
- *
316
- * @generated from enum value: TYPE_MESSAGE = 11;
317
- */
318
- Field_Kind[(Field_Kind["TYPE_MESSAGE"] = 11)] = "TYPE_MESSAGE";
319
- /**
320
- * Field type bytes.
321
- *
322
- * @generated from enum value: TYPE_BYTES = 12;
323
- */
324
- Field_Kind[(Field_Kind["TYPE_BYTES"] = 12)] = "TYPE_BYTES";
325
- /**
326
- * Field type uint32.
327
- *
328
- * @generated from enum value: TYPE_UINT32 = 13;
329
- */
330
- Field_Kind[(Field_Kind["TYPE_UINT32"] = 13)] = "TYPE_UINT32";
331
- /**
332
- * Field type enum.
333
- *
334
- * @generated from enum value: TYPE_ENUM = 14;
335
- */
336
- Field_Kind[(Field_Kind["TYPE_ENUM"] = 14)] = "TYPE_ENUM";
337
- /**
338
- * Field type sfixed32.
339
- *
340
- * @generated from enum value: TYPE_SFIXED32 = 15;
341
- */
342
- Field_Kind[(Field_Kind["TYPE_SFIXED32"] = 15)] = "TYPE_SFIXED32";
343
- /**
344
- * Field type sfixed64.
345
- *
346
- * @generated from enum value: TYPE_SFIXED64 = 16;
347
- */
348
- Field_Kind[(Field_Kind["TYPE_SFIXED64"] = 16)] = "TYPE_SFIXED64";
349
- /**
350
- * Field type sint32.
351
- *
352
- * @generated from enum value: TYPE_SINT32 = 17;
353
- */
354
- Field_Kind[(Field_Kind["TYPE_SINT32"] = 17)] = "TYPE_SINT32";
355
- /**
356
- * Field type sint64.
357
- *
358
- * @generated from enum value: TYPE_SINT64 = 18;
359
- */
360
- Field_Kind[(Field_Kind["TYPE_SINT64"] = 18)] = "TYPE_SINT64";
320
+ Field_Kind[Field_Kind["TYPE_ENUM"] = 14] = "TYPE_ENUM";
321
+ /**
322
+ * Field type sfixed32.
323
+ *
324
+ * @generated from enum value: TYPE_SFIXED32 = 15;
325
+ */
326
+ Field_Kind[Field_Kind["TYPE_SFIXED32"] = 15] = "TYPE_SFIXED32";
327
+ /**
328
+ * Field type sfixed64.
329
+ *
330
+ * @generated from enum value: TYPE_SFIXED64 = 16;
331
+ */
332
+ Field_Kind[Field_Kind["TYPE_SFIXED64"] = 16] = "TYPE_SFIXED64";
333
+ /**
334
+ * Field type sint32.
335
+ *
336
+ * @generated from enum value: TYPE_SINT32 = 17;
337
+ */
338
+ Field_Kind[Field_Kind["TYPE_SINT32"] = 17] = "TYPE_SINT32";
339
+ /**
340
+ * Field type sint64.
341
+ *
342
+ * @generated from enum value: TYPE_SINT64 = 18;
343
+ */
344
+ Field_Kind[Field_Kind["TYPE_SINT64"] = 18] = "TYPE_SINT64";
361
345
  })(Field_Kind || (Field_Kind = {}));
362
346
  // Retrieve enum metadata with: proto3.getEnumType(Field_Kind)
363
347
  proto3.util.setEnumType(Field_Kind, "google.protobuf.Field.Kind", [
364
- { no: 0, name: "TYPE_UNKNOWN" },
365
- { no: 1, name: "TYPE_DOUBLE" },
366
- { no: 2, name: "TYPE_FLOAT" },
367
- { no: 3, name: "TYPE_INT64" },
368
- { no: 4, name: "TYPE_UINT64" },
369
- { no: 5, name: "TYPE_INT32" },
370
- { no: 6, name: "TYPE_FIXED64" },
371
- { no: 7, name: "TYPE_FIXED32" },
372
- { no: 8, name: "TYPE_BOOL" },
373
- { no: 9, name: "TYPE_STRING" },
374
- { no: 10, name: "TYPE_GROUP" },
375
- { no: 11, name: "TYPE_MESSAGE" },
376
- { no: 12, name: "TYPE_BYTES" },
377
- { no: 13, name: "TYPE_UINT32" },
378
- { no: 14, name: "TYPE_ENUM" },
379
- { no: 15, name: "TYPE_SFIXED32" },
380
- { no: 16, name: "TYPE_SFIXED64" },
381
- { no: 17, name: "TYPE_SINT32" },
382
- { no: 18, name: "TYPE_SINT64" },
348
+ { no: 0, name: "TYPE_UNKNOWN" },
349
+ { no: 1, name: "TYPE_DOUBLE" },
350
+ { no: 2, name: "TYPE_FLOAT" },
351
+ { no: 3, name: "TYPE_INT64" },
352
+ { no: 4, name: "TYPE_UINT64" },
353
+ { no: 5, name: "TYPE_INT32" },
354
+ { no: 6, name: "TYPE_FIXED64" },
355
+ { no: 7, name: "TYPE_FIXED32" },
356
+ { no: 8, name: "TYPE_BOOL" },
357
+ { no: 9, name: "TYPE_STRING" },
358
+ { no: 10, name: "TYPE_GROUP" },
359
+ { no: 11, name: "TYPE_MESSAGE" },
360
+ { no: 12, name: "TYPE_BYTES" },
361
+ { no: 13, name: "TYPE_UINT32" },
362
+ { no: 14, name: "TYPE_ENUM" },
363
+ { no: 15, name: "TYPE_SFIXED32" },
364
+ { no: 16, name: "TYPE_SFIXED64" },
365
+ { no: 17, name: "TYPE_SINT32" },
366
+ { no: 18, name: "TYPE_SINT64" },
383
367
  ]);
384
368
  /**
385
369
  * Whether a field is optional, required, or repeated.
@@ -388,97 +372,93 @@ proto3.util.setEnumType(Field_Kind, "google.protobuf.Field.Kind", [
388
372
  */
389
373
  export var Field_Cardinality;
390
374
  (function (Field_Cardinality) {
391
- /**
392
- * For fields with unknown cardinality.
393
- *
394
- * @generated from enum value: CARDINALITY_UNKNOWN = 0;
395
- */
396
- Field_Cardinality[(Field_Cardinality["UNKNOWN"] = 0)] = "UNKNOWN";
397
- /**
398
- * For optional fields.
399
- *
400
- * @generated from enum value: CARDINALITY_OPTIONAL = 1;
401
- */
402
- Field_Cardinality[(Field_Cardinality["OPTIONAL"] = 1)] = "OPTIONAL";
403
- /**
404
- * For required fields. Proto2 syntax only.
405
- *
406
- * @generated from enum value: CARDINALITY_REQUIRED = 2;
407
- */
408
- Field_Cardinality[(Field_Cardinality["REQUIRED"] = 2)] = "REQUIRED";
409
- /**
410
- * For repeated fields.
411
- *
412
- * @generated from enum value: CARDINALITY_REPEATED = 3;
413
- */
414
- Field_Cardinality[(Field_Cardinality["REPEATED"] = 3)] = "REPEATED";
415
- })(Field_Cardinality || (Field_Cardinality = {}));
416
- // Retrieve enum metadata with: proto3.getEnumType(Field_Cardinality)
417
- proto3.util.setEnumType(
418
- Field_Cardinality,
419
- "google.protobuf.Field.Cardinality",
420
- [
421
- { no: 0, name: "CARDINALITY_UNKNOWN" },
422
- { no: 1, name: "CARDINALITY_OPTIONAL" },
423
- { no: 2, name: "CARDINALITY_REQUIRED" },
424
- { no: 3, name: "CARDINALITY_REPEATED" },
425
- ]
426
- );
427
- /**
428
- * Enum type definition.
429
- *
430
- * @generated from message google.protobuf.Enum
431
- */
432
- export class Enum extends Message {
433
- constructor(data) {
434
- super();
435
375
  /**
436
- * Enum type name.
376
+ * For fields with unknown cardinality.
437
377
  *
438
- * @generated from field: string name = 1;
378
+ * @generated from enum value: CARDINALITY_UNKNOWN = 0;
439
379
  */
440
- this.name = "";
380
+ Field_Cardinality[Field_Cardinality["UNKNOWN"] = 0] = "UNKNOWN";
441
381
  /**
442
- * Enum value definitions.
382
+ * For optional fields.
443
383
  *
444
- * @generated from field: repeated google.protobuf.EnumValue enumvalue = 2;
384
+ * @generated from enum value: CARDINALITY_OPTIONAL = 1;
445
385
  */
446
- this.enumvalue = [];
386
+ Field_Cardinality[Field_Cardinality["OPTIONAL"] = 1] = "OPTIONAL";
447
387
  /**
448
- * Protocol buffer options.
388
+ * For required fields. Proto2 syntax only.
449
389
  *
450
- * @generated from field: repeated google.protobuf.Option options = 3;
390
+ * @generated from enum value: CARDINALITY_REQUIRED = 2;
451
391
  */
452
- this.options = [];
392
+ Field_Cardinality[Field_Cardinality["REQUIRED"] = 2] = "REQUIRED";
453
393
  /**
454
- * The source syntax.
394
+ * For repeated fields.
455
395
  *
456
- * @generated from field: google.protobuf.Syntax syntax = 5;
396
+ * @generated from enum value: CARDINALITY_REPEATED = 3;
457
397
  */
458
- this.syntax = Syntax.PROTO2;
459
- proto3.util.initPartial(data, this);
460
- }
461
- static fromBinary(bytes, options) {
462
- return new Enum().fromBinary(bytes, options);
463
- }
464
- static fromJson(jsonValue, options) {
465
- return new Enum().fromJson(jsonValue, options);
466
- }
467
- static fromJsonString(jsonString, options) {
468
- return new Enum().fromJsonString(jsonString, options);
469
- }
470
- static equals(a, b) {
471
- return proto3.util.equals(Enum, a, b);
472
- }
398
+ Field_Cardinality[Field_Cardinality["REPEATED"] = 3] = "REPEATED";
399
+ })(Field_Cardinality || (Field_Cardinality = {}));
400
+ // Retrieve enum metadata with: proto3.getEnumType(Field_Cardinality)
401
+ proto3.util.setEnumType(Field_Cardinality, "google.protobuf.Field.Cardinality", [
402
+ { no: 0, name: "CARDINALITY_UNKNOWN" },
403
+ { no: 1, name: "CARDINALITY_OPTIONAL" },
404
+ { no: 2, name: "CARDINALITY_REQUIRED" },
405
+ { no: 3, name: "CARDINALITY_REPEATED" },
406
+ ]);
407
+ /**
408
+ * Enum type definition.
409
+ *
410
+ * @generated from message google.protobuf.Enum
411
+ */
412
+ export class Enum extends Message {
413
+ constructor(data) {
414
+ super();
415
+ /**
416
+ * Enum type name.
417
+ *
418
+ * @generated from field: string name = 1;
419
+ */
420
+ this.name = "";
421
+ /**
422
+ * Enum value definitions.
423
+ *
424
+ * @generated from field: repeated google.protobuf.EnumValue enumvalue = 2;
425
+ */
426
+ this.enumvalue = [];
427
+ /**
428
+ * Protocol buffer options.
429
+ *
430
+ * @generated from field: repeated google.protobuf.Option options = 3;
431
+ */
432
+ this.options = [];
433
+ /**
434
+ * The source syntax.
435
+ *
436
+ * @generated from field: google.protobuf.Syntax syntax = 5;
437
+ */
438
+ this.syntax = Syntax.PROTO2;
439
+ proto3.util.initPartial(data, this);
440
+ }
441
+ static fromBinary(bytes, options) {
442
+ return new Enum().fromBinary(bytes, options);
443
+ }
444
+ static fromJson(jsonValue, options) {
445
+ return new Enum().fromJson(jsonValue, options);
446
+ }
447
+ static fromJsonString(jsonString, options) {
448
+ return new Enum().fromJsonString(jsonString, options);
449
+ }
450
+ static equals(a, b) {
451
+ return proto3.util.equals(Enum, a, b);
452
+ }
473
453
  }
474
454
  Enum.runtime = proto3;
475
455
  Enum.typeName = "google.protobuf.Enum";
476
456
  Enum.fields = proto3.util.newFieldList(() => [
477
- { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
478
- { no: 2, name: "enumvalue", kind: "message", T: EnumValue, repeated: true },
479
- { no: 3, name: "options", kind: "message", T: Option, repeated: true },
480
- { no: 4, name: "source_context", kind: "message", T: SourceContext },
481
- { no: 5, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
457
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
458
+ { no: 2, name: "enumvalue", kind: "message", T: EnumValue, repeated: true },
459
+ { no: 3, name: "options", kind: "message", T: Option, repeated: true },
460
+ { no: 4, name: "source_context", kind: "message", T: SourceContext },
461
+ { no: 5, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
482
462
  ]);
483
463
  /**
484
464
  * Enum value definition.
@@ -486,47 +466,47 @@ Enum.fields = proto3.util.newFieldList(() => [
486
466
  * @generated from message google.protobuf.EnumValue
487
467
  */
488
468
  export class EnumValue extends Message {
489
- constructor(data) {
490
- super();
491
- /**
492
- * Enum value name.
493
- *
494
- * @generated from field: string name = 1;
495
- */
496
- this.name = "";
497
- /**
498
- * Enum value number.
499
- *
500
- * @generated from field: int32 number = 2;
501
- */
502
- this.number = 0;
503
- /**
504
- * Protocol buffer options.
505
- *
506
- * @generated from field: repeated google.protobuf.Option options = 3;
507
- */
508
- this.options = [];
509
- proto3.util.initPartial(data, this);
510
- }
511
- static fromBinary(bytes, options) {
512
- return new EnumValue().fromBinary(bytes, options);
513
- }
514
- static fromJson(jsonValue, options) {
515
- return new EnumValue().fromJson(jsonValue, options);
516
- }
517
- static fromJsonString(jsonString, options) {
518
- return new EnumValue().fromJsonString(jsonString, options);
519
- }
520
- static equals(a, b) {
521
- return proto3.util.equals(EnumValue, a, b);
522
- }
469
+ constructor(data) {
470
+ super();
471
+ /**
472
+ * Enum value name.
473
+ *
474
+ * @generated from field: string name = 1;
475
+ */
476
+ this.name = "";
477
+ /**
478
+ * Enum value number.
479
+ *
480
+ * @generated from field: int32 number = 2;
481
+ */
482
+ this.number = 0;
483
+ /**
484
+ * Protocol buffer options.
485
+ *
486
+ * @generated from field: repeated google.protobuf.Option options = 3;
487
+ */
488
+ this.options = [];
489
+ proto3.util.initPartial(data, this);
490
+ }
491
+ static fromBinary(bytes, options) {
492
+ return new EnumValue().fromBinary(bytes, options);
493
+ }
494
+ static fromJson(jsonValue, options) {
495
+ return new EnumValue().fromJson(jsonValue, options);
496
+ }
497
+ static fromJsonString(jsonString, options) {
498
+ return new EnumValue().fromJsonString(jsonString, options);
499
+ }
500
+ static equals(a, b) {
501
+ return proto3.util.equals(EnumValue, a, b);
502
+ }
523
503
  }
524
504
  EnumValue.runtime = proto3;
525
505
  EnumValue.typeName = "google.protobuf.EnumValue";
526
506
  EnumValue.fields = proto3.util.newFieldList(() => [
527
- { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
528
- { no: 2, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
529
- { no: 3, name: "options", kind: "message", T: Option, repeated: true },
507
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
508
+ { no: 2, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
509
+ { no: 3, name: "options", kind: "message", T: Option, repeated: true },
530
510
  ]);
531
511
  /**
532
512
  * A protocol buffer option, which can be attached to a message, field,
@@ -535,35 +515,35 @@ EnumValue.fields = proto3.util.newFieldList(() => [
535
515
  * @generated from message google.protobuf.Option
536
516
  */
537
517
  export class Option extends Message {
538
- constructor(data) {
539
- super();
540
- /**
541
- * The option's name. For protobuf built-in options (options defined in
542
- * descriptor.proto), this is the short name. For example, `"map_entry"`.
543
- * For custom options, it should be the fully-qualified name. For example,
544
- * `"google.api.http"`.
545
- *
546
- * @generated from field: string name = 1;
547
- */
548
- this.name = "";
549
- proto3.util.initPartial(data, this);
550
- }
551
- static fromBinary(bytes, options) {
552
- return new Option().fromBinary(bytes, options);
553
- }
554
- static fromJson(jsonValue, options) {
555
- return new Option().fromJson(jsonValue, options);
556
- }
557
- static fromJsonString(jsonString, options) {
558
- return new Option().fromJsonString(jsonString, options);
559
- }
560
- static equals(a, b) {
561
- return proto3.util.equals(Option, a, b);
562
- }
518
+ constructor(data) {
519
+ super();
520
+ /**
521
+ * The option's name. For protobuf built-in options (options defined in
522
+ * descriptor.proto), this is the short name. For example, `"map_entry"`.
523
+ * For custom options, it should be the fully-qualified name. For example,
524
+ * `"google.api.http"`.
525
+ *
526
+ * @generated from field: string name = 1;
527
+ */
528
+ this.name = "";
529
+ proto3.util.initPartial(data, this);
530
+ }
531
+ static fromBinary(bytes, options) {
532
+ return new Option().fromBinary(bytes, options);
533
+ }
534
+ static fromJson(jsonValue, options) {
535
+ return new Option().fromJson(jsonValue, options);
536
+ }
537
+ static fromJsonString(jsonString, options) {
538
+ return new Option().fromJsonString(jsonString, options);
539
+ }
540
+ static equals(a, b) {
541
+ return proto3.util.equals(Option, a, b);
542
+ }
563
543
  }
564
544
  Option.runtime = proto3;
565
545
  Option.typeName = "google.protobuf.Option";
566
546
  Option.fields = proto3.util.newFieldList(() => [
567
- { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
568
- { no: 2, name: "value", kind: "message", T: Any },
547
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
548
+ { no: 2, name: "value", kind: "message", T: Any },
569
549
  ]);