buster/packages/sdk
dal ef41516325
Implement unified deployment for models and docs
- Added new deployment functionality to handle both models and documentation in a single request.
- Introduced new schemas for unified deployment requests and responses using Zod.
- Updated deployment handlers to process and validate models and docs together.
- Enhanced logging to provide detailed information about deleted models and docs during deployment.
- Refactored existing code to integrate the new deployment structure, ensuring backward compatibility with previous functionalities.
2025-09-09 00:32:48 -06:00
..
scripts sdk and ts cli 2025-08-27 15:53:53 -06:00
src Implement unified deployment for models and docs 2025-09-09 00:32:48 -06:00
.gitignore sdk and ts cli 2025-08-27 15:53:53 -06:00
README.md sdk and ts cli 2025-08-27 15:53:53 -06:00
biome.json sdk and ts cli 2025-08-27 15:53:53 -06:00
env.d.ts sdk and ts cli 2025-08-27 15:53:53 -06:00
package.json Added better formatting for cli package and updated versions to match workspace 2025-09-05 11:39:43 -06:00
tsconfig.json sdk and ts cli 2025-08-27 15:53:53 -06:00
vitest.config.ts sdk and ts cli 2025-08-27 15:53:53 -06:00

README.md

@buster/sdk

Minimal TypeScript SDK for the Buster API.

Installation

pnpm add @buster/sdk

Usage

import { createBusterSDK } from '@buster/sdk';

const sdk = createBusterSDK({
  apiKey: 'your-api-key',
  apiUrl: 'https://api.buster.so', // optional
});

// Test connection
const health = await sdk.healthcheck();
console.log('Server status:', health.status);

Configuration

interface SDKConfig {
  apiKey: string;           // Required
  apiUrl?: string;          // Default: 'https://api.buster.so'
  timeout?: number;         // Default: 30000ms
  retryAttempts?: number;   // Default: 3
  retryDelay?: number;      // Default: 1000ms
  headers?: Record<string, string>; // Optional custom headers
}

Error Handling

import { SDKError, NetworkError } from '@buster/sdk';

try {
  await sdk.healthcheck();
} catch (error) {
  if (error instanceof NetworkError) {
    console.error('Connection failed:', error.message);
  } else if (error instanceof SDKError) {
    console.error('API error:', error.statusCode, error.message);
  }
}