cadcam-sdk
v1.0.0
Published
TypeScript SDK for CAD/CAM GraphQL API
Readme
CAD/CAM GraphQL SDK
A TypeScript SDK for interacting with the CAD/CAM GraphQL API.
Installation
npm install cadcam-sdkUsage
import { CADClient } from 'cadcam-sdk';
// Initialize the client
const client = new CADClient({
endpoint: 'https://api.example.com/graphql',
token: 'your-auth-token'
});
// Example: Get the current user
async function getCurrentUser() {
const user = await client.users.me();
console.log(`Logged in as: ${user.name}`);
}
// Example: List projects
async function listProjects() {
const projects = await client.projects.list();
console.log('Projects:', projects.map(p => p.name));
}
// Example: Create a component
async function createComponent() {
const component = await client.components.create({
name: 'My Component',
description: 'A description of my component',
data: { /* component data */ },
projectId: 'project-123',
isPublic: false
});
console.log(`Component created with ID: ${component.id}`);
}CLI Usage
The SDK includes a command-line interface for common operations:
# Authentication
cadcam login --endpoint https://api.example.com/graphql
# List projects
cadcam projects list
# Create a component
cadcam components create --project project-123 --name "My Component"
# Get help for a command
cadcam --help
cadcam components --helpFeatures
- Full TypeScript support with type definitions for all entities
- Modular architecture with separate modules for each domain entity
- File upload support
- Command-line interface
- Authentication management
API Documentation
See the API documentation for detailed information about all available modules and methods.
