@ark-us/wasmxjs 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/LICENSE +3 -0
  2. package/README.md +280 -0
  3. package/main/codegen/cosmos/base/abci/v1beta1/abci.js +887 -0
  4. package/main/codegen/cosmos/base/kv/v1beta1/kv.js +139 -0
  5. package/main/codegen/cosmos/base/query/v1beta1/pagination.js +157 -0
  6. package/main/codegen/cosmos/base/reflection/v1beta1/reflection.js +231 -0
  7. package/main/codegen/cosmos/base/reflection/v2alpha1/reflection.js +1479 -0
  8. package/main/codegen/cosmos/base/snapshots/v1beta1/snapshot.js +478 -0
  9. package/main/codegen/cosmos/base/store/v1beta1/commit_info.js +207 -0
  10. package/main/codegen/cosmos/base/store/v1beta1/listening.js +89 -0
  11. package/main/codegen/cosmos/base/tendermint/v1beta1/query.js +951 -0
  12. package/main/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.js +117 -0
  13. package/main/codegen/cosmos/base/v1beta1/coin.js +223 -0
  14. package/main/codegen/cosmos/bundle.js +63 -0
  15. package/main/codegen/cosmos/rpc.query.js +55 -0
  16. package/main/codegen/extern.js +66 -0
  17. package/main/codegen/gogoproto/bundle.js +16 -0
  18. package/main/codegen/gogoproto/gogo.js +5 -0
  19. package/main/codegen/google/api/annotations.js +5 -0
  20. package/main/codegen/google/api/http.js +306 -0
  21. package/main/codegen/google/api/httpbody.js +102 -0
  22. package/main/codegen/google/bundle.js +26 -0
  23. package/main/codegen/google/protobuf/any.js +69 -0
  24. package/main/codegen/google/protobuf/descriptor.js +3429 -0
  25. package/main/codegen/google/protobuf/duration.js +69 -0
  26. package/main/codegen/google/protobuf/timestamp.js +69 -0
  27. package/main/codegen/helpers.js +170 -0
  28. package/main/codegen/index.js +93 -0
  29. package/main/codegen/tendermint/abci/types.js +3616 -0
  30. package/main/codegen/tendermint/bundle.js +37 -0
  31. package/main/codegen/tendermint/crypto/keys.js +69 -0
  32. package/main/codegen/tendermint/crypto/proof.js +372 -0
  33. package/main/codegen/tendermint/libs/bits/types.js +100 -0
  34. package/main/codegen/tendermint/p2p/types.js +322 -0
  35. package/main/codegen/tendermint/types/block.js +90 -0
  36. package/main/codegen/tendermint/types/evidence.js +335 -0
  37. package/main/codegen/tendermint/types/params.js +397 -0
  38. package/main/codegen/tendermint/types/types.js +1223 -0
  39. package/main/codegen/tendermint/types/validator.js +237 -0
  40. package/main/codegen/tendermint/version/types.js +126 -0
  41. package/main/codegen/wasmx/bundle.js +30 -0
  42. package/main/codegen/wasmx/client.js +65 -0
  43. package/main/codegen/wasmx/index.js +126 -0
  44. package/main/codegen/wasmx/rpc.query.js +65 -0
  45. package/main/codegen/wasmx/rpc.tx.js +44 -0
  46. package/main/codegen/wasmx/wasmx/contract.js +324 -0
  47. package/main/codegen/wasmx/wasmx/genesis.js +481 -0
  48. package/main/codegen/wasmx/wasmx/params.js +45 -0
  49. package/main/codegen/wasmx/wasmx/query.js +1187 -0
  50. package/main/codegen/wasmx/wasmx/query.rpc.Query.js +154 -0
  51. package/main/codegen/wasmx/wasmx/tx.amino.js +251 -0
  52. package/main/codegen/wasmx/wasmx/tx.js +937 -0
  53. package/main/codegen/wasmx/wasmx/tx.registry.js +213 -0
  54. package/main/codegen/wasmx/wasmx/tx.rpc.msg.js +85 -0
  55. package/main/index.js +16 -0
  56. package/module/codegen/cosmos/base/abci/v1beta1/abci.js +755 -0
  57. package/module/codegen/cosmos/base/kv/v1beta1/kv.js +110 -0
  58. package/module/codegen/cosmos/base/query/v1beta1/pagination.js +154 -0
  59. package/module/codegen/cosmos/base/reflection/v1beta1/reflection.js +183 -0
  60. package/module/codegen/cosmos/base/reflection/v2alpha1/reflection.js +1297 -0
  61. package/module/codegen/cosmos/base/snapshots/v1beta1/snapshot.js +439 -0
  62. package/module/codegen/cosmos/base/store/v1beta1/commit_info.js +179 -0
  63. package/module/codegen/cosmos/base/store/v1beta1/listening.js +86 -0
  64. package/module/codegen/cosmos/base/tendermint/v1beta1/query.js +866 -0
  65. package/module/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.js +74 -0
  66. package/module/codegen/cosmos/base/v1beta1/coin.js +213 -0
  67. package/module/codegen/cosmos/bundle.js +52 -0
  68. package/module/codegen/cosmos/rpc.query.js +17 -0
  69. package/module/codegen/extern.js +30 -0
  70. package/module/codegen/gogoproto/bundle.js +5 -0
  71. package/module/codegen/gogoproto/gogo.js +1 -0
  72. package/module/codegen/google/api/annotations.js +1 -0
  73. package/module/codegen/google/api/http.js +264 -0
  74. package/module/codegen/google/api/httpbody.js +115 -0
  75. package/module/codegen/google/bundle.js +15 -0
  76. package/module/codegen/google/protobuf/any.js +140 -0
  77. package/module/codegen/google/protobuf/descriptor.js +2801 -0
  78. package/module/codegen/google/protobuf/duration.js +119 -0
  79. package/module/codegen/google/protobuf/timestamp.js +143 -0
  80. package/module/codegen/helpers.js +140 -0
  81. package/module/codegen/index.js +14 -0
  82. package/module/codegen/tendermint/abci/types.js +3305 -0
  83. package/module/codegen/tendermint/bundle.js +26 -0
  84. package/module/codegen/tendermint/crypto/keys.js +60 -0
  85. package/module/codegen/tendermint/crypto/proof.js +320 -0
  86. package/module/codegen/tendermint/libs/bits/types.js +71 -0
  87. package/module/codegen/tendermint/p2p/types.js +305 -0
  88. package/module/codegen/tendermint/types/block.js +79 -0
  89. package/module/codegen/tendermint/types/evidence.js +285 -0
  90. package/module/codegen/tendermint/types/params.js +363 -0
  91. package/module/codegen/tendermint/types/types.js +1149 -0
  92. package/module/codegen/tendermint/types/validator.js +204 -0
  93. package/module/codegen/tendermint/version/types.js +119 -0
  94. package/module/codegen/wasmx/bundle.js +19 -0
  95. package/module/codegen/wasmx/client.js +36 -0
  96. package/module/codegen/wasmx/index.js +11 -0
  97. package/module/codegen/wasmx/rpc.query.js +20 -0
  98. package/module/codegen/wasmx/rpc.tx.js +7 -0
  99. package/module/codegen/wasmx/wasmx/contract.js +291 -0
  100. package/module/codegen/wasmx/wasmx/genesis.js +386 -0
  101. package/module/codegen/wasmx/wasmx/params.js +36 -0
  102. package/module/codegen/wasmx/wasmx/query.js +1052 -0
  103. package/module/codegen/wasmx/wasmx/query.rpc.Query.js +101 -0
  104. package/module/codegen/wasmx/wasmx/tx.amino.js +236 -0
  105. package/module/codegen/wasmx/wasmx/tx.js +815 -0
  106. package/module/codegen/wasmx/wasmx/tx.registry.js +199 -0
  107. package/module/codegen/wasmx/wasmx/tx.rpc.msg.js +47 -0
  108. package/module/index.js +1 -0
  109. package/package.json +88 -0
  110. package/src/codegen/cosmos/base/abci/v1beta1/abci.ts +1254 -0
  111. package/src/codegen/cosmos/base/kv/v1beta1/kv.ts +156 -0
  112. package/src/codegen/cosmos/base/query/v1beta1/pagination.ts +314 -0
  113. package/src/codegen/cosmos/base/reflection/v1beta1/reflection.ts +280 -0
  114. package/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts +2079 -0
  115. package/src/codegen/cosmos/base/snapshots/v1beta1/snapshot.ts +641 -0
  116. package/src/codegen/cosmos/base/store/v1beta1/commit_info.ts +269 -0
  117. package/src/codegen/cosmos/base/store/v1beta1/listening.ts +129 -0
  118. package/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts +107 -0
  119. package/src/codegen/cosmos/base/tendermint/v1beta1/query.ts +1284 -0
  120. package/src/codegen/cosmos/base/v1beta1/coin.ts +318 -0
  121. package/src/codegen/cosmos/bundle.ts +52 -0
  122. package/src/codegen/cosmos/rpc.query.ts +19 -0
  123. package/src/codegen/extern.ts +33 -0
  124. package/src/codegen/gogoproto/bundle.ts +3 -0
  125. package/src/codegen/gogoproto/gogo.ts +1 -0
  126. package/src/codegen/google/api/annotations.ts +1 -0
  127. package/src/codegen/google/api/http.ts +945 -0
  128. package/src/codegen/google/api/httpbody.ts +200 -0
  129. package/src/codegen/google/bundle.ts +18 -0
  130. package/src/codegen/google/protobuf/any.ts +305 -0
  131. package/src/codegen/google/protobuf/descriptor.ts +5113 -0
  132. package/src/codegen/google/protobuf/duration.ts +229 -0
  133. package/src/codegen/google/protobuf/timestamp.ts +273 -0
  134. package/src/codegen/helpers.ts +240 -0
  135. package/src/codegen/index.ts +14 -0
  136. package/src/codegen/tendermint/abci/types.ts +4754 -0
  137. package/src/codegen/tendermint/bundle.ts +32 -0
  138. package/src/codegen/tendermint/crypto/keys.ts +83 -0
  139. package/src/codegen/tendermint/crypto/proof.ts +465 -0
  140. package/src/codegen/tendermint/libs/bits/types.ts +97 -0
  141. package/src/codegen/tendermint/p2p/types.ts +422 -0
  142. package/src/codegen/tendermint/types/block.ts +109 -0
  143. package/src/codegen/tendermint/types/evidence.ts +415 -0
  144. package/src/codegen/tendermint/types/params.ts +615 -0
  145. package/src/codegen/tendermint/types/types.ts +1663 -0
  146. package/src/codegen/tendermint/types/validator.ts +282 -0
  147. package/src/codegen/tendermint/version/types.ts +180 -0
  148. package/src/codegen/wasmx/bundle.ts +26 -0
  149. package/src/codegen/wasmx/client.ts +45 -0
  150. package/src/codegen/wasmx/index.ts +11 -0
  151. package/src/codegen/wasmx/rpc.query.ts +22 -0
  152. package/src/codegen/wasmx/rpc.tx.ts +10 -0
  153. package/src/codegen/wasmx/wasmx/contract.ts +470 -0
  154. package/src/codegen/wasmx/wasmx/genesis.ts +552 -0
  155. package/src/codegen/wasmx/wasmx/params.ts +50 -0
  156. package/src/codegen/wasmx/wasmx/query.rpc.Query.ts +149 -0
  157. package/src/codegen/wasmx/wasmx/query.ts +1668 -0
  158. package/src/codegen/wasmx/wasmx/tx.amino.ts +314 -0
  159. package/src/codegen/wasmx/wasmx/tx.registry.ts +230 -0
  160. package/src/codegen/wasmx/wasmx/tx.rpc.msg.ts +80 -0
  161. package/src/codegen/wasmx/wasmx/tx.ts +1331 -0
  162. package/src/index.ts +1 -0
  163. package/types/codegen/cosmos/base/abci/v1beta1/abci.d.ts +338 -0
  164. package/types/codegen/cosmos/base/kv/v1beta1/kv.d.ts +33 -0
  165. package/types/codegen/cosmos/base/query/v1beta1/pagination.d.ts +140 -0
  166. package/types/codegen/cosmos/base/reflection/v1beta1/reflection.d.ts +75 -0
  167. package/types/codegen/cosmos/base/reflection/v2alpha1/reflection.d.ts +565 -0
  168. package/types/codegen/cosmos/base/snapshots/v1beta1/snapshot.d.ts +135 -0
  169. package/types/codegen/cosmos/base/store/v1beta1/commit_info.d.ts +71 -0
  170. package/types/codegen/cosmos/base/store/v1beta1/listening.d.ts +38 -0
  171. package/types/codegen/cosmos/base/tendermint/v1beta1/query.d.ts +282 -0
  172. package/types/codegen/cosmos/base/tendermint/v1beta1/query.lcd.d.ts +14 -0
  173. package/types/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.d.ts +36 -0
  174. package/types/codegen/cosmos/base/v1beta1/coin.d.ts +85 -0
  175. package/types/codegen/cosmos/bundle.d.ts +594 -0
  176. package/types/codegen/cosmos/lcd.d.ts +11 -0
  177. package/types/codegen/cosmos/rpc.query.d.ts +19 -0
  178. package/types/codegen/extern.d.ts +9 -0
  179. package/types/codegen/gogoproto/bundle.d.ts +1 -0
  180. package/types/codegen/gogoproto/gogo.d.ts +1 -0
  181. package/types/codegen/google/api/annotations.d.ts +1 -0
  182. package/types/codegen/google/api/http.d.ts +622 -0
  183. package/types/codegen/google/api/httpbody.d.ts +113 -0
  184. package/types/codegen/google/bundle.d.ts +274 -0
  185. package/types/codegen/google/protobuf/any.d.ts +238 -0
  186. package/types/codegen/google/protobuf/descriptor.d.ts +1835 -0
  187. package/types/codegen/google/protobuf/duration.d.ts +163 -0
  188. package/types/codegen/google/protobuf/timestamp.d.ts +207 -0
  189. package/types/codegen/helpers.d.ts +82 -0
  190. package/types/codegen/index.d.ts +13 -0
  191. package/types/codegen/tendermint/abci/types.d.ts +993 -0
  192. package/types/codegen/tendermint/bundle.d.ts +639 -0
  193. package/types/codegen/tendermint/crypto/keys.d.ts +18 -0
  194. package/types/codegen/tendermint/crypto/proof.d.ts +101 -0
  195. package/types/codegen/tendermint/libs/bits/types.d.ts +17 -0
  196. package/types/codegen/tendermint/p2p/types.d.ts +78 -0
  197. package/types/codegen/tendermint/types/block.d.ts +22 -0
  198. package/types/codegen/tendermint/types/evidence.d.ts +91 -0
  199. package/types/codegen/tendermint/types/params.d.ts +193 -0
  200. package/types/codegen/tendermint/types/types.d.ts +363 -0
  201. package/types/codegen/tendermint/types/validator.d.ts +54 -0
  202. package/types/codegen/tendermint/version/types.d.ts +52 -0
  203. package/types/codegen/wasmx/bundle.d.ts +614 -0
  204. package/types/codegen/wasmx/client.d.ts +151 -0
  205. package/types/codegen/wasmx/index.d.ts +11 -0
  206. package/types/codegen/wasmx/lcd.d.ts +14 -0
  207. package/types/codegen/wasmx/rpc.query.d.ts +32 -0
  208. package/types/codegen/wasmx/rpc.tx.d.ts +8 -0
  209. package/types/codegen/wasmx/wasmx/contract.d.ts +122 -0
  210. package/types/codegen/wasmx/wasmx/genesis.d.ts +107 -0
  211. package/types/codegen/wasmx/wasmx/params.d.ts +14 -0
  212. package/types/codegen/wasmx/wasmx/query.d.ts +451 -0
  213. package/types/codegen/wasmx/wasmx/query.lcd.d.ts +17 -0
  214. package/types/codegen/wasmx/wasmx/query.rpc.Query.d.ts +48 -0
  215. package/types/codegen/wasmx/wasmx/tx.amino.d.ts +110 -0
  216. package/types/codegen/wasmx/wasmx/tx.d.ts +332 -0
  217. package/types/codegen/wasmx/wasmx/tx.registry.d.ts +136 -0
  218. package/types/codegen/wasmx/wasmx/tx.rpc.msg.d.ts +33 -0
  219. package/types/index.d.ts +1 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,622 @@
1
+ import * as _m0 from "protobufjs/minimal";
2
+ /**
3
+ * Defines the HTTP configuration for an API service. It contains a list of
4
+ * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
5
+ * to one or more HTTP REST API methods.
6
+ */
7
+ export interface Http {
8
+ /**
9
+ * A list of HTTP configuration rules that apply to individual API methods.
10
+ *
11
+ * **NOTE:** All service configuration rules follow "last one wins" order.
12
+ */
13
+ rules: HttpRule[];
14
+ /**
15
+ * When set to true, URL path parmeters will be fully URI-decoded except in
16
+ * cases of single segment matches in reserved expansion, where "%2F" will be
17
+ * left encoded.
18
+ *
19
+ * The default behavior is to not decode RFC 6570 reserved characters in multi
20
+ * segment matches.
21
+ */
22
+ fullyDecodeReservedExpansion: boolean;
23
+ }
24
+ /**
25
+ * Defines the HTTP configuration for an API service. It contains a list of
26
+ * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
27
+ * to one or more HTTP REST API methods.
28
+ */
29
+ export interface HttpSDKType {
30
+ /**
31
+ * A list of HTTP configuration rules that apply to individual API methods.
32
+ *
33
+ * **NOTE:** All service configuration rules follow "last one wins" order.
34
+ */
35
+ rules: HttpRuleSDKType[];
36
+ /**
37
+ * When set to true, URL path parmeters will be fully URI-decoded except in
38
+ * cases of single segment matches in reserved expansion, where "%2F" will be
39
+ * left encoded.
40
+ *
41
+ * The default behavior is to not decode RFC 6570 reserved characters in multi
42
+ * segment matches.
43
+ */
44
+ fully_decode_reserved_expansion: boolean;
45
+ }
46
+ /**
47
+ * `HttpRule` defines the mapping of an RPC method to one or more HTTP
48
+ * REST API methods. The mapping specifies how different portions of the RPC
49
+ * request message are mapped to URL path, URL query parameters, and
50
+ * HTTP request body. The mapping is typically specified as an
51
+ * `google.api.http` annotation on the RPC method,
52
+ * see "google/api/annotations.proto" for details.
53
+ *
54
+ * The mapping consists of a field specifying the path template and
55
+ * method kind. The path template can refer to fields in the request
56
+ * message, as in the example below which describes a REST GET
57
+ * operation on a resource collection of messages:
58
+ *
59
+ *
60
+ * service Messaging {
61
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
62
+ * option (google.api.http).get =
63
+ * "/v1/messages/{message_id}/{sub.subfield}";
64
+ * }
65
+ * }
66
+ * message GetMessageRequest {
67
+ * message SubMessage {
68
+ * string subfield = 1;
69
+ * }
70
+ * string message_id = 1; // mapped to the URL
71
+ * SubMessage sub = 2; // `sub.subfield` is url-mapped
72
+ * }
73
+ * message Message {
74
+ * string text = 1; // content of the resource
75
+ * }
76
+ *
77
+ * The same http annotation can alternatively be expressed inside the
78
+ * `GRPC API Configuration` YAML file.
79
+ *
80
+ * http:
81
+ * rules:
82
+ * - selector: <proto_package_name>.Messaging.GetMessage
83
+ * get: /v1/messages/{message_id}/{sub.subfield}
84
+ *
85
+ * This definition enables an automatic, bidrectional mapping of HTTP
86
+ * JSON to RPC. Example:
87
+ *
88
+ * HTTP | RPC
89
+ * -----|-----
90
+ * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub:
91
+ * SubMessage(subfield: "foo"))`
92
+ *
93
+ * In general, not only fields but also field paths can be referenced
94
+ * from a path pattern. Fields mapped to the path pattern cannot be
95
+ * repeated and must have a primitive (non-message) type.
96
+ *
97
+ * Any fields in the request message which are not bound by the path
98
+ * pattern automatically become (optional) HTTP query
99
+ * parameters. Assume the following definition of the request message:
100
+ *
101
+ *
102
+ * service Messaging {
103
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
104
+ * option (google.api.http).get = "/v1/messages/{message_id}";
105
+ * }
106
+ * }
107
+ * message GetMessageRequest {
108
+ * message SubMessage {
109
+ * string subfield = 1;
110
+ * }
111
+ * string message_id = 1; // mapped to the URL
112
+ * int64 revision = 2; // becomes a parameter
113
+ * SubMessage sub = 3; // `sub.subfield` becomes a parameter
114
+ * }
115
+ *
116
+ *
117
+ * This enables a HTTP JSON to RPC mapping as below:
118
+ *
119
+ * HTTP | RPC
120
+ * -----|-----
121
+ * `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
122
+ * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
123
+ * "foo"))`
124
+ *
125
+ * Note that fields which are mapped to HTTP parameters must have a
126
+ * primitive type or a repeated primitive type. Message types are not
127
+ * allowed. In the case of a repeated type, the parameter can be
128
+ * repeated in the URL, as in `...?param=A&param=B`.
129
+ *
130
+ * For HTTP method kinds which allow a request body, the `body` field
131
+ * specifies the mapping. Consider a REST update method on the
132
+ * message resource collection:
133
+ *
134
+ *
135
+ * service Messaging {
136
+ * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
137
+ * option (google.api.http) = {
138
+ * put: "/v1/messages/{message_id}"
139
+ * body: "message"
140
+ * };
141
+ * }
142
+ * }
143
+ * message UpdateMessageRequest {
144
+ * string message_id = 1; // mapped to the URL
145
+ * Message message = 2; // mapped to the body
146
+ * }
147
+ *
148
+ *
149
+ * The following HTTP JSON to RPC mapping is enabled, where the
150
+ * representation of the JSON in the request body is determined by
151
+ * protos JSON encoding:
152
+ *
153
+ * HTTP | RPC
154
+ * -----|-----
155
+ * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
156
+ * "123456" message { text: "Hi!" })`
157
+ *
158
+ * The special name `*` can be used in the body mapping to define that
159
+ * every field not bound by the path template should be mapped to the
160
+ * request body. This enables the following alternative definition of
161
+ * the update method:
162
+ *
163
+ * service Messaging {
164
+ * rpc UpdateMessage(Message) returns (Message) {
165
+ * option (google.api.http) = {
166
+ * put: "/v1/messages/{message_id}"
167
+ * body: "*"
168
+ * };
169
+ * }
170
+ * }
171
+ * message Message {
172
+ * string message_id = 1;
173
+ * string text = 2;
174
+ * }
175
+ *
176
+ *
177
+ * The following HTTP JSON to RPC mapping is enabled:
178
+ *
179
+ * HTTP | RPC
180
+ * -----|-----
181
+ * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
182
+ * "123456" text: "Hi!")`
183
+ *
184
+ * Note that when using `*` in the body mapping, it is not possible to
185
+ * have HTTP parameters, as all fields not bound by the path end in
186
+ * the body. This makes this option more rarely used in practice of
187
+ * defining REST APIs. The common usage of `*` is in custom methods
188
+ * which don't use the URL at all for transferring data.
189
+ *
190
+ * It is possible to define multiple HTTP methods for one RPC by using
191
+ * the `additional_bindings` option. Example:
192
+ *
193
+ * service Messaging {
194
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
195
+ * option (google.api.http) = {
196
+ * get: "/v1/messages/{message_id}"
197
+ * additional_bindings {
198
+ * get: "/v1/users/{user_id}/messages/{message_id}"
199
+ * }
200
+ * };
201
+ * }
202
+ * }
203
+ * message GetMessageRequest {
204
+ * string message_id = 1;
205
+ * string user_id = 2;
206
+ * }
207
+ *
208
+ *
209
+ * This enables the following two alternative HTTP JSON to RPC
210
+ * mappings:
211
+ *
212
+ * HTTP | RPC
213
+ * -----|-----
214
+ * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
215
+ * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
216
+ * "123456")`
217
+ *
218
+ * # Rules for HTTP mapping
219
+ *
220
+ * The rules for mapping HTTP path, query parameters, and body fields
221
+ * to the request message are as follows:
222
+ *
223
+ * 1. The `body` field specifies either `*` or a field path, or is
224
+ * omitted. If omitted, it indicates there is no HTTP request body.
225
+ * 2. Leaf fields (recursive expansion of nested messages in the
226
+ * request) can be classified into three types:
227
+ * (a) Matched in the URL template.
228
+ * (b) Covered by body (if body is `*`, everything except (a) fields;
229
+ * else everything under the body field)
230
+ * (c) All other fields.
231
+ * 3. URL query parameters found in the HTTP request are mapped to (c) fields.
232
+ * 4. Any body sent with an HTTP request can contain only (b) fields.
233
+ *
234
+ * The syntax of the path template is as follows:
235
+ *
236
+ * Template = "/" Segments [ Verb ] ;
237
+ * Segments = Segment { "/" Segment } ;
238
+ * Segment = "*" | "**" | LITERAL | Variable ;
239
+ * Variable = "{" FieldPath [ "=" Segments ] "}" ;
240
+ * FieldPath = IDENT { "." IDENT } ;
241
+ * Verb = ":" LITERAL ;
242
+ *
243
+ * The syntax `*` matches a single path segment. The syntax `**` matches zero
244
+ * or more path segments, which must be the last part of the path except the
245
+ * `Verb`. The syntax `LITERAL` matches literal text in the path.
246
+ *
247
+ * The syntax `Variable` matches part of the URL path as specified by its
248
+ * template. A variable template must not contain other variables. If a variable
249
+ * matches a single path segment, its template may be omitted, e.g. `{var}`
250
+ * is equivalent to `{var=*}`.
251
+ *
252
+ * If a variable contains exactly one path segment, such as `"{var}"` or
253
+ * `"{var=*}"`, when such a variable is expanded into a URL path, all characters
254
+ * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
255
+ * Discovery Document as `{var}`.
256
+ *
257
+ * If a variable contains one or more path segments, such as `"{var=foo/*}"`
258
+ * or `"{var=**}"`, when such a variable is expanded into a URL path, all
259
+ * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
260
+ * show up in the Discovery Document as `{+var}`.
261
+ *
262
+ * NOTE: While the single segment variable matches the semantics of
263
+ * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
264
+ * Simple String Expansion, the multi segment variable **does not** match
265
+ * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
266
+ * does not expand special characters like `?` and `#`, which would lead
267
+ * to invalid URLs.
268
+ *
269
+ * NOTE: the field paths in variables and in the `body` must not refer to
270
+ * repeated fields or map fields.
271
+ */
272
+ export interface HttpRule {
273
+ /**
274
+ * Selects methods to which this rule applies.
275
+ *
276
+ * Refer to [selector][google.api.DocumentationRule.selector] for syntax
277
+ * details.
278
+ */
279
+ selector: string;
280
+ /** Used for listing and getting information about resources. */
281
+ get?: string;
282
+ /** Used for updating a resource. */
283
+ put?: string;
284
+ /** Used for creating a resource. */
285
+ post?: string;
286
+ /** Used for deleting a resource. */
287
+ delete?: string;
288
+ /** Used for updating a resource. */
289
+ patch?: string;
290
+ /**
291
+ * The custom pattern is used for specifying an HTTP method that is not
292
+ * included in the `pattern` field, such as HEAD, or "*" to leave the
293
+ * HTTP method unspecified for this rule. The wild-card rule is useful
294
+ * for services that provide content to Web (HTML) clients.
295
+ */
296
+ custom?: CustomHttpPattern;
297
+ /**
298
+ * The name of the request field whose value is mapped to the HTTP body, or
299
+ * `*` for mapping all fields not captured by the path pattern to the HTTP
300
+ * body. NOTE: the referred field must not be a repeated field and must be
301
+ * present at the top-level of request message type.
302
+ */
303
+ body: string;
304
+ /**
305
+ * Optional. The name of the response field whose value is mapped to the HTTP
306
+ * body of response. Other response fields are ignored. When
307
+ * not set, the response message will be used as HTTP body of response.
308
+ */
309
+ responseBody: string;
310
+ /**
311
+ * Additional HTTP bindings for the selector. Nested bindings must
312
+ * not contain an `additional_bindings` field themselves (that is,
313
+ * the nesting may only be one level deep).
314
+ */
315
+ additionalBindings: HttpRule[];
316
+ }
317
+ /**
318
+ * `HttpRule` defines the mapping of an RPC method to one or more HTTP
319
+ * REST API methods. The mapping specifies how different portions of the RPC
320
+ * request message are mapped to URL path, URL query parameters, and
321
+ * HTTP request body. The mapping is typically specified as an
322
+ * `google.api.http` annotation on the RPC method,
323
+ * see "google/api/annotations.proto" for details.
324
+ *
325
+ * The mapping consists of a field specifying the path template and
326
+ * method kind. The path template can refer to fields in the request
327
+ * message, as in the example below which describes a REST GET
328
+ * operation on a resource collection of messages:
329
+ *
330
+ *
331
+ * service Messaging {
332
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
333
+ * option (google.api.http).get =
334
+ * "/v1/messages/{message_id}/{sub.subfield}";
335
+ * }
336
+ * }
337
+ * message GetMessageRequest {
338
+ * message SubMessage {
339
+ * string subfield = 1;
340
+ * }
341
+ * string message_id = 1; // mapped to the URL
342
+ * SubMessage sub = 2; // `sub.subfield` is url-mapped
343
+ * }
344
+ * message Message {
345
+ * string text = 1; // content of the resource
346
+ * }
347
+ *
348
+ * The same http annotation can alternatively be expressed inside the
349
+ * `GRPC API Configuration` YAML file.
350
+ *
351
+ * http:
352
+ * rules:
353
+ * - selector: <proto_package_name>.Messaging.GetMessage
354
+ * get: /v1/messages/{message_id}/{sub.subfield}
355
+ *
356
+ * This definition enables an automatic, bidrectional mapping of HTTP
357
+ * JSON to RPC. Example:
358
+ *
359
+ * HTTP | RPC
360
+ * -----|-----
361
+ * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub:
362
+ * SubMessage(subfield: "foo"))`
363
+ *
364
+ * In general, not only fields but also field paths can be referenced
365
+ * from a path pattern. Fields mapped to the path pattern cannot be
366
+ * repeated and must have a primitive (non-message) type.
367
+ *
368
+ * Any fields in the request message which are not bound by the path
369
+ * pattern automatically become (optional) HTTP query
370
+ * parameters. Assume the following definition of the request message:
371
+ *
372
+ *
373
+ * service Messaging {
374
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
375
+ * option (google.api.http).get = "/v1/messages/{message_id}";
376
+ * }
377
+ * }
378
+ * message GetMessageRequest {
379
+ * message SubMessage {
380
+ * string subfield = 1;
381
+ * }
382
+ * string message_id = 1; // mapped to the URL
383
+ * int64 revision = 2; // becomes a parameter
384
+ * SubMessage sub = 3; // `sub.subfield` becomes a parameter
385
+ * }
386
+ *
387
+ *
388
+ * This enables a HTTP JSON to RPC mapping as below:
389
+ *
390
+ * HTTP | RPC
391
+ * -----|-----
392
+ * `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
393
+ * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
394
+ * "foo"))`
395
+ *
396
+ * Note that fields which are mapped to HTTP parameters must have a
397
+ * primitive type or a repeated primitive type. Message types are not
398
+ * allowed. In the case of a repeated type, the parameter can be
399
+ * repeated in the URL, as in `...?param=A&param=B`.
400
+ *
401
+ * For HTTP method kinds which allow a request body, the `body` field
402
+ * specifies the mapping. Consider a REST update method on the
403
+ * message resource collection:
404
+ *
405
+ *
406
+ * service Messaging {
407
+ * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
408
+ * option (google.api.http) = {
409
+ * put: "/v1/messages/{message_id}"
410
+ * body: "message"
411
+ * };
412
+ * }
413
+ * }
414
+ * message UpdateMessageRequest {
415
+ * string message_id = 1; // mapped to the URL
416
+ * Message message = 2; // mapped to the body
417
+ * }
418
+ *
419
+ *
420
+ * The following HTTP JSON to RPC mapping is enabled, where the
421
+ * representation of the JSON in the request body is determined by
422
+ * protos JSON encoding:
423
+ *
424
+ * HTTP | RPC
425
+ * -----|-----
426
+ * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
427
+ * "123456" message { text: "Hi!" })`
428
+ *
429
+ * The special name `*` can be used in the body mapping to define that
430
+ * every field not bound by the path template should be mapped to the
431
+ * request body. This enables the following alternative definition of
432
+ * the update method:
433
+ *
434
+ * service Messaging {
435
+ * rpc UpdateMessage(Message) returns (Message) {
436
+ * option (google.api.http) = {
437
+ * put: "/v1/messages/{message_id}"
438
+ * body: "*"
439
+ * };
440
+ * }
441
+ * }
442
+ * message Message {
443
+ * string message_id = 1;
444
+ * string text = 2;
445
+ * }
446
+ *
447
+ *
448
+ * The following HTTP JSON to RPC mapping is enabled:
449
+ *
450
+ * HTTP | RPC
451
+ * -----|-----
452
+ * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
453
+ * "123456" text: "Hi!")`
454
+ *
455
+ * Note that when using `*` in the body mapping, it is not possible to
456
+ * have HTTP parameters, as all fields not bound by the path end in
457
+ * the body. This makes this option more rarely used in practice of
458
+ * defining REST APIs. The common usage of `*` is in custom methods
459
+ * which don't use the URL at all for transferring data.
460
+ *
461
+ * It is possible to define multiple HTTP methods for one RPC by using
462
+ * the `additional_bindings` option. Example:
463
+ *
464
+ * service Messaging {
465
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
466
+ * option (google.api.http) = {
467
+ * get: "/v1/messages/{message_id}"
468
+ * additional_bindings {
469
+ * get: "/v1/users/{user_id}/messages/{message_id}"
470
+ * }
471
+ * };
472
+ * }
473
+ * }
474
+ * message GetMessageRequest {
475
+ * string message_id = 1;
476
+ * string user_id = 2;
477
+ * }
478
+ *
479
+ *
480
+ * This enables the following two alternative HTTP JSON to RPC
481
+ * mappings:
482
+ *
483
+ * HTTP | RPC
484
+ * -----|-----
485
+ * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
486
+ * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
487
+ * "123456")`
488
+ *
489
+ * # Rules for HTTP mapping
490
+ *
491
+ * The rules for mapping HTTP path, query parameters, and body fields
492
+ * to the request message are as follows:
493
+ *
494
+ * 1. The `body` field specifies either `*` or a field path, or is
495
+ * omitted. If omitted, it indicates there is no HTTP request body.
496
+ * 2. Leaf fields (recursive expansion of nested messages in the
497
+ * request) can be classified into three types:
498
+ * (a) Matched in the URL template.
499
+ * (b) Covered by body (if body is `*`, everything except (a) fields;
500
+ * else everything under the body field)
501
+ * (c) All other fields.
502
+ * 3. URL query parameters found in the HTTP request are mapped to (c) fields.
503
+ * 4. Any body sent with an HTTP request can contain only (b) fields.
504
+ *
505
+ * The syntax of the path template is as follows:
506
+ *
507
+ * Template = "/" Segments [ Verb ] ;
508
+ * Segments = Segment { "/" Segment } ;
509
+ * Segment = "*" | "**" | LITERAL | Variable ;
510
+ * Variable = "{" FieldPath [ "=" Segments ] "}" ;
511
+ * FieldPath = IDENT { "." IDENT } ;
512
+ * Verb = ":" LITERAL ;
513
+ *
514
+ * The syntax `*` matches a single path segment. The syntax `**` matches zero
515
+ * or more path segments, which must be the last part of the path except the
516
+ * `Verb`. The syntax `LITERAL` matches literal text in the path.
517
+ *
518
+ * The syntax `Variable` matches part of the URL path as specified by its
519
+ * template. A variable template must not contain other variables. If a variable
520
+ * matches a single path segment, its template may be omitted, e.g. `{var}`
521
+ * is equivalent to `{var=*}`.
522
+ *
523
+ * If a variable contains exactly one path segment, such as `"{var}"` or
524
+ * `"{var=*}"`, when such a variable is expanded into a URL path, all characters
525
+ * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
526
+ * Discovery Document as `{var}`.
527
+ *
528
+ * If a variable contains one or more path segments, such as `"{var=foo/*}"`
529
+ * or `"{var=**}"`, when such a variable is expanded into a URL path, all
530
+ * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
531
+ * show up in the Discovery Document as `{+var}`.
532
+ *
533
+ * NOTE: While the single segment variable matches the semantics of
534
+ * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
535
+ * Simple String Expansion, the multi segment variable **does not** match
536
+ * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
537
+ * does not expand special characters like `?` and `#`, which would lead
538
+ * to invalid URLs.
539
+ *
540
+ * NOTE: the field paths in variables and in the `body` must not refer to
541
+ * repeated fields or map fields.
542
+ */
543
+ export interface HttpRuleSDKType {
544
+ /**
545
+ * Selects methods to which this rule applies.
546
+ *
547
+ * Refer to [selector][google.api.DocumentationRule.selector] for syntax
548
+ * details.
549
+ */
550
+ selector: string;
551
+ /** Used for listing and getting information about resources. */
552
+ get?: string;
553
+ /** Used for updating a resource. */
554
+ put?: string;
555
+ /** Used for creating a resource. */
556
+ post?: string;
557
+ /** Used for deleting a resource. */
558
+ delete?: string;
559
+ /** Used for updating a resource. */
560
+ patch?: string;
561
+ /**
562
+ * The custom pattern is used for specifying an HTTP method that is not
563
+ * included in the `pattern` field, such as HEAD, or "*" to leave the
564
+ * HTTP method unspecified for this rule. The wild-card rule is useful
565
+ * for services that provide content to Web (HTML) clients.
566
+ */
567
+ custom?: CustomHttpPatternSDKType;
568
+ /**
569
+ * The name of the request field whose value is mapped to the HTTP body, or
570
+ * `*` for mapping all fields not captured by the path pattern to the HTTP
571
+ * body. NOTE: the referred field must not be a repeated field and must be
572
+ * present at the top-level of request message type.
573
+ */
574
+ body: string;
575
+ /**
576
+ * Optional. The name of the response field whose value is mapped to the HTTP
577
+ * body of response. Other response fields are ignored. When
578
+ * not set, the response message will be used as HTTP body of response.
579
+ */
580
+ response_body: string;
581
+ /**
582
+ * Additional HTTP bindings for the selector. Nested bindings must
583
+ * not contain an `additional_bindings` field themselves (that is,
584
+ * the nesting may only be one level deep).
585
+ */
586
+ additional_bindings: HttpRuleSDKType[];
587
+ }
588
+ /** A custom pattern is used for defining custom HTTP verb. */
589
+ export interface CustomHttpPattern {
590
+ /** The name of this custom HTTP verb. */
591
+ kind: string;
592
+ /** The path matched by this custom verb. */
593
+ path: string;
594
+ }
595
+ /** A custom pattern is used for defining custom HTTP verb. */
596
+ export interface CustomHttpPatternSDKType {
597
+ /** The name of this custom HTTP verb. */
598
+ kind: string;
599
+ /** The path matched by this custom verb. */
600
+ path: string;
601
+ }
602
+ export declare const Http: {
603
+ encode(message: Http, writer?: _m0.Writer): _m0.Writer;
604
+ decode(input: _m0.Reader | Uint8Array, length?: number): Http;
605
+ fromJSON(object: any): Http;
606
+ toJSON(message: Http): unknown;
607
+ fromPartial(object: Partial<Http>): Http;
608
+ };
609
+ export declare const HttpRule: {
610
+ encode(message: HttpRule, writer?: _m0.Writer): _m0.Writer;
611
+ decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule;
612
+ fromJSON(object: any): HttpRule;
613
+ toJSON(message: HttpRule): unknown;
614
+ fromPartial(object: Partial<HttpRule>): HttpRule;
615
+ };
616
+ export declare const CustomHttpPattern: {
617
+ encode(message: CustomHttpPattern, writer?: _m0.Writer): _m0.Writer;
618
+ decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern;
619
+ fromJSON(object: any): CustomHttpPattern;
620
+ toJSON(message: CustomHttpPattern): unknown;
621
+ fromPartial(object: Partial<CustomHttpPattern>): CustomHttpPattern;
622
+ };