https://github.com/techplexengineer/onshape-ts-fetch-client
Depreciated Onshape API Client with apikey middleware, generated with openapi
https://github.com/techplexengineer/onshape-ts-fetch-client
cad onshape openapi
Last synced: 4 months ago
JSON representation
Depreciated Onshape API Client with apikey middleware, generated with openapi
- Host: GitHub
- URL: https://github.com/techplexengineer/onshape-ts-fetch-client
- Owner: TechplexEngineer
- Created: 2023-05-22T23:41:10.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-18T23:36:32.000Z (over 2 years ago)
- Last Synced: 2025-10-14T18:37:41.549Z (6 months ago)
- Topics: cad, onshape, openapi
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/onshape-ts-fetch-client
- Size: 4.39 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
Onshape Typescript Fetch client
===============================
# WARNING: Unmaintained
The openapi generator typescript-fetch generates code that does not compile.
Recomment alternate approach such as: https://github.com/drwpow/openapi-typescript
REST Api client for Onshape generated from Openapi spec https://cad.onshape.com/api/openapi using the typescript-fetch generator.
See src/example.test.ts for a working example.
```typescript
import 'dotenv/config'
import {
Configuration, APIKeyAuthMiddleware, DocumentApi, OnshapeClient
} from 'onshape-ts-fetch-client'
const secretKey = process.env.ONSHAPE_SECRET_KEY
const accessKey = process.env.ONSHAPE_ACCESS_KEY
const config = new Configuration({
middleware: [
APIKeyAuthMiddleware(secretKey, accessKey)
]
});
const did = "f00ba40ee71d7a9324b5af07"
// Option 1: accessing the api's individually
const docApi = new DocumentApi(config)
const docVersions = await docApi.getDocumentVersions({did})
// Option 2: Using the api client instance
const client = new OnshapeClient(config);
const docVersions2 = await client.DocumentApi.getDocumentVersions({did});
```