npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

autodesk.forge.designautomation

v3.0.5

Published

Client sdk for Forge DesignAutomation API

Downloads

18,755

Readme

autodesk.forge.designautomation

Design-Automation SDK Node.js

Overview

AutodeskForgeDesignAutomation - Asynchronous Node.js library for the Autodesk Forge Design Automation v3 implementation.

Requirements

Contributions

Contributions are welcome! Please open a Pull Request.

Support

Please ask questions on StackOverflow with tag autodesk-designautomation tag. If it turns out that you may have found a bug, please open an issue

Tutorials

Please visit Learn Forge tutorial.

Installation

For Node.js

npm

npm package is published on npm. Install this package using following command

npm install autodesk.forge.designautomation --save

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Configuring ApiClient

User can use default settings or change following properties of ApiClient.

  1. CircuitBreaker : Configure the threshold failure count and failure interval of circuit breaker.

    Default :

    • Failure Count : 10
    • Failure interval : 10000 ms
        let AutodeskForgeDesignAutomation = require('autodesk.forge.designautomation');
        let config = {
          "circuitBreaker": {
              "threshold": 11,
              "interval": 1200
          }
        };
        let apiClient = new AutodeskForgeDesignAutomation.AutodeskForgeDesignAutomationClient(config);
        let api = new AutodeskForgeDesignAutomation.AutodeskForgeDesignAutomationApi(apiClient)
  2. Retry : Autodesk resiliency library provides 3 types of retry policies.

    • WAIT : Retry after fixed delay interval.
    • EXPONENTIAL : Retry after exponential delay interval.
    • JITTER : Retry after exponential delay with jitter interval.

    User can specify number of retry count and retry policy.

      let AutodeskForgeDesignAutomation = require('autodesk.forge.designautomation');
      let config = {
          "retry" : {
              "maxNumberOfRetries" :  7,
              "backoffDelay" : 4000,
              "backoffPolicy" : "exponentialBackoffWithJitter"
          }
      };
      let apiClient = new AutodeskForgeDesignAutomation.AutodeskForgeDesignAutomationClient(config);
      let api = new AutodeskForgeDesignAutomation.AutodeskForgeDesignAutomationApi(apiClient)
  3. Timeout : Set request timeout.

    	  let AutodeskForgeDesignAutomation = require('autodesk.forge.designautomation');
       	
        let config = {
            "requestTimeout" : 13000
        };
        let apiClient = new AutodeskForgeDesignAutomation.AutodeskForgeDesignAutomationClient(config);
        let api = new AutodeskForgeDesignAutomation.AutodeskForgeDesignAutomationApi(apiClient)

Getting Started

Please follow the installation instruction and execute the following code:

  1. Default api client
let AutodeskForgeDesignAutomation = require('autodesk.forge.designautomation');

let defaultClient = AutodeskForgeDesignAutomation.AutodeskForgeDesignAutomationClient.instance;

// Configure OAuth2 access token for authorization: 2-legged
let oauth = defaultClient.authManager.authentications['2-legged'];
oauth.accessToken = "YOUR ACCESS TOKEN";

// And/Or you can pass fetchToken and refreshToken to manage the token
oauth.fetchToken = function() { return Promise.resolve({accessToken: "token", expiresIn: 300000}) }
oauth.refreshToken = function() { return Promise.resolve({accessToken: "token", expiresIn: 300000}) }

let api = new AutodeskForgeDesignAutomation.AutodeskForgeDesignAutomationApi()

let item = new AutodeskForgeDesignAutomation.Activity(); // {Activity} 

api.createActivity(item).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

  1. ApiClient configuration
let AutodeskForgeDesignAutomation = require('autodesk.forge.designautomation');

let config = {
		        "retry" : {
		            "maxNumberOfRetries" :  7,
		            "backoffDelay" : 4000,
		            "backoffPolicy" : "exponentialBackoffWithJitter"
		        },
		        "circuitBreaker": {
		            "threshold": 11,
		            "interval": 1200
		        },
		        "requestTimeout" : 13000
		    };
    
let client = new AutodeskForgeDesignAutomation.AutodeskForgeDesignAutomationClient(config); 


// Configure OAuth2 access token for authorization: 2-legged
let oauth = client.authManager.authentications['2-legged'];
oauth.accessToken = "YOUR ACCESS TOKEN";

// And/Or you can pass fetchToken and refreshToken to manage the token
oauth.fetchToken = function() { return Promise.resolve({accessToken: "token", expiresIn: 300000}) }
oauth.refreshToken = function() { return Promise.resolve({accessToken: "token", expiresIn: 300000}) }


let api = new AutodeskForgeDesignAutomation.AutodeskForgeDesignAutomationApi(client)

let item = new AutodeskForgeDesignAutomation.Activity(); // {Activity} 

api.createActivity(item).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://developer.api.autodesk.com/da/us-east

Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | createActivity | POST /v3/activities | Creates a new Activity. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | createActivityAlias | POST /v3/activities/{id}/aliases | Creates a new alias for this Activity. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | createActivityVersion | POST /v3/activities/{id}/versions | Creates a new version of the Activity. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | createAppBundle | POST /v3/appbundles | Creates a new AppBundle. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | createAppBundleAlias | POST /v3/appbundles/{id}/aliases | Creates a new alias for this AppBundle. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | createAppBundleVersion | POST /v3/appbundles/{id}/versions | Creates a new version of the AppBundle. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | createNickname | PATCH /v3/forgeapps/{id} | Creates/updates the nickname for the current Forge app. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | createWorkItem | POST /v3/workitems | Creates a new WorkItem and queues it for processing. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | createWorkItemsBatch | POST /v3/workitems/batch | Creates new WorkItems and queues them for processing. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | deleteActivity | DELETE /v3/activities/{id} | Deletes the specified Activity. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | deleteActivityAlias | DELETE /v3/activities/{id}/aliases/{aliasId} | Deletes the alias. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | deleteActivityVersion | DELETE /v3/activities/{id}/versions/{version} | Deletes the specified version of the Activity. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | deleteAppBundle | DELETE /v3/appbundles/{id} | Deletes the specified AppBundle. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | deleteAppBundleAlias | DELETE /v3/appbundles/{id}/aliases/{aliasId} | Deletes the alias. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | deleteAppBundleVersion | DELETE /v3/appbundles/{id}/versions/{version} | Deletes the specified version of the AppBundle. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | deleteForgeApp | DELETE /v3/forgeapps/{id} | Delete all data associated with this Forge app. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | deleteServiceLimits | DELETE /v3/servicelimits/{owner} | Deletes user service limits. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | deleteWorkitem | DELETE /v3/workitems/{id} | Cancels a specific WorkItem. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getActivities | GET /v3/activities | Lists all available Activities. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getActivity | GET /v3/activities/{id} | Gets the details of the specified Activity. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getActivityAlias | GET /v3/activities/{id}/aliases/{aliasId} | Get alias details. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getActivityAliases | GET /v3/activities/{id}/aliases | Lists all aliases for the specified Activity. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getActivityVersion | GET /v3/activities/{id}/versions/{version} | Gets the details of the specified version of the Activity. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getActivityVersions | GET /v3/activities/{id}/versions | Lists all versions of the specified Activity. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getAppBundle | GET /v3/appbundles/{id} | Gets the details of the specified AppBundle. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getAppBundleAlias | GET /v3/appbundles/{id}/aliases/{aliasId} | Get alias details. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getAppBundleAliases | GET /v3/appbundles/{id}/aliases | Lists all aliases for the specified AppBundle. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getAppBundleVersion | GET /v3/appbundles/{id}/versions/{version} | Gets the details of the specified version of the AppBundle. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getAppBundleVersions | GET /v3/appbundles/{id}/versions | Lists all versions of the specified AppBundle. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getAppBundles | GET /v3/appbundles | Lists all available AppBundles. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getEngine | GET /v3/engines/{id} | Gets the details of the specified Engine. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getEngines | GET /v3/engines | Lists all available Engines. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getNickname | GET /v3/forgeapps/{id} | Returns the user's (app) nickname. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getServiceLimit | GET /v3/servicelimits/{owner} | Get the service limit configuration. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getShares | GET /v3/shares | Gets all Shares (AppBundles and Activities) shared by this Forge app. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | getWorkitemStatus | GET /v3/workitems/{id} | Gets the status of a specific WorkItem. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | healthStatus | GET /v3/health/{engine} | AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | modifyActivityAlias | PATCH /v3/activities/{id}/aliases/{aliasId} | Modify alias details. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | modifyAppBundleAlias | PATCH /v3/appbundles/{id}/aliases/{aliasId} | Modify alias details. AutodeskForgeDesignAutomation.AutodeskForgeDesignautomationApi | modifyServiceLimits | PUT /v3/servicelimits/{owner} | Creates a new service limits configuration or updates exiting.

Documentation for Models

Documentation for Authorization

2-legged

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
    • code:all: Author or execute your codes

3-legged

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://developer.api.autodesk.com/authentication/v1/authorize
  • Scopes:
    • code:all: Author or execute your codes

License

This sample is licensed under the terms of the Apache License 2.0. Please see the LICENSE file for full details.