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