@transai/connector-runner-onshape
v0.11.1
Published
Onshape connector for the XOD platform. This connector enables integration with Onshape's REST API to automatically sync all accessible documents and supports upload/download/export operations for CAD files.
Readme
connector-runner-onshape
Onshape connector for the XOD platform. This connector enables integration with Onshape's REST API to automatically sync all accessible documents and supports upload/download/export operations for CAD files.
Features
- Automatic Document Discovery: Automatically discovers and syncs all accessible documents from your Onshape account
- Incremental Sync: Only processes documents that have been created or modified since the last sync
- Element Extraction: Extracts metadata for parts, assemblies, drawings, and other CAD elements
- Model Upload: Upload CAD models to Onshape
- Model Download: Download models from Onshape
- Model Export: Export models in various formats (STEP, IGES, STL, etc.)
- File Management: Uses FilesSDK for file operations
Configuration
{
"connectorType": "onshape",
"config": {
"baseUrl": "https://cad.onshape.com",
"accessKey": "your-access-key",
"secretKey": "your-secret-key",
"datasourceIdentifier": "onshape-prod",
"interval": 3600,
"offsetFilePrefix": "onshape",
"downloadDestination": "/data/onshape/downloads",
"uploadDestination": "/data/onshape/uploads"
}
}Configuration Options
baseUrl- Onshape API base URL (default: https://cad.onshape.com)accessKey- Your Onshape API access keysecretKey- Your Onshape API secret keydatasourceIdentifier- Unique identifier for this datasourceinterval- How often to check for updates in seconds (default: 3600)offsetFilePrefix- Prefix for offset tracking files (default: "onshape")downloadDestination- Local path for downloaded filesuploadDestination- Local path for files to upload
How It Works
First Run
- Discovers all documents accessible to the authenticated user
- Fetches all workspaces and elements for each document
- Emits document and element metadata to the data pipeline
Subsequent Runs
- Automatically checks for new or modified documents every
intervalseconds - Only processes documents that have changed since the last sync (incremental)
- Continues to discover new documents as they are created
Building
Run nx build connector-runner-onshape to build the library.
Running unit tests
Run nx test connector-runner-onshape to execute the unit tests via Jest.
