@bufbuild/protobuf 0.0.1-alpha.1 → 0.0.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 (127) hide show
  1. package/README.md +21 -1
  2. package/dist/cjs/binary-encoding.js +402 -410
  3. package/dist/cjs/descriptor-registry.js +407 -449
  4. package/dist/cjs/descriptor-set.js +416 -513
  5. package/dist/cjs/field.js +30 -30
  6. package/dist/cjs/google/protobuf/any_pb.js +122 -140
  7. package/dist/cjs/google/protobuf/api_pb.js +177 -224
  8. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +125 -227
  9. package/dist/cjs/google/protobuf/descriptor_pb.js +1029 -1888
  10. package/dist/cjs/google/protobuf/duration_pb.js +72 -88
  11. package/dist/cjs/google/protobuf/empty_pb.js +17 -17
  12. package/dist/cjs/google/protobuf/field_mask_pb.js +77 -94
  13. package/dist/cjs/google/protobuf/source_context_pb.js +25 -25
  14. package/dist/cjs/google/protobuf/struct_pb.js +144 -181
  15. package/dist/cjs/google/protobuf/timestamp_pb.js +86 -123
  16. package/dist/cjs/google/protobuf/type_pb.js +406 -462
  17. package/dist/cjs/google/protobuf/wrappers_pb.js +407 -470
  18. package/dist/cjs/index.js +24 -122
  19. package/dist/cjs/message.js +81 -89
  20. package/dist/cjs/private/assert.js +20 -26
  21. package/dist/cjs/private/base64.js +79 -78
  22. package/dist/cjs/private/binary-format-common.js +195 -208
  23. package/dist/cjs/private/binary-format-proto2.js +75 -109
  24. package/dist/cjs/private/binary-format-proto3.js +57 -90
  25. package/dist/cjs/private/enum.js +38 -43
  26. package/dist/cjs/private/field-list.js +51 -50
  27. package/dist/cjs/private/field-wrapper.js +8 -10
  28. package/dist/cjs/private/field.js +22 -25
  29. package/dist/cjs/private/goog-varint.js +275 -0
  30. package/dist/cjs/private/json-format-common.js +414 -440
  31. package/dist/cjs/private/json-format-proto2.js +78 -89
  32. package/dist/cjs/private/json-format-proto3.js +69 -93
  33. package/dist/cjs/private/message-type.js +26 -27
  34. package/dist/cjs/private/names.js +58 -62
  35. package/dist/cjs/private/proto-runtime.js +11 -16
  36. package/dist/cjs/private/scalars.js +100 -103
  37. package/dist/cjs/private/util-common.js +180 -210
  38. package/dist/cjs/proto-int64.js +111 -112
  39. package/dist/cjs/proto2.js +50 -63
  40. package/dist/cjs/proto3.js +61 -74
  41. package/dist/cjs/service-type.js +14 -17
  42. package/dist/cjs/type-registry.js +33 -31
  43. package/dist/esm/binary-encoding.js +401 -414
  44. package/dist/esm/descriptor-registry.js +409 -458
  45. package/dist/esm/descriptor-set.js +417 -478
  46. package/dist/esm/field.js +29 -29
  47. package/dist/esm/google/protobuf/any_pb.js +122 -140
  48. package/dist/esm/google/protobuf/api_pb.js +177 -197
  49. package/dist/esm/google/protobuf/compiler/plugin_pb.js +123 -216
  50. package/dist/esm/google/protobuf/descriptor_pb.js +1013 -1804
  51. package/dist/esm/google/protobuf/duration_pb.js +72 -88
  52. package/dist/esm/google/protobuf/empty_pb.js +17 -17
  53. package/dist/esm/google/protobuf/field_mask_pb.js +77 -94
  54. package/dist/esm/google/protobuf/source_context_pb.js +25 -25
  55. package/dist/esm/google/protobuf/struct_pb.js +143 -180
  56. package/dist/esm/google/protobuf/timestamp_pb.js +86 -123
  57. package/dist/esm/google/protobuf/type_pb.js +401 -421
  58. package/dist/esm/google/protobuf/wrappers_pb.js +406 -397
  59. package/dist/esm/index.js +1 -1
  60. package/dist/esm/message.js +81 -89
  61. package/dist/esm/private/assert.js +19 -21
  62. package/dist/esm/private/base64.js +79 -78
  63. package/dist/esm/private/binary-format-common.js +196 -207
  64. package/dist/esm/private/binary-format-proto2.js +76 -81
  65. package/dist/esm/private/binary-format-proto3.js +58 -67
  66. package/dist/esm/private/enum.js +38 -43
  67. package/dist/esm/private/field-list.js +51 -50
  68. package/dist/esm/private/field-wrapper.js +8 -10
  69. package/dist/esm/private/field.js +22 -22
  70. package/dist/esm/private/goog-varint.js +266 -0
  71. package/dist/esm/private/json-format-common.js +414 -435
  72. package/dist/esm/private/json-format-proto2.js +76 -81
  73. package/dist/esm/private/json-format-proto3.js +66 -80
  74. package/dist/esm/private/message-type.js +27 -28
  75. package/dist/esm/private/names.js +57 -57
  76. package/dist/esm/private/proto-runtime.js +11 -11
  77. package/dist/esm/private/scalars.js +99 -99
  78. package/dist/esm/private/util-common.js +180 -192
  79. package/dist/esm/proto-int64.js +111 -112
  80. package/dist/esm/proto2.js +50 -57
  81. package/dist/esm/proto3.js +61 -68
  82. package/dist/esm/service-type.js +12 -12
  83. package/dist/esm/type-registry.js +33 -31
  84. package/dist/types/binary-encoding.d.ts +398 -398
  85. package/dist/types/binary-format.d.ts +69 -91
  86. package/dist/types/descriptor-registry.d.ts +23 -29
  87. package/dist/types/descriptor-set.d.ts +107 -128
  88. package/dist/types/enum.d.ts +21 -21
  89. package/dist/types/field-list.d.ts +21 -21
  90. package/dist/types/field.d.ts +191 -231
  91. package/dist/types/google/protobuf/any_pb.d.ts +56 -77
  92. package/dist/types/google/protobuf/api_pb.d.ts +144 -187
  93. package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +195 -257
  94. package/dist/types/google/protobuf/descriptor_pb.d.ts +1360 -1737
  95. package/dist/types/google/protobuf/duration_pb.d.ts +30 -50
  96. package/dist/types/google/protobuf/empty_pb.d.ts +9 -28
  97. package/dist/types/google/protobuf/field_mask_pb.d.ts +17 -37
  98. package/dist/types/google/protobuf/source_context_pb.d.ts +16 -35
  99. package/dist/types/google/protobuf/struct_pb.d.ts +64 -115
  100. package/dist/types/google/protobuf/timestamp_pb.d.ts +31 -51
  101. package/dist/types/google/protobuf/type_pb.d.ts +355 -422
  102. package/dist/types/google/protobuf/wrappers_pb.d.ts +181 -297
  103. package/dist/types/index.d.ts +4 -27
  104. package/dist/types/json-format.d.ts +70 -89
  105. package/dist/types/message-type.d.ts +38 -46
  106. package/dist/types/message.d.ts +73 -99
  107. package/dist/types/private/assert.d.ts +1 -4
  108. package/dist/types/private/binary-format-common.d.ts +6 -32
  109. package/dist/types/private/enum.d.ts +4 -11
  110. package/dist/types/private/field-list.d.ts +14 -21
  111. package/dist/types/private/field-wrapper.d.ts +5 -11
  112. package/dist/types/private/field.d.ts +12 -12
  113. package/dist/types/{google/varint.d.ts → private/goog-varint.d.ts} +6 -13
  114. package/dist/types/private/json-format-common.d.ts +5 -27
  115. package/dist/types/private/message-type.d.ts +3 -8
  116. package/dist/types/private/names.d.ts +1 -4
  117. package/dist/types/private/options-map.d.ts +1 -1
  118. package/dist/types/private/proto-runtime.d.ts +29 -42
  119. package/dist/types/private/scalars.d.ts +5 -12
  120. package/dist/types/private/util-common.d.ts +1 -4
  121. package/dist/types/private/util.d.ts +29 -41
  122. package/dist/types/proto-int64.d.ts +42 -42
  123. package/dist/types/service-type.d.ts +37 -57
  124. package/dist/types/type-registry.d.ts +13 -15
  125. package/package.json +2 -2
  126. package/dist/cjs/google/varint.js +0 -280
  127. package/dist/esm/google/varint.js +0 -265
@@ -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.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
3
3
  // @generated from file google/protobuf/api.proto (package google.protobuf, syntax proto3)
4
4
  //
5
5
  // Protocol Buffers - Google's data interchange format
@@ -48,90 +48,90 @@ import { SourceContext } from "./source_context_pb.js";
48
48
  * @generated from message google.protobuf.Api
49
49
  */
50
50
  export class Api extends Message {
51
- constructor(data) {
52
- super();
53
- /**
54
- * The fully qualified name of this interface, including package name
55
- * followed by the interface's simple name.
56
- *
57
- * @generated from field: string name = 1;
58
- */
59
- this.name = "";
60
- /**
61
- * The methods of this interface, in unspecified order.
62
- *
63
- * @generated from field: repeated google.protobuf.Method methods = 2;
64
- */
65
- this.methods = [];
66
- /**
67
- * Any metadata attached to the interface.
68
- *
69
- * @generated from field: repeated google.protobuf.Option options = 3;
70
- */
71
- this.options = [];
72
- /**
73
- * A version string for this interface. If specified, must have the form
74
- * `major-version.minor-version`, as in `1.10`. If the minor version is
75
- * omitted, it defaults to zero. If the entire version field is empty, the
76
- * major version is derived from the package name, as outlined below. If the
77
- * field is not empty, the version in the package name will be verified to be
78
- * consistent with what is provided here.
79
- *
80
- * The versioning schema uses [semantic
81
- * versioning](http://semver.org) where the major version number
82
- * indicates a breaking change and the minor version an additive,
83
- * non-breaking change. Both version numbers are signals to users
84
- * what to expect from different versions, and should be carefully
85
- * chosen based on the product plan.
86
- *
87
- * The major version is also reflected in the package name of the
88
- * interface, which must end in `v<major-version>`, as in
89
- * `google.feature.v1`. For major versions 0 and 1, the suffix can
90
- * be omitted. Zero major versions must only be used for
91
- * experimental, non-GA interfaces.
92
- *
93
- *
94
- *
95
- * @generated from field: string version = 4;
96
- */
97
- this.version = "";
98
- /**
99
- * Included interfaces. See [Mixin][].
100
- *
101
- * @generated from field: repeated google.protobuf.Mixin mixins = 6;
102
- */
103
- this.mixins = [];
104
- /**
105
- * The source syntax of the service.
106
- *
107
- * @generated from field: google.protobuf.Syntax syntax = 7;
108
- */
109
- this.syntax = Syntax.PROTO2;
110
- proto3.util.initPartial(data, this);
111
- }
112
- static fromBinary(bytes, options) {
113
- return new Api().fromBinary(bytes, options);
114
- }
115
- static fromJson(jsonValue, options) {
116
- return new Api().fromJson(jsonValue, options);
117
- }
118
- static fromJsonString(jsonString, options) {
119
- return new Api().fromJsonString(jsonString, options);
120
- }
121
- static equals(a, b) {
122
- return proto3.util.equals(Api, a, b);
123
- }
51
+ constructor(data) {
52
+ super();
53
+ /**
54
+ * The fully qualified name of this interface, including package name
55
+ * followed by the interface's simple name.
56
+ *
57
+ * @generated from field: string name = 1;
58
+ */
59
+ this.name = "";
60
+ /**
61
+ * The methods of this interface, in unspecified order.
62
+ *
63
+ * @generated from field: repeated google.protobuf.Method methods = 2;
64
+ */
65
+ this.methods = [];
66
+ /**
67
+ * Any metadata attached to the interface.
68
+ *
69
+ * @generated from field: repeated google.protobuf.Option options = 3;
70
+ */
71
+ this.options = [];
72
+ /**
73
+ * A version string for this interface. If specified, must have the form
74
+ * `major-version.minor-version`, as in `1.10`. If the minor version is
75
+ * omitted, it defaults to zero. If the entire version field is empty, the
76
+ * major version is derived from the package name, as outlined below. If the
77
+ * field is not empty, the version in the package name will be verified to be
78
+ * consistent with what is provided here.
79
+ *
80
+ * The versioning schema uses [semantic
81
+ * versioning](http://semver.org) where the major version number
82
+ * indicates a breaking change and the minor version an additive,
83
+ * non-breaking change. Both version numbers are signals to users
84
+ * what to expect from different versions, and should be carefully
85
+ * chosen based on the product plan.
86
+ *
87
+ * The major version is also reflected in the package name of the
88
+ * interface, which must end in `v<major-version>`, as in
89
+ * `google.feature.v1`. For major versions 0 and 1, the suffix can
90
+ * be omitted. Zero major versions must only be used for
91
+ * experimental, non-GA interfaces.
92
+ *
93
+ *
94
+ *
95
+ * @generated from field: string version = 4;
96
+ */
97
+ this.version = "";
98
+ /**
99
+ * Included interfaces. See [Mixin][].
100
+ *
101
+ * @generated from field: repeated google.protobuf.Mixin mixins = 6;
102
+ */
103
+ this.mixins = [];
104
+ /**
105
+ * The source syntax of the service.
106
+ *
107
+ * @generated from field: google.protobuf.Syntax syntax = 7;
108
+ */
109
+ this.syntax = Syntax.PROTO2;
110
+ proto3.util.initPartial(data, this);
111
+ }
112
+ static fromBinary(bytes, options) {
113
+ return new Api().fromBinary(bytes, options);
114
+ }
115
+ static fromJson(jsonValue, options) {
116
+ return new Api().fromJson(jsonValue, options);
117
+ }
118
+ static fromJsonString(jsonString, options) {
119
+ return new Api().fromJsonString(jsonString, options);
120
+ }
121
+ static equals(a, b) {
122
+ return proto3.util.equals(Api, a, b);
123
+ }
124
124
  }
125
125
  Api.runtime = proto3;
126
126
  Api.typeName = "google.protobuf.Api";
127
127
  Api.fields = proto3.util.newFieldList(() => [
128
- { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
129
- { no: 2, name: "methods", kind: "message", T: Method, repeated: true },
130
- { no: 3, name: "options", kind: "message", T: Option, repeated: true },
131
- { no: 4, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ },
132
- { no: 5, name: "source_context", kind: "message", T: SourceContext },
133
- { no: 6, name: "mixins", kind: "message", T: Mixin, repeated: true },
134
- { no: 7, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
128
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
129
+ { no: 2, name: "methods", kind: "message", T: Method, repeated: true },
130
+ { no: 3, name: "options", kind: "message", T: Option, repeated: true },
131
+ { no: 4, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ },
132
+ { no: 5, name: "source_context", kind: "message", T: SourceContext },
133
+ { no: 6, name: "mixins", kind: "message", T: Mixin, repeated: true },
134
+ { no: 7, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
135
135
  ]);
136
136
  /**
137
137
  * Method represents a method of an API interface.
@@ -139,95 +139,75 @@ Api.fields = proto3.util.newFieldList(() => [
139
139
  * @generated from message google.protobuf.Method
140
140
  */
141
141
  export class Method extends Message {
142
- constructor(data) {
143
- super();
144
- /**
145
- * The simple name of this method.
146
- *
147
- * @generated from field: string name = 1;
148
- */
149
- this.name = "";
150
- /**
151
- * A URL of the input message type.
152
- *
153
- * @generated from field: string request_type_url = 2;
154
- */
155
- this.requestTypeUrl = "";
156
- /**
157
- * If true, the request is streamed.
158
- *
159
- * @generated from field: bool request_streaming = 3;
160
- */
161
- this.requestStreaming = false;
162
- /**
163
- * The URL of the output message type.
164
- *
165
- * @generated from field: string response_type_url = 4;
166
- */
167
- this.responseTypeUrl = "";
168
- /**
169
- * If true, the response is streamed.
170
- *
171
- * @generated from field: bool response_streaming = 5;
172
- */
173
- this.responseStreaming = false;
174
- /**
175
- * Any metadata attached to the method.
176
- *
177
- * @generated from field: repeated google.protobuf.Option options = 6;
178
- */
179
- this.options = [];
180
- /**
181
- * The source syntax of this method.
182
- *
183
- * @generated from field: google.protobuf.Syntax syntax = 7;
184
- */
185
- this.syntax = Syntax.PROTO2;
186
- proto3.util.initPartial(data, this);
187
- }
188
- static fromBinary(bytes, options) {
189
- return new Method().fromBinary(bytes, options);
190
- }
191
- static fromJson(jsonValue, options) {
192
- return new Method().fromJson(jsonValue, options);
193
- }
194
- static fromJsonString(jsonString, options) {
195
- return new Method().fromJsonString(jsonString, options);
196
- }
197
- static equals(a, b) {
198
- return proto3.util.equals(Method, a, b);
199
- }
142
+ constructor(data) {
143
+ super();
144
+ /**
145
+ * The simple name of this method.
146
+ *
147
+ * @generated from field: string name = 1;
148
+ */
149
+ this.name = "";
150
+ /**
151
+ * A URL of the input message type.
152
+ *
153
+ * @generated from field: string request_type_url = 2;
154
+ */
155
+ this.requestTypeUrl = "";
156
+ /**
157
+ * If true, the request is streamed.
158
+ *
159
+ * @generated from field: bool request_streaming = 3;
160
+ */
161
+ this.requestStreaming = false;
162
+ /**
163
+ * The URL of the output message type.
164
+ *
165
+ * @generated from field: string response_type_url = 4;
166
+ */
167
+ this.responseTypeUrl = "";
168
+ /**
169
+ * If true, the response is streamed.
170
+ *
171
+ * @generated from field: bool response_streaming = 5;
172
+ */
173
+ this.responseStreaming = false;
174
+ /**
175
+ * Any metadata attached to the method.
176
+ *
177
+ * @generated from field: repeated google.protobuf.Option options = 6;
178
+ */
179
+ this.options = [];
180
+ /**
181
+ * The source syntax of this method.
182
+ *
183
+ * @generated from field: google.protobuf.Syntax syntax = 7;
184
+ */
185
+ this.syntax = Syntax.PROTO2;
186
+ proto3.util.initPartial(data, this);
187
+ }
188
+ static fromBinary(bytes, options) {
189
+ return new Method().fromBinary(bytes, options);
190
+ }
191
+ static fromJson(jsonValue, options) {
192
+ return new Method().fromJson(jsonValue, options);
193
+ }
194
+ static fromJsonString(jsonString, options) {
195
+ return new Method().fromJsonString(jsonString, options);
196
+ }
197
+ static equals(a, b) {
198
+ return proto3.util.equals(Method, a, b);
199
+ }
200
200
  }
201
201
  Method.runtime = proto3;
202
202
  Method.typeName = "google.protobuf.Method";
203
203
  Method.fields = proto3.util.newFieldList(() => [
204
- { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
205
- {
206
- no: 2,
207
- name: "request_type_url",
208
- kind: "scalar",
209
- T: 9 /* ScalarType.STRING */,
210
- },
211
- {
212
- no: 3,
213
- name: "request_streaming",
214
- kind: "scalar",
215
- T: 8 /* ScalarType.BOOL */,
216
- },
217
- {
218
- no: 4,
219
- name: "response_type_url",
220
- kind: "scalar",
221
- T: 9 /* ScalarType.STRING */,
222
- },
223
- {
224
- no: 5,
225
- name: "response_streaming",
226
- kind: "scalar",
227
- T: 8 /* ScalarType.BOOL */,
228
- },
229
- { no: 6, name: "options", kind: "message", T: Option, repeated: true },
230
- { no: 7, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
204
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
205
+ { no: 2, name: "request_type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
206
+ { no: 3, name: "request_streaming", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
207
+ { no: 4, name: "response_type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
208
+ { no: 5, name: "response_streaming", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
209
+ { no: 6, name: "options", kind: "message", T: Option, repeated: true },
210
+ { no: 7, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
231
211
  ]);
232
212
  /**
233
213
  * Declares an API Interface to be included in this interface. The including
@@ -312,39 +292,39 @@ Method.fields = proto3.util.newFieldList(() => [
312
292
  * @generated from message google.protobuf.Mixin
313
293
  */
314
294
  export class Mixin extends Message {
315
- constructor(data) {
316
- super();
317
- /**
318
- * The fully qualified name of the interface which is included.
319
- *
320
- * @generated from field: string name = 1;
321
- */
322
- this.name = "";
323
- /**
324
- * If non-empty specifies a path under which inherited HTTP paths
325
- * are rooted.
326
- *
327
- * @generated from field: string root = 2;
328
- */
329
- this.root = "";
330
- proto3.util.initPartial(data, this);
331
- }
332
- static fromBinary(bytes, options) {
333
- return new Mixin().fromBinary(bytes, options);
334
- }
335
- static fromJson(jsonValue, options) {
336
- return new Mixin().fromJson(jsonValue, options);
337
- }
338
- static fromJsonString(jsonString, options) {
339
- return new Mixin().fromJsonString(jsonString, options);
340
- }
341
- static equals(a, b) {
342
- return proto3.util.equals(Mixin, a, b);
343
- }
295
+ constructor(data) {
296
+ super();
297
+ /**
298
+ * The fully qualified name of the interface which is included.
299
+ *
300
+ * @generated from field: string name = 1;
301
+ */
302
+ this.name = "";
303
+ /**
304
+ * If non-empty specifies a path under which inherited HTTP paths
305
+ * are rooted.
306
+ *
307
+ * @generated from field: string root = 2;
308
+ */
309
+ this.root = "";
310
+ proto3.util.initPartial(data, this);
311
+ }
312
+ static fromBinary(bytes, options) {
313
+ return new Mixin().fromBinary(bytes, options);
314
+ }
315
+ static fromJson(jsonValue, options) {
316
+ return new Mixin().fromJson(jsonValue, options);
317
+ }
318
+ static fromJsonString(jsonString, options) {
319
+ return new Mixin().fromJsonString(jsonString, options);
320
+ }
321
+ static equals(a, b) {
322
+ return proto3.util.equals(Mixin, a, b);
323
+ }
344
324
  }
345
325
  Mixin.runtime = proto3;
346
326
  Mixin.typeName = "google.protobuf.Mixin";
347
327
  Mixin.fields = proto3.util.newFieldList(() => [
348
- { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
349
- { no: 2, name: "root", kind: "scalar", T: 9 /* ScalarType.STRING */ },
328
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
329
+ { no: 2, name: "root", kind: "scalar", T: 9 /* ScalarType.STRING */ },
350
330
  ]);