@bufbuild/protobuf 0.0.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +6 -0
  2. package/dist/cjs/binary-encoding.js +434 -0
  3. package/dist/cjs/binary-format.js +2 -0
  4. package/dist/cjs/descriptor-registry.js +518 -0
  5. package/dist/cjs/descriptor-set.js +557 -0
  6. package/dist/cjs/enum.js +2 -0
  7. package/dist/cjs/field-list.js +2 -0
  8. package/dist/cjs/field.js +40 -0
  9. package/dist/cjs/google/protobuf/any_pb.js +280 -0
  10. package/dist/cjs/google/protobuf/api_pb.js +383 -0
  11. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +334 -0
  12. package/dist/cjs/google/protobuf/descriptor_pb.js +2311 -0
  13. package/dist/cjs/google/protobuf/duration_pb.js +201 -0
  14. package/dist/cjs/google/protobuf/empty_pb.js +72 -0
  15. package/dist/cjs/google/protobuf/field_mask_pb.js +347 -0
  16. package/dist/cjs/google/protobuf/source_context_pb.js +74 -0
  17. package/dist/cjs/google/protobuf/struct_pb.js +288 -0
  18. package/dist/cjs/google/protobuf/timestamp_pb.js +271 -0
  19. package/dist/cjs/google/protobuf/type_pb.js +613 -0
  20. package/dist/cjs/google/protobuf/wrappers_pb.js +658 -0
  21. package/dist/cjs/google/varint.js +280 -0
  22. package/dist/cjs/index.js +148 -0
  23. package/dist/cjs/json-format.js +2 -0
  24. package/dist/cjs/message-type.js +2 -0
  25. package/dist/cjs/message.js +98 -0
  26. package/dist/cjs/private/assert.js +52 -0
  27. package/dist/cjs/private/base64.js +118 -0
  28. package/dist/cjs/private/binary-format-common.js +253 -0
  29. package/dist/cjs/private/binary-format-proto2.js +120 -0
  30. package/dist/cjs/private/binary-format-proto3.js +102 -0
  31. package/dist/cjs/private/enum.js +70 -0
  32. package/dist/cjs/private/field-list.js +62 -0
  33. package/dist/cjs/private/field-wrapper.js +25 -0
  34. package/dist/cjs/private/field.js +34 -0
  35. package/dist/cjs/private/json-format-common.js +482 -0
  36. package/dist/cjs/private/json-format-proto2.js +100 -0
  37. package/dist/cjs/private/json-format-proto3.js +103 -0
  38. package/dist/cjs/private/message-type.js +37 -0
  39. package/dist/cjs/private/names.js +101 -0
  40. package/dist/cjs/private/options-map.js +2 -0
  41. package/dist/cjs/private/proto-runtime.js +24 -0
  42. package/dist/cjs/private/scalars.js +138 -0
  43. package/dist/cjs/private/util-common.js +229 -0
  44. package/dist/cjs/private/util.js +2 -0
  45. package/dist/cjs/proto-int64.js +121 -0
  46. package/dist/cjs/proto2.js +86 -0
  47. package/dist/cjs/proto3.js +99 -0
  48. package/dist/cjs/service-type.js +43 -0
  49. package/dist/cjs/type-registry.js +42 -0
  50. package/dist/esm/binary-encoding.js +434 -0
  51. package/dist/esm/binary-format.js +1 -0
  52. package/dist/esm/descriptor-registry.js +521 -0
  53. package/dist/esm/descriptor-set.js +517 -0
  54. package/dist/esm/enum.js +1 -0
  55. package/dist/esm/field-list.js +1 -0
  56. package/dist/esm/field.js +37 -0
  57. package/dist/esm/google/protobuf/any_pb.js +276 -0
  58. package/dist/esm/google/protobuf/api_pb.js +350 -0
  59. package/dist/esm/google/protobuf/compiler/plugin_pb.js +318 -0
  60. package/dist/esm/google/protobuf/descriptor_pb.js +2213 -0
  61. package/dist/esm/google/protobuf/duration_pb.js +197 -0
  62. package/dist/esm/google/protobuf/empty_pb.js +68 -0
  63. package/dist/esm/google/protobuf/field_mask_pb.js +343 -0
  64. package/dist/esm/google/protobuf/source_context_pb.js +70 -0
  65. package/dist/esm/google/protobuf/struct_pb.js +282 -0
  66. package/dist/esm/google/protobuf/timestamp_pb.js +267 -0
  67. package/dist/esm/google/protobuf/type_pb.js +569 -0
  68. package/dist/esm/google/protobuf/wrappers_pb.js +574 -0
  69. package/dist/esm/google/varint.js +265 -0
  70. package/dist/esm/index.js +24 -0
  71. package/dist/esm/json-format.js +1 -0
  72. package/dist/esm/message-type.js +1 -0
  73. package/dist/esm/message.js +94 -0
  74. package/dist/esm/private/assert.js +41 -0
  75. package/dist/esm/private/base64.js +113 -0
  76. package/dist/esm/private/binary-format-common.js +243 -0
  77. package/dist/esm/private/binary-format-proto2.js +87 -0
  78. package/dist/esm/private/binary-format-proto3.js +74 -0
  79. package/dist/esm/private/enum.js +64 -0
  80. package/dist/esm/private/field-list.js +58 -0
  81. package/dist/esm/private/field-wrapper.js +20 -0
  82. package/dist/esm/private/field.js +27 -0
  83. package/dist/esm/private/json-format-common.js +473 -0
  84. package/dist/esm/private/json-format-proto2.js +90 -0
  85. package/dist/esm/private/json-format-proto3.js +89 -0
  86. package/dist/esm/private/message-type.js +33 -0
  87. package/dist/esm/private/names.js +90 -0
  88. package/dist/esm/private/options-map.js +1 -0
  89. package/dist/esm/private/proto-runtime.js +15 -0
  90. package/dist/esm/private/scalars.js +129 -0
  91. package/dist/esm/private/util-common.js +207 -0
  92. package/dist/esm/private/util.js +1 -0
  93. package/dist/esm/proto-int64.js +118 -0
  94. package/dist/esm/proto2.js +77 -0
  95. package/dist/esm/proto3.js +90 -0
  96. package/dist/esm/service-type.js +37 -0
  97. package/dist/esm/type-registry.js +38 -0
  98. package/dist/types/binary-encoding.d.ts +421 -0
  99. package/dist/types/binary-format.d.ts +109 -0
  100. package/dist/types/descriptor-registry.d.ts +42 -0
  101. package/dist/types/descriptor-set.d.ts +171 -0
  102. package/dist/types/enum.d.ts +31 -0
  103. package/dist/types/field-list.d.ts +27 -0
  104. package/dist/types/field.d.ts +295 -0
  105. package/dist/types/google/protobuf/any_pb.d.ts +167 -0
  106. package/dist/types/google/protobuf/api_pb.d.ts +296 -0
  107. package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +294 -0
  108. package/dist/types/google/protobuf/descriptor_pb.d.ts +1959 -0
  109. package/dist/types/google/protobuf/duration_pb.d.ts +117 -0
  110. package/dist/types/google/protobuf/empty_pb.d.ts +44 -0
  111. package/dist/types/google/protobuf/field_mask_pb.d.ts +243 -0
  112. package/dist/types/google/protobuf/source_context_pb.d.ts +44 -0
  113. package/dist/types/google/protobuf/struct_pb.d.ts +205 -0
  114. package/dist/types/google/protobuf/timestamp_pb.d.ts +151 -0
  115. package/dist/types/google/protobuf/type_pb.d.ts +482 -0
  116. package/dist/types/google/protobuf/wrappers_pb.d.ts +379 -0
  117. package/dist/types/google/varint.d.ts +65 -0
  118. package/dist/types/index.d.ts +53 -0
  119. package/dist/types/json-format.d.ts +129 -0
  120. package/dist/types/message-type.d.ts +58 -0
  121. package/dist/types/message.d.ts +124 -0
  122. package/dist/types/private/assert.d.ts +19 -0
  123. package/dist/types/private/base64.d.ts +18 -0
  124. package/dist/types/private/binary-format-common.d.ts +38 -0
  125. package/dist/types/private/binary-format-proto2.d.ts +2 -0
  126. package/dist/types/private/binary-format-proto3.d.ts +2 -0
  127. package/dist/types/private/enum.d.ts +29 -0
  128. package/dist/types/private/field-list.d.ts +25 -0
  129. package/dist/types/private/field-wrapper.d.ts +27 -0
  130. package/dist/types/private/field.d.ts +15 -0
  131. package/dist/types/private/json-format-common.d.ts +30 -0
  132. package/dist/types/private/json-format-proto2.d.ts +2 -0
  133. package/dist/types/private/json-format-proto3.d.ts +2 -0
  134. package/dist/types/private/message-type.d.ts +15 -0
  135. package/dist/types/private/names.d.ts +19 -0
  136. package/dist/types/private/options-map.d.ts +7 -0
  137. package/dist/types/private/proto-runtime.d.ts +55 -0
  138. package/dist/types/private/scalars.d.ts +33 -0
  139. package/dist/types/private/util-common.d.ts +5 -0
  140. package/dist/types/private/util.d.ts +55 -0
  141. package/dist/types/proto-int64.d.ts +94 -0
  142. package/dist/types/proto2.d.ts +4 -0
  143. package/dist/types/proto3.d.ts +4 -0
  144. package/dist/types/service-type.d.ts +118 -0
  145. package/dist/types/type-registry.d.ts +37 -0
  146. package/package.json +31 -0
@@ -0,0 +1,334 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ // @generated by protoc-gen-es v0.0.1-alpha.1 with parameter "bootstrap_wkt=true,ts_nocheck=false"
4
+ // @generated from file google/protobuf/compiler/plugin.proto (package google.protobuf.compiler, syntax proto2)
5
+ //
6
+ // Protocol Buffers - Google's data interchange format
7
+ // Copyright 2008 Google Inc. All rights reserved.
8
+ // https://developers.google.com/protocol-buffers/
9
+ //
10
+ // Redistribution and use in source and binary forms, with or without
11
+ // modification, are permitted provided that the following conditions are
12
+ // met:
13
+ //
14
+ // * Redistributions of source code must retain the above copyright
15
+ // notice, this list of conditions and the following disclaimer.
16
+ // * Redistributions in binary form must reproduce the above
17
+ // copyright notice, this list of conditions and the following disclaimer
18
+ // in the documentation and/or other materials provided with the
19
+ // distribution.
20
+ // * Neither the name of Google Inc. nor the names of its
21
+ // contributors may be used to endorse or promote products derived from
22
+ // this software without specific prior written permission.
23
+ //
24
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
+ // Author: kenton@google.com (Kenton Varda)
36
+ //
37
+ // WARNING: The plugin interface is currently EXPERIMENTAL and is subject to
38
+ // change.
39
+ //
40
+ // protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is
41
+ // just a program that reads a CodeGeneratorRequest from stdin and writes a
42
+ // CodeGeneratorResponse to stdout.
43
+ //
44
+ // Plugins written using C++ can use google/protobuf/compiler/plugin.h instead
45
+ // of dealing with the raw protocol defined here.
46
+ //
47
+ // A plugin executable needs only to be placed somewhere in the path. The
48
+ // plugin should be named "protoc-gen-$NAME", and will then be used when the
49
+ // flag "--${NAME}_out" is passed to protoc.
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.CodeGeneratorResponse_File =
52
+ exports.CodeGeneratorResponse_Feature =
53
+ exports.CodeGeneratorResponse =
54
+ exports.CodeGeneratorRequest =
55
+ exports.Version =
56
+ void 0;
57
+ const index_js_1 = require("../../../index.js");
58
+ const descriptor_pb_js_1 = require("../descriptor_pb.js");
59
+ /**
60
+ * The version number of protocol compiler.
61
+ *
62
+ * @generated from message google.protobuf.compiler.Version
63
+ */
64
+ class Version extends index_js_1.Message {
65
+ constructor(data) {
66
+ super();
67
+ index_js_1.proto2.util.initPartial(data, this);
68
+ }
69
+ static fromBinary(bytes, options) {
70
+ return new Version().fromBinary(bytes, options);
71
+ }
72
+ static fromJson(jsonValue, options) {
73
+ return new Version().fromJson(jsonValue, options);
74
+ }
75
+ static fromJsonString(jsonString, options) {
76
+ return new Version().fromJsonString(jsonString, options);
77
+ }
78
+ static equals(a, b) {
79
+ return index_js_1.proto2.util.equals(Version, a, b);
80
+ }
81
+ }
82
+ exports.Version = Version;
83
+ Version.runtime = index_js_1.proto2;
84
+ Version.typeName = "google.protobuf.compiler.Version";
85
+ Version.fields = index_js_1.proto2.util.newFieldList(() => [
86
+ {
87
+ no: 1,
88
+ name: "major",
89
+ kind: "scalar",
90
+ T: 5 /* ScalarType.INT32 */,
91
+ opt: true,
92
+ },
93
+ {
94
+ no: 2,
95
+ name: "minor",
96
+ kind: "scalar",
97
+ T: 5 /* ScalarType.INT32 */,
98
+ opt: true,
99
+ },
100
+ {
101
+ no: 3,
102
+ name: "patch",
103
+ kind: "scalar",
104
+ T: 5 /* ScalarType.INT32 */,
105
+ opt: true,
106
+ },
107
+ {
108
+ no: 4,
109
+ name: "suffix",
110
+ kind: "scalar",
111
+ T: 9 /* ScalarType.STRING */,
112
+ opt: true,
113
+ },
114
+ ]);
115
+ /**
116
+ * An encoded CodeGeneratorRequest is written to the plugin's stdin.
117
+ *
118
+ * @generated from message google.protobuf.compiler.CodeGeneratorRequest
119
+ */
120
+ class CodeGeneratorRequest extends index_js_1.Message {
121
+ constructor(data) {
122
+ super();
123
+ /**
124
+ * The .proto files that were explicitly listed on the command-line. The
125
+ * code generator should generate code only for these files. Each file's
126
+ * descriptor will be included in proto_file, below.
127
+ *
128
+ * @generated from field: repeated string file_to_generate = 1;
129
+ */
130
+ this.fileToGenerate = [];
131
+ /**
132
+ * FileDescriptorProtos for all files in files_to_generate and everything
133
+ * they import. The files will appear in topological order, so each file
134
+ * appears before any file that imports it.
135
+ *
136
+ * protoc guarantees that all proto_files will be written after
137
+ * the fields above, even though this is not technically guaranteed by the
138
+ * protobuf wire format. This theoretically could allow a plugin to stream
139
+ * in the FileDescriptorProtos and handle them one by one rather than read
140
+ * the entire set into memory at once. However, as of this writing, this
141
+ * is not similarly optimized on protoc's end -- it will store all fields in
142
+ * memory at once before sending them to the plugin.
143
+ *
144
+ * Type names of fields and extensions in the FileDescriptorProto are always
145
+ * fully qualified.
146
+ *
147
+ * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15;
148
+ */
149
+ this.protoFile = [];
150
+ index_js_1.proto2.util.initPartial(data, this);
151
+ }
152
+ static fromBinary(bytes, options) {
153
+ return new CodeGeneratorRequest().fromBinary(bytes, options);
154
+ }
155
+ static fromJson(jsonValue, options) {
156
+ return new CodeGeneratorRequest().fromJson(jsonValue, options);
157
+ }
158
+ static fromJsonString(jsonString, options) {
159
+ return new CodeGeneratorRequest().fromJsonString(jsonString, options);
160
+ }
161
+ static equals(a, b) {
162
+ return index_js_1.proto2.util.equals(CodeGeneratorRequest, a, b);
163
+ }
164
+ }
165
+ exports.CodeGeneratorRequest = CodeGeneratorRequest;
166
+ CodeGeneratorRequest.runtime = index_js_1.proto2;
167
+ CodeGeneratorRequest.typeName = "google.protobuf.compiler.CodeGeneratorRequest";
168
+ CodeGeneratorRequest.fields = index_js_1.proto2.util.newFieldList(() => [
169
+ {
170
+ no: 1,
171
+ name: "file_to_generate",
172
+ kind: "scalar",
173
+ T: 9 /* ScalarType.STRING */,
174
+ repeated: true,
175
+ },
176
+ {
177
+ no: 2,
178
+ name: "parameter",
179
+ kind: "scalar",
180
+ T: 9 /* ScalarType.STRING */,
181
+ opt: true,
182
+ },
183
+ {
184
+ no: 15,
185
+ name: "proto_file",
186
+ kind: "message",
187
+ T: descriptor_pb_js_1.FileDescriptorProto,
188
+ repeated: true,
189
+ },
190
+ { no: 3, name: "compiler_version", kind: "message", T: Version, opt: true },
191
+ ]);
192
+ /**
193
+ * The plugin writes an encoded CodeGeneratorResponse to stdout.
194
+ *
195
+ * @generated from message google.protobuf.compiler.CodeGeneratorResponse
196
+ */
197
+ class CodeGeneratorResponse extends index_js_1.Message {
198
+ constructor(data) {
199
+ super();
200
+ /**
201
+ * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
202
+ */
203
+ this.file = [];
204
+ index_js_1.proto2.util.initPartial(data, this);
205
+ }
206
+ static fromBinary(bytes, options) {
207
+ return new CodeGeneratorResponse().fromBinary(bytes, options);
208
+ }
209
+ static fromJson(jsonValue, options) {
210
+ return new CodeGeneratorResponse().fromJson(jsonValue, options);
211
+ }
212
+ static fromJsonString(jsonString, options) {
213
+ return new CodeGeneratorResponse().fromJsonString(jsonString, options);
214
+ }
215
+ static equals(a, b) {
216
+ return index_js_1.proto2.util.equals(CodeGeneratorResponse, a, b);
217
+ }
218
+ }
219
+ exports.CodeGeneratorResponse = CodeGeneratorResponse;
220
+ CodeGeneratorResponse.runtime = index_js_1.proto2;
221
+ CodeGeneratorResponse.typeName =
222
+ "google.protobuf.compiler.CodeGeneratorResponse";
223
+ CodeGeneratorResponse.fields = index_js_1.proto2.util.newFieldList(() => [
224
+ {
225
+ no: 1,
226
+ name: "error",
227
+ kind: "scalar",
228
+ T: 9 /* ScalarType.STRING */,
229
+ opt: true,
230
+ },
231
+ {
232
+ no: 2,
233
+ name: "supported_features",
234
+ kind: "scalar",
235
+ T: 4 /* ScalarType.UINT64 */,
236
+ opt: true,
237
+ },
238
+ {
239
+ no: 15,
240
+ name: "file",
241
+ kind: "message",
242
+ T: CodeGeneratorResponse_File,
243
+ repeated: true,
244
+ },
245
+ ]);
246
+ /**
247
+ * Sync with code_generator.h.
248
+ *
249
+ * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature
250
+ */
251
+ var CodeGeneratorResponse_Feature;
252
+ (function (CodeGeneratorResponse_Feature) {
253
+ /**
254
+ * @generated from enum value: FEATURE_NONE = 0;
255
+ */
256
+ CodeGeneratorResponse_Feature[(CodeGeneratorResponse_Feature["NONE"] = 0)] =
257
+ "NONE";
258
+ /**
259
+ * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1;
260
+ */
261
+ CodeGeneratorResponse_Feature[
262
+ (CodeGeneratorResponse_Feature["PROTO3_OPTIONAL"] = 1)
263
+ ] = "PROTO3_OPTIONAL";
264
+ })(
265
+ (CodeGeneratorResponse_Feature =
266
+ exports.CodeGeneratorResponse_Feature ||
267
+ (exports.CodeGeneratorResponse_Feature = {}))
268
+ );
269
+ // Retrieve enum metadata with: proto2.getEnumType(CodeGeneratorResponse_Feature)
270
+ index_js_1.proto2.util.setEnumType(
271
+ CodeGeneratorResponse_Feature,
272
+ "google.protobuf.compiler.CodeGeneratorResponse.Feature",
273
+ [
274
+ { no: 0, name: "FEATURE_NONE" },
275
+ { no: 1, name: "FEATURE_PROTO3_OPTIONAL" },
276
+ ]
277
+ );
278
+ /**
279
+ * Represents a single generated file.
280
+ *
281
+ * @generated from message google.protobuf.compiler.CodeGeneratorResponse.File
282
+ */
283
+ class CodeGeneratorResponse_File extends index_js_1.Message {
284
+ constructor(data) {
285
+ super();
286
+ index_js_1.proto2.util.initPartial(data, this);
287
+ }
288
+ static fromBinary(bytes, options) {
289
+ return new CodeGeneratorResponse_File().fromBinary(bytes, options);
290
+ }
291
+ static fromJson(jsonValue, options) {
292
+ return new CodeGeneratorResponse_File().fromJson(jsonValue, options);
293
+ }
294
+ static fromJsonString(jsonString, options) {
295
+ return new CodeGeneratorResponse_File().fromJsonString(jsonString, options);
296
+ }
297
+ static equals(a, b) {
298
+ return index_js_1.proto2.util.equals(CodeGeneratorResponse_File, a, b);
299
+ }
300
+ }
301
+ exports.CodeGeneratorResponse_File = CodeGeneratorResponse_File;
302
+ CodeGeneratorResponse_File.runtime = index_js_1.proto2;
303
+ CodeGeneratorResponse_File.typeName =
304
+ "google.protobuf.compiler.CodeGeneratorResponse.File";
305
+ CodeGeneratorResponse_File.fields = index_js_1.proto2.util.newFieldList(() => [
306
+ {
307
+ no: 1,
308
+ name: "name",
309
+ kind: "scalar",
310
+ T: 9 /* ScalarType.STRING */,
311
+ opt: true,
312
+ },
313
+ {
314
+ no: 2,
315
+ name: "insertion_point",
316
+ kind: "scalar",
317
+ T: 9 /* ScalarType.STRING */,
318
+ opt: true,
319
+ },
320
+ {
321
+ no: 15,
322
+ name: "content",
323
+ kind: "scalar",
324
+ T: 9 /* ScalarType.STRING */,
325
+ opt: true,
326
+ },
327
+ {
328
+ no: 16,
329
+ name: "generated_code_info",
330
+ kind: "message",
331
+ T: descriptor_pb_js_1.GeneratedCodeInfo,
332
+ opt: true,
333
+ },
334
+ ]);