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

Method forUrl

typescript/src/Vaas.ts:102–110  ·  view source on GitHub ↗

Get verdict for URL * @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. * @throws {Vaas

(
    url: URL,
    ct: CancellationToken = CancellationToken.fromMilliseconds(
      this.defaultTimeoutUrlReq,
    ),
  )

Source from the content-addressed store, hash-verified

100 * @throws {VaasTimeoutError} Timeout. Retry request.
101 */
102 public async forUrl(
103 url: URL,
104 ct: CancellationToken = CancellationToken.fromMilliseconds(
105 this.defaultTimeoutUrlReq,
106 ),
107 ): Promise<VaasVerdict> {
108 const request = this.forUrlRequest(url).then((response) => response);
109 return timeout(request, ct.timeout());
110 }
111
112 /** Get verdict for a SHA256
113 * @throws {VaasInvalidStateError} If connect() has not been called and awaited. Signifies caller error.

Callers 1

mainFunction · 0.95

Calls 4

forUrlRequestMethod · 0.95
timeoutFunction · 0.85
fromMillisecondsMethod · 0.80
timeoutMethod · 0.80

Tested by

no test coverage detected