This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

onshape-ts-fetch-client

1.168.20965-e01b1f4d96d1 • Public • Published

Onshape Typescript Fetch client

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.

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});

Readme

Keywords

none

Package Sidebar

Install

npm i onshape-ts-fetch-client

Weekly Downloads

0

Version

1.168.20965-e01b1f4d96d1

License

ISC

Unpacked Size

1.91 kB

Total Files

2

Last publish

Collaborators

  • techplex