1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | import {
|
19 | ClientDuplexStream,
|
20 | ClientReadableStream,
|
21 | ClientUnaryCall,
|
22 | ClientWritableStream,
|
23 | ServiceError,
|
24 | } from './call';
|
25 | import { CallCredentials, OAuth2Client } from './call-credentials';
|
26 | import { StatusObject } from './call-interface';
|
27 | import { Channel, ChannelImplementation } from './channel';
|
28 | import { CompressionAlgorithms } from './compression-algorithms';
|
29 | import { ConnectivityState } from './connectivity-state';
|
30 | import { ChannelCredentials, VerifyOptions } from './channel-credentials';
|
31 | import {
|
32 | CallOptions,
|
33 | Client,
|
34 | ClientOptions,
|
35 | CallInvocationTransformer,
|
36 | CallProperties,
|
37 | UnaryCallback,
|
38 | } from './client';
|
39 | import { LogVerbosity, Status, Propagate } from './constants';
|
40 | import * as logging from './logging';
|
41 | import {
|
42 | Deserialize,
|
43 | loadPackageDefinition,
|
44 | makeClientConstructor,
|
45 | MethodDefinition,
|
46 | Serialize,
|
47 | ServiceDefinition,
|
48 | } from './make-client';
|
49 | import { Metadata, MetadataOptions, MetadataValue } from './metadata';
|
50 | import {
|
51 | Server,
|
52 | ServerOptions,
|
53 | UntypedHandleCall,
|
54 | UntypedServiceImplementation,
|
55 | } from './server';
|
56 | import { KeyCertPair, ServerCredentials } from './server-credentials';
|
57 | import { StatusBuilder } from './status-builder';
|
58 | import {
|
59 | handleBidiStreamingCall,
|
60 | handleServerStreamingCall,
|
61 | handleClientStreamingCall,
|
62 | handleUnaryCall,
|
63 | sendUnaryData,
|
64 | ServerUnaryCall,
|
65 | ServerReadableStream,
|
66 | ServerWritableStream,
|
67 | ServerDuplexStream,
|
68 | ServerErrorResponse,
|
69 | } from './server-call';
|
70 |
|
71 | export { OAuth2Client };
|
72 |
|
73 |
|
74 |
|
75 |
|
76 | export const credentials = {
|
77 | |
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | combineChannelCredentials: (
|
85 | channelCredentials: ChannelCredentials,
|
86 | ...callCredentials: CallCredentials[]
|
87 | ): ChannelCredentials => {
|
88 | return callCredentials.reduce(
|
89 | (acc, other) => acc.compose(other),
|
90 | channelCredentials
|
91 | );
|
92 | },
|
93 |
|
94 | |
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | combineCallCredentials: (
|
102 | first: CallCredentials,
|
103 | ...additional: CallCredentials[]
|
104 | ): CallCredentials => {
|
105 | return additional.reduce((acc, other) => acc.compose(other), first);
|
106 | },
|
107 |
|
108 |
|
109 | createInsecure: ChannelCredentials.createInsecure,
|
110 | createSsl: ChannelCredentials.createSsl,
|
111 | createFromSecureContext: ChannelCredentials.createFromSecureContext,
|
112 |
|
113 |
|
114 | createFromMetadataGenerator: CallCredentials.createFromMetadataGenerator,
|
115 | createFromGoogleCredential: CallCredentials.createFromGoogleCredential,
|
116 | createEmpty: CallCredentials.createEmpty,
|
117 | };
|
118 |
|
119 |
|
120 |
|
121 | export { Metadata, MetadataOptions, MetadataValue };
|
122 |
|
123 |
|
124 |
|
125 | export {
|
126 | LogVerbosity as logVerbosity,
|
127 | Status as status,
|
128 | ConnectivityState as connectivityState,
|
129 | Propagate as propagate,
|
130 | CompressionAlgorithms as compressionAlgorithms,
|
131 |
|
132 | };
|
133 |
|
134 |
|
135 |
|
136 | export {
|
137 | Client,
|
138 | ClientOptions,
|
139 | loadPackageDefinition,
|
140 | makeClientConstructor,
|
141 | makeClientConstructor as makeGenericClientConstructor,
|
142 | CallProperties,
|
143 | CallInvocationTransformer,
|
144 | ChannelImplementation as Channel,
|
145 | Channel as ChannelInterface,
|
146 | UnaryCallback as requestCallback,
|
147 | };
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 | export const closeClient = (client: Client) => client.close();
|
154 |
|
155 | export const waitForClientReady = (
|
156 | client: Client,
|
157 | deadline: Date | number,
|
158 | callback: (error?: Error) => void
|
159 | ) => client.waitForReady(deadline, callback);
|
160 |
|
161 |
|
162 |
|
163 | export {
|
164 | sendUnaryData,
|
165 | ChannelCredentials,
|
166 | CallCredentials,
|
167 | Deadline,
|
168 | Serialize as serialize,
|
169 | Deserialize as deserialize,
|
170 | ClientUnaryCall,
|
171 | ClientReadableStream,
|
172 | ClientWritableStream,
|
173 | ClientDuplexStream,
|
174 | CallOptions,
|
175 | MethodDefinition,
|
176 | StatusObject,
|
177 | ServiceError,
|
178 | ServerUnaryCall,
|
179 | ServerReadableStream,
|
180 | ServerWritableStream,
|
181 | ServerDuplexStream,
|
182 | ServerErrorResponse,
|
183 | ServiceDefinition,
|
184 | UntypedHandleCall,
|
185 | UntypedServiceImplementation,
|
186 | VerifyOptions,
|
187 | };
|
188 |
|
189 |
|
190 |
|
191 | export {
|
192 | handleBidiStreamingCall,
|
193 | handleServerStreamingCall,
|
194 | handleUnaryCall,
|
195 | handleClientStreamingCall,
|
196 | };
|
197 |
|
198 |
|
199 | export type Call =
|
200 | | ClientUnaryCall
|
201 | | ClientReadableStream<any>
|
202 | | ClientWritableStream<any>
|
203 | | ClientDuplexStream<any, any>;
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 | export const loadObject = (value: any, options: any): never => {
|
211 | throw new Error(
|
212 | 'Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead'
|
213 | );
|
214 | };
|
215 |
|
216 | export const load = (filename: any, format: any, options: any): never => {
|
217 | throw new Error(
|
218 | 'Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead'
|
219 | );
|
220 | };
|
221 |
|
222 | export const setLogger = (logger: Partial<Console>): void => {
|
223 | logging.setLogger(logger);
|
224 | };
|
225 |
|
226 | export const setLogVerbosity = (verbosity: LogVerbosity): void => {
|
227 | logging.setLoggerVerbosity(verbosity);
|
228 | };
|
229 |
|
230 | export { Server, ServerOptions };
|
231 | export { ServerCredentials };
|
232 | export { KeyCertPair };
|
233 |
|
234 | export const getClientChannel = (client: Client) => {
|
235 | return Client.prototype.getChannel.call(client);
|
236 | };
|
237 |
|
238 | export { StatusBuilder };
|
239 |
|
240 | export { Listener, InterceptingListener } from './call-interface';
|
241 |
|
242 | export {
|
243 | Requester,
|
244 | ListenerBuilder,
|
245 | RequesterBuilder,
|
246 | Interceptor,
|
247 | InterceptorOptions,
|
248 | InterceptorProvider,
|
249 | InterceptingCall,
|
250 | InterceptorConfigurationError,
|
251 | NextCall,
|
252 | } from './client-interceptors';
|
253 |
|
254 | export {
|
255 | GrpcObject,
|
256 | ServiceClientConstructor,
|
257 | ProtobufTypeDefinition,
|
258 | } from './make-client';
|
259 |
|
260 | export { ChannelOptions } from './channel-options';
|
261 |
|
262 | export { getChannelzServiceDefinition, getChannelzHandlers } from './channelz';
|
263 |
|
264 | export { addAdminServicesToServer } from './admin';
|
265 |
|
266 | export {
|
267 | ServiceConfig,
|
268 | LoadBalancingConfig,
|
269 | MethodConfig,
|
270 | RetryPolicy,
|
271 | } from './service-config';
|
272 |
|
273 | export {
|
274 | ServerListener,
|
275 | FullServerListener,
|
276 | ServerListenerBuilder,
|
277 | Responder,
|
278 | FullResponder,
|
279 | ResponderBuilder,
|
280 | ServerInterceptingCallInterface,
|
281 | ServerInterceptingCall,
|
282 | ServerInterceptor,
|
283 | } from './server-interceptors';
|
284 |
|
285 | import * as experimental from './experimental';
|
286 | export { experimental };
|
287 |
|
288 | import * as resolver_dns from './resolver-dns';
|
289 | import * as resolver_uds from './resolver-uds';
|
290 | import * as resolver_ip from './resolver-ip';
|
291 | import * as load_balancer_pick_first from './load-balancer-pick-first';
|
292 | import * as load_balancer_round_robin from './load-balancer-round-robin';
|
293 | import * as load_balancer_outlier_detection from './load-balancer-outlier-detection';
|
294 | import * as channelz from './channelz';
|
295 | import { Deadline } from './deadline';
|
296 |
|
297 | (() => {
|
298 | resolver_dns.setup();
|
299 | resolver_uds.setup();
|
300 | resolver_ip.setup();
|
301 | load_balancer_pick_first.setup();
|
302 | load_balancer_round_robin.setup();
|
303 | load_balancer_outlier_detection.setup();
|
304 | channelz.setup();
|
305 | })();
|