@reptilestyle/grpc-js 1.9.14-compression.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 (436) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +79 -0
  3. package/build/src/admin.d.ts +11 -0
  4. package/build/src/admin.js +30 -0
  5. package/build/src/admin.js.map +1 -0
  6. package/build/src/backoff-timeout.d.ts +90 -0
  7. package/build/src/backoff-timeout.js +174 -0
  8. package/build/src/backoff-timeout.js.map +1 -0
  9. package/build/src/call-credentials.d.ts +56 -0
  10. package/build/src/call-credentials.js +153 -0
  11. package/build/src/call-credentials.js.map +1 -0
  12. package/build/src/call-interface.d.ts +85 -0
  13. package/build/src/call-interface.js +84 -0
  14. package/build/src/call-interface.js.map +1 -0
  15. package/build/src/call-number.d.ts +1 -0
  16. package/build/src/call-number.js +24 -0
  17. package/build/src/call-number.js.map +1 -0
  18. package/build/src/call.d.ts +80 -0
  19. package/build/src/call.js +136 -0
  20. package/build/src/call.js.map +1 -0
  21. package/build/src/channel-credentials.d.ts +81 -0
  22. package/build/src/channel-credentials.js +177 -0
  23. package/build/src/channel-credentials.js.map +1 -0
  24. package/build/src/channel-options.d.ts +72 -0
  25. package/build/src/channel-options.js +69 -0
  26. package/build/src/channel-options.js.map +1 -0
  27. package/build/src/channel.d.ts +76 -0
  28. package/build/src/channel.js +68 -0
  29. package/build/src/channel.js.map +1 -0
  30. package/build/src/channelz.d.ts +108 -0
  31. package/build/src/channelz.js +637 -0
  32. package/build/src/channelz.js.map +1 -0
  33. package/build/src/client-interceptors.d.ts +120 -0
  34. package/build/src/client-interceptors.js +428 -0
  35. package/build/src/client-interceptors.js.map +1 -0
  36. package/build/src/client.d.ts +74 -0
  37. package/build/src/client.js +431 -0
  38. package/build/src/client.js.map +1 -0
  39. package/build/src/compression-algorithms.d.ts +5 -0
  40. package/build/src/compression-algorithms.js +26 -0
  41. package/build/src/compression-algorithms.js.map +1 -0
  42. package/build/src/compression-filter.d.ts +26 -0
  43. package/build/src/compression-filter.js +257 -0
  44. package/build/src/compression-filter.js.map +1 -0
  45. package/build/src/connectivity-state.d.ts +7 -0
  46. package/build/src/connectivity-state.js +28 -0
  47. package/build/src/connectivity-state.js.map +1 -0
  48. package/build/src/constants.d.ts +38 -0
  49. package/build/src/constants.js +64 -0
  50. package/build/src/constants.js.map +1 -0
  51. package/build/src/control-plane-status.d.ts +5 -0
  52. package/build/src/control-plane-status.js +42 -0
  53. package/build/src/control-plane-status.js.map +1 -0
  54. package/build/src/deadline.d.ts +14 -0
  55. package/build/src/deadline.js +97 -0
  56. package/build/src/deadline.js.map +1 -0
  57. package/build/src/duration.d.ts +7 -0
  58. package/build/src/duration.js +34 -0
  59. package/build/src/duration.js.map +1 -0
  60. package/build/src/error.d.ts +2 -0
  61. package/build/src/error.js +40 -0
  62. package/build/src/error.js.map +1 -0
  63. package/build/src/events.d.ts +9 -0
  64. package/build/src/events.js +19 -0
  65. package/build/src/events.js.map +1 -0
  66. package/build/src/experimental.d.ts +16 -0
  67. package/build/src/experimental.js +39 -0
  68. package/build/src/experimental.js.map +1 -0
  69. package/build/src/filter-stack.d.ts +21 -0
  70. package/build/src/filter-stack.js +82 -0
  71. package/build/src/filter-stack.js.map +1 -0
  72. package/build/src/filter.d.ts +25 -0
  73. package/build/src/filter.js +38 -0
  74. package/build/src/filter.js.map +1 -0
  75. package/build/src/generated/channelz.d.ts +72 -0
  76. package/build/src/generated/channelz.js +3 -0
  77. package/build/src/generated/channelz.js.map +1 -0
  78. package/build/src/generated/google/protobuf/Any.d.ts +9 -0
  79. package/build/src/generated/google/protobuf/Any.js +4 -0
  80. package/build/src/generated/google/protobuf/Any.js.map +1 -0
  81. package/build/src/generated/google/protobuf/BoolValue.d.ts +6 -0
  82. package/build/src/generated/google/protobuf/BoolValue.js +4 -0
  83. package/build/src/generated/google/protobuf/BoolValue.js.map +1 -0
  84. package/build/src/generated/google/protobuf/BytesValue.d.ts +6 -0
  85. package/build/src/generated/google/protobuf/BytesValue.js +4 -0
  86. package/build/src/generated/google/protobuf/BytesValue.js.map +1 -0
  87. package/build/src/generated/google/protobuf/DoubleValue.d.ts +6 -0
  88. package/build/src/generated/google/protobuf/DoubleValue.js +4 -0
  89. package/build/src/generated/google/protobuf/DoubleValue.js.map +1 -0
  90. package/build/src/generated/google/protobuf/Duration.d.ts +9 -0
  91. package/build/src/generated/google/protobuf/Duration.js +4 -0
  92. package/build/src/generated/google/protobuf/Duration.js.map +1 -0
  93. package/build/src/generated/google/protobuf/FloatValue.d.ts +6 -0
  94. package/build/src/generated/google/protobuf/FloatValue.js +4 -0
  95. package/build/src/generated/google/protobuf/FloatValue.js.map +1 -0
  96. package/build/src/generated/google/protobuf/Int32Value.d.ts +6 -0
  97. package/build/src/generated/google/protobuf/Int32Value.js +4 -0
  98. package/build/src/generated/google/protobuf/Int32Value.js.map +1 -0
  99. package/build/src/generated/google/protobuf/Int64Value.d.ts +7 -0
  100. package/build/src/generated/google/protobuf/Int64Value.js +4 -0
  101. package/build/src/generated/google/protobuf/Int64Value.js.map +1 -0
  102. package/build/src/generated/google/protobuf/StringValue.d.ts +6 -0
  103. package/build/src/generated/google/protobuf/StringValue.js +4 -0
  104. package/build/src/generated/google/protobuf/StringValue.js.map +1 -0
  105. package/build/src/generated/google/protobuf/Timestamp.d.ts +9 -0
  106. package/build/src/generated/google/protobuf/Timestamp.js +4 -0
  107. package/build/src/generated/google/protobuf/Timestamp.js.map +1 -0
  108. package/build/src/generated/google/protobuf/UInt32Value.d.ts +6 -0
  109. package/build/src/generated/google/protobuf/UInt32Value.js +4 -0
  110. package/build/src/generated/google/protobuf/UInt32Value.js.map +1 -0
  111. package/build/src/generated/google/protobuf/UInt64Value.d.ts +7 -0
  112. package/build/src/generated/google/protobuf/UInt64Value.js +4 -0
  113. package/build/src/generated/google/protobuf/UInt64Value.js.map +1 -0
  114. package/build/src/generated/grpc/channelz/v1/Address.d.ts +79 -0
  115. package/build/src/generated/grpc/channelz/v1/Address.js +4 -0
  116. package/build/src/generated/grpc/channelz/v1/Address.js.map +1 -0
  117. package/build/src/generated/grpc/channelz/v1/Channel.d.ts +64 -0
  118. package/build/src/generated/grpc/channelz/v1/Channel.js +4 -0
  119. package/build/src/generated/grpc/channelz/v1/Channel.js.map +1 -0
  120. package/build/src/generated/grpc/channelz/v1/ChannelConnectivityState.d.ts +24 -0
  121. package/build/src/generated/grpc/channelz/v1/ChannelConnectivityState.js +14 -0
  122. package/build/src/generated/grpc/channelz/v1/ChannelConnectivityState.js.map +1 -0
  123. package/build/src/generated/grpc/channelz/v1/ChannelData.d.ts +72 -0
  124. package/build/src/generated/grpc/channelz/v1/ChannelData.js +4 -0
  125. package/build/src/generated/grpc/channelz/v1/ChannelData.js.map +1 -0
  126. package/build/src/generated/grpc/channelz/v1/ChannelRef.d.ts +27 -0
  127. package/build/src/generated/grpc/channelz/v1/ChannelRef.js +4 -0
  128. package/build/src/generated/grpc/channelz/v1/ChannelRef.js.map +1 -0
  129. package/build/src/generated/grpc/channelz/v1/ChannelTrace.d.ts +41 -0
  130. package/build/src/generated/grpc/channelz/v1/ChannelTrace.js +4 -0
  131. package/build/src/generated/grpc/channelz/v1/ChannelTrace.js.map +1 -0
  132. package/build/src/generated/grpc/channelz/v1/ChannelTraceEvent.d.ts +74 -0
  133. package/build/src/generated/grpc/channelz/v1/ChannelTraceEvent.js +15 -0
  134. package/build/src/generated/grpc/channelz/v1/ChannelTraceEvent.js.map +1 -0
  135. package/build/src/generated/grpc/channelz/v1/Channelz.d.ts +159 -0
  136. package/build/src/generated/grpc/channelz/v1/Channelz.js +4 -0
  137. package/build/src/generated/grpc/channelz/v1/Channelz.js.map +1 -0
  138. package/build/src/generated/grpc/channelz/v1/GetChannelRequest.d.ts +13 -0
  139. package/build/src/generated/grpc/channelz/v1/GetChannelRequest.js +4 -0
  140. package/build/src/generated/grpc/channelz/v1/GetChannelRequest.js.map +1 -0
  141. package/build/src/generated/grpc/channelz/v1/GetChannelResponse.d.ts +15 -0
  142. package/build/src/generated/grpc/channelz/v1/GetChannelResponse.js +4 -0
  143. package/build/src/generated/grpc/channelz/v1/GetChannelResponse.js.map +1 -0
  144. package/build/src/generated/grpc/channelz/v1/GetServerRequest.d.ts +13 -0
  145. package/build/src/generated/grpc/channelz/v1/GetServerRequest.js +4 -0
  146. package/build/src/generated/grpc/channelz/v1/GetServerRequest.js.map +1 -0
  147. package/build/src/generated/grpc/channelz/v1/GetServerResponse.d.ts +15 -0
  148. package/build/src/generated/grpc/channelz/v1/GetServerResponse.js +4 -0
  149. package/build/src/generated/grpc/channelz/v1/GetServerResponse.js.map +1 -0
  150. package/build/src/generated/grpc/channelz/v1/GetServerSocketsRequest.d.ts +35 -0
  151. package/build/src/generated/grpc/channelz/v1/GetServerSocketsRequest.js +4 -0
  152. package/build/src/generated/grpc/channelz/v1/GetServerSocketsRequest.js.map +1 -0
  153. package/build/src/generated/grpc/channelz/v1/GetServerSocketsResponse.d.ts +29 -0
  154. package/build/src/generated/grpc/channelz/v1/GetServerSocketsResponse.js +4 -0
  155. package/build/src/generated/grpc/channelz/v1/GetServerSocketsResponse.js.map +1 -0
  156. package/build/src/generated/grpc/channelz/v1/GetServersRequest.d.ts +33 -0
  157. package/build/src/generated/grpc/channelz/v1/GetServersRequest.js +4 -0
  158. package/build/src/generated/grpc/channelz/v1/GetServersRequest.js.map +1 -0
  159. package/build/src/generated/grpc/channelz/v1/GetServersResponse.d.ts +29 -0
  160. package/build/src/generated/grpc/channelz/v1/GetServersResponse.js +4 -0
  161. package/build/src/generated/grpc/channelz/v1/GetServersResponse.js.map +1 -0
  162. package/build/src/generated/grpc/channelz/v1/GetSocketRequest.d.ts +25 -0
  163. package/build/src/generated/grpc/channelz/v1/GetSocketRequest.js +4 -0
  164. package/build/src/generated/grpc/channelz/v1/GetSocketRequest.js.map +1 -0
  165. package/build/src/generated/grpc/channelz/v1/GetSocketResponse.d.ts +15 -0
  166. package/build/src/generated/grpc/channelz/v1/GetSocketResponse.js +4 -0
  167. package/build/src/generated/grpc/channelz/v1/GetSocketResponse.js.map +1 -0
  168. package/build/src/generated/grpc/channelz/v1/GetSubchannelRequest.d.ts +13 -0
  169. package/build/src/generated/grpc/channelz/v1/GetSubchannelRequest.js +4 -0
  170. package/build/src/generated/grpc/channelz/v1/GetSubchannelRequest.js.map +1 -0
  171. package/build/src/generated/grpc/channelz/v1/GetSubchannelResponse.d.ts +15 -0
  172. package/build/src/generated/grpc/channelz/v1/GetSubchannelResponse.js +4 -0
  173. package/build/src/generated/grpc/channelz/v1/GetSubchannelResponse.js.map +1 -0
  174. package/build/src/generated/grpc/channelz/v1/GetTopChannelsRequest.d.ts +33 -0
  175. package/build/src/generated/grpc/channelz/v1/GetTopChannelsRequest.js +4 -0
  176. package/build/src/generated/grpc/channelz/v1/GetTopChannelsRequest.js.map +1 -0
  177. package/build/src/generated/grpc/channelz/v1/GetTopChannelsResponse.d.ts +29 -0
  178. package/build/src/generated/grpc/channelz/v1/GetTopChannelsResponse.js +4 -0
  179. package/build/src/generated/grpc/channelz/v1/GetTopChannelsResponse.js.map +1 -0
  180. package/build/src/generated/grpc/channelz/v1/Security.d.ts +79 -0
  181. package/build/src/generated/grpc/channelz/v1/Security.js +4 -0
  182. package/build/src/generated/grpc/channelz/v1/Security.js.map +1 -0
  183. package/build/src/generated/grpc/channelz/v1/Server.d.ts +41 -0
  184. package/build/src/generated/grpc/channelz/v1/Server.js +4 -0
  185. package/build/src/generated/grpc/channelz/v1/Server.js.map +1 -0
  186. package/build/src/generated/grpc/channelz/v1/ServerData.d.ts +53 -0
  187. package/build/src/generated/grpc/channelz/v1/ServerData.js +4 -0
  188. package/build/src/generated/grpc/channelz/v1/ServerData.js.map +1 -0
  189. package/build/src/generated/grpc/channelz/v1/ServerRef.d.ts +27 -0
  190. package/build/src/generated/grpc/channelz/v1/ServerRef.js +4 -0
  191. package/build/src/generated/grpc/channelz/v1/ServerRef.js.map +1 -0
  192. package/build/src/generated/grpc/channelz/v1/Socket.d.ts +66 -0
  193. package/build/src/generated/grpc/channelz/v1/Socket.js +4 -0
  194. package/build/src/generated/grpc/channelz/v1/Socket.js.map +1 -0
  195. package/build/src/generated/grpc/channelz/v1/SocketData.d.ts +146 -0
  196. package/build/src/generated/grpc/channelz/v1/SocketData.js +4 -0
  197. package/build/src/generated/grpc/channelz/v1/SocketData.js.map +1 -0
  198. package/build/src/generated/grpc/channelz/v1/SocketOption.d.ts +43 -0
  199. package/build/src/generated/grpc/channelz/v1/SocketOption.js +4 -0
  200. package/build/src/generated/grpc/channelz/v1/SocketOption.js.map +1 -0
  201. package/build/src/generated/grpc/channelz/v1/SocketOptionLinger.d.ts +29 -0
  202. package/build/src/generated/grpc/channelz/v1/SocketOptionLinger.js +4 -0
  203. package/build/src/generated/grpc/channelz/v1/SocketOptionLinger.js.map +1 -0
  204. package/build/src/generated/grpc/channelz/v1/SocketOptionTcpInfo.d.ts +70 -0
  205. package/build/src/generated/grpc/channelz/v1/SocketOptionTcpInfo.js +4 -0
  206. package/build/src/generated/grpc/channelz/v1/SocketOptionTcpInfo.js.map +1 -0
  207. package/build/src/generated/grpc/channelz/v1/SocketOptionTimeout.d.ts +15 -0
  208. package/build/src/generated/grpc/channelz/v1/SocketOptionTimeout.js +4 -0
  209. package/build/src/generated/grpc/channelz/v1/SocketOptionTimeout.js.map +1 -0
  210. package/build/src/generated/grpc/channelz/v1/SocketRef.d.ts +27 -0
  211. package/build/src/generated/grpc/channelz/v1/SocketRef.js +4 -0
  212. package/build/src/generated/grpc/channelz/v1/SocketRef.js.map +1 -0
  213. package/build/src/generated/grpc/channelz/v1/Subchannel.d.ts +66 -0
  214. package/build/src/generated/grpc/channelz/v1/Subchannel.js +4 -0
  215. package/build/src/generated/grpc/channelz/v1/Subchannel.js.map +1 -0
  216. package/build/src/generated/grpc/channelz/v1/SubchannelRef.d.ts +27 -0
  217. package/build/src/generated/grpc/channelz/v1/SubchannelRef.js +4 -0
  218. package/build/src/generated/grpc/channelz/v1/SubchannelRef.js.map +1 -0
  219. package/build/src/http_proxy.d.ts +15 -0
  220. package/build/src/http_proxy.js +259 -0
  221. package/build/src/http_proxy.js.map +1 -0
  222. package/build/src/index.d.ts +76 -0
  223. package/build/src/index.js +140 -0
  224. package/build/src/index.js.map +1 -0
  225. package/build/src/internal-channel.d.ts +118 -0
  226. package/build/src/internal-channel.js +535 -0
  227. package/build/src/internal-channel.js.map +1 -0
  228. package/build/src/load-balancer-child-handler.d.ts +24 -0
  229. package/build/src/load-balancer-child-handler.js +151 -0
  230. package/build/src/load-balancer-child-handler.js.map +1 -0
  231. package/build/src/load-balancer-outlier-detection.d.ts +61 -0
  232. package/build/src/load-balancer-outlier-detection.js +608 -0
  233. package/build/src/load-balancer-outlier-detection.js.map +1 -0
  234. package/build/src/load-balancer-pick-first.d.ts +97 -0
  235. package/build/src/load-balancer-pick-first.js +393 -0
  236. package/build/src/load-balancer-pick-first.js.map +1 -0
  237. package/build/src/load-balancer-round-robin.d.ts +21 -0
  238. package/build/src/load-balancer-round-robin.js +174 -0
  239. package/build/src/load-balancer-round-robin.js.map +1 -0
  240. package/build/src/load-balancer.d.ts +97 -0
  241. package/build/src/load-balancer.js +102 -0
  242. package/build/src/load-balancer.js.map +1 -0
  243. package/build/src/load-balancing-call.d.ts +44 -0
  244. package/build/src/load-balancing-call.js +269 -0
  245. package/build/src/load-balancing-call.js.map +1 -0
  246. package/build/src/logging.d.ts +7 -0
  247. package/build/src/logging.js +114 -0
  248. package/build/src/logging.js.map +1 -0
  249. package/build/src/make-client.d.ts +71 -0
  250. package/build/src/make-client.js +143 -0
  251. package/build/src/make-client.js.map +1 -0
  252. package/build/src/max-message-size-filter.d.ts +15 -0
  253. package/build/src/max-message-size-filter.js +86 -0
  254. package/build/src/max-message-size-filter.js.map +1 -0
  255. package/build/src/metadata.d.ts +84 -0
  256. package/build/src/metadata.js +249 -0
  257. package/build/src/metadata.js.map +1 -0
  258. package/build/src/object-stream.d.ts +27 -0
  259. package/build/src/object-stream.js +19 -0
  260. package/build/src/object-stream.js.map +1 -0
  261. package/build/src/picker.d.ts +91 -0
  262. package/build/src/picker.js +78 -0
  263. package/build/src/picker.js.map +1 -0
  264. package/build/src/resolver-dns.d.ts +13 -0
  265. package/build/src/resolver-dns.js +328 -0
  266. package/build/src/resolver-dns.js.map +1 -0
  267. package/build/src/resolver-ip.d.ts +1 -0
  268. package/build/src/resolver-ip.js +104 -0
  269. package/build/src/resolver-ip.js.map +1 -0
  270. package/build/src/resolver-uds.d.ts +1 -0
  271. package/build/src/resolver-uds.js +50 -0
  272. package/build/src/resolver-uds.js.map +1 -0
  273. package/build/src/resolver.d.ts +105 -0
  274. package/build/src/resolver.js +87 -0
  275. package/build/src/resolver.js.map +1 -0
  276. package/build/src/resolving-call.d.ts +44 -0
  277. package/build/src/resolving-call.js +273 -0
  278. package/build/src/resolving-call.js.map +1 -0
  279. package/build/src/resolving-load-balancer.d.ts +67 -0
  280. package/build/src/resolving-load-balancer.js +304 -0
  281. package/build/src/resolving-load-balancer.js.map +1 -0
  282. package/build/src/retrying-call.d.ts +94 -0
  283. package/build/src/retrying-call.js +639 -0
  284. package/build/src/retrying-call.js.map +1 -0
  285. package/build/src/server-call.d.ts +159 -0
  286. package/build/src/server-call.js +700 -0
  287. package/build/src/server-call.js.map +1 -0
  288. package/build/src/server-credentials.d.ts +11 -0
  289. package/build/src/server-credentials.js +81 -0
  290. package/build/src/server-credentials.js.map +1 -0
  291. package/build/src/server.d.ts +56 -0
  292. package/build/src/server.js +892 -0
  293. package/build/src/server.js.map +1 -0
  294. package/build/src/service-config.d.ts +56 -0
  295. package/build/src/service-config.js +416 -0
  296. package/build/src/service-config.js.map +1 -0
  297. package/build/src/status-builder.d.ts +28 -0
  298. package/build/src/status-builder.js +68 -0
  299. package/build/src/status-builder.js.map +1 -0
  300. package/build/src/stream-decoder.d.ts +10 -0
  301. package/build/src/stream-decoder.js +96 -0
  302. package/build/src/stream-decoder.js.map +1 -0
  303. package/build/src/subchannel-address.d.ts +18 -0
  304. package/build/src/subchannel-address.js +65 -0
  305. package/build/src/subchannel-address.js.map +1 -0
  306. package/build/src/subchannel-call.d.ts +61 -0
  307. package/build/src/subchannel-call.js +461 -0
  308. package/build/src/subchannel-call.js.map +1 -0
  309. package/build/src/subchannel-interface.d.ts +49 -0
  310. package/build/src/subchannel-interface.js +59 -0
  311. package/build/src/subchannel-interface.js.map +1 -0
  312. package/build/src/subchannel-pool.d.ts +40 -0
  313. package/build/src/subchannel-pool.js +137 -0
  314. package/build/src/subchannel-pool.js.map +1 -0
  315. package/build/src/subchannel.d.ts +119 -0
  316. package/build/src/subchannel.js +353 -0
  317. package/build/src/subchannel.js.map +1 -0
  318. package/build/src/tls-helpers.d.ts +2 -0
  319. package/build/src/tls-helpers.js +34 -0
  320. package/build/src/tls-helpers.js.map +1 -0
  321. package/build/src/transport.d.ts +130 -0
  322. package/build/src/transport.js +640 -0
  323. package/build/src/transport.js.map +1 -0
  324. package/build/src/uri-parser.d.ts +12 -0
  325. package/build/src/uri-parser.js +110 -0
  326. package/build/src/uri-parser.js.map +1 -0
  327. package/package.json +85 -0
  328. package/proto/channelz.proto +564 -0
  329. package/src/admin.ts +45 -0
  330. package/src/backoff-timeout.ts +196 -0
  331. package/src/call-credentials.ts +226 -0
  332. package/src/call-interface.ts +173 -0
  333. package/src/call-number.ts +22 -0
  334. package/src/call.ts +200 -0
  335. package/src/channel-credentials.ts +267 -0
  336. package/src/channel-options.ts +119 -0
  337. package/src/channel.ts +174 -0
  338. package/src/channelz.ts +886 -0
  339. package/src/client-interceptors.ts +577 -0
  340. package/src/client.ts +715 -0
  341. package/src/compression-algorithms.ts +22 -0
  342. package/src/compression-filter.ts +315 -0
  343. package/src/connectivity-state.ts +24 -0
  344. package/src/constants.ts +66 -0
  345. package/src/control-plane-status.ts +43 -0
  346. package/src/deadline.ts +95 -0
  347. package/src/duration.ts +36 -0
  348. package/src/error.ts +37 -0
  349. package/src/events.ts +26 -0
  350. package/src/experimental.ts +48 -0
  351. package/src/filter-stack.ts +100 -0
  352. package/src/filter.ts +63 -0
  353. package/src/generated/channelz.ts +73 -0
  354. package/src/generated/google/protobuf/Any.ts +13 -0
  355. package/src/generated/google/protobuf/BoolValue.ts +10 -0
  356. package/src/generated/google/protobuf/BytesValue.ts +10 -0
  357. package/src/generated/google/protobuf/DoubleValue.ts +10 -0
  358. package/src/generated/google/protobuf/Duration.ts +13 -0
  359. package/src/generated/google/protobuf/FloatValue.ts +10 -0
  360. package/src/generated/google/protobuf/Int32Value.ts +10 -0
  361. package/src/generated/google/protobuf/Int64Value.ts +11 -0
  362. package/src/generated/google/protobuf/StringValue.ts +10 -0
  363. package/src/generated/google/protobuf/Timestamp.ts +13 -0
  364. package/src/generated/google/protobuf/UInt32Value.ts +10 -0
  365. package/src/generated/google/protobuf/UInt64Value.ts +11 -0
  366. package/src/generated/grpc/channelz/v1/Address.ts +89 -0
  367. package/src/generated/grpc/channelz/v1/Channel.ts +68 -0
  368. package/src/generated/grpc/channelz/v1/ChannelConnectivityState.ts +45 -0
  369. package/src/generated/grpc/channelz/v1/ChannelData.ts +76 -0
  370. package/src/generated/grpc/channelz/v1/ChannelRef.ts +31 -0
  371. package/src/generated/grpc/channelz/v1/ChannelTrace.ts +45 -0
  372. package/src/generated/grpc/channelz/v1/ChannelTraceEvent.ts +91 -0
  373. package/src/generated/grpc/channelz/v1/Channelz.ts +178 -0
  374. package/src/generated/grpc/channelz/v1/GetChannelRequest.ts +17 -0
  375. package/src/generated/grpc/channelz/v1/GetChannelResponse.ts +19 -0
  376. package/src/generated/grpc/channelz/v1/GetServerRequest.ts +17 -0
  377. package/src/generated/grpc/channelz/v1/GetServerResponse.ts +19 -0
  378. package/src/generated/grpc/channelz/v1/GetServerSocketsRequest.ts +39 -0
  379. package/src/generated/grpc/channelz/v1/GetServerSocketsResponse.ts +33 -0
  380. package/src/generated/grpc/channelz/v1/GetServersRequest.ts +37 -0
  381. package/src/generated/grpc/channelz/v1/GetServersResponse.ts +33 -0
  382. package/src/generated/grpc/channelz/v1/GetSocketRequest.ts +29 -0
  383. package/src/generated/grpc/channelz/v1/GetSocketResponse.ts +19 -0
  384. package/src/generated/grpc/channelz/v1/GetSubchannelRequest.ts +17 -0
  385. package/src/generated/grpc/channelz/v1/GetSubchannelResponse.ts +19 -0
  386. package/src/generated/grpc/channelz/v1/GetTopChannelsRequest.ts +37 -0
  387. package/src/generated/grpc/channelz/v1/GetTopChannelsResponse.ts +33 -0
  388. package/src/generated/grpc/channelz/v1/Security.ts +87 -0
  389. package/src/generated/grpc/channelz/v1/Server.ts +45 -0
  390. package/src/generated/grpc/channelz/v1/ServerData.ts +57 -0
  391. package/src/generated/grpc/channelz/v1/ServerRef.ts +31 -0
  392. package/src/generated/grpc/channelz/v1/Socket.ts +70 -0
  393. package/src/generated/grpc/channelz/v1/SocketData.ts +150 -0
  394. package/src/generated/grpc/channelz/v1/SocketOption.ts +47 -0
  395. package/src/generated/grpc/channelz/v1/SocketOptionLinger.ts +33 -0
  396. package/src/generated/grpc/channelz/v1/SocketOptionTcpInfo.ts +74 -0
  397. package/src/generated/grpc/channelz/v1/SocketOptionTimeout.ts +19 -0
  398. package/src/generated/grpc/channelz/v1/SocketRef.ts +31 -0
  399. package/src/generated/grpc/channelz/v1/Subchannel.ts +70 -0
  400. package/src/generated/grpc/channelz/v1/SubchannelRef.ts +31 -0
  401. package/src/http_proxy.ts +311 -0
  402. package/src/index.ts +284 -0
  403. package/src/internal-channel.ts +832 -0
  404. package/src/load-balancer-child-handler.ts +169 -0
  405. package/src/load-balancer-outlier-detection.ts +882 -0
  406. package/src/load-balancer-pick-first.ts +487 -0
  407. package/src/load-balancer-round-robin.ts +249 -0
  408. package/src/load-balancer.ts +230 -0
  409. package/src/load-balancing-call.ts +351 -0
  410. package/src/logging.ts +123 -0
  411. package/src/make-client.ts +238 -0
  412. package/src/max-message-size-filter.ts +88 -0
  413. package/src/metadata.ts +298 -0
  414. package/src/object-stream.ts +66 -0
  415. package/src/picker.ts +146 -0
  416. package/src/resolver-dns.ts +412 -0
  417. package/src/resolver-ip.ts +120 -0
  418. package/src/resolver-uds.ts +63 -0
  419. package/src/resolver.ts +180 -0
  420. package/src/resolving-call.ts +331 -0
  421. package/src/resolving-load-balancer.ts +403 -0
  422. package/src/retrying-call.ts +821 -0
  423. package/src/server-call.ts +1033 -0
  424. package/src/server-credentials.ts +108 -0
  425. package/src/server.ts +1300 -0
  426. package/src/service-config.ts +542 -0
  427. package/src/status-builder.ts +80 -0
  428. package/src/stream-decoder.ts +105 -0
  429. package/src/subchannel-address.ts +88 -0
  430. package/src/subchannel-call.ts +539 -0
  431. package/src/subchannel-interface.ts +97 -0
  432. package/src/subchannel-pool.ts +176 -0
  433. package/src/subchannel.ts +482 -0
  434. package/src/tls-helpers.ts +35 -0
  435. package/src/transport.ts +824 -0
  436. package/src/uri-parser.ts +114 -0
package/src/call.ts ADDED
@@ -0,0 +1,200 @@
1
+ /*
2
+ * Copyright 2019 gRPC authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ import { EventEmitter } from 'events';
19
+ import { Duplex, Readable, Writable } from 'stream';
20
+
21
+ import { StatusObject, MessageContext } from './call-interface';
22
+ import { Status } from './constants';
23
+ import { EmitterAugmentation1 } from './events';
24
+ import { Metadata } from './metadata';
25
+ import { ObjectReadable, ObjectWritable, WriteCallback } from './object-stream';
26
+ import { InterceptingCallInterface } from './client-interceptors';
27
+
28
+ /**
29
+ * A type extending the built-in Error object with additional fields.
30
+ */
31
+ export type ServiceError = StatusObject & Error;
32
+
33
+ /**
34
+ * A base type for all user-facing values returned by client-side method calls.
35
+ */
36
+ export type SurfaceCall = {
37
+ call?: InterceptingCallInterface;
38
+ cancel(): void;
39
+ getPeer(): string;
40
+ } & EmitterAugmentation1<'metadata', Metadata> &
41
+ EmitterAugmentation1<'status', StatusObject> &
42
+ EventEmitter;
43
+
44
+ /**
45
+ * A type representing the return value of a unary method call.
46
+ */
47
+ export type ClientUnaryCall = SurfaceCall;
48
+
49
+ /**
50
+ * A type representing the return value of a server stream method call.
51
+ */
52
+ export type ClientReadableStream<ResponseType> = {
53
+ deserialize: (chunk: Buffer) => ResponseType;
54
+ } & SurfaceCall &
55
+ ObjectReadable<ResponseType>;
56
+
57
+ /**
58
+ * A type representing the return value of a client stream method call.
59
+ */
60
+ export type ClientWritableStream<RequestType> = {
61
+ serialize: (value: RequestType) => Buffer;
62
+ } & SurfaceCall &
63
+ ObjectWritable<RequestType>;
64
+
65
+ /**
66
+ * A type representing the return value of a bidirectional stream method call.
67
+ */
68
+ export type ClientDuplexStream<RequestType, ResponseType> =
69
+ ClientWritableStream<RequestType> & ClientReadableStream<ResponseType>;
70
+
71
+ /**
72
+ * Construct a ServiceError from a StatusObject. This function exists primarily
73
+ * as an attempt to make the error stack trace clearly communicate that the
74
+ * error is not necessarily a problem in gRPC itself.
75
+ * @param status
76
+ */
77
+ export function callErrorFromStatus(
78
+ status: StatusObject,
79
+ callerStack: string
80
+ ): ServiceError {
81
+ const message = `${status.code} ${Status[status.code]}: ${status.details}`;
82
+ const error = new Error(message);
83
+ const stack = `${error.stack}\nfor call at\n${callerStack}`;
84
+ return Object.assign(new Error(message), status, { stack });
85
+ }
86
+
87
+ export class ClientUnaryCallImpl
88
+ extends EventEmitter
89
+ implements ClientUnaryCall
90
+ {
91
+ public call?: InterceptingCallInterface;
92
+ constructor() {
93
+ super();
94
+ }
95
+
96
+ cancel(): void {
97
+ this.call?.cancelWithStatus(Status.CANCELLED, 'Cancelled on client');
98
+ }
99
+
100
+ getPeer(): string {
101
+ return this.call?.getPeer() ?? 'unknown';
102
+ }
103
+ }
104
+
105
+ export class ClientReadableStreamImpl<ResponseType>
106
+ extends Readable
107
+ implements ClientReadableStream<ResponseType>
108
+ {
109
+ public call?: InterceptingCallInterface;
110
+ constructor(readonly deserialize: (chunk: Buffer) => ResponseType) {
111
+ super({ objectMode: true });
112
+ }
113
+
114
+ cancel(): void {
115
+ this.call?.cancelWithStatus(Status.CANCELLED, 'Cancelled on client');
116
+ }
117
+
118
+ getPeer(): string {
119
+ return this.call?.getPeer() ?? 'unknown';
120
+ }
121
+
122
+ _read(_size: number): void {
123
+ this.call?.startRead();
124
+ }
125
+ }
126
+
127
+ export class ClientWritableStreamImpl<RequestType>
128
+ extends Writable
129
+ implements ClientWritableStream<RequestType>
130
+ {
131
+ public call?: InterceptingCallInterface;
132
+ constructor(readonly serialize: (value: RequestType) => Buffer) {
133
+ super({ objectMode: true });
134
+ }
135
+
136
+ cancel(): void {
137
+ this.call?.cancelWithStatus(Status.CANCELLED, 'Cancelled on client');
138
+ }
139
+
140
+ getPeer(): string {
141
+ return this.call?.getPeer() ?? 'unknown';
142
+ }
143
+
144
+ _write(chunk: RequestType, encoding: string, cb: WriteCallback) {
145
+ const context: MessageContext = {
146
+ callback: cb,
147
+ };
148
+ const flags = Number(encoding);
149
+ if (!Number.isNaN(flags)) {
150
+ context.flags = flags;
151
+ }
152
+ this.call?.sendMessageWithContext(context, chunk);
153
+ }
154
+
155
+ _final(cb: Function) {
156
+ this.call?.halfClose();
157
+ cb();
158
+ }
159
+ }
160
+
161
+ export class ClientDuplexStreamImpl<RequestType, ResponseType>
162
+ extends Duplex
163
+ implements ClientDuplexStream<RequestType, ResponseType>
164
+ {
165
+ public call?: InterceptingCallInterface;
166
+ constructor(
167
+ readonly serialize: (value: RequestType) => Buffer,
168
+ readonly deserialize: (chunk: Buffer) => ResponseType
169
+ ) {
170
+ super({ objectMode: true });
171
+ }
172
+
173
+ cancel(): void {
174
+ this.call?.cancelWithStatus(Status.CANCELLED, 'Cancelled on client');
175
+ }
176
+
177
+ getPeer(): string {
178
+ return this.call?.getPeer() ?? 'unknown';
179
+ }
180
+
181
+ _read(_size: number): void {
182
+ this.call?.startRead();
183
+ }
184
+
185
+ _write(chunk: RequestType, encoding: string, cb: WriteCallback) {
186
+ const context: MessageContext = {
187
+ callback: cb,
188
+ };
189
+ const flags = Number(encoding);
190
+ if (!Number.isNaN(flags)) {
191
+ context.flags = flags;
192
+ }
193
+ this.call?.sendMessageWithContext(context, chunk);
194
+ }
195
+
196
+ _final(cb: Function) {
197
+ this.call?.halfClose();
198
+ cb();
199
+ }
200
+ }
@@ -0,0 +1,267 @@
1
+ /*
2
+ * Copyright 2019 gRPC authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ import {
19
+ ConnectionOptions,
20
+ createSecureContext,
21
+ PeerCertificate,
22
+ SecureContext,
23
+ } from 'tls';
24
+
25
+ import { CallCredentials } from './call-credentials';
26
+ import { CIPHER_SUITES, getDefaultRootsData } from './tls-helpers';
27
+
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ function verifyIsBufferOrNull(obj: any, friendlyName: string): void {
30
+ if (obj && !(obj instanceof Buffer)) {
31
+ throw new TypeError(`${friendlyName}, if provided, must be a Buffer.`);
32
+ }
33
+ }
34
+
35
+ /**
36
+ * A callback that will receive the expected hostname and presented peer
37
+ * certificate as parameters. The callback should return an error to
38
+ * indicate that the presented certificate is considered invalid and
39
+ * otherwise returned undefined.
40
+ */
41
+ export type CheckServerIdentityCallback = (
42
+ hostname: string,
43
+ cert: PeerCertificate
44
+ ) => Error | undefined;
45
+
46
+ /**
47
+ * Additional peer verification options that can be set when creating
48
+ * SSL credentials.
49
+ */
50
+ export interface VerifyOptions {
51
+ /**
52
+ * If set, this callback will be invoked after the usual hostname verification
53
+ * has been performed on the peer certificate.
54
+ */
55
+ checkServerIdentity?: CheckServerIdentityCallback;
56
+ }
57
+
58
+ /**
59
+ * A class that contains credentials for communicating over a channel, as well
60
+ * as a set of per-call credentials, which are applied to every method call made
61
+ * over a channel initialized with an instance of this class.
62
+ */
63
+ export abstract class ChannelCredentials {
64
+ protected callCredentials: CallCredentials;
65
+
66
+ protected constructor(callCredentials?: CallCredentials) {
67
+ this.callCredentials = callCredentials || CallCredentials.createEmpty();
68
+ }
69
+ /**
70
+ * Returns a copy of this object with the included set of per-call credentials
71
+ * expanded to include callCredentials.
72
+ * @param callCredentials A CallCredentials object to associate with this
73
+ * instance.
74
+ */
75
+ abstract compose(callCredentials: CallCredentials): ChannelCredentials;
76
+
77
+ /**
78
+ * Gets the set of per-call credentials associated with this instance.
79
+ */
80
+ _getCallCredentials(): CallCredentials {
81
+ return this.callCredentials;
82
+ }
83
+
84
+ /**
85
+ * Gets a SecureContext object generated from input parameters if this
86
+ * instance was created with createSsl, or null if this instance was created
87
+ * with createInsecure.
88
+ */
89
+ abstract _getConnectionOptions(): ConnectionOptions | null;
90
+
91
+ /**
92
+ * Indicates whether this credentials object creates a secure channel.
93
+ */
94
+ abstract _isSecure(): boolean;
95
+
96
+ /**
97
+ * Check whether two channel credentials objects are equal. Two secure
98
+ * credentials are equal if they were constructed with the same parameters.
99
+ * @param other The other ChannelCredentials Object
100
+ */
101
+ abstract _equals(other: ChannelCredentials): boolean;
102
+
103
+ /**
104
+ * Return a new ChannelCredentials instance with a given set of credentials.
105
+ * The resulting instance can be used to construct a Channel that communicates
106
+ * over TLS.
107
+ * @param rootCerts The root certificate data.
108
+ * @param privateKey The client certificate private key, if available.
109
+ * @param certChain The client certificate key chain, if available.
110
+ * @param verifyOptions Additional options to modify certificate verification
111
+ */
112
+ static createSsl(
113
+ rootCerts?: Buffer | null,
114
+ privateKey?: Buffer | null,
115
+ certChain?: Buffer | null,
116
+ verifyOptions?: VerifyOptions
117
+ ): ChannelCredentials {
118
+ verifyIsBufferOrNull(rootCerts, 'Root certificate');
119
+ verifyIsBufferOrNull(privateKey, 'Private key');
120
+ verifyIsBufferOrNull(certChain, 'Certificate chain');
121
+ if (privateKey && !certChain) {
122
+ throw new Error(
123
+ 'Private key must be given with accompanying certificate chain'
124
+ );
125
+ }
126
+ if (!privateKey && certChain) {
127
+ throw new Error(
128
+ 'Certificate chain must be given with accompanying private key'
129
+ );
130
+ }
131
+ const secureContext = createSecureContext({
132
+ ca: rootCerts ?? getDefaultRootsData() ?? undefined,
133
+ key: privateKey ?? undefined,
134
+ cert: certChain ?? undefined,
135
+ ciphers: CIPHER_SUITES,
136
+ });
137
+ return new SecureChannelCredentialsImpl(secureContext, verifyOptions ?? {});
138
+ }
139
+
140
+ /**
141
+ * Return a new ChannelCredentials instance with credentials created using
142
+ * the provided secureContext. The resulting instances can be used to
143
+ * construct a Channel that communicates over TLS. gRPC will not override
144
+ * anything in the provided secureContext, so the environment variables
145
+ * GRPC_SSL_CIPHER_SUITES and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH will
146
+ * not be applied.
147
+ * @param secureContext The return value of tls.createSecureContext()
148
+ * @param verifyOptions Additional options to modify certificate verification
149
+ */
150
+ static createFromSecureContext(
151
+ secureContext: SecureContext,
152
+ verifyOptions?: VerifyOptions
153
+ ): ChannelCredentials {
154
+ return new SecureChannelCredentialsImpl(secureContext, verifyOptions ?? {});
155
+ }
156
+
157
+ /**
158
+ * Return a new ChannelCredentials instance with no credentials.
159
+ */
160
+ static createInsecure(): ChannelCredentials {
161
+ return new InsecureChannelCredentialsImpl();
162
+ }
163
+ }
164
+
165
+ class InsecureChannelCredentialsImpl extends ChannelCredentials {
166
+ constructor(callCredentials?: CallCredentials) {
167
+ super(callCredentials);
168
+ }
169
+
170
+ compose(callCredentials: CallCredentials): never {
171
+ throw new Error('Cannot compose insecure credentials');
172
+ }
173
+
174
+ _getConnectionOptions(): ConnectionOptions | null {
175
+ return null;
176
+ }
177
+ _isSecure(): boolean {
178
+ return false;
179
+ }
180
+ _equals(other: ChannelCredentials): boolean {
181
+ return other instanceof InsecureChannelCredentialsImpl;
182
+ }
183
+ }
184
+
185
+ class SecureChannelCredentialsImpl extends ChannelCredentials {
186
+ connectionOptions: ConnectionOptions;
187
+
188
+ constructor(
189
+ private secureContext: SecureContext,
190
+ private verifyOptions: VerifyOptions
191
+ ) {
192
+ super();
193
+ this.connectionOptions = {
194
+ secureContext,
195
+ };
196
+ // Node asserts that this option is a function, so we cannot pass undefined
197
+ if (verifyOptions?.checkServerIdentity) {
198
+ this.connectionOptions.checkServerIdentity =
199
+ verifyOptions.checkServerIdentity;
200
+ }
201
+ }
202
+
203
+ compose(callCredentials: CallCredentials): ChannelCredentials {
204
+ const combinedCallCredentials =
205
+ this.callCredentials.compose(callCredentials);
206
+ return new ComposedChannelCredentialsImpl(this, combinedCallCredentials);
207
+ }
208
+
209
+ _getConnectionOptions(): ConnectionOptions | null {
210
+ // Copy to prevent callers from mutating this.connectionOptions
211
+ return { ...this.connectionOptions };
212
+ }
213
+ _isSecure(): boolean {
214
+ return true;
215
+ }
216
+ _equals(other: ChannelCredentials): boolean {
217
+ if (this === other) {
218
+ return true;
219
+ }
220
+ if (other instanceof SecureChannelCredentialsImpl) {
221
+ return (
222
+ this.secureContext === other.secureContext &&
223
+ this.verifyOptions.checkServerIdentity ===
224
+ other.verifyOptions.checkServerIdentity
225
+ );
226
+ } else {
227
+ return false;
228
+ }
229
+ }
230
+ }
231
+
232
+ class ComposedChannelCredentialsImpl extends ChannelCredentials {
233
+ constructor(
234
+ private channelCredentials: SecureChannelCredentialsImpl,
235
+ callCreds: CallCredentials
236
+ ) {
237
+ super(callCreds);
238
+ }
239
+ compose(callCredentials: CallCredentials) {
240
+ const combinedCallCredentials =
241
+ this.callCredentials.compose(callCredentials);
242
+ return new ComposedChannelCredentialsImpl(
243
+ this.channelCredentials,
244
+ combinedCallCredentials
245
+ );
246
+ }
247
+
248
+ _getConnectionOptions(): ConnectionOptions | null {
249
+ return this.channelCredentials._getConnectionOptions();
250
+ }
251
+ _isSecure(): boolean {
252
+ return true;
253
+ }
254
+ _equals(other: ChannelCredentials): boolean {
255
+ if (this === other) {
256
+ return true;
257
+ }
258
+ if (other instanceof ComposedChannelCredentialsImpl) {
259
+ return (
260
+ this.channelCredentials._equals(other.channelCredentials) &&
261
+ this.callCredentials._equals(other.callCredentials)
262
+ );
263
+ } else {
264
+ return false;
265
+ }
266
+ }
267
+ }
@@ -0,0 +1,119 @@
1
+ /*
2
+ * Copyright 2019 gRPC authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ import { CompressionAlgorithms } from './compression-algorithms';
19
+
20
+ /**
21
+ * An interface that contains options used when initializing a Channel instance.
22
+ */
23
+ export interface ChannelOptions {
24
+ 'grpc.ssl_target_name_override'?: string;
25
+ 'grpc.primary_user_agent'?: string;
26
+ 'grpc.secondary_user_agent'?: string;
27
+ 'grpc.default_authority'?: string;
28
+ 'grpc.keepalive_time_ms'?: number;
29
+ 'grpc.keepalive_timeout_ms'?: number;
30
+ 'grpc.keepalive_permit_without_calls'?: number;
31
+ 'grpc.service_config'?: string;
32
+ 'grpc.max_concurrent_streams'?: number;
33
+ 'grpc.initial_reconnect_backoff_ms'?: number;
34
+ 'grpc.max_reconnect_backoff_ms'?: number;
35
+ 'grpc.use_local_subchannel_pool'?: number;
36
+ 'grpc.max_send_message_length'?: number;
37
+ 'grpc.max_receive_message_length'?: number;
38
+ 'grpc.enable_http_proxy'?: number;
39
+ /* http_connect_target and http_connect_creds are used for passing data
40
+ * around internally, and should not be documented as public-facing options
41
+ */
42
+ 'grpc.http_connect_target'?: string;
43
+ 'grpc.http_connect_creds'?: string;
44
+ 'grpc.default_compression_algorithm'?: CompressionAlgorithms;
45
+ 'grpc.enable_channelz'?: number;
46
+ 'grpc.dns_min_time_between_resolutions_ms'?: number;
47
+ 'grpc.enable_retries'?: number;
48
+ 'grpc.per_rpc_retry_buffer_size'?: number;
49
+ /* This option is pattered like a core option, but the core does not have
50
+ * this option. It is closely related to the option
51
+ * grpc.per_rpc_retry_buffer_size, which is in the core. The core will likely
52
+ * implement this functionality using the ResourceQuota mechanism, so there
53
+ * will probably not be any collision or other inconsistency. */
54
+ 'grpc.retry_buffer_size'?: number;
55
+ 'grpc.max_connection_age_ms'?: number;
56
+ 'grpc.max_connection_age_grace_ms'?: number;
57
+ 'grpc-node.max_session_memory'?: number;
58
+ 'grpc.service_config_disable_resolution'?: number;
59
+ 'grpc.client_idle_timeout_ms'?: number;
60
+ /**
61
+ * Set the enableTrace option in TLS clients and servers
62
+ */
63
+ 'grpc-node.tls_enable_trace'?: number;
64
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
+ [key: string]: any;
66
+ }
67
+
68
+ /**
69
+ * This is for checking provided options at runtime. This is an object for
70
+ * easier membership checking.
71
+ */
72
+ export const recognizedOptions = {
73
+ 'grpc.ssl_target_name_override': true,
74
+ 'grpc.primary_user_agent': true,
75
+ 'grpc.secondary_user_agent': true,
76
+ 'grpc.default_authority': true,
77
+ 'grpc.keepalive_time_ms': true,
78
+ 'grpc.keepalive_timeout_ms': true,
79
+ 'grpc.keepalive_permit_without_calls': true,
80
+ 'grpc.service_config': true,
81
+ 'grpc.max_concurrent_streams': true,
82
+ 'grpc.initial_reconnect_backoff_ms': true,
83
+ 'grpc.max_reconnect_backoff_ms': true,
84
+ 'grpc.use_local_subchannel_pool': true,
85
+ 'grpc.max_send_message_length': true,
86
+ 'grpc.max_receive_message_length': true,
87
+ 'grpc.enable_http_proxy': true,
88
+ 'grpc.enable_channelz': true,
89
+ 'grpc.dns_min_time_between_resolutions_ms': true,
90
+ 'grpc.enable_retries': true,
91
+ 'grpc.per_rpc_retry_buffer_size': true,
92
+ 'grpc.retry_buffer_size': true,
93
+ 'grpc.max_connection_age_ms': true,
94
+ 'grpc.max_connection_age_grace_ms': true,
95
+ 'grpc-node.max_session_memory': true,
96
+ 'grpc.service_config_disable_resolution': true,
97
+ 'grpc.client_idle_timeout_ms': true,
98
+ 'grpc-node.tls_enable_trace': true,
99
+ };
100
+
101
+ export function channelOptionsEqual(
102
+ options1: ChannelOptions,
103
+ options2: ChannelOptions
104
+ ) {
105
+ const keys1 = Object.keys(options1).sort();
106
+ const keys2 = Object.keys(options2).sort();
107
+ if (keys1.length !== keys2.length) {
108
+ return false;
109
+ }
110
+ for (let i = 0; i < keys1.length; i += 1) {
111
+ if (keys1[i] !== keys2[i]) {
112
+ return false;
113
+ }
114
+ if (options1[keys1[i]] !== options2[keys2[i]]) {
115
+ return false;
116
+ }
117
+ }
118
+ return true;
119
+ }