Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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];
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";
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";
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":
.then((oa3Legged) => {
let hubs = new ForgeAPI.HubsApi();
return (hubs.getHubs({}, oa3Legged, oa3Legged.credentials));
})
.then((hubs) => {
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()
}
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()
}