MCPcopy Create free account
hub / github.com/GDATASoftwareAG/vaas / forStream

Method forStream

typescript/src/Vaas.ts:86–94  ·  view source on GitHub ↗

Get verdict for Readable Stream * @throws {VaasInvalidStateError} If connect() has not been called and awaited. Signifies caller error. * @throws {VaasAuthenticationError} Authentication failed. * @throws {VaasConnectionClosedError} Connection was closed. Call connect() to reconnect. * @

(
    stream: Readable,
    ct: CancellationToken = CancellationToken.fromMilliseconds(
      this.defaultTimeoutStreamReq,
    ),
  )

Source from the content-addressed store, hash-verified

84 * @throws {VaasServerError} Stream could not be read properly in VaaS clouds
85 */
86 public async forStream(
87 stream: Readable,
88 ct: CancellationToken = CancellationToken.fromMilliseconds(
89 this.defaultTimeoutStreamReq,
90 ),
91 ): Promise<VaasVerdict> {
92 const request = this.forStreamRequest(stream).then((response) => response);
93 return timeout(request, ct.timeout());
94 }
95
96 /** Get verdict for URL
97 * @throws {VaasInvalidStateError} If connect() has not been called and awaited. Signifies caller error.

Callers

nothing calls this directly

Calls 4

forStreamRequestMethod · 0.95
timeoutFunction · 0.85
fromMillisecondsMethod · 0.80
timeoutMethod · 0.80

Tested by

no test coverage detected