@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,280 @@
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/any.proto (package google.protobuf, syntax proto3)
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
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Any = void 0;
37
+ const index_js_1 = require("../../index.js");
38
+ /**
39
+ * `Any` contains an arbitrary serialized protocol buffer message along with a
40
+ * URL that describes the type of the serialized message.
41
+ *
42
+ * Protobuf library provides support to pack/unpack Any values in the form
43
+ * of utility functions or additional generated methods of the Any type.
44
+ *
45
+ * Example 1: Pack and unpack a message in C++.
46
+ *
47
+ * Foo foo = ...;
48
+ * Any any;
49
+ * any.PackFrom(foo);
50
+ * ...
51
+ * if (any.UnpackTo(&foo)) {
52
+ * ...
53
+ * }
54
+ *
55
+ * Example 2: Pack and unpack a message in Java.
56
+ *
57
+ * Foo foo = ...;
58
+ * Any any = Any.pack(foo);
59
+ * ...
60
+ * if (any.is(Foo.class)) {
61
+ * foo = any.unpack(Foo.class);
62
+ * }
63
+ *
64
+ * Example 3: Pack and unpack a message in Python.
65
+ *
66
+ * foo = Foo(...)
67
+ * any = Any()
68
+ * any.Pack(foo)
69
+ * ...
70
+ * if any.Is(Foo.DESCRIPTOR):
71
+ * any.Unpack(foo)
72
+ * ...
73
+ *
74
+ * Example 4: Pack and unpack a message in Go
75
+ *
76
+ * foo := &pb.Foo{...}
77
+ * any, err := anypb.New(foo)
78
+ * if err != nil {
79
+ * ...
80
+ * }
81
+ * ...
82
+ * foo := &pb.Foo{}
83
+ * if err := any.UnmarshalTo(foo); err != nil {
84
+ * ...
85
+ * }
86
+ *
87
+ * The pack methods provided by protobuf library will by default use
88
+ * 'type.googleapis.com/full.type.name' as the type URL and the unpack
89
+ * methods only use the fully qualified type name after the last '/'
90
+ * in the type URL, for example "foo.bar.com/x/y.z" will yield type
91
+ * name "y.z".
92
+ *
93
+ *
94
+ * JSON
95
+ * ====
96
+ * The JSON representation of an `Any` value uses the regular
97
+ * representation of the deserialized, embedded message, with an
98
+ * additional field `@type` which contains the type URL. Example:
99
+ *
100
+ * package google.profile;
101
+ * message Person {
102
+ * string first_name = 1;
103
+ * string last_name = 2;
104
+ * }
105
+ *
106
+ * {
107
+ * "@type": "type.googleapis.com/google.profile.Person",
108
+ * "firstName": <string>,
109
+ * "lastName": <string>
110
+ * }
111
+ *
112
+ * If the embedded message type is well-known and has a custom JSON
113
+ * representation, that representation will be embedded adding a field
114
+ * `value` which holds the custom JSON in addition to the `@type`
115
+ * field. Example (for message [google.protobuf.Duration][]):
116
+ *
117
+ * {
118
+ * "@type": "type.googleapis.com/google.protobuf.Duration",
119
+ * "value": "1.212s"
120
+ * }
121
+ *
122
+ *
123
+ * @generated from message google.protobuf.Any
124
+ */
125
+ class Any extends index_js_1.Message {
126
+ constructor(data) {
127
+ super();
128
+ /**
129
+ * A URL/resource name that uniquely identifies the type of the serialized
130
+ * protocol buffer message. This string must contain at least
131
+ * one "/" character. The last segment of the URL's path must represent
132
+ * the fully qualified name of the type (as in
133
+ * `path/google.protobuf.Duration`). The name should be in a canonical form
134
+ * (e.g., leading "." is not accepted).
135
+ *
136
+ * In practice, teams usually precompile into the binary all types that they
137
+ * expect it to use in the context of Any. However, for URLs which use the
138
+ * scheme `http`, `https`, or no scheme, one can optionally set up a type
139
+ * server that maps type URLs to message definitions as follows:
140
+ *
141
+ * * If no scheme is provided, `https` is assumed.
142
+ * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
143
+ * value in binary format, or produce an error.
144
+ * * Applications are allowed to cache lookup results based on the
145
+ * URL, or have them precompiled into a binary to avoid any
146
+ * lookup. Therefore, binary compatibility needs to be preserved
147
+ * on changes to types. (Use versioned type names to manage
148
+ * breaking changes.)
149
+ *
150
+ * Note: this functionality is not currently available in the official
151
+ * protobuf release, and it is not used for type URLs beginning with
152
+ * type.googleapis.com.
153
+ *
154
+ * Schemes other than `http`, `https` (or the empty scheme) might be
155
+ * used with implementation specific semantics.
156
+ *
157
+ *
158
+ * @generated from field: string type_url = 1;
159
+ */
160
+ this.typeUrl = "";
161
+ /**
162
+ * Must be a valid serialized protocol buffer of the above specified type.
163
+ *
164
+ * @generated from field: bytes value = 2;
165
+ */
166
+ this.value = new Uint8Array(0);
167
+ index_js_1.proto3.util.initPartial(data, this);
168
+ }
169
+ toJson(options) {
170
+ if (this.typeUrl === "") {
171
+ return {};
172
+ }
173
+ const typeName = this.typeUrlToName(this.typeUrl);
174
+ const messageType = options?.typeRegistry?.findMessage(typeName);
175
+ if (!messageType) {
176
+ throw new Error(
177
+ `cannot encode message google.protobuf.Any to JSON: "${this.typeUrl}" is not in the type registry`
178
+ );
179
+ }
180
+ const message = messageType.fromBinary(this.value);
181
+ let json = message.toJson(options);
182
+ if (
183
+ typeName.startsWith("google.protobuf.") ||
184
+ json === null ||
185
+ Array.isArray(json) ||
186
+ typeof json !== "object"
187
+ ) {
188
+ json = { value: json };
189
+ }
190
+ json["@type"] = this.typeUrl;
191
+ return json;
192
+ }
193
+ fromJson(json, options) {
194
+ if (json === null || Array.isArray(json) || typeof json != "object") {
195
+ throw new Error(
196
+ `cannot decode message google.protobuf.Any from JSON: expected object but got ${
197
+ json === null ? "null" : Array.isArray(json) ? "array" : typeof json
198
+ }`
199
+ );
200
+ }
201
+ const typeUrl = json["@type"];
202
+ if (typeof typeUrl != "string" || typeUrl == "") {
203
+ throw new Error(
204
+ `cannot decode message google.protobuf.Any from JSON: "@type" is empty`
205
+ );
206
+ }
207
+ const typeName = this.typeUrlToName(typeUrl),
208
+ messageType = options?.typeRegistry?.findMessage(typeName);
209
+ if (!messageType) {
210
+ throw new Error(
211
+ `cannot decode message google.protobuf.Any from JSON: ${typeUrl} is not in the type registry`
212
+ );
213
+ }
214
+ let message;
215
+ if (
216
+ typeName.startsWith("google.protobuf.") &&
217
+ Object.prototype.hasOwnProperty.call(json, "value")
218
+ ) {
219
+ message = messageType.fromJson(json["value"], options);
220
+ } else {
221
+ const copy = Object.assign({}, json);
222
+ delete copy["@type"];
223
+ message = messageType.fromJson(copy, options);
224
+ }
225
+ this.packFrom(message);
226
+ return this;
227
+ }
228
+ packFrom(message) {
229
+ this.value = message.toBinary();
230
+ this.typeUrl = this.typeNameToUrl(message.getType().typeName);
231
+ }
232
+ unpackTo(target) {
233
+ if (!this.is(target.getType())) {
234
+ return false;
235
+ }
236
+ target.fromBinary(this.value);
237
+ return true;
238
+ }
239
+ is(type) {
240
+ return this.typeUrl === this.typeNameToUrl(type.typeName);
241
+ }
242
+ typeNameToUrl(name) {
243
+ return `type.googleapis.com/${name}`;
244
+ }
245
+ typeUrlToName(url) {
246
+ if (!url.length) {
247
+ throw new Error(`invalid type url: ${url}`);
248
+ }
249
+ const slash = url.lastIndexOf("/");
250
+ const name = slash > 0 ? url.substring(slash + 1) : url;
251
+ if (!name.length) {
252
+ throw new Error(`invalid type url: ${url}`);
253
+ }
254
+ return name;
255
+ }
256
+ static pack(message) {
257
+ const any = new Any();
258
+ any.packFrom(message);
259
+ return any;
260
+ }
261
+ static fromBinary(bytes, options) {
262
+ return new Any().fromBinary(bytes, options);
263
+ }
264
+ static fromJson(jsonValue, options) {
265
+ return new Any().fromJson(jsonValue, options);
266
+ }
267
+ static fromJsonString(jsonString, options) {
268
+ return new Any().fromJsonString(jsonString, options);
269
+ }
270
+ static equals(a, b) {
271
+ return index_js_1.proto3.util.equals(Any, a, b);
272
+ }
273
+ }
274
+ exports.Any = Any;
275
+ Any.runtime = index_js_1.proto3;
276
+ Any.typeName = "google.protobuf.Any";
277
+ Any.fields = index_js_1.proto3.util.newFieldList(() => [
278
+ { no: 1, name: "type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
279
+ { no: 2, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
280
+ ]);
@@ -0,0 +1,383 @@
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/api.proto (package google.protobuf, syntax proto3)
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
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Mixin = exports.Method = exports.Api = void 0;
37
+ const index_js_1 = require("../../index.js");
38
+ const type_pb_js_1 = require("./type_pb.js");
39
+ const source_context_pb_js_1 = require("./source_context_pb.js");
40
+ /**
41
+ * Api is a light-weight descriptor for an API Interface.
42
+ *
43
+ * Interfaces are also described as "protocol buffer services" in some contexts,
44
+ * such as by the "service" keyword in a .proto file, but they are different
45
+ * from API Services, which represent a concrete implementation of an interface
46
+ * as opposed to simply a description of methods and bindings. They are also
47
+ * sometimes simply referred to as "APIs" in other contexts, such as the name of
48
+ * this message itself. See https://cloud.google.com/apis/design/glossary for
49
+ * detailed terminology.
50
+ *
51
+ * @generated from message google.protobuf.Api
52
+ */
53
+ class Api extends index_js_1.Message {
54
+ constructor(data) {
55
+ super();
56
+ /**
57
+ * The fully qualified name of this interface, including package name
58
+ * followed by the interface's simple name.
59
+ *
60
+ * @generated from field: string name = 1;
61
+ */
62
+ this.name = "";
63
+ /**
64
+ * The methods of this interface, in unspecified order.
65
+ *
66
+ * @generated from field: repeated google.protobuf.Method methods = 2;
67
+ */
68
+ this.methods = [];
69
+ /**
70
+ * Any metadata attached to the interface.
71
+ *
72
+ * @generated from field: repeated google.protobuf.Option options = 3;
73
+ */
74
+ this.options = [];
75
+ /**
76
+ * A version string for this interface. If specified, must have the form
77
+ * `major-version.minor-version`, as in `1.10`. If the minor version is
78
+ * omitted, it defaults to zero. If the entire version field is empty, the
79
+ * major version is derived from the package name, as outlined below. If the
80
+ * field is not empty, the version in the package name will be verified to be
81
+ * consistent with what is provided here.
82
+ *
83
+ * The versioning schema uses [semantic
84
+ * versioning](http://semver.org) where the major version number
85
+ * indicates a breaking change and the minor version an additive,
86
+ * non-breaking change. Both version numbers are signals to users
87
+ * what to expect from different versions, and should be carefully
88
+ * chosen based on the product plan.
89
+ *
90
+ * The major version is also reflected in the package name of the
91
+ * interface, which must end in `v<major-version>`, as in
92
+ * `google.feature.v1`. For major versions 0 and 1, the suffix can
93
+ * be omitted. Zero major versions must only be used for
94
+ * experimental, non-GA interfaces.
95
+ *
96
+ *
97
+ *
98
+ * @generated from field: string version = 4;
99
+ */
100
+ this.version = "";
101
+ /**
102
+ * Included interfaces. See [Mixin][].
103
+ *
104
+ * @generated from field: repeated google.protobuf.Mixin mixins = 6;
105
+ */
106
+ this.mixins = [];
107
+ /**
108
+ * The source syntax of the service.
109
+ *
110
+ * @generated from field: google.protobuf.Syntax syntax = 7;
111
+ */
112
+ this.syntax = type_pb_js_1.Syntax.PROTO2;
113
+ index_js_1.proto3.util.initPartial(data, this);
114
+ }
115
+ static fromBinary(bytes, options) {
116
+ return new Api().fromBinary(bytes, options);
117
+ }
118
+ static fromJson(jsonValue, options) {
119
+ return new Api().fromJson(jsonValue, options);
120
+ }
121
+ static fromJsonString(jsonString, options) {
122
+ return new Api().fromJsonString(jsonString, options);
123
+ }
124
+ static equals(a, b) {
125
+ return index_js_1.proto3.util.equals(Api, a, b);
126
+ }
127
+ }
128
+ exports.Api = Api;
129
+ Api.runtime = index_js_1.proto3;
130
+ Api.typeName = "google.protobuf.Api";
131
+ Api.fields = index_js_1.proto3.util.newFieldList(() => [
132
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
133
+ { no: 2, name: "methods", kind: "message", T: Method, repeated: true },
134
+ {
135
+ no: 3,
136
+ name: "options",
137
+ kind: "message",
138
+ T: type_pb_js_1.Option,
139
+ repeated: true,
140
+ },
141
+ { no: 4, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ },
142
+ {
143
+ no: 5,
144
+ name: "source_context",
145
+ kind: "message",
146
+ T: source_context_pb_js_1.SourceContext,
147
+ },
148
+ { no: 6, name: "mixins", kind: "message", T: Mixin, repeated: true },
149
+ {
150
+ no: 7,
151
+ name: "syntax",
152
+ kind: "enum",
153
+ T: index_js_1.proto3.getEnumType(type_pb_js_1.Syntax),
154
+ },
155
+ ]);
156
+ /**
157
+ * Method represents a method of an API interface.
158
+ *
159
+ * @generated from message google.protobuf.Method
160
+ */
161
+ class Method extends index_js_1.Message {
162
+ constructor(data) {
163
+ super();
164
+ /**
165
+ * The simple name of this method.
166
+ *
167
+ * @generated from field: string name = 1;
168
+ */
169
+ this.name = "";
170
+ /**
171
+ * A URL of the input message type.
172
+ *
173
+ * @generated from field: string request_type_url = 2;
174
+ */
175
+ this.requestTypeUrl = "";
176
+ /**
177
+ * If true, the request is streamed.
178
+ *
179
+ * @generated from field: bool request_streaming = 3;
180
+ */
181
+ this.requestStreaming = false;
182
+ /**
183
+ * The URL of the output message type.
184
+ *
185
+ * @generated from field: string response_type_url = 4;
186
+ */
187
+ this.responseTypeUrl = "";
188
+ /**
189
+ * If true, the response is streamed.
190
+ *
191
+ * @generated from field: bool response_streaming = 5;
192
+ */
193
+ this.responseStreaming = false;
194
+ /**
195
+ * Any metadata attached to the method.
196
+ *
197
+ * @generated from field: repeated google.protobuf.Option options = 6;
198
+ */
199
+ this.options = [];
200
+ /**
201
+ * The source syntax of this method.
202
+ *
203
+ * @generated from field: google.protobuf.Syntax syntax = 7;
204
+ */
205
+ this.syntax = type_pb_js_1.Syntax.PROTO2;
206
+ index_js_1.proto3.util.initPartial(data, this);
207
+ }
208
+ static fromBinary(bytes, options) {
209
+ return new Method().fromBinary(bytes, options);
210
+ }
211
+ static fromJson(jsonValue, options) {
212
+ return new Method().fromJson(jsonValue, options);
213
+ }
214
+ static fromJsonString(jsonString, options) {
215
+ return new Method().fromJsonString(jsonString, options);
216
+ }
217
+ static equals(a, b) {
218
+ return index_js_1.proto3.util.equals(Method, a, b);
219
+ }
220
+ }
221
+ exports.Method = Method;
222
+ Method.runtime = index_js_1.proto3;
223
+ Method.typeName = "google.protobuf.Method";
224
+ Method.fields = index_js_1.proto3.util.newFieldList(() => [
225
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
226
+ {
227
+ no: 2,
228
+ name: "request_type_url",
229
+ kind: "scalar",
230
+ T: 9 /* ScalarType.STRING */,
231
+ },
232
+ {
233
+ no: 3,
234
+ name: "request_streaming",
235
+ kind: "scalar",
236
+ T: 8 /* ScalarType.BOOL */,
237
+ },
238
+ {
239
+ no: 4,
240
+ name: "response_type_url",
241
+ kind: "scalar",
242
+ T: 9 /* ScalarType.STRING */,
243
+ },
244
+ {
245
+ no: 5,
246
+ name: "response_streaming",
247
+ kind: "scalar",
248
+ T: 8 /* ScalarType.BOOL */,
249
+ },
250
+ {
251
+ no: 6,
252
+ name: "options",
253
+ kind: "message",
254
+ T: type_pb_js_1.Option,
255
+ repeated: true,
256
+ },
257
+ {
258
+ no: 7,
259
+ name: "syntax",
260
+ kind: "enum",
261
+ T: index_js_1.proto3.getEnumType(type_pb_js_1.Syntax),
262
+ },
263
+ ]);
264
+ /**
265
+ * Declares an API Interface to be included in this interface. The including
266
+ * interface must redeclare all the methods from the included interface, but
267
+ * documentation and options are inherited as follows:
268
+ *
269
+ * - If after comment and whitespace stripping, the documentation
270
+ * string of the redeclared method is empty, it will be inherited
271
+ * from the original method.
272
+ *
273
+ * - Each annotation belonging to the service config (http,
274
+ * visibility) which is not set in the redeclared method will be
275
+ * inherited.
276
+ *
277
+ * - If an http annotation is inherited, the path pattern will be
278
+ * modified as follows. Any version prefix will be replaced by the
279
+ * version of the including interface plus the [root][] path if
280
+ * specified.
281
+ *
282
+ * Example of a simple mixin:
283
+ *
284
+ * package google.acl.v1;
285
+ * service AccessControl {
286
+ * // Get the underlying ACL object.
287
+ * rpc GetAcl(GetAclRequest) returns (Acl) {
288
+ * option (google.api.http).get = "/v1/{resource=**}:getAcl";
289
+ * }
290
+ * }
291
+ *
292
+ * package google.storage.v2;
293
+ * service Storage {
294
+ * rpc GetAcl(GetAclRequest) returns (Acl);
295
+ *
296
+ * // Get a data record.
297
+ * rpc GetData(GetDataRequest) returns (Data) {
298
+ * option (google.api.http).get = "/v2/{resource=**}";
299
+ * }
300
+ * }
301
+ *
302
+ * Example of a mixin configuration:
303
+ *
304
+ * apis:
305
+ * - name: google.storage.v2.Storage
306
+ * mixins:
307
+ * - name: google.acl.v1.AccessControl
308
+ *
309
+ * The mixin construct implies that all methods in `AccessControl` are
310
+ * also declared with same name and request/response types in
311
+ * `Storage`. A documentation generator or annotation processor will
312
+ * see the effective `Storage.GetAcl` method after inheriting
313
+ * documentation and annotations as follows:
314
+ *
315
+ * service Storage {
316
+ * // Get the underlying ACL object.
317
+ * rpc GetAcl(GetAclRequest) returns (Acl) {
318
+ * option (google.api.http).get = "/v2/{resource=**}:getAcl";
319
+ * }
320
+ * ...
321
+ * }
322
+ *
323
+ * Note how the version in the path pattern changed from `v1` to `v2`.
324
+ *
325
+ * If the `root` field in the mixin is specified, it should be a
326
+ * relative path under which inherited HTTP paths are placed. Example:
327
+ *
328
+ * apis:
329
+ * - name: google.storage.v2.Storage
330
+ * mixins:
331
+ * - name: google.acl.v1.AccessControl
332
+ * root: acls
333
+ *
334
+ * This implies the following inherited HTTP annotation:
335
+ *
336
+ * service Storage {
337
+ * // Get the underlying ACL object.
338
+ * rpc GetAcl(GetAclRequest) returns (Acl) {
339
+ * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
340
+ * }
341
+ * ...
342
+ * }
343
+ *
344
+ * @generated from message google.protobuf.Mixin
345
+ */
346
+ class Mixin extends index_js_1.Message {
347
+ constructor(data) {
348
+ super();
349
+ /**
350
+ * The fully qualified name of the interface which is included.
351
+ *
352
+ * @generated from field: string name = 1;
353
+ */
354
+ this.name = "";
355
+ /**
356
+ * If non-empty specifies a path under which inherited HTTP paths
357
+ * are rooted.
358
+ *
359
+ * @generated from field: string root = 2;
360
+ */
361
+ this.root = "";
362
+ index_js_1.proto3.util.initPartial(data, this);
363
+ }
364
+ static fromBinary(bytes, options) {
365
+ return new Mixin().fromBinary(bytes, options);
366
+ }
367
+ static fromJson(jsonValue, options) {
368
+ return new Mixin().fromJson(jsonValue, options);
369
+ }
370
+ static fromJsonString(jsonString, options) {
371
+ return new Mixin().fromJsonString(jsonString, options);
372
+ }
373
+ static equals(a, b) {
374
+ return index_js_1.proto3.util.equals(Mixin, a, b);
375
+ }
376
+ }
377
+ exports.Mixin = Mixin;
378
+ Mixin.runtime = index_js_1.proto3;
379
+ Mixin.typeName = "google.protobuf.Mixin";
380
+ Mixin.fields = index_js_1.proto3.util.newFieldList(() => [
381
+ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
382
+ { no: 2, name: "root", kind: "scalar", T: 9 /* ScalarType.STRING */ },
383
+ ]);