How to use the forge-apis.HubsApi function in forge-apis

To help you get started, we’ve selected a few forge-apis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / forge-apis / forge-apis-tests.ts View on Github external
foldersApi.getFolder('', '', authClientTwoLegged, authToken);
// $ExpectType Promise
foldersApi.getFolderContents('', '', {}, authClientTwoLegged, authToken);
// $ExpectType Promise
foldersApi.getFolderParent('', '', authClientTwoLegged, authToken);
// $ExpectType Promise
foldersApi.getFolderRefs('', '', {}, authClientTwoLegged, authToken);
// $ExpectType Promise
foldersApi.getFolderRelationshipsRefs('', '', {}, authClientTwoLegged, authToken);
// $ExpectType Promise
foldersApi.postFolder('', {}, authClientTwoLegged, authToken);
// $ExpectType Promise
foldersApi.postFolderRelationshipsRef('', '', {}, authClientTwoLegged, authToken);

// $ExpectType HubsApi
const hubsApi = new HubsApi();
// $ExpectType Promise
hubsApi.getHub('', authClientTwoLegged, authToken);
// $ExpectType Promise
hubsApi.getHubs({}, authClientTwoLegged, authToken);

// $ExpectType ItemsApi
const itemsApi = new ItemsApi();
// $ExpectType Promise
itemsApi.getItem('', '', authClientTwoLegged, authToken);
// $ExpectType Promise
itemsApi.getItemParentFolder('', '', authClientTwoLegged, authToken);
// $ExpectType Promise
itemsApi.getItemRefs('', '', {}, authClientTwoLegged, authToken);
// $ExpectType Promise
itemsApi.getItemRelationshipsRefs('', '', {}, authClientTwoLegged, authToken);
// $ExpectType Promise
github Autodesk-Forge / forge-derivatives-explorer / routes / data.management.js View on Github external
router.get('/treeNode', function (req, res) {
    var href = decodeURIComponent(req.query.href);
    console.log("treeNode for " + href);

    var tokenSession = new token(req.session);

    if (href === '#') {
        // # stands for ROOT
        var hubs = new forgeSDK.HubsApi();

        try {
            hubs.getHubs({}, tokenSession.getInternalOAuth(), tokenSession.getInternalCredentials())
            .then(function (data) {
                res.json(makeTree(data.body.data, true));
            })
            .catch(function (error) {
                console.log(error);
            });
        } catch (ex) {
            console.log(ex);
        }  
    } else {
        var params = href.split('/');
        var resourceName = params[params.length - 2];
        var resourceId = params[params.length - 1];
github Autodesk-Forge / bim360appstore-viewer-nodejs-visual.reports / server / data.management.tree.js View on Github external
function getHubs(tokenSession, res) {
   // # stands for ROOT
    var hubs = new forgeSDK.HubsApi();

    hubs.getHubs({}, tokenSession.getInternalOAuth(), tokenSession.getInternalCredentials())
      .then(function (data) {
      var hubsForTree = [];
      data.body.data.forEach(function (hub) {
        var hubType;

        switch (hub.attributes.extension.type) {
          case "hubs:autodesk.core:Hub":
            hubType = "hubs";
            break;
          case "hubs:autodesk.a360:PersonalHub":
            hubType = "personalHub";
            break;
          case "hubs:autodesk.bim360:Account":
            hubType = "bim360Hubs";
github Autodesk-Forge / bim360appstore-model.derivative-nodejs-xls.exporter / server / data.management.tree.js View on Github external
function getHubs(tokenSession, res) {
   // # stands for ROOT
    var hubs = new forgeSDK.HubsApi();

    hubs.getHubs({}, tokenSession.getInternalOAuth(), tokenSession.getInternalCredentials())
      .then(function (data) {
      var hubsForTree = [];
      data.body.data.forEach(function (hub) {
        var hubType;

        switch (hub.attributes.extension.type) {
          case "hubs:autodesk.core:Hub":
            hubType = "hubs";
            break;
          case "hubs:autodesk.a360:PersonalHub":
            hubType = "personalHub";
            break;
          case "hubs:autodesk.bim360:Account":
            hubType = "bim360hubs";
github Autodesk-Forge / bim360appstore-data.management-nodejs-transfer.storage / server / forge / tree.js View on Github external
function getHubs(oauthClient, credentials, res) {
  var hubs = new forgeSDK.HubsApi();
  hubs.getHubs({}, oauthClient, credentials)
    .then(function (data) {
      if (process.env.CONSOLELOG)
        if (data.body.meta.warnings)
          for (var key in data.body.meta.warnings) {
            var warning = data.body.meta.warnings[key];
            console.log(warning.HttpStatusCode + "/" + warning.ErrorCode + ":" + warning.Detail + ' > ' + warning.Title)
          }


      var hubsForTree = [];
      data.body.data.forEach(function (hub) {
        var hubType;

        switch (hub.attributes.extension.type) {
          case "hubs:autodesk.core:Hub":
github Autodesk-Forge / forge.commandline-nodejs / api / dm.js View on Github external
.then((oa3Legged) => {
				let hubs = new ForgeAPI.HubsApi();
				return (hubs.getHubs({}, oa3Legged, oa3Legged.credentials));
			})
			.then((hubs) => {
github Autodesk-Forge / forge-boilers.nodejs / 6 - viewer+server+data-mng+derivatives / src / server / api / services / DMSvc.js View on Github external
constructor(config) {

    super(config)

    this._projectsAPI = new Forge.ProjectsApi()
    this._versionsAPI = new Forge.VersionsApi()
    this._foldersAPI = new Forge.FoldersApi()
    this._itemsAPI = new Forge.ItemsApi()
    this._hubsAPI = new Forge.HubsApi()
  }
github Autodesk-Forge / forge-rcdb.nodejs / src / server / api / services / DMSvc.js View on Github external
constructor(config) {

    super(config)

    this._projectsAPI = new Forge.ProjectsApi()
    this._versionsAPI = new Forge.VersionsApi()
    this._foldersAPI = new Forge.FoldersApi()
    this._itemsAPI = new Forge.ItemsApi()
    this._hubsAPI = new Forge.HubsApi()
  }