@datadome/fraud-sdk-node
Version:
Fraud Protection - Node.js SDK
64 lines • 1.86 kB
TypeScript
import { Address } from '../address';
/**
* Enum representing possible actions in response to a request.
*
* @enum
* @property {string} ALLOW - Indicates that the request is permitted and should proceed.
* @property {string} DENY - Indicates that the request is blocked and should not proceed.
*/
export declare enum ResponseAction {
ALLOW = "allow",
DENY = "deny"
}
/**
* Represents the possible statuses of an API response.
*
* @enum
* @property {string} OK - The request was successful.
* @property {string} FAILURE - Something went wrong, but the action should continue.
* @property {string} TIMEOUT - The request timed out.
*/
export declare enum ResponseStatus {
OK = "ok",
FAILURE = "failure",
TIMEOUT = "timeout"
}
/**
* Represents an error in the API response.
*
* @property {string} field - The field that caused the error.
* @property {string} error - The error message.
*/
export interface Error {
field: string;
error: string;
}
/**
* Response of the Account Protect API
* @property action - Action answered to Customer endpoint
* @property eventId - Event identifier associated to this validate event
* @property status - Status of the call the API
* @property reasons - Reasons of the action response
* @property score - Score of the request (a positive integer)
* @property ip - User IP
* @property location - User location
*/
export interface Response {
action: ResponseAction;
eventId: string;
status: ResponseStatus;
reasons?: string[];
score?: number;
ip?: string;
location?: Address;
}
/**
* Error response of the Account Protect API
* @property message - Message of the error
* @property errors - Errors of the API
*/
export interface ResponseError extends Response {
message: string;
errors: Error[];
}
//# sourceMappingURL=response.d.ts.map