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

Method forFile

typescript/src/Vaas.ts:150–158  ·  view source on GitHub ↗

Get verdict for a file * @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 {V

(
    fileBuffer: Uint8Array,
    ct: CancellationToken = CancellationToken.fromMilliseconds(
      this.defaultTimeoutFileReq,
    ),
  )

Source from the content-addressed store, hash-verified

148 * @throws {VaasTimeoutError} Timeout. Retry request.
149 */
150 public async forFile(
151 fileBuffer: Uint8Array,
152 ct: CancellationToken = CancellationToken.fromMilliseconds(
153 this.defaultTimeoutFileReq,
154 ),
155 ): Promise<VaasVerdict> {
156 const request = this.forRequest(fileBuffer).then((response) => response);
157 return timeout(request, ct.timeout());
158 }
159
160 /** Get verdict for a list of files
161 * @throws {VaasInvalidStateError} If connect() has not been called and awaited. Signifies caller error.

Callers 3

forFileListMethod · 0.95
mainFunction · 0.95
mainFunction · 0.95

Calls 4

forRequestMethod · 0.95
timeoutFunction · 0.85
fromMillisecondsMethod · 0.80
timeoutMethod · 0.80

Tested by

no test coverage detected