@mochabug/adaptkit 1.0.0-rc.4 → 1.0.0-rc.7

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 (75) hide show
  1. package/assets/build.js +2 -57
  2. package/assets/configurator.html +14 -0
  3. package/assets/configurator.ssg.tsx +2 -16
  4. package/assets/configurator_react.tsx +6 -3
  5. package/assets/executor.html +14 -0
  6. package/assets/executor.ssg.tsx +2 -16
  7. package/assets/executor_browser_react.tsx +6 -3
  8. package/assets/gitignore +3 -1
  9. package/assets/tsconf.json +3 -5
  10. package/bin/add.d.ts +3 -0
  11. package/bin/add.d.ts.map +1 -0
  12. package/bin/genproto/buf/validate/validate_pb.d.ts +8122 -0
  13. package/bin/genproto/buf/validate/validate_pb.d.ts.map +1 -0
  14. package/bin/genproto/google/api/annotations_pb.d.ts +14 -0
  15. package/bin/genproto/google/api/annotations_pb.d.ts.map +1 -0
  16. package/bin/genproto/google/api/client_pb.d.ts +1402 -0
  17. package/bin/genproto/google/api/client_pb.d.ts.map +1 -0
  18. package/bin/genproto/google/api/http_pb.d.ts +837 -0
  19. package/bin/genproto/google/api/http_pb.d.ts.map +1 -0
  20. package/bin/genproto/google/api/launch_stage_pb.d.ts +94 -0
  21. package/bin/genproto/google/api/launch_stage_pb.d.ts.map +1 -0
  22. package/bin/genproto/mochabugapis/adapt/graph/exchange_pb.d.ts +75 -0
  23. package/bin/genproto/mochabugapis/adapt/graph/exchange_pb.d.ts.map +1 -0
  24. package/bin/genproto/mochabugapis/adapt/graph/jtd_schema_pb.d.ts +225 -0
  25. package/bin/genproto/mochabugapis/adapt/graph/jtd_schema_pb.d.ts.map +1 -0
  26. package/bin/genproto/mochabugapis/adapt/graph/receiver_pb.d.ts +67 -0
  27. package/bin/genproto/mochabugapis/adapt/graph/receiver_pb.d.ts.map +1 -0
  28. package/bin/genproto/mochabugapis/adapt/graph/signal_binding_pb.d.ts +133 -0
  29. package/bin/genproto/mochabugapis/adapt/graph/signal_binding_pb.d.ts.map +1 -0
  30. package/bin/genproto/mochabugapis/adapt/graph/signal_descriptor_pb.d.ts +87 -0
  31. package/bin/genproto/mochabugapis/adapt/graph/signal_descriptor_pb.d.ts.map +1 -0
  32. package/bin/genproto/mochabugapis/adapt/graph/transceiver_pb.d.ts +63 -0
  33. package/bin/genproto/mochabugapis/adapt/graph/transceiver_pb.d.ts.map +1 -0
  34. package/bin/genproto/mochabugapis/adapt/graph/transmitter_pb.d.ts +75 -0
  35. package/bin/genproto/mochabugapis/adapt/graph/transmitter_pb.d.ts.map +1 -0
  36. package/bin/genproto/mochabugapis/adapt/graph/vertex_config_pb.d.ts +109 -0
  37. package/bin/genproto/mochabugapis/adapt/graph/vertex_config_pb.d.ts.map +1 -0
  38. package/bin/genproto/mochabugapis/adapt/plugins/v1/file_pb.d.ts +62 -0
  39. package/bin/genproto/mochabugapis/adapt/plugins/v1/file_pb.d.ts.map +1 -0
  40. package/bin/genproto/mochabugapis/adapt/plugins/v1/manifest_pb.d.ts +223 -0
  41. package/bin/genproto/mochabugapis/adapt/plugins/v1/manifest_pb.d.ts.map +1 -0
  42. package/bin/genproto/mochabugapis/adapt/plugins/v1/oauth2_service_pb.d.ts +715 -0
  43. package/bin/genproto/mochabugapis/adapt/plugins/v1/oauth2_service_pb.d.ts.map +1 -0
  44. package/bin/genproto/mochabugapis/adapt/plugins/v1/oneof_service_pb.d.ts +92 -0
  45. package/bin/genproto/mochabugapis/adapt/plugins/v1/oneof_service_pb.d.ts.map +1 -0
  46. package/bin/genproto/mochabugapis/adapt/plugins/v1/plugins_pb.d.ts +194 -0
  47. package/bin/genproto/mochabugapis/adapt/plugins/v1/plugins_pb.d.ts.map +1 -0
  48. package/bin/genproto/mochabugapis/adapt/plugins/v1/service_binding_pb.d.ts +134 -0
  49. package/bin/genproto/mochabugapis/adapt/plugins/v1/service_binding_pb.d.ts.map +1 -0
  50. package/bin/genproto/mochabugapis/adapt/plugins/v1/service_definition_pb.d.ts +116 -0
  51. package/bin/genproto/mochabugapis/adapt/plugins/v1/service_definition_pb.d.ts.map +1 -0
  52. package/bin/genproto/mochabugapis/adapt/plugins/v1/tls_service_pb.d.ts +159 -0
  53. package/bin/genproto/mochabugapis/adapt/plugins/v1/tls_service_pb.d.ts.map +1 -0
  54. package/bin/genproto/mochabugapis/adapt/plugins/v1/variable_service_pb.d.ts +60 -0
  55. package/bin/genproto/mochabugapis/adapt/plugins/v1/variable_service_pb.d.ts.map +1 -0
  56. package/bin/genproto/mochabugapis/adapt/plugins/v1/vertex_pb.d.ts +232 -0
  57. package/bin/genproto/mochabugapis/adapt/plugins/v1/vertex_pb.d.ts.map +1 -0
  58. package/bin/index.d.ts +7 -0
  59. package/bin/index.d.ts.map +1 -0
  60. package/bin/index.js +366 -259
  61. package/bin/index.js.map +4 -4
  62. package/bin/init.d.ts +2 -0
  63. package/bin/init.d.ts.map +1 -0
  64. package/bin/oauth2.d.ts +2 -0
  65. package/bin/oauth2.d.ts.map +1 -0
  66. package/bin/publish.d.ts +23 -0
  67. package/bin/publish.d.ts.map +1 -0
  68. package/bin/utils.d.ts +13 -0
  69. package/bin/utils.d.ts.map +1 -0
  70. package/bin/vertices.d.ts +3 -0
  71. package/bin/vertices.d.ts.map +1 -0
  72. package/package.json +6 -13
  73. package/assets/build-client.js +0 -111
  74. package/assets/global.d.ts +0 -7
  75. package/assets/inject.js +0 -15
@@ -0,0 +1,837 @@
1
+ import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
2
+ import type { Message } from "@bufbuild/protobuf";
3
+ /**
4
+ * Describes the file google/api/http.proto.
5
+ */
6
+ export declare const file_google_api_http: GenFile;
7
+ /**
8
+ * Defines the HTTP configuration for an API service. It contains a list of
9
+ * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
10
+ * to one or more HTTP REST API methods.
11
+ *
12
+ * @generated from message google.api.Http
13
+ */
14
+ export type Http = Message<"google.api.Http"> & {
15
+ /**
16
+ * A list of HTTP configuration rules that apply to individual API methods.
17
+ *
18
+ * **NOTE:** All service configuration rules follow "last one wins" order.
19
+ *
20
+ * @generated from field: repeated google.api.HttpRule rules = 1;
21
+ */
22
+ rules: HttpRule[];
23
+ /**
24
+ * When set to true, URL path parameters will be fully URI-decoded except in
25
+ * cases of single segment matches in reserved expansion, where "%2F" will be
26
+ * left encoded.
27
+ *
28
+ * The default behavior is to not decode RFC 6570 reserved characters in multi
29
+ * segment matches.
30
+ *
31
+ * @generated from field: bool fully_decode_reserved_expansion = 2;
32
+ */
33
+ fullyDecodeReservedExpansion: boolean;
34
+ };
35
+ /**
36
+ * Defines the HTTP configuration for an API service. It contains a list of
37
+ * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
38
+ * to one or more HTTP REST API methods.
39
+ *
40
+ * @generated from message google.api.Http
41
+ */
42
+ export type HttpJson = {
43
+ /**
44
+ * A list of HTTP configuration rules that apply to individual API methods.
45
+ *
46
+ * **NOTE:** All service configuration rules follow "last one wins" order.
47
+ *
48
+ * @generated from field: repeated google.api.HttpRule rules = 1;
49
+ */
50
+ rules?: HttpRuleJson[];
51
+ /**
52
+ * When set to true, URL path parameters will be fully URI-decoded except in
53
+ * cases of single segment matches in reserved expansion, where "%2F" will be
54
+ * left encoded.
55
+ *
56
+ * The default behavior is to not decode RFC 6570 reserved characters in multi
57
+ * segment matches.
58
+ *
59
+ * @generated from field: bool fully_decode_reserved_expansion = 2;
60
+ */
61
+ fullyDecodeReservedExpansion?: boolean;
62
+ };
63
+ /**
64
+ * Describes the message google.api.Http.
65
+ * Use `create(HttpSchema)` to create a new message.
66
+ */
67
+ export declare const HttpSchema: GenMessage<Http, HttpJson>;
68
+ /**
69
+ * gRPC Transcoding
70
+ *
71
+ * gRPC Transcoding is a feature for mapping between a gRPC method and one or
72
+ * more HTTP REST endpoints. It allows developers to build a single API service
73
+ * that supports both gRPC APIs and REST APIs. Many systems, including [Google
74
+ * APIs](https://github.com/googleapis/googleapis),
75
+ * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
76
+ * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
77
+ * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
78
+ * and use it for large scale production services.
79
+ *
80
+ * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
81
+ * how different portions of the gRPC request message are mapped to the URL
82
+ * path, URL query parameters, and HTTP request body. It also controls how the
83
+ * gRPC response message is mapped to the HTTP response body. `HttpRule` is
84
+ * typically specified as an `google.api.http` annotation on the gRPC method.
85
+ *
86
+ * Each mapping specifies a URL path template and an HTTP method. The path
87
+ * template may refer to one or more fields in the gRPC request message, as long
88
+ * as each field is a non-repeated field with a primitive (non-message) type.
89
+ * The path template controls how fields of the request message are mapped to
90
+ * the URL path.
91
+ *
92
+ * Example:
93
+ *
94
+ * service Messaging {
95
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
96
+ * option (google.api.http) = {
97
+ * get: "/v1/{name=messages/*}"
98
+ * };
99
+ * }
100
+ * }
101
+ * message GetMessageRequest {
102
+ * string name = 1; // Mapped to URL path.
103
+ * }
104
+ * message Message {
105
+ * string text = 1; // The resource content.
106
+ * }
107
+ *
108
+ * This enables an HTTP REST to gRPC mapping as below:
109
+ *
110
+ * - HTTP: `GET /v1/messages/123456`
111
+ * - gRPC: `GetMessage(name: "messages/123456")`
112
+ *
113
+ * Any fields in the request message which are not bound by the path template
114
+ * automatically become HTTP query parameters if there is no HTTP request body.
115
+ * For example:
116
+ *
117
+ * service Messaging {
118
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
119
+ * option (google.api.http) = {
120
+ * get:"/v1/messages/{message_id}"
121
+ * };
122
+ * }
123
+ * }
124
+ * message GetMessageRequest {
125
+ * message SubMessage {
126
+ * string subfield = 1;
127
+ * }
128
+ * string message_id = 1; // Mapped to URL path.
129
+ * int64 revision = 2; // Mapped to URL query parameter `revision`.
130
+ * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
131
+ * }
132
+ *
133
+ * This enables a HTTP JSON to RPC mapping as below:
134
+ *
135
+ * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
136
+ * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
137
+ * SubMessage(subfield: "foo"))`
138
+ *
139
+ * Note that fields which are mapped to URL query parameters must have a
140
+ * primitive type or a repeated primitive type or a non-repeated message type.
141
+ * In the case of a repeated type, the parameter can be repeated in the URL
142
+ * as `...?param=A&param=B`. In the case of a message type, each field of the
143
+ * message is mapped to a separate parameter, such as
144
+ * `...?foo.a=A&foo.b=B&foo.c=C`.
145
+ *
146
+ * For HTTP methods that allow a request body, the `body` field
147
+ * specifies the mapping. Consider a REST update method on the
148
+ * message resource collection:
149
+ *
150
+ * service Messaging {
151
+ * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
152
+ * option (google.api.http) = {
153
+ * patch: "/v1/messages/{message_id}"
154
+ * body: "message"
155
+ * };
156
+ * }
157
+ * }
158
+ * message UpdateMessageRequest {
159
+ * string message_id = 1; // mapped to the URL
160
+ * Message message = 2; // mapped to the body
161
+ * }
162
+ *
163
+ * The following HTTP JSON to RPC mapping is enabled, where the
164
+ * representation of the JSON in the request body is determined by
165
+ * protos JSON encoding:
166
+ *
167
+ * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
168
+ * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
169
+ *
170
+ * The special name `*` can be used in the body mapping to define that
171
+ * every field not bound by the path template should be mapped to the
172
+ * request body. This enables the following alternative definition of
173
+ * the update method:
174
+ *
175
+ * service Messaging {
176
+ * rpc UpdateMessage(Message) returns (Message) {
177
+ * option (google.api.http) = {
178
+ * patch: "/v1/messages/{message_id}"
179
+ * body: "*"
180
+ * };
181
+ * }
182
+ * }
183
+ * message Message {
184
+ * string message_id = 1;
185
+ * string text = 2;
186
+ * }
187
+ *
188
+ *
189
+ * The following HTTP JSON to RPC mapping is enabled:
190
+ *
191
+ * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
192
+ * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
193
+ *
194
+ * Note that when using `*` in the body mapping, it is not possible to
195
+ * have HTTP parameters, as all fields not bound by the path end in
196
+ * the body. This makes this option more rarely used in practice when
197
+ * defining REST APIs. The common usage of `*` is in custom methods
198
+ * which don't use the URL at all for transferring data.
199
+ *
200
+ * It is possible to define multiple HTTP methods for one RPC by using
201
+ * the `additional_bindings` option. Example:
202
+ *
203
+ * service Messaging {
204
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
205
+ * option (google.api.http) = {
206
+ * get: "/v1/messages/{message_id}"
207
+ * additional_bindings {
208
+ * get: "/v1/users/{user_id}/messages/{message_id}"
209
+ * }
210
+ * };
211
+ * }
212
+ * }
213
+ * message GetMessageRequest {
214
+ * string message_id = 1;
215
+ * string user_id = 2;
216
+ * }
217
+ *
218
+ * This enables the following two alternative HTTP JSON to RPC mappings:
219
+ *
220
+ * - HTTP: `GET /v1/messages/123456`
221
+ * - gRPC: `GetMessage(message_id: "123456")`
222
+ *
223
+ * - HTTP: `GET /v1/users/me/messages/123456`
224
+ * - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
225
+ *
226
+ * Rules for HTTP mapping
227
+ *
228
+ * 1. Leaf request fields (recursive expansion nested messages in the request
229
+ * message) are classified into three categories:
230
+ * - Fields referred by the path template. They are passed via the URL path.
231
+ * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
232
+ * are passed via the HTTP
233
+ * request body.
234
+ * - All other fields are passed via the URL query parameters, and the
235
+ * parameter name is the field path in the request message. A repeated
236
+ * field can be represented as multiple query parameters under the same
237
+ * name.
238
+ * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
239
+ * query parameter, all fields
240
+ * are passed via URL path and HTTP request body.
241
+ * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
242
+ * request body, all
243
+ * fields are passed via URL path and URL query parameters.
244
+ *
245
+ * Path template syntax
246
+ *
247
+ * Template = "/" Segments [ Verb ] ;
248
+ * Segments = Segment { "/" Segment } ;
249
+ * Segment = "*" | "**" | LITERAL | Variable ;
250
+ * Variable = "{" FieldPath [ "=" Segments ] "}" ;
251
+ * FieldPath = IDENT { "." IDENT } ;
252
+ * Verb = ":" LITERAL ;
253
+ *
254
+ * The syntax `*` matches a single URL path segment. The syntax `**` matches
255
+ * zero or more URL path segments, which must be the last part of the URL path
256
+ * except the `Verb`.
257
+ *
258
+ * The syntax `Variable` matches part of the URL path as specified by its
259
+ * template. A variable template must not contain other variables. If a variable
260
+ * matches a single path segment, its template may be omitted, e.g. `{var}`
261
+ * is equivalent to `{var=*}`.
262
+ *
263
+ * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
264
+ * contains any reserved character, such characters should be percent-encoded
265
+ * before the matching.
266
+ *
267
+ * If a variable contains exactly one path segment, such as `"{var}"` or
268
+ * `"{var=*}"`, when such a variable is expanded into a URL path on the client
269
+ * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
270
+ * server side does the reverse decoding. Such variables show up in the
271
+ * [Discovery
272
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
273
+ * `{var}`.
274
+ *
275
+ * If a variable contains multiple path segments, such as `"{var=foo/*}"`
276
+ * or `"{var=**}"`, when such a variable is expanded into a URL path on the
277
+ * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
278
+ * The server side does the reverse decoding, except "%2F" and "%2f" are left
279
+ * unchanged. Such variables show up in the
280
+ * [Discovery
281
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
282
+ * `{+var}`.
283
+ *
284
+ * Using gRPC API Service Configuration
285
+ *
286
+ * gRPC API Service Configuration (service config) is a configuration language
287
+ * for configuring a gRPC service to become a user-facing product. The
288
+ * service config is simply the YAML representation of the `google.api.Service`
289
+ * proto message.
290
+ *
291
+ * As an alternative to annotating your proto file, you can configure gRPC
292
+ * transcoding in your service config YAML files. You do this by specifying a
293
+ * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
294
+ * effect as the proto annotation. This can be particularly useful if you
295
+ * have a proto that is reused in multiple services. Note that any transcoding
296
+ * specified in the service config will override any matching transcoding
297
+ * configuration in the proto.
298
+ *
299
+ * The following example selects a gRPC method and applies an `HttpRule` to it:
300
+ *
301
+ * http:
302
+ * rules:
303
+ * - selector: example.v1.Messaging.GetMessage
304
+ * get: /v1/messages/{message_id}/{sub.subfield}
305
+ *
306
+ * Special notes
307
+ *
308
+ * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
309
+ * proto to JSON conversion must follow the [proto3
310
+ * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
311
+ *
312
+ * While the single segment variable follows the semantics of
313
+ * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
314
+ * Expansion, the multi segment variable **does not** follow RFC 6570 Section
315
+ * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
316
+ * does not expand special characters like `?` and `#`, which would lead
317
+ * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
318
+ * for multi segment variables.
319
+ *
320
+ * The path variables **must not** refer to any repeated or mapped field,
321
+ * because client libraries are not capable of handling such variable expansion.
322
+ *
323
+ * The path variables **must not** capture the leading "/" character. The reason
324
+ * is that the most common use case "{var}" does not capture the leading "/"
325
+ * character. For consistency, all path variables must share the same behavior.
326
+ *
327
+ * Repeated message fields must not be mapped to URL query parameters, because
328
+ * no client library can support such complicated mapping.
329
+ *
330
+ * If an API needs to use a JSON array for request or response body, it can map
331
+ * the request or response body to a repeated field. However, some gRPC
332
+ * Transcoding implementations may not support this feature.
333
+ *
334
+ * @generated from message google.api.HttpRule
335
+ */
336
+ export type HttpRule = Message<"google.api.HttpRule"> & {
337
+ /**
338
+ * Selects a method to which this rule applies.
339
+ *
340
+ * Refer to [selector][google.api.DocumentationRule.selector] for syntax
341
+ * details.
342
+ *
343
+ * @generated from field: string selector = 1;
344
+ */
345
+ selector: string;
346
+ /**
347
+ * Determines the URL pattern is matched by this rules. This pattern can be
348
+ * used with any of the {get|put|post|delete|patch} methods. A custom method
349
+ * can be defined using the 'custom' field.
350
+ *
351
+ * @generated from oneof google.api.HttpRule.pattern
352
+ */
353
+ pattern: {
354
+ /**
355
+ * Maps to HTTP GET. Used for listing and getting information about
356
+ * resources.
357
+ *
358
+ * @generated from field: string get = 2;
359
+ */
360
+ value: string;
361
+ case: "get";
362
+ } | {
363
+ /**
364
+ * Maps to HTTP PUT. Used for replacing a resource.
365
+ *
366
+ * @generated from field: string put = 3;
367
+ */
368
+ value: string;
369
+ case: "put";
370
+ } | {
371
+ /**
372
+ * Maps to HTTP POST. Used for creating a resource or performing an action.
373
+ *
374
+ * @generated from field: string post = 4;
375
+ */
376
+ value: string;
377
+ case: "post";
378
+ } | {
379
+ /**
380
+ * Maps to HTTP DELETE. Used for deleting a resource.
381
+ *
382
+ * @generated from field: string delete = 5;
383
+ */
384
+ value: string;
385
+ case: "delete";
386
+ } | {
387
+ /**
388
+ * Maps to HTTP PATCH. Used for updating a resource.
389
+ *
390
+ * @generated from field: string patch = 6;
391
+ */
392
+ value: string;
393
+ case: "patch";
394
+ } | {
395
+ /**
396
+ * The custom pattern is used for specifying an HTTP method that is not
397
+ * included in the `pattern` field, such as HEAD, or "*" to leave the
398
+ * HTTP method unspecified for this rule. The wild-card rule is useful
399
+ * for services that provide content to Web (HTML) clients.
400
+ *
401
+ * @generated from field: google.api.CustomHttpPattern custom = 8;
402
+ */
403
+ value: CustomHttpPattern;
404
+ case: "custom";
405
+ } | {
406
+ case: undefined;
407
+ value?: undefined;
408
+ };
409
+ /**
410
+ * The name of the request field whose value is mapped to the HTTP request
411
+ * body, or `*` for mapping all request fields not captured by the path
412
+ * pattern to the HTTP body, or omitted for not having any HTTP request body.
413
+ *
414
+ * NOTE: the referred field must be present at the top-level of the request
415
+ * message type.
416
+ *
417
+ * @generated from field: string body = 7;
418
+ */
419
+ body: string;
420
+ /**
421
+ * Optional. The name of the response field whose value is mapped to the HTTP
422
+ * response body. When omitted, the entire response message will be used
423
+ * as the HTTP response body.
424
+ *
425
+ * NOTE: The referred field must be present at the top-level of the response
426
+ * message type.
427
+ *
428
+ * @generated from field: string response_body = 12;
429
+ */
430
+ responseBody: string;
431
+ /**
432
+ * Additional HTTP bindings for the selector. Nested bindings must
433
+ * not contain an `additional_bindings` field themselves (that is,
434
+ * the nesting may only be one level deep).
435
+ *
436
+ * @generated from field: repeated google.api.HttpRule additional_bindings = 11;
437
+ */
438
+ additionalBindings: HttpRule[];
439
+ };
440
+ /**
441
+ * gRPC Transcoding
442
+ *
443
+ * gRPC Transcoding is a feature for mapping between a gRPC method and one or
444
+ * more HTTP REST endpoints. It allows developers to build a single API service
445
+ * that supports both gRPC APIs and REST APIs. Many systems, including [Google
446
+ * APIs](https://github.com/googleapis/googleapis),
447
+ * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
448
+ * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
449
+ * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
450
+ * and use it for large scale production services.
451
+ *
452
+ * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
453
+ * how different portions of the gRPC request message are mapped to the URL
454
+ * path, URL query parameters, and HTTP request body. It also controls how the
455
+ * gRPC response message is mapped to the HTTP response body. `HttpRule` is
456
+ * typically specified as an `google.api.http` annotation on the gRPC method.
457
+ *
458
+ * Each mapping specifies a URL path template and an HTTP method. The path
459
+ * template may refer to one or more fields in the gRPC request message, as long
460
+ * as each field is a non-repeated field with a primitive (non-message) type.
461
+ * The path template controls how fields of the request message are mapped to
462
+ * the URL path.
463
+ *
464
+ * Example:
465
+ *
466
+ * service Messaging {
467
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
468
+ * option (google.api.http) = {
469
+ * get: "/v1/{name=messages/*}"
470
+ * };
471
+ * }
472
+ * }
473
+ * message GetMessageRequest {
474
+ * string name = 1; // Mapped to URL path.
475
+ * }
476
+ * message Message {
477
+ * string text = 1; // The resource content.
478
+ * }
479
+ *
480
+ * This enables an HTTP REST to gRPC mapping as below:
481
+ *
482
+ * - HTTP: `GET /v1/messages/123456`
483
+ * - gRPC: `GetMessage(name: "messages/123456")`
484
+ *
485
+ * Any fields in the request message which are not bound by the path template
486
+ * automatically become HTTP query parameters if there is no HTTP request body.
487
+ * For example:
488
+ *
489
+ * service Messaging {
490
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
491
+ * option (google.api.http) = {
492
+ * get:"/v1/messages/{message_id}"
493
+ * };
494
+ * }
495
+ * }
496
+ * message GetMessageRequest {
497
+ * message SubMessage {
498
+ * string subfield = 1;
499
+ * }
500
+ * string message_id = 1; // Mapped to URL path.
501
+ * int64 revision = 2; // Mapped to URL query parameter `revision`.
502
+ * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
503
+ * }
504
+ *
505
+ * This enables a HTTP JSON to RPC mapping as below:
506
+ *
507
+ * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
508
+ * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
509
+ * SubMessage(subfield: "foo"))`
510
+ *
511
+ * Note that fields which are mapped to URL query parameters must have a
512
+ * primitive type or a repeated primitive type or a non-repeated message type.
513
+ * In the case of a repeated type, the parameter can be repeated in the URL
514
+ * as `...?param=A&param=B`. In the case of a message type, each field of the
515
+ * message is mapped to a separate parameter, such as
516
+ * `...?foo.a=A&foo.b=B&foo.c=C`.
517
+ *
518
+ * For HTTP methods that allow a request body, the `body` field
519
+ * specifies the mapping. Consider a REST update method on the
520
+ * message resource collection:
521
+ *
522
+ * service Messaging {
523
+ * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
524
+ * option (google.api.http) = {
525
+ * patch: "/v1/messages/{message_id}"
526
+ * body: "message"
527
+ * };
528
+ * }
529
+ * }
530
+ * message UpdateMessageRequest {
531
+ * string message_id = 1; // mapped to the URL
532
+ * Message message = 2; // mapped to the body
533
+ * }
534
+ *
535
+ * The following HTTP JSON to RPC mapping is enabled, where the
536
+ * representation of the JSON in the request body is determined by
537
+ * protos JSON encoding:
538
+ *
539
+ * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
540
+ * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
541
+ *
542
+ * The special name `*` can be used in the body mapping to define that
543
+ * every field not bound by the path template should be mapped to the
544
+ * request body. This enables the following alternative definition of
545
+ * the update method:
546
+ *
547
+ * service Messaging {
548
+ * rpc UpdateMessage(Message) returns (Message) {
549
+ * option (google.api.http) = {
550
+ * patch: "/v1/messages/{message_id}"
551
+ * body: "*"
552
+ * };
553
+ * }
554
+ * }
555
+ * message Message {
556
+ * string message_id = 1;
557
+ * string text = 2;
558
+ * }
559
+ *
560
+ *
561
+ * The following HTTP JSON to RPC mapping is enabled:
562
+ *
563
+ * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
564
+ * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
565
+ *
566
+ * Note that when using `*` in the body mapping, it is not possible to
567
+ * have HTTP parameters, as all fields not bound by the path end in
568
+ * the body. This makes this option more rarely used in practice when
569
+ * defining REST APIs. The common usage of `*` is in custom methods
570
+ * which don't use the URL at all for transferring data.
571
+ *
572
+ * It is possible to define multiple HTTP methods for one RPC by using
573
+ * the `additional_bindings` option. Example:
574
+ *
575
+ * service Messaging {
576
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
577
+ * option (google.api.http) = {
578
+ * get: "/v1/messages/{message_id}"
579
+ * additional_bindings {
580
+ * get: "/v1/users/{user_id}/messages/{message_id}"
581
+ * }
582
+ * };
583
+ * }
584
+ * }
585
+ * message GetMessageRequest {
586
+ * string message_id = 1;
587
+ * string user_id = 2;
588
+ * }
589
+ *
590
+ * This enables the following two alternative HTTP JSON to RPC mappings:
591
+ *
592
+ * - HTTP: `GET /v1/messages/123456`
593
+ * - gRPC: `GetMessage(message_id: "123456")`
594
+ *
595
+ * - HTTP: `GET /v1/users/me/messages/123456`
596
+ * - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
597
+ *
598
+ * Rules for HTTP mapping
599
+ *
600
+ * 1. Leaf request fields (recursive expansion nested messages in the request
601
+ * message) are classified into three categories:
602
+ * - Fields referred by the path template. They are passed via the URL path.
603
+ * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
604
+ * are passed via the HTTP
605
+ * request body.
606
+ * - All other fields are passed via the URL query parameters, and the
607
+ * parameter name is the field path in the request message. A repeated
608
+ * field can be represented as multiple query parameters under the same
609
+ * name.
610
+ * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
611
+ * query parameter, all fields
612
+ * are passed via URL path and HTTP request body.
613
+ * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
614
+ * request body, all
615
+ * fields are passed via URL path and URL query parameters.
616
+ *
617
+ * Path template syntax
618
+ *
619
+ * Template = "/" Segments [ Verb ] ;
620
+ * Segments = Segment { "/" Segment } ;
621
+ * Segment = "*" | "**" | LITERAL | Variable ;
622
+ * Variable = "{" FieldPath [ "=" Segments ] "}" ;
623
+ * FieldPath = IDENT { "." IDENT } ;
624
+ * Verb = ":" LITERAL ;
625
+ *
626
+ * The syntax `*` matches a single URL path segment. The syntax `**` matches
627
+ * zero or more URL path segments, which must be the last part of the URL path
628
+ * except the `Verb`.
629
+ *
630
+ * The syntax `Variable` matches part of the URL path as specified by its
631
+ * template. A variable template must not contain other variables. If a variable
632
+ * matches a single path segment, its template may be omitted, e.g. `{var}`
633
+ * is equivalent to `{var=*}`.
634
+ *
635
+ * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
636
+ * contains any reserved character, such characters should be percent-encoded
637
+ * before the matching.
638
+ *
639
+ * If a variable contains exactly one path segment, such as `"{var}"` or
640
+ * `"{var=*}"`, when such a variable is expanded into a URL path on the client
641
+ * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
642
+ * server side does the reverse decoding. Such variables show up in the
643
+ * [Discovery
644
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
645
+ * `{var}`.
646
+ *
647
+ * If a variable contains multiple path segments, such as `"{var=foo/*}"`
648
+ * or `"{var=**}"`, when such a variable is expanded into a URL path on the
649
+ * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
650
+ * The server side does the reverse decoding, except "%2F" and "%2f" are left
651
+ * unchanged. Such variables show up in the
652
+ * [Discovery
653
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
654
+ * `{+var}`.
655
+ *
656
+ * Using gRPC API Service Configuration
657
+ *
658
+ * gRPC API Service Configuration (service config) is a configuration language
659
+ * for configuring a gRPC service to become a user-facing product. The
660
+ * service config is simply the YAML representation of the `google.api.Service`
661
+ * proto message.
662
+ *
663
+ * As an alternative to annotating your proto file, you can configure gRPC
664
+ * transcoding in your service config YAML files. You do this by specifying a
665
+ * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
666
+ * effect as the proto annotation. This can be particularly useful if you
667
+ * have a proto that is reused in multiple services. Note that any transcoding
668
+ * specified in the service config will override any matching transcoding
669
+ * configuration in the proto.
670
+ *
671
+ * The following example selects a gRPC method and applies an `HttpRule` to it:
672
+ *
673
+ * http:
674
+ * rules:
675
+ * - selector: example.v1.Messaging.GetMessage
676
+ * get: /v1/messages/{message_id}/{sub.subfield}
677
+ *
678
+ * Special notes
679
+ *
680
+ * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
681
+ * proto to JSON conversion must follow the [proto3
682
+ * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
683
+ *
684
+ * While the single segment variable follows the semantics of
685
+ * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
686
+ * Expansion, the multi segment variable **does not** follow RFC 6570 Section
687
+ * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
688
+ * does not expand special characters like `?` and `#`, which would lead
689
+ * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
690
+ * for multi segment variables.
691
+ *
692
+ * The path variables **must not** refer to any repeated or mapped field,
693
+ * because client libraries are not capable of handling such variable expansion.
694
+ *
695
+ * The path variables **must not** capture the leading "/" character. The reason
696
+ * is that the most common use case "{var}" does not capture the leading "/"
697
+ * character. For consistency, all path variables must share the same behavior.
698
+ *
699
+ * Repeated message fields must not be mapped to URL query parameters, because
700
+ * no client library can support such complicated mapping.
701
+ *
702
+ * If an API needs to use a JSON array for request or response body, it can map
703
+ * the request or response body to a repeated field. However, some gRPC
704
+ * Transcoding implementations may not support this feature.
705
+ *
706
+ * @generated from message google.api.HttpRule
707
+ */
708
+ export type HttpRuleJson = {
709
+ /**
710
+ * Selects a method to which this rule applies.
711
+ *
712
+ * Refer to [selector][google.api.DocumentationRule.selector] for syntax
713
+ * details.
714
+ *
715
+ * @generated from field: string selector = 1;
716
+ */
717
+ selector?: string;
718
+ /**
719
+ * Maps to HTTP GET. Used for listing and getting information about
720
+ * resources.
721
+ *
722
+ * @generated from field: string get = 2;
723
+ */
724
+ get?: string;
725
+ /**
726
+ * Maps to HTTP PUT. Used for replacing a resource.
727
+ *
728
+ * @generated from field: string put = 3;
729
+ */
730
+ put?: string;
731
+ /**
732
+ * Maps to HTTP POST. Used for creating a resource or performing an action.
733
+ *
734
+ * @generated from field: string post = 4;
735
+ */
736
+ post?: string;
737
+ /**
738
+ * Maps to HTTP DELETE. Used for deleting a resource.
739
+ *
740
+ * @generated from field: string delete = 5;
741
+ */
742
+ delete?: string;
743
+ /**
744
+ * Maps to HTTP PATCH. Used for updating a resource.
745
+ *
746
+ * @generated from field: string patch = 6;
747
+ */
748
+ patch?: string;
749
+ /**
750
+ * The custom pattern is used for specifying an HTTP method that is not
751
+ * included in the `pattern` field, such as HEAD, or "*" to leave the
752
+ * HTTP method unspecified for this rule. The wild-card rule is useful
753
+ * for services that provide content to Web (HTML) clients.
754
+ *
755
+ * @generated from field: google.api.CustomHttpPattern custom = 8;
756
+ */
757
+ custom?: CustomHttpPatternJson;
758
+ /**
759
+ * The name of the request field whose value is mapped to the HTTP request
760
+ * body, or `*` for mapping all request fields not captured by the path
761
+ * pattern to the HTTP body, or omitted for not having any HTTP request body.
762
+ *
763
+ * NOTE: the referred field must be present at the top-level of the request
764
+ * message type.
765
+ *
766
+ * @generated from field: string body = 7;
767
+ */
768
+ body?: string;
769
+ /**
770
+ * Optional. The name of the response field whose value is mapped to the HTTP
771
+ * response body. When omitted, the entire response message will be used
772
+ * as the HTTP response body.
773
+ *
774
+ * NOTE: The referred field must be present at the top-level of the response
775
+ * message type.
776
+ *
777
+ * @generated from field: string response_body = 12;
778
+ */
779
+ responseBody?: string;
780
+ /**
781
+ * Additional HTTP bindings for the selector. Nested bindings must
782
+ * not contain an `additional_bindings` field themselves (that is,
783
+ * the nesting may only be one level deep).
784
+ *
785
+ * @generated from field: repeated google.api.HttpRule additional_bindings = 11;
786
+ */
787
+ additionalBindings?: HttpRuleJson[];
788
+ };
789
+ /**
790
+ * Describes the message google.api.HttpRule.
791
+ * Use `create(HttpRuleSchema)` to create a new message.
792
+ */
793
+ export declare const HttpRuleSchema: GenMessage<HttpRule, HttpRuleJson>;
794
+ /**
795
+ * A custom pattern is used for defining custom HTTP verb.
796
+ *
797
+ * @generated from message google.api.CustomHttpPattern
798
+ */
799
+ export type CustomHttpPattern = Message<"google.api.CustomHttpPattern"> & {
800
+ /**
801
+ * The name of this custom HTTP verb.
802
+ *
803
+ * @generated from field: string kind = 1;
804
+ */
805
+ kind: string;
806
+ /**
807
+ * The path matched by this custom verb.
808
+ *
809
+ * @generated from field: string path = 2;
810
+ */
811
+ path: string;
812
+ };
813
+ /**
814
+ * A custom pattern is used for defining custom HTTP verb.
815
+ *
816
+ * @generated from message google.api.CustomHttpPattern
817
+ */
818
+ export type CustomHttpPatternJson = {
819
+ /**
820
+ * The name of this custom HTTP verb.
821
+ *
822
+ * @generated from field: string kind = 1;
823
+ */
824
+ kind?: string;
825
+ /**
826
+ * The path matched by this custom verb.
827
+ *
828
+ * @generated from field: string path = 2;
829
+ */
830
+ path?: string;
831
+ };
832
+ /**
833
+ * Describes the message google.api.CustomHttpPattern.
834
+ * Use `create(CustomHttpPatternSchema)` to create a new message.
835
+ */
836
+ export declare const CustomHttpPatternSchema: GenMessage<CustomHttpPattern, CustomHttpPatternJson>;
837
+ //# sourceMappingURL=http_pb.d.ts.map