(options?: Partial<HttpClientOptions<ServiceType>>)
| 22 | lastReceivedBuf?: Uint8Array; |
| 23 | |
| 24 | constructor(options?: Partial<HttpClientOptions<ServiceType>>) { |
| 25 | this._options = Object.assign({}, defaultHttpClientOptions, options); |
| 26 | this.serviceMap = ServiceMapUtil.getServiceMap(this._options.proto); |
| 27 | this.tsbuffer = new TSBuffer(this._options.proto.types); |
| 28 | this.logger = this._options.logger; |
| 29 | |
| 30 | this._http = this._options.server.startsWith('https://') ? https : http; |
| 31 | |
| 32 | this.logger.log('TSRPC HTTP Client :', this._options.server); |
| 33 | } |
| 34 | |
| 35 | callApi<T extends keyof ServiceType['req']>(apiName: T, req: ServiceType['req'][T], options: TransportOptions = {}): SuperPromise<ServiceType['res'][T], TsrpcError> { |
| 36 | let sn = this._snCounter.getNext(); |
nothing calls this directly
no test coverage detected