npm package: @jacob-sdk/simulate-data
Description: TypeScript SDK for Jacob Data API - Generate mock/fake data using Faker.js for users, products, orders, and 80+ data types
Author: Jacob Tech
Latest version: 0.1.1

# @jacob-sdk/simulate-data

TypeScript SDK for Jacob Data API - Generate mock/fake data using Faker.js for users, products, orders, and 80+ data types.

## Installation

```bash
npm install @jacob-sdk/simulate-data
# or
pnpm add @jacob-sdk/simulate-data
# or
yarn add @jacob-sdk/simulate-data
```

## Step 1: Create an API Key

Before using the SDK, create an API key:

```bash
curl -X POST https://jacob-data.onrender.com/api-keys \
  -H "Content-Type: application/json" \
  -d '{"description": "My API key"}'
```

Response:
```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "key": "sk_live_a3f2d9c8e1b4567890abcdef12345678",
  "description": "My API key",
  "createdAt": "2024-01-15T10:30:00.000Z"
}
```

## Step 2: Quick Start

```typescript
import { JacobDataApiClient } from "@jacob-sdk/simulate-data";

const client = new JacobDataApiClient({
  headers: {
    "x-api-key": "sk_live_a3f2d9c8e1b4567890abcdef12345678"
  }
});

// Generate custom fake data
const response = await client.fakeData.fakeControllerGenerate({
  count: 5,
  keys: ["id:uuid", "name:string", "email:email", "price:number"]
});

// Generate fake users
await client.fakeData.fakeControllerGenerateUsers({
  count: 10,
  keys: ["id:uuid", "firstName:firstName", "lastName:lastName", "email:email"]
});

// Generate fake products
await client.fakeData.fakeControllerGenerateProducts({
  count: 20,
  keys: ["id:uuid", "name:productName", "price:price", "description:paragraph"]
});
```

## Configuration

```typescript
const client = new JacobDataApiClient({
  // Custom base URL (optional)
  baseUrl: "https://jacob-data.onrender.com",

  // Request timeout in seconds (default: 60)
  timeoutInSeconds: 30,

  // Max retries on failure (default: 2)
  maxRetries: 3,

  // API Key (required)
  headers: {
    "x-api-key": process.env.JACOB_DATA_API_KEY
  }
});
```

## Available Data Types

The SDK supports 80+ data generation methods via `client.fakeData`:

### E-commerce
- `fakeControllerGenerateUsers()` - User profiles
- `fakeControllerGenerateProducts()` - Product catalog
- `fakeControllerGenerateOrders()` - Order records
- `fakeControllerGenerateCategories()` - Product categories
- `fakeControllerGenerateReviews()` - Product reviews
- `fakeControllerGenerateCarts()` - Shopping carts
- `fakeControllerGeneratePayments()` - Payment transactions
- `fakeControllerGenerateCustomers()` - Customer data
- `fakeControllerGenerateInvoices()` - Invoice records

### Content & Social
- `fakeControllerGeneratePosts()` - Blog/social posts
- `fakeControllerGenerateComments()` - Comments
- `fakeControllerGenerateArticles()` - Articles
- `fakeControllerGenerateTags()` - Content tags
- `fakeControllerGenerateProfiles()` - User profiles
- `fakeControllerGenerateFollowers()` - Follower relationships
- `fakeControllerGenerateMessages()` - Messages
- `fakeControllerGenerateNotifications()` - Notifications

### Education
- `fakeControllerGenerateCourses()` - Courses
- `fakeControllerGenerateStudents()` - Students
- `fakeControllerGenerateTeachers()` - Teachers
- `fakeControllerGenerateEnrollments()` - Enrollments
- `fakeControllerGenerateLessons()` - Lessons

### Healthcare
- `fakeControllerGeneratePatients()` - Patient records
- `fakeControllerGenerateDoctors()` - Doctor profiles
- `fakeControllerGenerateAppointments()` - Appointments
- `fakeControllerGeneratePrescriptions()` - Prescriptions

### Real Estate
- `fakeControllerGenerateProperties()` - Properties
- `fakeControllerGenerateAgents()` - Real estate agents
- `fakeControllerGenerateListings()` - Property listings

### HR & Business
- `fakeControllerGenerateEmployees()` - Employees
- `fakeControllerGenerateCompanies()` - Companies
- `fakeControllerGenerateJobs()` - Job postings
- `fakeControllerGenerateCandidates()` - Job candidates
- `fakeControllerGenerateInterviews()` - Interviews
- `fakeControllerGenerateSalaries()` - Salary data
- `fakeControllerGenerateDepartments()` - Departments

### Finance
- `fakeControllerGenerateTransactions()` - Transactions
- `fakeControllerGenerateAccounts()` - Bank accounts
- `fakeControllerGenerateWallets()` - Digital wallets
- `fakeControllerGenerateTransfers()` - Money transfers

### Travel & Events
- `fakeControllerGenerateBookings()` - Bookings
- `fakeControllerGenerateEvents()` - Events
- `fakeControllerGenerateTickets()` - Tickets
- `fakeControllerGenerateVenues()` - Venues
- `fakeControllerGenerateReservations()` - Reservations
- `fakeControllerGenerateFlights()` - Flights
- `fakeControllerGenerateHotels()` - Hotels
- `fakeControllerGenerateDestinations()` - Destinations
- `fakeControllerGenerateTours()` - Tours
- `fakeControllerGenerateTravelers()` - Travelers

### Gaming
- `fakeControllerGenerateGames()` - Games
- `fakeControllerGenerateGamers()` - Gamers
- `fakeControllerGenerateScores()` - Game scores
- `fakeControllerGenerateAchievements()` - Achievements
- `fakeControllerGenerateLeaderboards()` - Leaderboards

### Sports
- `fakeControllerGenerateTeams()` - Sports teams
- `fakeControllerGenerateMatches()` - Matches
- `fakeControllerGenerateAthletes()` - Athletes
- `fakeControllerGenerateLeagues()` - Leagues
- `fakeControllerGenerateStadiums()` - Stadiums

### Logistics
- `fakeControllerGenerateShipments()` - Shipments
- `fakeControllerGenerateWarehouses()` - Warehouses
- `fakeControllerGenerateDrivers()` - Drivers
- `fakeControllerGenerateRoutes()` - Delivery routes

### Restaurant
- `fakeControllerGenerateMenus()` - Menus
- `fakeControllerGenerateDishes()` - Dishes
- `fakeControllerGenerateRestaurants()` - Restaurants
- `fakeControllerGenerateTables()` - Table reservations

### IoT & Sensors
- `fakeControllerGenerateDevices()` - IoT devices
- `fakeControllerGenerateSensors()` - Sensors
- `fakeControllerGenerateReadings()` - Sensor readings
- `fakeControllerGenerateAlerts()` - Alerts
- `fakeControllerGenerateGeolocations()` - Geolocation data

### Media & Publishing
- `fakeControllerGenerateNews()` - News articles
- `fakeControllerGenerateAuthors()` - Authors
- `fakeControllerGeneratePublishers()` - Publishers
- `fakeControllerGenerateSubscriptions()` - Subscriptions

### Inventory
- `fakeControllerGenerateItems()` - Inventory items
- `fakeControllerGenerateStocks()` - Stock levels
- `fakeControllerGenerateSuppliers()` - Suppliers
- `fakeControllerGeneratePurchases()` - Purchase orders

### Support
- `fakeControllerGenerateSupportTickets()` - Support tickets
- `fakeControllerGenerateSupportAgents()` - Support agents
- `fakeControllerGenerateResponses()` - Ticket responses
- `fakeControllerGeneratePriorities()` - Priority levels

## Schema Keys Format

Define your data schema using `fieldName:type` format:

```typescript
keys: [
  "id:uuid",           // UUID
  "name:firstName",    // First name
  "email:email",       // Email address
  "age:number",        // Random number
  "bio:paragraph",     // Paragraph text
  "avatar:imageUrl",   // Image URL
  "createdAt:date"     // Date
]
```

## Error Handling

```typescript
import { JacobDataApiClient, BadRequestError } from "@jacob-sdk/simulate-data";

try {
  await client.fakeData.fakeControllerGenerate({
    count: 5,
    keys: ["id:uuid"]
  });
} catch (error) {
  if (error instanceof BadRequestError) {
    console.error("Invalid request:", error.message);
  }
}
```

## Managing API Keys

```typescript
// Create API key
const newKey = await client.apiKeys.apiKeysControllerCreate({
  description: "My new key"
});

// List all API keys
const keys = await client.apiKeys.apiKeysControllerFindAll();

// Revoke an API key
await client.apiKeys.apiKeysControllerRevoke({ id: "key-id-here" });
```

## Health Check

```typescript
// Check API health status
const health = await client.health.healthControllerCheck();
```

## Requirements

- Node.js >= 18.0.0

## API Documentation

Full API documentation: https://jacob-data.onrender.com/api-docs

## License

MIT