npm package: @org-cyber/asguard
Description: OpenAPI client for asguard
Author: Pixelpro
Latest version: 1.0.0

# TypeScript (Axios) API client for asguard

Complete Asguard platform SDK - Fraud Detection + Face Verification.
Two independent microservices, one unified client.

## Overview

This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.

- API version: 1.0.0
- Package version: 1.0.0

## Installation

```sh
npm install asguard
# Or when working locally:
npm install
npm run build
```

## Getting Started

```typescript
import { Configuration, FraudDetectionApi, FaceVerificationApi } from "asguard";

// Configuration for Fraud Service (Port 8081)
const fraudConfig = new Configuration({
  basePath: "http://localhost:8081",
  baseOptions: {
    headers: {
      "X-API-Key": "YOUR_API_KEY", // ApiKeyAuth
    },
  },
});

const fraudApi = new FraudDetectionApi(fraudConfig);

async function checkRisk() {
  try {
    const response = await fraudApi.checkFraud({
      user_id: "user_123",
      transaction_id: "txn_456",
      amount: 250000.0,
      currency: "USD",
      ip_address: "192.168.1.5",
      device_id: "device_789",
    });
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

// Configuration for Face Service (Port 8082)
const faceConfig = new Configuration({
  basePath: "http://localhost:8082",
  baseOptions: {
    headers: {
      Authorization: "Bearer YOUR_TOKEN", // BearerAuth
    },
  },
});

const faceApi = new FaceVerificationApi(faceConfig);

async function testFace() {
  try {
    const response = await faceApi.healthCheckFace();
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}
```

## Documentation for API Endpoints

All URIs are relative to _http://localhost:8081_

| Class                 | Method                                                       | HTTP request          | Description                                           |
| --------------------- | ------------------------------------------------------------ | --------------------- | ----------------------------------------------------- |
| _FaceVerificationApi_ | [**analyzeFace**](docs/FaceVerificationApi.md#analyzeface)   | **POST** /v1/analyze  | Analyze face image quality and extract embedding      |
| _FaceVerificationApi_ | [**compareFaces**](docs/FaceVerificationApi.md#comparefaces) | **POST** /v1/compare  | Compare a probe face image with a reference embedding |
| _FraudDetectionApi_   | [**checkFraud**](docs/FraudDetectionApi.md#checkfraud)       | **POST** /analyze     | Check transaction for fraud risk                      |
| _SystemApi_           | [**healthCheckFace**](docs/SystemApi.md#healthcheckface)     | **GET** /face/health  | Face service health check                             |
| _SystemApi_           | [**healthCheckFraud**](docs/SystemApi.md#healthcheckfraud)   | **GET** /fraud/health | Fraud service health check                            |

## Documentation For Models

- [AnalyzeFaceRequest](docs/AnalyzeFaceRequest.md)
- [AnalyzeResponse](docs/AnalyzeResponse.md)
- [CompareFacesRequest](docs/CompareFacesRequest.md)
- [CompareResponse](docs/CompareResponse.md)
- [ErrorResponse](docs/ErrorResponse.md)
- [FraudCheckRequest](docs/FraudCheckRequest.md)
- [FraudCheckResponse](docs/FraudCheckResponse.md)
- [HealthResponse](docs/HealthResponse.md)

## Documentation For Authorization

Authentication schemes defined for the API:

### ApiKeyAuth

- **Type**: API key
- **API key parameter name**: X-API-Key
- **Location**: HTTP header

### BearerAuth

- **Type**: HTTP Bearer token authentication