atlas.js-protos 0.1.0

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 (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +85 -0
  3. package/dist/filetree/index.d.ts +2 -0
  4. package/dist/filetree/index.js +8 -0
  5. package/dist/filetree/index.mjs +3 -0
  6. package/dist/filetree/query.d.ts +1 -0
  7. package/dist/filetree/query.js +13 -0
  8. package/dist/filetree/query.mjs +2 -0
  9. package/dist/filetree/tx.d.ts +1 -0
  10. package/dist/filetree/tx.js +11 -0
  11. package/dist/filetree/tx.mjs +2 -0
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.js +17 -0
  14. package/dist/index.mjs +1 -0
  15. package/dist/storage/index.d.ts +5 -0
  16. package/dist/storage/index.js +16 -0
  17. package/dist/storage/index.mjs +6 -0
  18. package/dist/storage/query.d.ts +1 -0
  19. package/dist/storage/query.js +27 -0
  20. package/dist/storage/query.mjs +2 -0
  21. package/dist/storage/tx.d.ts +1 -0
  22. package/dist/storage/tx.js +21 -0
  23. package/dist/storage/tx.mjs +2 -0
  24. package/dist/types/amino/amino.d.ts +1 -0
  25. package/dist/types/amino/amino.js +2 -0
  26. package/dist/types/amino/amino.mjs +1 -0
  27. package/dist/types/amino/bundle.d.ts +1 -0
  28. package/dist/types/amino/bundle.js +41 -0
  29. package/dist/types/amino/bundle.mjs +5 -0
  30. package/dist/types/atlas/bundle.d.ts +905 -0
  31. package/dist/types/atlas/bundle.js +98 -0
  32. package/dist/types/atlas/bundle.mjs +62 -0
  33. package/dist/types/atlas/filetree/v1/genesis.d.ts +45 -0
  34. package/dist/types/atlas/filetree/v1/genesis.js +107 -0
  35. package/dist/types/atlas/filetree/v1/genesis.mjs +71 -0
  36. package/dist/types/atlas/filetree/v1/params.d.ts +40 -0
  37. package/dist/types/atlas/filetree/v1/params.js +94 -0
  38. package/dist/types/atlas/filetree/v1/params.mjs +58 -0
  39. package/dist/types/atlas/filetree/v1/query.d.ts +330 -0
  40. package/dist/types/atlas/filetree/v1/query.js +567 -0
  41. package/dist/types/atlas/filetree/v1/query.mjs +531 -0
  42. package/dist/types/atlas/filetree/v1/query.rpc.Query.d.ts +28 -0
  43. package/dist/types/atlas/filetree/v1/query.rpc.Query.js +89 -0
  44. package/dist/types/atlas/filetree/v1/query.rpc.Query.mjs +51 -0
  45. package/dist/types/atlas/filetree/v1/query.rpc.func.d.ts +29 -0
  46. package/dist/types/atlas/filetree/v1/query.rpc.func.js +58 -0
  47. package/dist/types/atlas/filetree/v1/query.rpc.func.mjs +55 -0
  48. package/dist/types/atlas/filetree/v1/tree.d.ts +44 -0
  49. package/dist/types/atlas/filetree/v1/tree.js +124 -0
  50. package/dist/types/atlas/filetree/v1/tree.mjs +88 -0
  51. package/dist/types/atlas/filetree/v1/tx.d.ts +260 -0
  52. package/dist/types/atlas/filetree/v1/tx.js +449 -0
  53. package/dist/types/atlas/filetree/v1/tx.mjs +413 -0
  54. package/dist/types/atlas/filetree/v1/tx.rpc.func.d.ts +23 -0
  55. package/dist/types/atlas/filetree/v1/tx.rpc.func.js +34 -0
  56. package/dist/types/atlas/filetree/v1/tx.rpc.func.mjs +31 -0
  57. package/dist/types/atlas/filetree/v1/tx.rpc.msg.d.ts +22 -0
  58. package/dist/types/atlas/filetree/v1/tx.rpc.msg.js +67 -0
  59. package/dist/types/atlas/filetree/v1/tx.rpc.msg.mjs +29 -0
  60. package/dist/types/atlas/rpc.query.d.ts +49 -0
  61. package/dist/types/atlas/rpc.query.js +59 -0
  62. package/dist/types/atlas/rpc.query.mjs +22 -0
  63. package/dist/types/atlas/rpc.tx.d.ts +18 -0
  64. package/dist/types/atlas/rpc.tx.js +52 -0
  65. package/dist/types/atlas/rpc.tx.mjs +15 -0
  66. package/dist/types/atlas/storage/v1/file.d.ts +59 -0
  67. package/dist/types/atlas/storage/v1/file.js +173 -0
  68. package/dist/types/atlas/storage/v1/file.mjs +137 -0
  69. package/dist/types/atlas/storage/v1/genesis.d.ts +45 -0
  70. package/dist/types/atlas/storage/v1/genesis.js +107 -0
  71. package/dist/types/atlas/storage/v1/genesis.mjs +71 -0
  72. package/dist/types/atlas/storage/v1/params.d.ts +48 -0
  73. package/dist/types/atlas/storage/v1/params.js +127 -0
  74. package/dist/types/atlas/storage/v1/params.mjs +91 -0
  75. package/dist/types/atlas/storage/v1/proof.d.ts +145 -0
  76. package/dist/types/atlas/storage/v1/proof.js +318 -0
  77. package/dist/types/atlas/storage/v1/proof.mjs +282 -0
  78. package/dist/types/atlas/storage/v1/provider.d.ts +51 -0
  79. package/dist/types/atlas/storage/v1/provider.js +141 -0
  80. package/dist/types/atlas/storage/v1/provider.mjs +105 -0
  81. package/dist/types/atlas/storage/v1/query.d.ts +914 -0
  82. package/dist/types/atlas/storage/v1/query.js +1570 -0
  83. package/dist/types/atlas/storage/v1/query.mjs +1534 -0
  84. package/dist/types/atlas/storage/v1/query.rpc.Query.d.ts +56 -0
  85. package/dist/types/atlas/storage/v1/query.rpc.Query.js +154 -0
  86. package/dist/types/atlas/storage/v1/query.rpc.Query.mjs +116 -0
  87. package/dist/types/atlas/storage/v1/query.rpc.func.d.ts +78 -0
  88. package/dist/types/atlas/storage/v1/query.rpc.func.js +149 -0
  89. package/dist/types/atlas/storage/v1/query.rpc.func.mjs +146 -0
  90. package/dist/types/atlas/storage/v1/subscription.d.ts +55 -0
  91. package/dist/types/atlas/storage/v1/subscription.js +159 -0
  92. package/dist/types/atlas/storage/v1/subscription.mjs +123 -0
  93. package/dist/types/atlas/storage/v1/tx.d.ts +694 -0
  94. package/dist/types/atlas/storage/v1/tx.js +1203 -0
  95. package/dist/types/atlas/storage/v1/tx.mjs +1167 -0
  96. package/dist/types/atlas/storage/v1/tx.rpc.func.d.ts +56 -0
  97. package/dist/types/atlas/storage/v1/tx.rpc.func.js +77 -0
  98. package/dist/types/atlas/storage/v1/tx.rpc.func.mjs +74 -0
  99. package/dist/types/atlas/storage/v1/tx.rpc.msg.d.ts +35 -0
  100. package/dist/types/atlas/storage/v1/tx.rpc.msg.js +97 -0
  101. package/dist/types/atlas/storage/v1/tx.rpc.msg.mjs +59 -0
  102. package/dist/types/cosmos/bank/v1beta1/authz.d.ts +62 -0
  103. package/dist/types/cosmos/bank/v1beta1/authz.js +123 -0
  104. package/dist/types/cosmos/bank/v1beta1/authz.mjs +87 -0
  105. package/dist/types/cosmos/bank/v1beta1/bank.d.ts +391 -0
  106. package/dist/types/cosmos/bank/v1beta1/bank.js +626 -0
  107. package/dist/types/cosmos/bank/v1beta1/bank.mjs +590 -0
  108. package/dist/types/cosmos/bank/v1beta1/genesis.d.ts +122 -0
  109. package/dist/types/cosmos/bank/v1beta1/genesis.js +224 -0
  110. package/dist/types/cosmos/bank/v1beta1/genesis.mjs +188 -0
  111. package/dist/types/cosmos/bank/v1beta1/query.d.ts +1377 -0
  112. package/dist/types/cosmos/bank/v1beta1/query.js +2038 -0
  113. package/dist/types/cosmos/bank/v1beta1/query.mjs +2002 -0
  114. package/dist/types/cosmos/bank/v1beta1/query.rpc.Query.d.ts +119 -0
  115. package/dist/types/cosmos/bank/v1beta1/query.rpc.Query.js +174 -0
  116. package/dist/types/cosmos/bank/v1beta1/query.rpc.Query.mjs +136 -0
  117. package/dist/types/cosmos/bank/v1beta1/query.rpc.func.d.ts +129 -0
  118. package/dist/types/cosmos/bank/v1beta1/query.rpc.func.js +212 -0
  119. package/dist/types/cosmos/bank/v1beta1/query.rpc.func.mjs +209 -0
  120. package/dist/types/cosmos/bank/v1beta1/tx.d.ts +398 -0
  121. package/dist/types/cosmos/bank/v1beta1/tx.js +599 -0
  122. package/dist/types/cosmos/bank/v1beta1/tx.mjs +563 -0
  123. package/dist/types/cosmos/bank/v1beta1/tx.rpc.func.d.ts +37 -0
  124. package/dist/types/cosmos/bank/v1beta1/tx.rpc.func.js +50 -0
  125. package/dist/types/cosmos/bank/v1beta1/tx.rpc.func.mjs +47 -0
  126. package/dist/types/cosmos/bank/v1beta1/tx.rpc.msg.d.ts +34 -0
  127. package/dist/types/cosmos/bank/v1beta1/tx.rpc.msg.js +73 -0
  128. package/dist/types/cosmos/bank/v1beta1/tx.rpc.msg.mjs +35 -0
  129. package/dist/types/cosmos/base/query/v1beta1/pagination.d.ts +163 -0
  130. package/dist/types/cosmos/base/query/v1beta1/pagination.js +219 -0
  131. package/dist/types/cosmos/base/query/v1beta1/pagination.mjs +183 -0
  132. package/dist/types/cosmos/base/v1beta1/coin.d.ts +193 -0
  133. package/dist/types/cosmos/base/v1beta1/coin.js +320 -0
  134. package/dist/types/cosmos/base/v1beta1/coin.mjs +284 -0
  135. package/dist/types/cosmos/bundle.d.ts +761 -0
  136. package/dist/types/cosmos/bundle.js +97 -0
  137. package/dist/types/cosmos/bundle.mjs +61 -0
  138. package/dist/types/cosmos/msg/v1/msg.d.ts +1 -0
  139. package/dist/types/cosmos/msg/v1/msg.js +2 -0
  140. package/dist/types/cosmos/msg/v1/msg.mjs +1 -0
  141. package/dist/types/cosmos/query/v1/query.d.ts +1 -0
  142. package/dist/types/cosmos/query/v1/query.js +2 -0
  143. package/dist/types/cosmos/query/v1/query.mjs +1 -0
  144. package/dist/types/cosmos/rpc.query.d.ts +24 -0
  145. package/dist/types/cosmos/rpc.query.js +51 -0
  146. package/dist/types/cosmos/rpc.query.mjs +14 -0
  147. package/dist/types/cosmos/rpc.tx.d.ts +10 -0
  148. package/dist/types/cosmos/rpc.tx.js +44 -0
  149. package/dist/types/cosmos/rpc.tx.mjs +7 -0
  150. package/dist/types/cosmos_proto/bundle.d.ts +31 -0
  151. package/dist/types/cosmos_proto/bundle.js +41 -0
  152. package/dist/types/cosmos_proto/bundle.mjs +5 -0
  153. package/dist/types/cosmos_proto/cosmos.d.ts +144 -0
  154. package/dist/types/cosmos_proto/cosmos.js +244 -0
  155. package/dist/types/cosmos_proto/cosmos.mjs +206 -0
  156. package/dist/types/extern.d.ts +11 -0
  157. package/dist/types/extern.js +47 -0
  158. package/dist/types/extern.mjs +41 -0
  159. package/dist/types/gogoproto/bundle.d.ts +1 -0
  160. package/dist/types/gogoproto/bundle.js +41 -0
  161. package/dist/types/gogoproto/bundle.mjs +5 -0
  162. package/dist/types/gogoproto/gogo.d.ts +1 -0
  163. package/dist/types/gogoproto/gogo.js +2 -0
  164. package/dist/types/gogoproto/gogo.mjs +1 -0
  165. package/dist/types/google/api/annotations.d.ts +1 -0
  166. package/dist/types/google/api/annotations.js +2 -0
  167. package/dist/types/google/api/annotations.mjs +1 -0
  168. package/dist/types/google/api/http.d.ts +1006 -0
  169. package/dist/types/google/api/http.js +589 -0
  170. package/dist/types/google/api/http.mjs +553 -0
  171. package/dist/types/google/bundle.d.ts +545 -0
  172. package/dist/types/google/bundle.js +52 -0
  173. package/dist/types/google/bundle.mjs +16 -0
  174. package/dist/types/google/protobuf/descriptor.d.ts +2755 -0
  175. package/dist/types/google/protobuf/descriptor.js +4612 -0
  176. package/dist/types/google/protobuf/descriptor.mjs +4535 -0
  177. package/dist/types/google/protobuf/timestamp.d.ts +319 -0
  178. package/dist/types/google/protobuf/timestamp.js +197 -0
  179. package/dist/types/google/protobuf/timestamp.mjs +161 -0
  180. package/dist/types/helper-func-types.d.ts +40 -0
  181. package/dist/types/helper-func-types.js +57 -0
  182. package/dist/types/helper-func-types.mjs +53 -0
  183. package/dist/types/helpers.d.ts +56 -0
  184. package/dist/types/helpers.js +161 -0
  185. package/dist/types/helpers.mjs +110 -0
  186. package/dist/types/index.d.ts +15 -0
  187. package/dist/types/index.js +32 -0
  188. package/dist/types/index.mjs +16 -0
  189. package/dist/types/registry.d.ts +35 -0
  190. package/dist/types/registry.js +200 -0
  191. package/dist/types/registry.mjs +163 -0
  192. package/dist/types/types.d.ts +74 -0
  193. package/dist/types/types.js +8 -0
  194. package/dist/types/types.mjs +7 -0
  195. package/package.json +97 -0
@@ -0,0 +1,553 @@
1
+ //@ts-nocheck
2
+ import * as _m0 from "protobufjs/minimal";
3
+ import { GlobalDecoderRegistry } from "../../registry";
4
+ function createBaseHttp() {
5
+ return {
6
+ rules: [],
7
+ fullyDecodeReservedExpansion: false
8
+ };
9
+ }
10
+ /**
11
+ * Defines the HTTP configuration for an API service. It contains a list of
12
+ * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
13
+ * to one or more HTTP REST API methods.
14
+ * @name Http
15
+ * @package google.api
16
+ * @see proto type: google.api.Http
17
+ */
18
+ export const Http = {
19
+ typeUrl: "/google.api.Http",
20
+ is(o) {
21
+ return o && (o.$typeUrl === Http.typeUrl || Array.isArray(o.rules) && (!o.rules.length || HttpRule.is(o.rules[0])) && typeof o.fullyDecodeReservedExpansion === "boolean");
22
+ },
23
+ isSDK(o) {
24
+ return o && (o.$typeUrl === Http.typeUrl || Array.isArray(o.rules) && (!o.rules.length || HttpRule.isSDK(o.rules[0])) && typeof o.fully_decode_reserved_expansion === "boolean");
25
+ },
26
+ encode(message, writer = _m0.Writer.create()) {
27
+ for (const v of message.rules) {
28
+ HttpRule.encode(v, writer.uint32(10).fork()).ldelim();
29
+ }
30
+ if (message.fullyDecodeReservedExpansion === true) {
31
+ writer.uint32(16).bool(message.fullyDecodeReservedExpansion);
32
+ }
33
+ return writer;
34
+ },
35
+ decode(input, length) {
36
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
37
+ let end = length === undefined ? reader.len : reader.pos + length;
38
+ const message = createBaseHttp();
39
+ while (reader.pos < end) {
40
+ const tag = reader.uint32();
41
+ switch (tag >>> 3) {
42
+ case 1:
43
+ message.rules.push(HttpRule.decode(reader, reader.uint32()));
44
+ break;
45
+ case 2:
46
+ message.fullyDecodeReservedExpansion = reader.bool();
47
+ break;
48
+ default:
49
+ reader.skipType(tag & 7);
50
+ break;
51
+ }
52
+ }
53
+ return message;
54
+ },
55
+ fromPartial(object) {
56
+ const message = createBaseHttp();
57
+ message.rules = object.rules?.map(e => HttpRule.fromPartial(e)) || [];
58
+ message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false;
59
+ return message;
60
+ },
61
+ fromProtoMsg(message) {
62
+ return Http.decode(message.value);
63
+ },
64
+ toProto(message) {
65
+ return Http.encode(message).finish();
66
+ },
67
+ toProtoMsg(message) {
68
+ return {
69
+ typeUrl: "/google.api.Http",
70
+ value: Http.encode(message).finish()
71
+ };
72
+ },
73
+ registerTypeUrl() {
74
+ if (!GlobalDecoderRegistry.registerExistingTypeUrl(Http.typeUrl)) {
75
+ return;
76
+ }
77
+ HttpRule.registerTypeUrl();
78
+ }
79
+ };
80
+ GlobalDecoderRegistry.register(Http.typeUrl, Http);
81
+ function createBaseHttpRule() {
82
+ return {
83
+ selector: "",
84
+ get: undefined,
85
+ put: undefined,
86
+ post: undefined,
87
+ delete: undefined,
88
+ patch: undefined,
89
+ custom: undefined,
90
+ body: "",
91
+ responseBody: "",
92
+ additionalBindings: []
93
+ };
94
+ }
95
+ /**
96
+ * gRPC Transcoding
97
+ *
98
+ * gRPC Transcoding is a feature for mapping between a gRPC method and one or
99
+ * more HTTP REST endpoints. It allows developers to build a single API service
100
+ * that supports both gRPC APIs and REST APIs. Many systems, including [Google
101
+ * APIs](https://github.com/googleapis/googleapis),
102
+ * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
103
+ * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
104
+ * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
105
+ * and use it for large scale production services.
106
+ *
107
+ * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
108
+ * how different portions of the gRPC request message are mapped to the URL
109
+ * path, URL query parameters, and HTTP request body. It also controls how the
110
+ * gRPC response message is mapped to the HTTP response body. `HttpRule` is
111
+ * typically specified as an `google.api.http` annotation on the gRPC method.
112
+ *
113
+ * Each mapping specifies a URL path template and an HTTP method. The path
114
+ * template may refer to one or more fields in the gRPC request message, as long
115
+ * as each field is a non-repeated field with a primitive (non-message) type.
116
+ * The path template controls how fields of the request message are mapped to
117
+ * the URL path.
118
+ *
119
+ * Example:
120
+ *
121
+ * service Messaging {
122
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
123
+ * option (google.api.http) = {
124
+ * get: "/v1/{name=messages/*}"
125
+ * };
126
+ * }
127
+ * }
128
+ * message GetMessageRequest {
129
+ * string name = 1; // Mapped to URL path.
130
+ * }
131
+ * message Message {
132
+ * string text = 1; // The resource content.
133
+ * }
134
+ *
135
+ * This enables an HTTP REST to gRPC mapping as below:
136
+ *
137
+ * - HTTP: `GET /v1/messages/123456`
138
+ * - gRPC: `GetMessage(name: "messages/123456")`
139
+ *
140
+ * Any fields in the request message which are not bound by the path template
141
+ * automatically become HTTP query parameters if there is no HTTP request body.
142
+ * For example:
143
+ *
144
+ * service Messaging {
145
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
146
+ * option (google.api.http) = {
147
+ * get:"/v1/messages/{message_id}"
148
+ * };
149
+ * }
150
+ * }
151
+ * message GetMessageRequest {
152
+ * message SubMessage {
153
+ * string subfield = 1;
154
+ * }
155
+ * string message_id = 1; // Mapped to URL path.
156
+ * int64 revision = 2; // Mapped to URL query parameter `revision`.
157
+ * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
158
+ * }
159
+ *
160
+ * This enables a HTTP JSON to RPC mapping as below:
161
+ *
162
+ * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
163
+ * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
164
+ * SubMessage(subfield: "foo"))`
165
+ *
166
+ * Note that fields which are mapped to URL query parameters must have a
167
+ * primitive type or a repeated primitive type or a non-repeated message type.
168
+ * In the case of a repeated type, the parameter can be repeated in the URL
169
+ * as `...?param=A&param=B`. In the case of a message type, each field of the
170
+ * message is mapped to a separate parameter, such as
171
+ * `...?foo.a=A&foo.b=B&foo.c=C`.
172
+ *
173
+ * For HTTP methods that allow a request body, the `body` field
174
+ * specifies the mapping. Consider a REST update method on the
175
+ * message resource collection:
176
+ *
177
+ * service Messaging {
178
+ * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
179
+ * option (google.api.http) = {
180
+ * patch: "/v1/messages/{message_id}"
181
+ * body: "message"
182
+ * };
183
+ * }
184
+ * }
185
+ * message UpdateMessageRequest {
186
+ * string message_id = 1; // mapped to the URL
187
+ * Message message = 2; // mapped to the body
188
+ * }
189
+ *
190
+ * The following HTTP JSON to RPC mapping is enabled, where the
191
+ * representation of the JSON in the request body is determined by
192
+ * protos JSON encoding:
193
+ *
194
+ * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
195
+ * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
196
+ *
197
+ * The special name `*` can be used in the body mapping to define that
198
+ * every field not bound by the path template should be mapped to the
199
+ * request body. This enables the following alternative definition of
200
+ * the update method:
201
+ *
202
+ * service Messaging {
203
+ * rpc UpdateMessage(Message) returns (Message) {
204
+ * option (google.api.http) = {
205
+ * patch: "/v1/messages/{message_id}"
206
+ * body: "*"
207
+ * };
208
+ * }
209
+ * }
210
+ * message Message {
211
+ * string message_id = 1;
212
+ * string text = 2;
213
+ * }
214
+ *
215
+ *
216
+ * The following HTTP JSON to RPC mapping is enabled:
217
+ *
218
+ * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
219
+ * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
220
+ *
221
+ * Note that when using `*` in the body mapping, it is not possible to
222
+ * have HTTP parameters, as all fields not bound by the path end in
223
+ * the body. This makes this option more rarely used in practice when
224
+ * defining REST APIs. The common usage of `*` is in custom methods
225
+ * which don't use the URL at all for transferring data.
226
+ *
227
+ * It is possible to define multiple HTTP methods for one RPC by using
228
+ * the `additional_bindings` option. Example:
229
+ *
230
+ * service Messaging {
231
+ * rpc GetMessage(GetMessageRequest) returns (Message) {
232
+ * option (google.api.http) = {
233
+ * get: "/v1/messages/{message_id}"
234
+ * additional_bindings {
235
+ * get: "/v1/users/{user_id}/messages/{message_id}"
236
+ * }
237
+ * };
238
+ * }
239
+ * }
240
+ * message GetMessageRequest {
241
+ * string message_id = 1;
242
+ * string user_id = 2;
243
+ * }
244
+ *
245
+ * This enables the following two alternative HTTP JSON to RPC mappings:
246
+ *
247
+ * - HTTP: `GET /v1/messages/123456`
248
+ * - gRPC: `GetMessage(message_id: "123456")`
249
+ *
250
+ * - HTTP: `GET /v1/users/me/messages/123456`
251
+ * - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
252
+ *
253
+ * Rules for HTTP mapping
254
+ *
255
+ * 1. Leaf request fields (recursive expansion nested messages in the request
256
+ * message) are classified into three categories:
257
+ * - Fields referred by the path template. They are passed via the URL path.
258
+ * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
259
+ * are passed via the HTTP
260
+ * request body.
261
+ * - All other fields are passed via the URL query parameters, and the
262
+ * parameter name is the field path in the request message. A repeated
263
+ * field can be represented as multiple query parameters under the same
264
+ * name.
265
+ * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
266
+ * query parameter, all fields
267
+ * are passed via URL path and HTTP request body.
268
+ * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
269
+ * request body, all
270
+ * fields are passed via URL path and URL query parameters.
271
+ *
272
+ * Path template syntax
273
+ *
274
+ * Template = "/" Segments [ Verb ] ;
275
+ * Segments = Segment { "/" Segment } ;
276
+ * Segment = "*" | "**" | LITERAL | Variable ;
277
+ * Variable = "{" FieldPath [ "=" Segments ] "}" ;
278
+ * FieldPath = IDENT { "." IDENT } ;
279
+ * Verb = ":" LITERAL ;
280
+ *
281
+ * The syntax `*` matches a single URL path segment. The syntax `**` matches
282
+ * zero or more URL path segments, which must be the last part of the URL path
283
+ * except the `Verb`.
284
+ *
285
+ * The syntax `Variable` matches part of the URL path as specified by its
286
+ * template. A variable template must not contain other variables. If a variable
287
+ * matches a single path segment, its template may be omitted, e.g. `{var}`
288
+ * is equivalent to `{var=*}`.
289
+ *
290
+ * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
291
+ * contains any reserved character, such characters should be percent-encoded
292
+ * before the matching.
293
+ *
294
+ * If a variable contains exactly one path segment, such as `"{var}"` or
295
+ * `"{var=*}"`, when such a variable is expanded into a URL path on the client
296
+ * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
297
+ * server side does the reverse decoding. Such variables show up in the
298
+ * [Discovery
299
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
300
+ * `{var}`.
301
+ *
302
+ * If a variable contains multiple path segments, such as `"{var=foo/*}"`
303
+ * or `"{var=**}"`, when such a variable is expanded into a URL path on the
304
+ * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
305
+ * The server side does the reverse decoding, except "%2F" and "%2f" are left
306
+ * unchanged. Such variables show up in the
307
+ * [Discovery
308
+ * Document](https://developers.google.com/discovery/v1/reference/apis) as
309
+ * `{+var}`.
310
+ *
311
+ * Using gRPC API Service Configuration
312
+ *
313
+ * gRPC API Service Configuration (service config) is a configuration language
314
+ * for configuring a gRPC service to become a user-facing product. The
315
+ * service config is simply the YAML representation of the `google.api.Service`
316
+ * proto message.
317
+ *
318
+ * As an alternative to annotating your proto file, you can configure gRPC
319
+ * transcoding in your service config YAML files. You do this by specifying a
320
+ * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
321
+ * effect as the proto annotation. This can be particularly useful if you
322
+ * have a proto that is reused in multiple services. Note that any transcoding
323
+ * specified in the service config will override any matching transcoding
324
+ * configuration in the proto.
325
+ *
326
+ * The following example selects a gRPC method and applies an `HttpRule` to it:
327
+ *
328
+ * http:
329
+ * rules:
330
+ * - selector: example.v1.Messaging.GetMessage
331
+ * get: /v1/messages/{message_id}/{sub.subfield}
332
+ *
333
+ * Special notes
334
+ *
335
+ * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
336
+ * proto to JSON conversion must follow the [proto3
337
+ * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
338
+ *
339
+ * While the single segment variable follows the semantics of
340
+ * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
341
+ * Expansion, the multi segment variable **does not** follow RFC 6570 Section
342
+ * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
343
+ * does not expand special characters like `?` and `#`, which would lead
344
+ * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
345
+ * for multi segment variables.
346
+ *
347
+ * The path variables **must not** refer to any repeated or mapped field,
348
+ * because client libraries are not capable of handling such variable expansion.
349
+ *
350
+ * The path variables **must not** capture the leading "/" character. The reason
351
+ * is that the most common use case "{var}" does not capture the leading "/"
352
+ * character. For consistency, all path variables must share the same behavior.
353
+ *
354
+ * Repeated message fields must not be mapped to URL query parameters, because
355
+ * no client library can support such complicated mapping.
356
+ *
357
+ * If an API needs to use a JSON array for request or response body, it can map
358
+ * the request or response body to a repeated field. However, some gRPC
359
+ * Transcoding implementations may not support this feature.
360
+ * @name HttpRule
361
+ * @package google.api
362
+ * @see proto type: google.api.HttpRule
363
+ */
364
+ export const HttpRule = {
365
+ typeUrl: "/google.api.HttpRule",
366
+ is(o) {
367
+ return o && (o.$typeUrl === HttpRule.typeUrl || typeof o.selector === "string" && typeof o.body === "string" && typeof o.responseBody === "string" && Array.isArray(o.additionalBindings) && (!o.additionalBindings.length || HttpRule.is(o.additionalBindings[0])));
368
+ },
369
+ isSDK(o) {
370
+ return o && (o.$typeUrl === HttpRule.typeUrl || typeof o.selector === "string" && typeof o.body === "string" && typeof o.response_body === "string" && Array.isArray(o.additional_bindings) && (!o.additional_bindings.length || HttpRule.isSDK(o.additional_bindings[0])));
371
+ },
372
+ encode(message, writer = _m0.Writer.create()) {
373
+ if (message.selector !== "") {
374
+ writer.uint32(10).string(message.selector);
375
+ }
376
+ if (message.get !== undefined) {
377
+ writer.uint32(18).string(message.get);
378
+ }
379
+ if (message.put !== undefined) {
380
+ writer.uint32(26).string(message.put);
381
+ }
382
+ if (message.post !== undefined) {
383
+ writer.uint32(34).string(message.post);
384
+ }
385
+ if (message.delete !== undefined) {
386
+ writer.uint32(42).string(message.delete);
387
+ }
388
+ if (message.patch !== undefined) {
389
+ writer.uint32(50).string(message.patch);
390
+ }
391
+ if (message.custom !== undefined) {
392
+ CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim();
393
+ }
394
+ if (message.body !== "") {
395
+ writer.uint32(58).string(message.body);
396
+ }
397
+ if (message.responseBody !== "") {
398
+ writer.uint32(98).string(message.responseBody);
399
+ }
400
+ for (const v of message.additionalBindings) {
401
+ HttpRule.encode(v, writer.uint32(90).fork()).ldelim();
402
+ }
403
+ return writer;
404
+ },
405
+ decode(input, length) {
406
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
407
+ let end = length === undefined ? reader.len : reader.pos + length;
408
+ const message = createBaseHttpRule();
409
+ while (reader.pos < end) {
410
+ const tag = reader.uint32();
411
+ switch (tag >>> 3) {
412
+ case 1:
413
+ message.selector = reader.string();
414
+ break;
415
+ case 2:
416
+ message.get = reader.string();
417
+ break;
418
+ case 3:
419
+ message.put = reader.string();
420
+ break;
421
+ case 4:
422
+ message.post = reader.string();
423
+ break;
424
+ case 5:
425
+ message.delete = reader.string();
426
+ break;
427
+ case 6:
428
+ message.patch = reader.string();
429
+ break;
430
+ case 8:
431
+ message.custom = CustomHttpPattern.decode(reader, reader.uint32());
432
+ break;
433
+ case 7:
434
+ message.body = reader.string();
435
+ break;
436
+ case 12:
437
+ message.responseBody = reader.string();
438
+ break;
439
+ case 11:
440
+ message.additionalBindings.push(HttpRule.decode(reader, reader.uint32()));
441
+ break;
442
+ default:
443
+ reader.skipType(tag & 7);
444
+ break;
445
+ }
446
+ }
447
+ return message;
448
+ },
449
+ fromPartial(object) {
450
+ const message = createBaseHttpRule();
451
+ message.selector = object.selector ?? "";
452
+ message.get = object.get ?? undefined;
453
+ message.put = object.put ?? undefined;
454
+ message.post = object.post ?? undefined;
455
+ message.delete = object.delete ?? undefined;
456
+ message.patch = object.patch ?? undefined;
457
+ message.custom = object.custom !== undefined && object.custom !== null ? CustomHttpPattern.fromPartial(object.custom) : undefined;
458
+ message.body = object.body ?? "";
459
+ message.responseBody = object.responseBody ?? "";
460
+ message.additionalBindings = object.additionalBindings?.map(e => HttpRule.fromPartial(e)) || [];
461
+ return message;
462
+ },
463
+ fromProtoMsg(message) {
464
+ return HttpRule.decode(message.value);
465
+ },
466
+ toProto(message) {
467
+ return HttpRule.encode(message).finish();
468
+ },
469
+ toProtoMsg(message) {
470
+ return {
471
+ typeUrl: "/google.api.HttpRule",
472
+ value: HttpRule.encode(message).finish()
473
+ };
474
+ },
475
+ registerTypeUrl() {
476
+ if (!GlobalDecoderRegistry.registerExistingTypeUrl(HttpRule.typeUrl)) {
477
+ return;
478
+ }
479
+ CustomHttpPattern.registerTypeUrl();
480
+ HttpRule.registerTypeUrl();
481
+ }
482
+ };
483
+ GlobalDecoderRegistry.register(HttpRule.typeUrl, HttpRule);
484
+ function createBaseCustomHttpPattern() {
485
+ return {
486
+ kind: "",
487
+ path: ""
488
+ };
489
+ }
490
+ /**
491
+ * A custom pattern is used for defining custom HTTP verb.
492
+ * @name CustomHttpPattern
493
+ * @package google.api
494
+ * @see proto type: google.api.CustomHttpPattern
495
+ */
496
+ export const CustomHttpPattern = {
497
+ typeUrl: "/google.api.CustomHttpPattern",
498
+ is(o) {
499
+ return o && (o.$typeUrl === CustomHttpPattern.typeUrl || typeof o.kind === "string" && typeof o.path === "string");
500
+ },
501
+ isSDK(o) {
502
+ return o && (o.$typeUrl === CustomHttpPattern.typeUrl || typeof o.kind === "string" && typeof o.path === "string");
503
+ },
504
+ encode(message, writer = _m0.Writer.create()) {
505
+ if (message.kind !== "") {
506
+ writer.uint32(10).string(message.kind);
507
+ }
508
+ if (message.path !== "") {
509
+ writer.uint32(18).string(message.path);
510
+ }
511
+ return writer;
512
+ },
513
+ decode(input, length) {
514
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
515
+ let end = length === undefined ? reader.len : reader.pos + length;
516
+ const message = createBaseCustomHttpPattern();
517
+ while (reader.pos < end) {
518
+ const tag = reader.uint32();
519
+ switch (tag >>> 3) {
520
+ case 1:
521
+ message.kind = reader.string();
522
+ break;
523
+ case 2:
524
+ message.path = reader.string();
525
+ break;
526
+ default:
527
+ reader.skipType(tag & 7);
528
+ break;
529
+ }
530
+ }
531
+ return message;
532
+ },
533
+ fromPartial(object) {
534
+ const message = createBaseCustomHttpPattern();
535
+ message.kind = object.kind ?? "";
536
+ message.path = object.path ?? "";
537
+ return message;
538
+ },
539
+ fromProtoMsg(message) {
540
+ return CustomHttpPattern.decode(message.value);
541
+ },
542
+ toProto(message) {
543
+ return CustomHttpPattern.encode(message).finish();
544
+ },
545
+ toProtoMsg(message) {
546
+ return {
547
+ typeUrl: "/google.api.CustomHttpPattern",
548
+ value: CustomHttpPattern.encode(message).finish()
549
+ };
550
+ },
551
+ registerTypeUrl() { }
552
+ };
553
+ GlobalDecoderRegistry.register(CustomHttpPattern.typeUrl, CustomHttpPattern);