CAD/CAM FUN SDK
A TypeScript SDK for interacting with the CAD/CAM GraphQL API.
Installation
npm install cadcamfun-sdk
Or using yarn:
yarn add cadcamfun-sdk
Quick Start
import { CADClient } from 'cadcamfun-sdk';
// Initialize the client
const client = new CADClient({
endpoint: 'https://cadcamfun.xyz/api/graphql',
token: 'your-auth-token' // Optional, can be set later
});
// Example: Get user profile
async function getUserProfile() {
try {
const profile = await client.users.me();
console.log('User profile:', profile);
} catch (error) {
console.error('Error fetching profile:', error);
}
}
getUserProfile();
CLI Usage
The SDK comes with a command-line interface (CLI) for common operations.
# Login to the API
cadcam login --endpoint https://cadcamfun.xyz/api/graphql
# Check authentication status
cadcam auth status
# List projects
cadcam projects list
# Get help for a command
cadcam --help
cadcam projects --help
Documentation
For full documentation, see the docs directory.
Modules
- Users - User accounts and authentication
- Projects - Project management
- Components - CAD component operations
- Drawings - 2D drawings management
- Toolpaths - CNC toolpath generation
- Organizations - Organization management
- Materials - Material library
- Tools - Tool library
- Machine Configs - CNC machine configurations
- Library Items - Shared component library
License
MIT