PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@bitgo/sdk-api/dist/src

Просмотр файла: api.d.ts

import superagent from 'superagent';
import { BitGoRequest } from '@bitgo/sdk-core';
import { AuthVersion, VerifyResponseOptions } from './types';
import { BitGoAPI } from './bitgoAPI';
/**
 * Add the bitgo-specific result() function on a superagent request.
 *
 * If the server response is successful, the `result()` function will return either the entire response body,
 * or the field from the response body specified by the `optionalField` parameter if it is provided.
 *
 * If the server response with an error, `result()` will handle HTTP errors appropriately by
 * rethrowing them as an `ApiResponseError` if possible, and otherwise rethrowing the underlying response error.
 *
 * @param req
 */
export declare function toBitgoRequest<ResponseResultType = any>(req: superagent.SuperAgentRequest): BitGoRequest<ResponseResultType>;
/**
 * Return a function which extracts the specified response body property from the response if successful,
 * otherwise throw an `ApiErrorResponse` parsed from the response body.
 * @param optionalField
 */
export declare function handleResponseResult<ResponseResultType>(optionalField?: string): (res: superagent.Response) => ResponseResultType;
/**
 * Handle an error or an error containing an HTTP response and use it to throw a well-formed error object.
 *
 * @param e
 */
export declare function handleResponseError(e: Error & {
    response?: superagent.Response;
}): never;
/**
 * Serialize request data based on the request content type
 * Note: Not sure this is still needed or even useful. Consider removing.
 * @param req
 */
export declare function serializeRequestData(req: superagent.Request): string | undefined;
/**
 * Set the superagent query string correctly for browsers or node.
 * @param req
 */
export declare function setRequestQueryString(req: superagent.SuperAgentRequest): void;
/**
 * Verify that the response received from the server is signed correctly.
 * Right now, it is very permissive with the timestamp variance.
 */
export declare function verifyResponse(bitgo: BitGoAPI, token: string | undefined, method: VerifyResponseOptions['method'], req: superagent.SuperAgentRequest, response: superagent.Response, authVersion: AuthVersion): superagent.Response;
//# sourceMappingURL=api.d.ts.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!